comparison filestatuswidget.cpp @ 199:f16fe0db11f3

* Add "Show All Files" toggle to show ignored and clean files * Clear selection when Esc is pressed * Don't delete and recreate the filesystem watcher on stat, just update it
author Chris Cannam
date Mon, 03 Jan 2011 22:02:08 +0000
parents 869825bc8bc4
children 0844b4d8d911 3d4291d4226c
comparison
equal deleted inserted replaced
198:4adbd5c9c15d 199:f16fe0db11f3
28 #include <QDateTime> 28 #include <QDateTime>
29 #include <QPushButton> 29 #include <QPushButton>
30 #include <QToolButton> 30 #include <QToolButton>
31 #include <QDir> 31 #include <QDir>
32 #include <QProcess> 32 #include <QProcess>
33 #include <QCheckBox>
33 34
34 FileStatusWidget::FileStatusWidget(QWidget *parent) : 35 FileStatusWidget::FileStatusWidget(QWidget *parent) :
35 QWidget(parent), 36 QWidget(parent),
36 m_dateReference(0) 37 m_dateReference(0)
37 { 38 {
77 m_simpleLabels[FileStates::Added] = tr("Added:"); 78 m_simpleLabels[FileStates::Added] = tr("Added:");
78 m_simpleLabels[FileStates::Removed] = tr("Removed:"); 79 m_simpleLabels[FileStates::Removed] = tr("Removed:");
79 m_simpleLabels[FileStates::Missing] = tr("Missing:"); 80 m_simpleLabels[FileStates::Missing] = tr("Missing:");
80 m_simpleLabels[FileStates::InConflict] = tr("In Conflict:"); 81 m_simpleLabels[FileStates::InConflict] = tr("In Conflict:");
81 m_simpleLabels[FileStates::Unknown] = tr("Untracked:"); 82 m_simpleLabels[FileStates::Unknown] = tr("Untracked:");
83 m_simpleLabels[FileStates::Ignored] = tr("Ignored:");
82 84
83 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); 85 m_descriptions[FileStates::Clean] = tr("You have not changed these files.");
84 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); 86 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them.");
85 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit."); 87 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit.");
86 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>" 88 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>"
90 "If you deleted them by accident, select them and use Revert to restore their previous contents."); 92 "If you deleted them by accident, select them and use Revert to restore their previous contents.");
91 m_descriptions[FileStates::InConflict] = tr("These files are unresolved following an incomplete merge.<br>Select a file and use Merge to try to resolve the merge again."); 93 m_descriptions[FileStates::InConflict] = tr("These files are unresolved following an incomplete merge.<br>Select a file and use Merge to try to resolve the merge again.");
92 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>" 94 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>"
93 // "Select a file and use Add to place it under version control or Ignore to remove it from this list."); 95 // "Select a file and use Add to place it under version control or Ignore to remove it from this list.");
94 "Select a file and use Add to place it under version control."); 96 "Select a file and use Add to place it under version control.");
97 m_descriptions[FileStates::Ignored] = tr("These files have names that match entries in the working folder's .hgignore file,<br>"
98 "and so will be ignored by the version control system.");
95 99
96 m_highlightExplanation = tr("Files highlighted <font color=#d40000>in red</font> " 100 m_highlightExplanation = tr("Files highlighted <font color=#d40000>in red</font> "
97 "have appeared since your most recent commit or update."); 101 "have appeared since your most recent commit or update.");
98 102
99 for (int i = int(FileStates::FirstState); 103 for (int i = int(FileStates::FirstState);
122 box->hide(); 126 box->hide();
123 } 127 }
124 128
125 layout->setRowStretch(++row, 20); 129 layout->setRowStretch(++row, 20);
126 130
131 layout->addItem(new QSpacerItem(1, 1), ++row, 0);
132
133 m_showAllFiles = new QCheckBox(tr("Show all files"), this);
134 layout->addWidget(m_showAllFiles, ++row, 0, 1, 3, Qt::AlignLeft);
135 connect(m_showAllFiles, SIGNAL(toggled(bool)),
136 this, SIGNAL(showAllChanged(bool)));
127 } 137 }
128 138
129 FileStatusWidget::~FileStatusWidget() 139 FileStatusWidget::~FileStatusWidget()
130 { 140 {
131 delete m_dateReference; 141 delete m_dateReference;