annotate src/hgtabwidget.h @ 628:5dc24f89b791

* "Use extension" check box now appears to the left of the button and label, and enables/disables the button and label depending on its state
author Sam Izzo <sam@humbug.net>
date Sun, 26 Aug 2012 02:39:08 +1000
parents 38c84c66ad7a
children ae67ea0af696
rev   line source
Chris@57 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@57 2
Chris@57 3 /*
Chris@57 4 EasyMercurial
Chris@57 5
Chris@57 6 Based on HgExplorer by Jari Korhonen
Chris@57 7 Copyright (c) 2010 Jari Korhonen
Chris@560 8 Copyright (c) 2012 Chris Cannam
Chris@560 9 Copyright (c) 2012 Queen Mary, University of London
Chris@57 10
Chris@57 11 This program is free software; you can redistribute it and/or
Chris@57 12 modify it under the terms of the GNU General Public License as
Chris@57 13 published by the Free Software Foundation; either version 2 of the
Chris@57 14 License, or (at your option) any later version. See the file
Chris@57 15 COPYING included with this distribution for more information.
Chris@57 16 */
Chris@57 17
Chris@96 18 #ifndef HGTABWIDGET_H
Chris@96 19 #define HGTABWIDGET_H
jtkorhonen@0 20
Chris@43 21 #include "changeset.h"
jtkorhonen@0 22 #include "common.h"
Chris@92 23 #include "filestates.h"
jtkorhonen@0 24
Chris@50 25 #include <QMenu>
Chris@50 26 #include <QListWidget>
Chris@50 27 #include <QGroupBox>
Chris@50 28 #include <QVBoxLayout>
Chris@50 29 #include <QCheckBox>
Chris@50 30 #include <QLabel>
Chris@88 31 #include <QTabWidget>
Chris@86 32
Chris@88 33 class FileStatusWidget;
Chris@116 34 class HistoryWidget;
jtkorhonen@0 35
Chris@96 36 class HgTabWidget: public QTabWidget
jtkorhonen@0 37 {
jtkorhonen@0 38 Q_OBJECT
jtkorhonen@0 39
jtkorhonen@0 40 public:
Chris@287 41 HgTabWidget(QWidget *parent, QString workFolderPath);
Chris@91 42
jtkorhonen@0 43 void updateWorkFolderFileList(QString fileList);
Chris@120 44
Chris@120 45 void setNewLog(QString hgLogList);
Chris@120 46 void addIncrementalLog(QString hgLogList);
Chris@120 47
Chris@287 48 void setLocalPath(QString workFolderPath);
jtkorhonen@0 49
Chris@153 50 void setCurrent(QStringList ids, QString branch);
Chris@506 51 void setClosedHeadIds(QSet<QString> ids);
Chris@128 52
Chris@505 53 void setHaveMerge(bool);
Chris@505 54
Chris@608 55 void clearAll();
Chris@230 56 void updateFileStates();
Chris@154 57 void updateHistory();
Chris@154 58
Chris@116 59 FileStates getFileStates() { return m_fileStates; }
Chris@90 60
Chris@163 61 bool canDiff() const;
Chris@90 62 bool canCommit() const;
Chris@109 63 bool canRevert() const;
Chris@92 64 bool canAdd() const;
Chris@92 65 bool canRemove() const;
Chris@163 66 bool canResolve() const;
Chris@425 67 bool canIgnore() const;
Chris@172 68 bool haveChangesToCommit() const;
Chris@95 69
Chris@103 70 QStringList getAllCommittableFiles() const;
Chris@109 71 QStringList getAllRevertableFiles() const;
Chris@326 72 QStringList getAllUnresolvedFiles() const;
Chris@109 73
Chris@95 74 QStringList getSelectedAddableFiles() const;
Chris@95 75 QStringList getSelectedRemovableFiles() const;
Chris@163 76
Chris@484 77 bool shouldShowAll() const;
Chris@484 78
Chris@95 79 signals:
Chris@95 80 void selectionChanged();
Chris@484 81 void showAllChanged();
jtkorhonen@0 82
Chris@141 83 void commit();
Chris@141 84 void revert();
Chris@141 85 void diffWorkingFolder();
Chris@168 86 void showSummary();
Chris@311 87 void newBranch();
Chris@311 88 void noBranch();
Chris@141 89
Chris@141 90 void updateTo(QString id);
Chris@148 91 void diffToParent(QString id, QString parent);
Chris@289 92 void showSummary(Changeset *);
Chris@141 93 void diffToCurrent(QString id);
Chris@141 94 void mergeFrom(QString id);
Chris@278 95 void newBranch(QString id);
Chris@514 96 void closeBranch(QString id);
Chris@141 97 void tag(QString id);
Chris@141 98
Chris@326 99 void annotateFiles(QStringList);
Chris@326 100 void diffFiles(QStringList);
Chris@326 101 void commitFiles(QStringList);
Chris@326 102 void revertFiles(QStringList);
Chris@361 103 void renameFiles(QStringList);
Chris@361 104 void copyFiles(QStringList);
Chris@326 105 void addFiles(QStringList);
Chris@326 106 void removeFiles(QStringList);
Chris@326 107 void redoFileMerges(QStringList);
Chris@326 108 void markFilesResolved(QStringList);
Chris@326 109 void ignoreFiles(QStringList);
Chris@326 110 void unIgnoreFiles(QStringList);
sam@624 111 void showIn(QStringList);
Chris@326 112
Chris@94 113 public slots:
Chris@94 114 void clearSelections();
Chris@153 115 void showWorkTab();
Chris@153 116 void showHistoryTab();
Chris@94 117
Chris@555 118 void setSearchText(QString text);
Chris@555 119
jtkorhonen@0 120 private:
Chris@116 121 FileStatusWidget *m_fileStatusWidget;
Chris@116 122 HistoryWidget *m_historyWidget;
Chris@116 123 FileStates m_fileStates;
Chris@505 124 bool m_haveMerge;
jtkorhonen@0 125
Chris@91 126 Changesets parseChangeSets(QString changeSetsStr);
jtkorhonen@0 127 };
jtkorhonen@0 128
Chris@96 129 #endif // HGTABWIDGET_H