comparison filestatuswidget.cpp @ 109:1721c580c10e

* Add a queueing mechanism for Hg actions, instead of refusing to start an action if something else is already happening. This is essential now that actions can be prompted by asynchronous events (e.g. filesystem watcher). * Make Revert behave sensibly
author Chris Cannam
date Fri, 26 Nov 2010 12:48:29 +0000
parents 729438d70af8
children 78374cefa10f
comparison
equal deleted inserted replaced
108:8ae3b44c0073 109:1721c580c10e
66 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); 66 m_descriptions[FileStates::Clean] = tr("You have not changed these files.");
67 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); 67 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them.");
68 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit."); 68 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit.");
69 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>" 69 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>"
70 "They will not be deleted from the local folder."); 70 "They will not be deleted from the local folder.");
71 m_descriptions[FileStates::Missing] = tr("These files are recorded in the version control but absent from your working folder.<br>" 71 m_descriptions[FileStates::Missing] = tr("These files are recorded in the version control, but absent from your working folder.<br>"
72 "If you deleted them intentionally, select them here and use <b>Remove</b> to tell the version control system about it."); 72 "If you deleted them by accident, select them here and use Revert to restore their previous contents.<br>"
73 "If you deleted them intentionally, select them here and use Remove to tell the version control system about it.");
73 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>" 74 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>"
74 "Select a file and use Add to place it under version control or Ignore to remove it from this list."); 75 "Select a file and use Add to place it under version control or Ignore to remove it from this list.");
75 76
76 m_highlightExplanation = tr("Files highlighted <font color=red>in red</font> " 77 m_highlightExplanation = tr("Files highlighted <font color=red>in red</font> "
77 "have appeared since your most recent commit or update."); 78 "have appeared since your most recent commit or update.");
186 { 187 {
187 QStringList files; 188 QStringList files;
188 files << m_fileStates.getFilesInState(FileStates::Modified); 189 files << m_fileStates.getFilesInState(FileStates::Modified);
189 files << m_fileStates.getFilesInState(FileStates::Added); 190 files << m_fileStates.getFilesInState(FileStates::Added);
190 files << m_fileStates.getFilesInState(FileStates::Removed); 191 files << m_fileStates.getFilesInState(FileStates::Removed);
192 return files;
193 }
194
195 QStringList FileStatusWidget::getSelectedRevertableFiles() const
196 {
197 QStringList files;
198 foreach (QString f, m_selectedFiles) {
199 switch (m_fileStates.getStateOfFile(f)) {
200 case FileStates::Added:
201 case FileStates::Modified:
202 case FileStates::Removed:
203 case FileStates::Missing:
204 files.push_back(f);
205 break;
206 default: break;
207 }
208 }
209 return files;
210 }
211
212 QStringList FileStatusWidget::getAllRevertableFiles() const
213 {
214 QStringList files;
215 files << m_fileStates.getFilesInState(FileStates::Modified);
216 files << m_fileStates.getFilesInState(FileStates::Added);
217 files << m_fileStates.getFilesInState(FileStates::Removed);
218 files << m_fileStates.getFilesInState(FileStates::Missing);
191 return files; 219 return files;
192 } 220 }
193 221
194 QStringList FileStatusWidget::getSelectedAddableFiles() const 222 QStringList FileStatusWidget::getSelectedAddableFiles() const
195 { 223 {