comparison filestatuswidget.h @ 115:78374cefa10f

* Add useful state message to file status page. Also add shouldBeFast() method to HgAction; use it to avoid showing progress bar for fast actions
author Chris Cannam
date Fri, 26 Nov 2010 21:48:25 +0000
parents 1721c580c10e
children 5c262ac73948
comparison
equal deleted inserted replaced
114:bb2d2eecdd60 115:78374cefa10f
22 22
23 #include <QWidget> 23 #include <QWidget>
24 24
25 class QLabel; 25 class QLabel;
26 class QListWidget; 26 class QListWidget;
27 class QPushButton;
27 class QFileInfo; 28 class QFileInfo;
28 29
29 class FileStatusWidget : public QWidget 30 class FileStatusWidget : public QWidget
30 { 31 {
31 Q_OBJECT 32 Q_OBJECT
38 void setLocalPath(QString p); 39 void setLocalPath(QString p);
39 40
40 QString remoteURL() const { return m_remoteURL; } 41 QString remoteURL() const { return m_remoteURL; }
41 void setRemoteURL(QString u); 42 void setRemoteURL(QString u);
42 43
43 QString branch() const { return m_branch; } 44 QString state() const { return m_state; }
44 void setBranch(QString b); 45 void setState(QString b);
45 46
46 FileStates fileStates() const { return m_fileStates; } 47 FileStates fileStates() const { return m_fileStates; }
47 void setFileStates(FileStates sp); 48 void setFileStates(FileStates sp);
48 49
49 bool haveChangesToCommit() const; 50 bool haveChangesToCommit() const;
77 QLabel *m_localPathLabel; 78 QLabel *m_localPathLabel;
78 79
79 QString m_remoteURL; 80 QString m_remoteURL;
80 QLabel *m_remoteURLLabel; 81 QLabel *m_remoteURLLabel;
81 82
82 QString m_branch; 83 QString m_state;
83 QLabel *m_branchLabel; 84 QLabel *m_stateLabel;
85
86 QLabel *m_noModificationsLabel;
84 87
85 FileStates m_fileStates; 88 FileStates m_fileStates;
86 QMap<FileStates::State, QString> m_simpleLabels; 89 QMap<FileStates::State, QString> m_simpleLabels;
87 QMap<FileStates::State, QString> m_descriptions; 90 QMap<FileStates::State, QString> m_descriptions;
88 QMap<FileStates::State, QListWidget *> m_stateListMap; 91 QMap<FileStates::State, QListWidget *> m_stateListMap;
90 93
91 QFileInfo *m_dateReference; 94 QFileInfo *m_dateReference;
92 QStringList m_selectedFiles; 95 QStringList m_selectedFiles;
93 96
94 void updateWidgets(); 97 void updateWidgets();
98 void updateStateLabel();
95 QString labelFor(FileStates::State, bool addHighlightExplanation = false); 99 QString labelFor(FileStates::State, bool addHighlightExplanation = false);
96 void setLabelFor(QWidget *w, FileStates::State, bool addHighlightExplanation); 100 void setLabelFor(QWidget *w, FileStates::State, bool addHighlightExplanation);
97 }; 101 };
98 102
99 #endif 103 #endif