Mercurial > hg > easyhg
comparison filestatuswidget.cpp @ 163:5c262ac73948
* First cut of work on merge/resolve logic
author | Chris Cannam |
---|---|
date | Fri, 03 Dec 2010 19:35:04 +0000 |
parents | 910c2c5d1873 |
children | 6c15700f4103 |
comparison
equal
deleted
inserted
replaced
162:910c2c5d1873 | 163:5c262ac73948 |
---|---|
68 m_simpleLabels[FileStates::Clean] = tr("Unmodified:"); | 68 m_simpleLabels[FileStates::Clean] = tr("Unmodified:"); |
69 m_simpleLabels[FileStates::Modified] = tr("Modified:"); | 69 m_simpleLabels[FileStates::Modified] = tr("Modified:"); |
70 m_simpleLabels[FileStates::Added] = tr("Added:"); | 70 m_simpleLabels[FileStates::Added] = tr("Added:"); |
71 m_simpleLabels[FileStates::Removed] = tr("Removed:"); | 71 m_simpleLabels[FileStates::Removed] = tr("Removed:"); |
72 m_simpleLabels[FileStates::Missing] = tr("Missing:"); | 72 m_simpleLabels[FileStates::Missing] = tr("Missing:"); |
73 m_simpleLabels[FileStates::InConflict] = tr("In Conflict:"); | |
73 m_simpleLabels[FileStates::Unknown] = tr("Untracked:"); | 74 m_simpleLabels[FileStates::Unknown] = tr("Untracked:"); |
74 | 75 |
75 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); | 76 m_descriptions[FileStates::Clean] = tr("You have not changed these files."); |
76 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); | 77 m_descriptions[FileStates::Modified] = tr("You have changed these files since you last committed them."); |
77 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit."); | 78 m_descriptions[FileStates::Added] = tr("These files will be added to version control next time you commit."); |
78 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>" | 79 m_descriptions[FileStates::Removed] = tr("These files will be removed from version control next time you commit.<br>" |
79 "They will not be deleted from the local folder."); | 80 "They will not be deleted from the local folder."); |
80 m_descriptions[FileStates::Missing] = tr("These files are recorded in the version control, but absent from your working folder.<br>" | 81 m_descriptions[FileStates::Missing] = tr("These files are recorded in the version control, but absent from your working folder.<br>" |
81 "If you intended to delete them, select them and use Remove to tell the version control system about it.<br>" | 82 "If you intended to delete them, select them and use Remove to tell the version control system about it.<br>" |
82 "If you deleted them by accident, select them and use Revert to restore their previous contents."); | 83 "If you deleted them by accident, select them and use Revert to restore their previous contents."); |
84 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."); | |
83 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>" | 85 m_descriptions[FileStates::Unknown] = tr("These files are in your working folder but are not under version control.<br>" |
84 "Select a file and use Add to place it under version control or Ignore to remove it from this list."); | 86 "Select a file and use Add to place it under version control or Ignore to remove it from this list."); |
85 | 87 |
86 m_highlightExplanation = tr("Files highlighted <font color=#d40000>in red</font> " | 88 m_highlightExplanation = tr("Files highlighted <font color=#d40000>in red</font> " |
87 "have appeared since your most recent commit or update."); | 89 "have appeared since your most recent commit or update."); |
88 | 90 |
89 for (int i = int(FileStates::FirstState); | 91 for (int i = int(FileStates::FirstState); |
90 i <= int(FileStates::LastState); ++i) { | 92 i <= int(FileStates::LastState); ++i) { |
91 | 93 |
92 FileStates::State s = FileStates::State(i); | 94 FileStates::State s = FileStates::State(i); |
93 | 95 |
94 QWidget *box = new QWidget; | 96 QWidget *box = new QWidget; |
95 QGridLayout *boxlayout = new QGridLayout; | 97 QGridLayout *boxlayout = new QGridLayout; |
220 switch (m_fileStates.getStateOfFile(f)) { | 222 switch (m_fileStates.getStateOfFile(f)) { |
221 case FileStates::Added: | 223 case FileStates::Added: |
222 case FileStates::Modified: | 224 case FileStates::Modified: |
223 case FileStates::Removed: | 225 case FileStates::Removed: |
224 case FileStates::Missing: | 226 case FileStates::Missing: |
227 case FileStates::InConflict: | |
225 files.push_back(f); | 228 files.push_back(f); |
226 break; | 229 break; |
227 default: break; | 230 default: break; |
228 } | 231 } |
229 } | 232 } |
235 QStringList files; | 238 QStringList files; |
236 files << m_fileStates.getFilesInState(FileStates::Modified); | 239 files << m_fileStates.getFilesInState(FileStates::Modified); |
237 files << m_fileStates.getFilesInState(FileStates::Added); | 240 files << m_fileStates.getFilesInState(FileStates::Added); |
238 files << m_fileStates.getFilesInState(FileStates::Removed); | 241 files << m_fileStates.getFilesInState(FileStates::Removed); |
239 files << m_fileStates.getFilesInState(FileStates::Missing); | 242 files << m_fileStates.getFilesInState(FileStates::Missing); |
243 files << m_fileStates.getFilesInState(FileStates::InConflict); | |
244 return files; | |
245 } | |
246 | |
247 QStringList FileStatusWidget::getSelectedUnresolvedFiles() const | |
248 { | |
249 QStringList files; | |
250 foreach (QString f, m_selectedFiles) { | |
251 switch (m_fileStates.getStateOfFile(f)) { | |
252 case FileStates::InConflict: | |
253 files.push_back(f); | |
254 break; | |
255 default: break; | |
256 } | |
257 } | |
258 return files; | |
259 } | |
260 | |
261 QStringList FileStatusWidget::getAllUnresolvedFiles() const | |
262 { | |
263 QStringList files; | |
264 files << m_fileStates.getFilesInState(FileStates::InConflict); | |
240 return files; | 265 return files; |
241 } | 266 } |
242 | 267 |
243 QStringList FileStatusWidget::getSelectedAddableFiles() const | 268 QStringList FileStatusWidget::getSelectedAddableFiles() const |
244 { | 269 { |
270 switch (m_fileStates.getStateOfFile(f)) { | 295 switch (m_fileStates.getStateOfFile(f)) { |
271 case FileStates::Clean: | 296 case FileStates::Clean: |
272 case FileStates::Added: | 297 case FileStates::Added: |
273 case FileStates::Modified: | 298 case FileStates::Modified: |
274 case FileStates::Missing: | 299 case FileStates::Missing: |
300 case FileStates::InConflict: | |
275 files.push_back(f); | 301 files.push_back(f); |
276 break; | 302 break; |
277 default: break; | 303 default: break; |
278 } | 304 } |
279 } | 305 } |
285 QStringList files; | 311 QStringList files; |
286 files << m_fileStates.getFilesInState(FileStates::Clean); | 312 files << m_fileStates.getFilesInState(FileStates::Clean); |
287 files << m_fileStates.getFilesInState(FileStates::Added); | 313 files << m_fileStates.getFilesInState(FileStates::Added); |
288 files << m_fileStates.getFilesInState(FileStates::Modified); | 314 files << m_fileStates.getFilesInState(FileStates::Modified); |
289 files << m_fileStates.getFilesInState(FileStates::Missing); | 315 files << m_fileStates.getFilesInState(FileStates::Missing); |
316 files << m_fileStates.getFilesInState(FileStates::InConflict); | |
290 return files; | 317 return files; |
291 } | 318 } |
292 | 319 |
293 void | 320 void |
294 FileStatusWidget::setLocalPath(QString p) | 321 FileStatusWidget::setLocalPath(QString p) |