Mercurial > hg > easyhg
comparison mainwindow.cpp @ 91:879af4608c5e
* Remove some old code in preparation for rebuilding it with the newer structure
author | Chris Cannam |
---|---|
date | Tue, 23 Nov 2010 21:04:02 +0000 |
parents | b43355c2473a |
children | 44ed7766d55a |
comparison
equal
deleted
inserted
replaced
90:b43355c2473a | 91:879af4608c5e |
---|---|
135 { | 135 { |
136 if (runningAction == ACT_NONE) | 136 if (runningAction == ACT_NONE) |
137 { | 137 { |
138 QStringList params; | 138 QStringList params; |
139 | 139 |
140 QString statFlags = hgExp -> getStatFlags(); | 140 params << "stat" << "-ardum"; |
141 if (statFlags.isEmpty()) | |
142 { | |
143 params << "stat"; | |
144 } | |
145 else | |
146 { | |
147 params << "stat" << "-" + statFlags; | |
148 } | |
149 | |
150 | 141 |
151 runner -> startHgCommand(workFolderPath, params); | 142 runner -> startHgCommand(workFolderPath, params); |
152 runningAction = ACT_STAT; | 143 runningAction = ACT_STAT; |
153 } | 144 } |
154 } | 145 } |
210 void MainWindow::hgRemove() | 201 void MainWindow::hgRemove() |
211 { | 202 { |
212 if (runningAction == ACT_NONE) | 203 if (runningAction == ACT_NONE) |
213 { | 204 { |
214 QStringList params; | 205 QStringList params; |
215 QString currentFile = hgExp -> getCurrentFileListLine(); | 206 QString currentFile;//!!! = hgExp -> getCurrentFileListLine(); |
216 | 207 |
217 if (!currentFile.isEmpty()) | 208 if (!currentFile.isEmpty()) |
218 { | 209 { |
219 if (QMessageBox::Ok == QMessageBox::warning(this, "Remove file", "Really remove file " + currentFile.mid(2) + "?", | 210 if (QMessageBox::Ok == QMessageBox::warning(this, "Remove file", "Really remove file " + currentFile.mid(2) + "?", |
220 QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel)) | 211 QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel)) |
231 void MainWindow::hgAnnotate() | 222 void MainWindow::hgAnnotate() |
232 { | 223 { |
233 if (runningAction == ACT_NONE) | 224 if (runningAction == ACT_NONE) |
234 { | 225 { |
235 QStringList params; | 226 QStringList params; |
236 QString currentFile = hgExp -> getCurrentFileListLine(); | 227 QString currentFile;//!!! = hgExp -> getCurrentFileListLine(); |
237 | 228 |
238 if (!currentFile.isEmpty()) | 229 if (!currentFile.isEmpty()) |
239 { | 230 { |
240 params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") | 231 params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") |
241 | 232 |
249 void MainWindow::hgResolveMark() | 240 void MainWindow::hgResolveMark() |
250 { | 241 { |
251 if (runningAction == ACT_NONE) | 242 if (runningAction == ACT_NONE) |
252 { | 243 { |
253 QStringList params; | 244 QStringList params; |
254 QString currentFile = hgExp -> getCurrentFileListLine(); | 245 QString currentFile;//!!! = hgExp -> getCurrentFileListLine(); |
255 | 246 |
256 if (!currentFile.isEmpty()) | 247 if (!currentFile.isEmpty()) |
257 { | 248 { |
258 params << "resolve" << "--mark" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") | 249 params << "resolve" << "--mark" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") |
259 | 250 |
283 { | 274 { |
284 if (runningAction == ACT_NONE) | 275 if (runningAction == ACT_NONE) |
285 { | 276 { |
286 QStringList params; | 277 QStringList params; |
287 | 278 |
288 QString currentFile = hgExp -> getCurrentFileListLine(); | 279 QString currentFile;//!!! = hgExp -> getCurrentFileListLine(); |
289 | 280 /*!!! |
290 if (areAllSelectedUntracked(hgExp -> workFolderFileList)) | 281 if (areAllSelectedUntracked(hgExp -> workFolderFileList)) |
291 { | 282 { |
292 //User wants to add selected file(s) | 283 //User wants to add selected file(s) |
293 params << "add" << "--"; | 284 params << "add" << "--"; |
294 | 285 |
306 params << "add"; | 297 params << "add"; |
307 } | 298 } |
308 | 299 |
309 runner -> startHgCommand(workFolderPath, params); | 300 runner -> startHgCommand(workFolderPath, params); |
310 runningAction = ACT_ADD; | 301 runningAction = ACT_ADD; |
302 */ | |
311 } | 303 } |
312 } | 304 } |
313 | 305 |
314 bool MainWindow::getCommentOrTag(QString& commentOrTag, | 306 bool MainWindow::getCommentOrTag(QString& commentOrTag, |
315 QString question, | 307 QString question, |
364 | 356 |
365 if (getCommentOrTag(comment, tr("Comment:"), tr("Save (commit)"))) | 357 if (getCommentOrTag(comment, tr("Comment:"), tr("Save (commit)"))) |
366 { | 358 { |
367 if (!comment.isEmpty()) | 359 if (!comment.isEmpty()) |
368 { | 360 { |
361 /*!!! | |
369 if ((justMerged == false) && (areAllSelectedCommitable(hgExp -> workFolderFileList))) | 362 if ((justMerged == false) && (areAllSelectedCommitable(hgExp -> workFolderFileList))) |
370 { | 363 { |
371 //User wants to commit selected file(s) (and this is not merge commit, which would fail if we selected files) | 364 //User wants to commit selected file(s) (and this is not merge commit, which would fail if we selected files) |
372 params << "commit" << "--message" << comment << "--user" << getUserInfo() << "--"; | 365 params << "commit" << "--message" << comment << "--user" << getUserInfo() << "--"; |
373 | 366 |
384 params << "commit" << "--message" << comment << "--user" << getUserInfo(); | 377 params << "commit" << "--message" << comment << "--user" << getUserInfo(); |
385 } | 378 } |
386 | 379 |
387 runner -> startHgCommand(workFolderPath, params); | 380 runner -> startHgCommand(workFolderPath, params); |
388 runningAction = ACT_COMMIT; | 381 runningAction = ACT_COMMIT; |
382 */ | |
389 } | 383 } |
390 } | 384 } |
391 } | 385 } |
392 } | 386 } |
393 | 387 |
461 void MainWindow::hgFileDiff() | 455 void MainWindow::hgFileDiff() |
462 { | 456 { |
463 if (runningAction == ACT_NONE) | 457 if (runningAction == ACT_NONE) |
464 { | 458 { |
465 QStringList params; | 459 QStringList params; |
466 | 460 /*!!! |
467 QString currentFile = hgExp -> getCurrentFileListLine(); | 461 QString currentFile = hgExp -> getCurrentFileListLine(); |
468 | 462 |
469 if (!currentFile.isEmpty()) | 463 if (!currentFile.isEmpty()) |
470 { | 464 { |
471 //Diff parent file against working folder file | 465 //Diff parent file against working folder file |
472 params << "kdiff3" << "--" << currentFile.mid(2); | 466 params << "kdiff3" << "--" << currentFile.mid(2); |
473 runner -> startHgCommand(workFolderPath, params); | 467 runner -> startHgCommand(workFolderPath, params); |
474 runningAction = ACT_FILEDIFF; | 468 runningAction = ACT_FILEDIFF; |
475 } | 469 } |
470 */ | |
476 } | 471 } |
477 } | 472 } |
478 | 473 |
479 | 474 |
480 void MainWindow::hgFolderDiff() | 475 void MainWindow::hgFolderDiff() |
498 QStringList params; | 493 QStringList params; |
499 | 494 |
500 //Diff 2 history log versions against each other | 495 //Diff 2 history log versions against each other |
501 QString revA; | 496 QString revA; |
502 QString revB; | 497 QString revB; |
503 | 498 /*!!! |
504 hgExp -> getHistoryDiffRevisions(revA, revB); | 499 hgExp -> getHistoryDiffRevisions(revA, revB); |
505 | 500 |
506 if ((!revA.isEmpty()) && (!revB.isEmpty())) | 501 if ((!revA.isEmpty()) && (!revB.isEmpty())) |
507 { | 502 { |
508 params << "kdiff3" << "--rev" << revA << "--rev" << revB; | 503 params << "kdiff3" << "--rev" << revA << "--rev" << revB; |
511 } | 506 } |
512 else | 507 else |
513 { | 508 { |
514 QMessageBox::information(this, tr("Changeset diff"), tr("Please select two changesets from history list or heads list first.")); | 509 QMessageBox::information(this, tr("Changeset diff"), tr("Please select two changesets from history list or heads list first.")); |
515 } | 510 } |
511 */ | |
516 } | 512 } |
517 } | 513 } |
518 | 514 |
519 | 515 |
520 | 516 |
538 { | 534 { |
539 if (runningAction == ACT_NONE) | 535 if (runningAction == ACT_NONE) |
540 { | 536 { |
541 QStringList params; | 537 QStringList params; |
542 QString rev; | 538 QString rev; |
543 | 539 /*!!! |
544 hgExp -> getUpdateToRevRevision(rev); | 540 hgExp -> getUpdateToRevRevision(rev); |
545 | 541 |
546 hgExp -> setCurrentIndex(WORKTAB); | 542 hgExp -> setCurrentIndex(WORKTAB); |
547 enableDisableActions(); | 543 enableDisableActions(); |
548 | 544 |
549 params << "update" << "--rev" << rev << "--clean"; | 545 params << "update" << "--rev" << rev << "--clean"; |
550 | 546 |
551 runner -> startHgCommand(workFolderPath, params); | 547 runner -> startHgCommand(workFolderPath, params); |
552 | 548 |
553 runningAction = ACT_UPDATE; | 549 runningAction = ACT_UPDATE; |
550 */ | |
554 } | 551 } |
555 } | 552 } |
556 | 553 |
557 | 554 |
558 void MainWindow::hgRevert() | 555 void MainWindow::hgRevert() |
559 { | 556 { |
560 if (runningAction == ACT_NONE) | 557 if (runningAction == ACT_NONE) |
561 { | 558 { |
559 /*!!! | |
562 QStringList params; | 560 QStringList params; |
563 QString currentFile = hgExp -> getCurrentFileListLine(); | 561 QString currentFile = hgExp -> getCurrentFileListLine(); |
564 | 562 |
565 params << "revert" << "--no-backup" << "--" << currentFile.mid(2); | 563 params << "revert" << "--no-backup" << "--" << currentFile.mid(2); |
566 | 564 |
567 runner -> startHgCommand(workFolderPath, params); | 565 runner -> startHgCommand(workFolderPath, params); |
568 runningAction = ACT_REVERT; | 566 runningAction = ACT_REVERT; |
567 */ | |
569 } | 568 } |
570 } | 569 } |
571 | 570 |
572 void MainWindow::hgRetryMerge() | 571 void MainWindow::hgRetryMerge() |
573 { | 572 { |
765 } else if (choice == "init") { | 764 } else if (choice == "init") { |
766 result = openInit(arg); | 765 result = openInit(arg); |
767 } | 766 } |
768 | 767 |
769 if (result) { | 768 if (result) { |
770 hgExp->clearLists(); | |
771 enableDisableActions(); | 769 enableDisableActions(); |
772 hgPaths(); | 770 hgPaths(); |
773 done = true; } | 771 done = true; |
772 } | |
774 | 773 |
775 } else { | 774 } else { |
776 | 775 |
777 // cancelled | 776 // cancelled |
778 done = true; | 777 done = true; |
1359 enableDisableActions(); | 1358 enableDisableActions(); |
1360 shouldHgStat = true; | 1359 shouldHgStat = true; |
1361 break; | 1360 break; |
1362 | 1361 |
1363 case ACT_LOG: | 1362 case ACT_LOG: |
1364 { | 1363 hgExp -> updateLocalRepoHgLogList(runner -> getOutput()); |
1365 hgExp -> updateLocalRepoHgLogList(runner -> getOutput()); | |
1366 } | |
1367 break; | 1364 break; |
1368 | 1365 |
1369 case ACT_PARENTS: | 1366 case ACT_PARENTS: |
1370 { | 1367 { |
1371 hgExp -> updateLocalRepoParentsList(runner -> getOutput()); | 1368 //!!! hgExp -> updateLocalRepoParentsList(runner -> getOutput()); |
1372 } | 1369 } |
1373 break; | 1370 break; |
1374 | 1371 |
1375 case ACT_HEADS: | 1372 case ACT_HEADS: |
1376 { | 1373 { |
1377 QString stdOut = runner -> getOutput(); | 1374 QString stdOut = runner -> getOutput(); |
1378 hgExp -> updateLocalRepoHeadsList(stdOut); | 1375 //!!! hgExp -> updateLocalRepoHeadsList(stdOut); |
1379 } | 1376 } |
1380 break; | 1377 break; |
1381 | 1378 |
1382 case ACT_REMOVE: | 1379 case ACT_REMOVE: |
1383 case ACT_ADD: | 1380 case ACT_ADD: |
1567 hgAnnotateAct -> setEnabled(localRepoActionsEnabled); | 1564 hgAnnotateAct -> setEnabled(localRepoActionsEnabled); |
1568 hgServeAct -> setEnabled(localRepoActionsEnabled); | 1565 hgServeAct -> setEnabled(localRepoActionsEnabled); |
1569 hgTagAct -> setEnabled(localRepoActionsEnabled); | 1566 hgTagAct -> setEnabled(localRepoActionsEnabled); |
1570 hgIgnoreAct -> setEnabled(localRepoActionsEnabled); | 1567 hgIgnoreAct -> setEnabled(localRepoActionsEnabled); |
1571 | 1568 |
1572 hgExp -> enableDisableOtherTabs(tabPage); | 1569 //!!!hgExp -> enableDisableOtherTabs(tabPage); |
1573 | 1570 |
1574 DEBUG << "localRepoActionsEnabled = " << localRepoActionsEnabled << endl; | 1571 DEBUG << "localRepoActionsEnabled = " << localRepoActionsEnabled << endl; |
1575 DEBUG << "canCommit = " << hgExp->canCommit() << endl; | 1572 DEBUG << "canCommit = " << hgExp->canCommit() << endl; |
1576 | 1573 |
1577 //!!! new stuff: | 1574 //!!! new stuff: |
1888 settings.setValue("pos", pos()); | 1885 settings.setValue("pos", pos()); |
1889 settings.setValue("size", size()); | 1886 settings.setValue("size", size()); |
1890 settings.setValue("remoterepopath", remoteRepoPath); | 1887 settings.setValue("remoterepopath", remoteRepoPath); |
1891 settings.setValue("workfolderpath", workFolderPath); | 1888 settings.setValue("workfolderpath", workFolderPath); |
1892 settings.setValue("firststart", firstStart); | 1889 settings.setValue("firststart", firstStart); |
1893 settings.setValue("viewFileTypes", hgExp -> getFileTypesBits()); | 1890 //!!!settings.setValue("viewFileTypes", hgExp -> getFileTypesBits()); |
1894 } | 1891 } |
1895 | 1892 |
1896 | 1893 |
1897 | 1894 |
1898 | 1895 |