Mercurial > hg > easyhg
comparison mainwindow.cpp @ 336:4229b6a8e9c6
Merge
author | Chris Cannam |
---|---|
date | Mon, 14 Mar 2011 10:00:29 +0000 |
parents | 70ad221e1619 |
children | 697d7d75eae5 |
comparison
equal
deleted
inserted
replaced
335:aa852b477e4d | 336:4229b6a8e9c6 |
---|---|
42 #include "logparser.h" | 42 #include "logparser.h" |
43 #include "confirmcommentdialog.h" | 43 #include "confirmcommentdialog.h" |
44 #include "incomingdialog.h" | 44 #include "incomingdialog.h" |
45 #include "settingsdialog.h" | 45 #include "settingsdialog.h" |
46 #include "moreinformationdialog.h" | 46 #include "moreinformationdialog.h" |
47 #include "annotatedialog.h" | |
47 #include "version.h" | 48 #include "version.h" |
48 #include "workstatuswidget.h" | 49 #include "workstatuswidget.h" |
49 | 50 |
50 | 51 |
51 MainWindow::MainWindow(QString myDirPath) : | 52 MainWindow::MainWindow(QString myDirPath) : |
355 QStringList params; | 356 QStringList params; |
356 params << "parents"; | 357 params << "parents"; |
357 m_runner->requestAction(HgAction(ACT_QUERY_PARENTS, m_workFolderPath, params)); | 358 m_runner->requestAction(HgAction(ACT_QUERY_PARENTS, m_workFolderPath, params)); |
358 } | 359 } |
359 | 360 |
360 void MainWindow::hgAnnotate() | 361 void MainWindow::hgAnnotateFiles(QStringList files) |
361 { | 362 { |
362 QStringList params; | 363 QStringList params; |
363 QString currentFile;//!!! = m_hgTabs -> getCurrentFileListLine(); | |
364 | 364 |
365 if (!currentFile.isEmpty()) | 365 if (!files.isEmpty()) { |
366 { | 366 params << "annotate" << "-udqc" << "--" << files; |
367 params << "annotate" << "--" << currentFile.mid(2); //Jump over status marker characters (e.g "M ") | |
368 | |
369 m_runner->requestAction(HgAction(ACT_ANNOTATE, m_workFolderPath, params)); | 367 m_runner->requestAction(HgAction(ACT_ANNOTATE, m_workFolderPath, params)); |
370 } | 368 } |
371 } | 369 } |
372 | 370 |
373 void MainWindow::hgResolveList() | 371 void MainWindow::hgResolveList() |
378 m_runner->requestAction(HgAction(ACT_RESOLVE_LIST, m_workFolderPath, params)); | 376 m_runner->requestAction(HgAction(ACT_RESOLVE_LIST, m_workFolderPath, params)); |
379 } | 377 } |
380 | 378 |
381 void MainWindow::hgAdd() | 379 void MainWindow::hgAdd() |
382 { | 380 { |
383 QStringList params; | |
384 | |
385 // hgExplorer permitted adding "all" files -- I'm not sure | 381 // hgExplorer permitted adding "all" files -- I'm not sure |
386 // that one is a good idea, let's require the user to select | 382 // that one is a good idea, let's require the user to select |
387 | 383 |
388 QStringList files = m_hgTabs->getSelectedAddableFiles(); | 384 hgAddFiles(m_hgTabs->getSelectedAddableFiles()); |
385 } | |
386 | |
387 void MainWindow::hgAddFiles(QStringList files) | |
388 { | |
389 QStringList params; | |
389 | 390 |
390 if (!files.empty()) { | 391 if (!files.empty()) { |
391 params << "add" << "--" << files; | 392 params << "add" << "--" << files; |
392 m_runner->requestAction(HgAction(ACT_ADD, m_workFolderPath, params)); | 393 m_runner->requestAction(HgAction(ACT_ADD, m_workFolderPath, params)); |
393 } | 394 } |
394 } | 395 } |
395 | 396 |
396 | |
397 void MainWindow::hgRemove() | 397 void MainWindow::hgRemove() |
398 { | 398 { |
399 QStringList params; | 399 hgRemoveFiles(m_hgTabs->getSelectedRemovableFiles()); |
400 | 400 } |
401 QStringList files = m_hgTabs->getSelectedRemovableFiles(); | 401 |
402 void MainWindow::hgRemoveFiles(QStringList files) | |
403 { | |
404 QStringList params; | |
402 | 405 |
403 if (!files.empty()) { | 406 if (!files.empty()) { |
404 params << "remove" << "--after" << "--force" << "--" << files; | 407 params << "remove" << "--after" << "--force" << "--" << files; |
405 m_runner->requestAction(HgAction(ACT_REMOVE, m_workFolderPath, params)); | 408 m_runner->requestAction(HgAction(ACT_REMOVE, m_workFolderPath, params)); |
406 } | 409 } |
407 } | 410 } |
408 | 411 |
409 void MainWindow::hgCommit() | 412 void MainWindow::hgCommit() |
410 { | 413 { |
414 hgCommitFiles(QStringList()); | |
415 } | |
416 | |
417 void MainWindow::hgCommitFiles(QStringList files) | |
418 { | |
411 QStringList params; | 419 QStringList params; |
412 QString comment; | 420 QString comment; |
413 | 421 |
414 if (m_justMerged) { | 422 if (m_justMerged) { |
415 comment = m_mergeCommitComment; | 423 comment = m_mergeCommitComment; |
416 } | 424 } |
417 | 425 |
418 QStringList files = m_hgTabs->getSelectedCommittableFiles(); | |
419 QStringList allFiles = m_hgTabs->getAllCommittableFiles(); | 426 QStringList allFiles = m_hgTabs->getAllCommittableFiles(); |
420 QStringList reportFiles = files; | 427 QStringList reportFiles = files; |
421 if (reportFiles.empty()) { | 428 if (reportFiles.empty()) { |
422 reportFiles = allFiles; | 429 reportFiles = allFiles; |
423 } | 430 } |
496 m_runner->requestAction(HgAction(ACT_NEW_BRANCH, m_workFolderPath, params)); | 503 m_runner->requestAction(HgAction(ACT_NEW_BRANCH, m_workFolderPath, params)); |
497 } | 504 } |
498 } | 505 } |
499 } | 506 } |
500 | 507 |
501 | |
502 void MainWindow::hgNoBranch() | 508 void MainWindow::hgNoBranch() |
503 { | 509 { |
504 if (m_currentParents.empty()) return; | 510 if (m_currentParents.empty()) return; |
505 | 511 |
506 QString parentBranch = m_currentParents[0]->branch(); | 512 QString parentBranch = m_currentParents[0]->branch(); |
508 | 514 |
509 QStringList params; | 515 QStringList params; |
510 params << "branch" << parentBranch; | 516 params << "branch" << parentBranch; |
511 m_runner->requestAction(HgAction(ACT_NEW_BRANCH, m_workFolderPath, params)); | 517 m_runner->requestAction(HgAction(ACT_NEW_BRANCH, m_workFolderPath, params)); |
512 } | 518 } |
513 | |
514 | 519 |
515 void MainWindow::hgTag(QString id) | 520 void MainWindow::hgTag(QString id) |
516 { | 521 { |
517 QStringList params; | 522 QStringList params; |
518 QString tag; | 523 QString tag; |
530 | 535 |
531 m_runner->requestAction(HgAction(ACT_TAG, m_workFolderPath, params)); | 536 m_runner->requestAction(HgAction(ACT_TAG, m_workFolderPath, params)); |
532 } | 537 } |
533 } | 538 } |
534 } | 539 } |
535 | |
536 | 540 |
537 void MainWindow::hgIgnore() | 541 void MainWindow::hgIgnore() |
538 { | 542 { |
539 QString hgIgnorePath; | 543 QString hgIgnorePath; |
540 QStringList params; | 544 QStringList params; |
566 action.executable = editor; | 570 action.executable = editor; |
567 | 571 |
568 m_runner->requestAction(action); | 572 m_runner->requestAction(action); |
569 } | 573 } |
570 | 574 |
575 void MainWindow::hgIgnoreFiles(QStringList files) | |
576 { | |
577 //!!! not implemented yet | |
578 DEBUG << "MainWindow::hgIgnoreFiles: Not implemented" << endl; | |
579 } | |
580 | |
581 void MainWindow::hgUnIgnoreFiles(QStringList files) | |
582 { | |
583 //!!! not implemented yet | |
584 DEBUG << "MainWindow::hgUnIgnoreFiles: Not implemented" << endl; | |
585 } | |
586 | |
571 QString MainWindow::getDiffBinaryName() | 587 QString MainWindow::getDiffBinaryName() |
572 { | 588 { |
573 QSettings settings; | 589 QSettings settings; |
574 settings.beginGroup("Locations"); | 590 settings.beginGroup("Locations"); |
575 return settings.value("extdiffbinary", "").toString(); | 591 return settings.value("extdiffbinary", "").toString(); |
598 m_runner->requestAction(HgAction(ACT_UNCOMMITTED_SUMMARY, m_workFolderPath, params)); | 614 m_runner->requestAction(HgAction(ACT_UNCOMMITTED_SUMMARY, m_workFolderPath, params)); |
599 } | 615 } |
600 | 616 |
601 void MainWindow::hgFolderDiff() | 617 void MainWindow::hgFolderDiff() |
602 { | 618 { |
619 hgDiffFiles(QStringList()); | |
620 } | |
621 | |
622 void MainWindow::hgDiffFiles(QStringList files) | |
623 { | |
603 QString diff = getDiffBinaryName(); | 624 QString diff = getDiffBinaryName(); |
604 if (diff == "") return; | 625 if (diff == "") return; |
605 | 626 |
606 QStringList params; | 627 QStringList params; |
607 | 628 |
608 // Diff parent against working folder (folder diff) | 629 // Diff parent against working folder (folder diff) |
609 | 630 |
610 params << "--config" << "extensions.extdiff=" << "extdiff"; | 631 params << "--config" << "extensions.extdiff=" << "extdiff"; |
611 params << "--program" << diff; | 632 params << "--program" << diff; |
612 | 633 |
613 params << m_hgTabs->getSelectedCommittableFiles(); // may be none: whole dir | 634 params << "--" << files; // may be none: whole dir |
614 | 635 |
615 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); | 636 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); |
616 } | 637 } |
617 | |
618 | 638 |
619 void MainWindow::hgDiffToCurrent(QString id) | 639 void MainWindow::hgDiffToCurrent(QString id) |
620 { | 640 { |
621 QString diff = getDiffBinaryName(); | 641 QString diff = getDiffBinaryName(); |
622 if (diff == "") return; | 642 if (diff == "") return; |
629 params << "--program" << diff; | 649 params << "--program" << diff; |
630 params << "--rev" << Changeset::hashOf(id); | 650 params << "--rev" << Changeset::hashOf(id); |
631 | 651 |
632 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); | 652 m_runner->requestAction(HgAction(ACT_FOLDERDIFF, m_workFolderPath, params)); |
633 } | 653 } |
634 | |
635 | 654 |
636 void MainWindow::hgDiffToParent(QString child, QString parent) | 655 void MainWindow::hgDiffToParent(QString child, QString parent) |
637 { | 656 { |
638 QString diff = getDiffBinaryName(); | 657 QString diff = getDiffBinaryName(); |
639 if (diff == "") return; | 658 if (diff == "") return; |
647 params << "--rev" << Changeset::hashOf(parent) | 666 params << "--rev" << Changeset::hashOf(parent) |
648 << "--rev" << Changeset::hashOf(child); | 667 << "--rev" << Changeset::hashOf(child); |
649 | 668 |
650 m_runner->requestAction(HgAction(ACT_CHGSETDIFF, m_workFolderPath, params)); | 669 m_runner->requestAction(HgAction(ACT_CHGSETDIFF, m_workFolderPath, params)); |
651 } | 670 } |
652 | 671 |
653 | 672 |
654 void MainWindow::hgShowSummaryFor(Changeset *cs) | 673 void MainWindow::hgShowSummaryFor(Changeset *cs) |
655 { | 674 { |
656 QStringList params; | 675 QStringList params; |
657 | 676 |
685 } | 704 } |
686 | 705 |
687 | 706 |
688 void MainWindow::hgRevert() | 707 void MainWindow::hgRevert() |
689 { | 708 { |
709 hgRevertFiles(QStringList()); | |
710 } | |
711 | |
712 void MainWindow::hgRevertFiles(QStringList files) | |
713 { | |
690 QStringList params; | 714 QStringList params; |
691 QString comment; | 715 QString comment; |
692 bool all = false; | 716 bool all = false; |
693 | 717 |
694 QStringList files = m_hgTabs->getSelectedRevertableFiles(); | |
695 QStringList allFiles = m_hgTabs->getAllRevertableFiles(); | 718 QStringList allFiles = m_hgTabs->getAllRevertableFiles(); |
696 if (files.empty() || files == allFiles) { | 719 if (files.empty() || files == allFiles) { |
697 files = allFiles; | 720 files = allFiles; |
698 all = true; | 721 all = true; |
699 } | 722 } |
756 m_runner->requestAction(HgAction(ACT_REVERT, m_workFolderPath, params)); | 779 m_runner->requestAction(HgAction(ACT_REVERT, m_workFolderPath, params)); |
757 } | 780 } |
758 } | 781 } |
759 | 782 |
760 | 783 |
761 void MainWindow::hgMarkResolved(QStringList files) | 784 void MainWindow::hgMarkFilesResolved(QStringList files) |
762 { | 785 { |
763 QStringList params; | 786 QStringList params; |
764 | 787 |
765 params << "resolve" << "--mark"; | 788 params << "resolve" << "--mark"; |
766 | 789 |
772 | 795 |
773 m_runner->requestAction(HgAction(ACT_RESOLVE_MARK, m_workFolderPath, params)); | 796 m_runner->requestAction(HgAction(ACT_RESOLVE_MARK, m_workFolderPath, params)); |
774 } | 797 } |
775 | 798 |
776 | 799 |
777 void MainWindow::hgRetryMerge() | 800 void MainWindow::hgRedoMerge() |
801 { | |
802 hgRedoFileMerges(QStringList()); | |
803 } | |
804 | |
805 | |
806 void MainWindow::hgRedoFileMerges(QStringList files) | |
778 { | 807 { |
779 QStringList params; | 808 QStringList params; |
780 | 809 |
781 params << "resolve"; | 810 params << "resolve"; |
782 | 811 |
783 QString merge = getMergeBinaryName(); | 812 QString merge = getMergeBinaryName(); |
784 if (merge != "") { | 813 if (merge != "") { |
785 params << "--tool" << merge; | 814 params << "--tool" << merge; |
786 } | 815 } |
787 | 816 |
788 QStringList files = m_hgTabs->getSelectedUnresolvedFiles(); | |
789 if (files.empty()) { | 817 if (files.empty()) { |
790 params << "--all"; | 818 params << "--all"; |
791 } else { | 819 } else { |
792 params << "--" << files; | 820 params << "--" << files; |
793 } | 821 } |
798 | 826 |
799 m_runner->requestAction(HgAction(ACT_RETRY_MERGE, m_workFolderPath, params)); | 827 m_runner->requestAction(HgAction(ACT_RETRY_MERGE, m_workFolderPath, params)); |
800 | 828 |
801 m_mergeCommitComment = tr("Merge"); | 829 m_mergeCommitComment = tr("Merge"); |
802 } | 830 } |
803 | 831 |
804 | 832 |
805 void MainWindow::hgMerge() | 833 void MainWindow::hgMerge() |
806 { | 834 { |
807 if (m_hgTabs->canResolve()) { | 835 if (m_hgTabs->canResolve()) { |
808 hgRetryMerge(); | 836 hgRedoMerge(); |
809 return; | 837 return; |
810 } | 838 } |
811 | 839 |
812 QStringList params; | 840 QStringList params; |
813 | 841 |
1425 updateToolBarStyle(); | 1453 updateToolBarStyle(); |
1426 hgRefresh(); | 1454 hgRefresh(); |
1427 } | 1455 } |
1428 } | 1456 } |
1429 | 1457 |
1430 #define STDOUT_NEEDS_BIG_WINDOW 512 | |
1431 #define SMALL_WND_W 500 | |
1432 #define SMALL_WND_H 300 | |
1433 | |
1434 #define BIG_WND_W 1024 | |
1435 #define BIG_WND_H 768 | |
1436 | |
1437 | |
1438 void MainWindow::presentLongStdoutToUser(QString stdo) | |
1439 { | |
1440 if (!stdo.isEmpty()) | |
1441 { | |
1442 QDialog dlg; | |
1443 | |
1444 if (stdo.length() > STDOUT_NEEDS_BIG_WINDOW) | |
1445 { | |
1446 dlg.setMinimumWidth(BIG_WND_W); | |
1447 dlg.setMinimumHeight(BIG_WND_H); | |
1448 } | |
1449 else | |
1450 { | |
1451 dlg.setMinimumWidth(SMALL_WND_W); | |
1452 dlg.setMinimumHeight(SMALL_WND_H); | |
1453 } | |
1454 | |
1455 QVBoxLayout *box = new QVBoxLayout; | |
1456 QListWidget *list = new QListWidget; | |
1457 list-> addItems(stdo.split("\n")); | |
1458 QPushButton *btn = new QPushButton(tr("Ok")); | |
1459 connect(btn, SIGNAL(clicked()), &dlg, SLOT(accept())); | |
1460 | |
1461 box -> addWidget(list); | |
1462 box -> addWidget(btn); | |
1463 dlg.setLayout(box); | |
1464 | |
1465 dlg.exec(); | |
1466 } | |
1467 else | |
1468 { | |
1469 QMessageBox::information(this, tr("EasyMercurial"), tr("Mercurial command did not return any output.")); | |
1470 } | |
1471 } | |
1472 | |
1473 void MainWindow::updateFileSystemWatcher() | 1458 void MainWindow::updateFileSystemWatcher() |
1474 { | 1459 { |
1475 bool justCreated = false; | 1460 bool justCreated = false; |
1476 if (!m_fsWatcher) { | 1461 if (!m_fsWatcher) { |
1477 m_fsWatcher = new QFileSystemWatcher(); | 1462 m_fsWatcher = new QFileSystemWatcher(); |
1665 QString head; | 1650 QString head; |
1666 QString report; | 1651 QString report; |
1667 int n = extractChangeCount(output); | 1652 int n = extractChangeCount(output); |
1668 if (n > 0) { | 1653 if (n > 0) { |
1669 head = tr("Pulled %n changeset(s)", "", n); | 1654 head = tr("Pulled %n changeset(s)", "", n); |
1670 report = tr("The new changes will be highlighted in the history.<br>Use Update to bring these changes into your working copy."); | 1655 report = tr("New changes will be highlighted in yellow in the history."); |
1671 } else if (n == 0) { | 1656 } else if (n == 0) { |
1672 head = tr("No changes to pull"); | 1657 head = tr("No changes to pull"); |
1673 report = tr("Your local repository already contains all changes found in the remote repository."); | 1658 report = tr("Your local repository already contains all changes found in the remote repository."); |
1674 } else { | 1659 } else { |
1675 head = tr("Pull complete"); | 1660 head = tr("Pull complete"); |
1776 return; | 1761 return; |
1777 case ACT_CLONEFROMREMOTE: | 1762 case ACT_CLONEFROMREMOTE: |
1778 // if clone fails, we have no repo | 1763 // if clone fails, we have no repo |
1779 m_workFolderPath = ""; | 1764 m_workFolderPath = ""; |
1780 enableDisableActions(); | 1765 enableDisableActions(); |
1781 break; | 1766 break; // go on to default report |
1782 case ACT_INCOMING: | 1767 case ACT_INCOMING: |
1783 // returns non-zero code and no output if the check was | 1768 // returns non-zero code and no output if the check was |
1784 // successful but there are no changes pending | 1769 // successful but there are no changes pending |
1785 if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") { | 1770 if (output.replace(QRegExp("(^|\\n)warning: [^\\n]*\\n"), "").trimmed() == "") { |
1786 showIncoming(""); | 1771 showIncoming(""); |
1787 return; | 1772 return; |
1788 } | 1773 } |
1789 break; | 1774 break; // go on to default report |
1790 case ACT_QUERY_HEADS: | 1775 case ACT_QUERY_HEADS: |
1791 // fails if repo is empty; we don't care (if there's a genuine | 1776 // fails if repo is empty; we don't care (if there's a genuine |
1792 // problem, something else will fail too). Pretend it | 1777 // problem, something else will fail too). Pretend it |
1793 // succeeded, so that any further actions that are contingent | 1778 // succeeded, so that any further actions that are contingent |
1794 // on the success of the heads query get carried out properly. | 1779 // on the success of the heads query get carried out properly. |
1803 case ACT_PUSH: | 1788 case ACT_PUSH: |
1804 if (output.contains("creates new remote heads")) { | 1789 if (output.contains("creates new remote heads")) { |
1805 reportNewRemoteHeads(output); | 1790 reportNewRemoteHeads(output); |
1806 return; | 1791 return; |
1807 } | 1792 } |
1793 break; // go on to default report | |
1794 case ACT_MERGE: | |
1795 case ACT_RETRY_MERGE: | |
1796 MoreInformationDialog::information | |
1797 (this, tr("Merge"), tr("Merge failed"), | |
1798 tr("Some files were not merged successfully.<p>You can Merge again to repeat the interactive merge; use Revert to abandon the merge entirely; or edit the files that are in conflict in an editor and, when you are happy with them, choose Mark Resolved in each file's right-button menu."), | |
1799 output); | |
1800 return; | |
1808 case ACT_STAT: | 1801 case ACT_STAT: |
1809 break; // go on and report | 1802 break; // go on to default report |
1810 default: | 1803 default: |
1811 break; | 1804 break; |
1812 } | 1805 } |
1813 | 1806 |
1814 QString command = action.executable; | 1807 QString command = action.executable; |
1893 case ACT_INCOMING: | 1886 case ACT_INCOMING: |
1894 showIncoming(output); | 1887 showIncoming(output); |
1895 break; | 1888 break; |
1896 | 1889 |
1897 case ACT_ANNOTATE: | 1890 case ACT_ANNOTATE: |
1898 presentLongStdoutToUser(output); | 1891 { |
1892 AnnotateDialog dialog(this, output); | |
1893 dialog.exec(); | |
1899 m_shouldHgStat = true; | 1894 m_shouldHgStat = true; |
1900 break; | 1895 break; |
1896 } | |
1901 | 1897 |
1902 case ACT_PULL: | 1898 case ACT_PULL: |
1903 showPullResult(output); | 1899 showPullResult(output); |
1904 m_shouldHgStat = true; | 1900 m_shouldHgStat = true; |
1905 break; | 1901 break; |
1968 m_justMerged = false; | 1964 m_justMerged = false; |
1969 m_shouldHgStat = true; | 1965 m_shouldHgStat = true; |
1970 break; | 1966 break; |
1971 | 1967 |
1972 case ACT_REVERT: | 1968 case ACT_REVERT: |
1973 hgMarkResolved(m_lastRevertedFiles); | 1969 hgMarkFilesResolved(m_lastRevertedFiles); |
1974 m_justMerged = false; | 1970 m_justMerged = false; |
1975 break; | 1971 break; |
1976 | 1972 |
1977 case ACT_REMOVE: | 1973 case ACT_REMOVE: |
1978 case ACT_ADD: | 1974 case ACT_ADD: |
2173 | 2169 |
2174 connect(m_hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming())); | 2170 connect(m_hgIncomingAct, SIGNAL(triggered()), this, SLOT(hgIncoming())); |
2175 connect(m_hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull())); | 2171 connect(m_hgPullAct, SIGNAL(triggered()), this, SLOT(hgPull())); |
2176 connect(m_hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush())); | 2172 connect(m_hgPushAct, SIGNAL(triggered()), this, SLOT(hgPush())); |
2177 | 2173 |
2178 connect(m_hgAnnotateAct, SIGNAL(triggered()), this, SLOT(hgAnnotate())); | |
2179 connect(m_hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); | 2174 connect(m_hgServeAct, SIGNAL(triggered()), this, SLOT(hgServe())); |
2180 } | 2175 } |
2181 | 2176 |
2182 void MainWindow::connectTabsSignals() | 2177 void MainWindow::connectTabsSignals() |
2183 { | 2178 { |
2179 connect(m_hgTabs, SIGNAL(currentChanged(int)), | |
2180 this, SLOT(enableDisableActions())); | |
2181 | |
2184 connect(m_hgTabs, SIGNAL(commit()), | 2182 connect(m_hgTabs, SIGNAL(commit()), |
2185 this, SLOT(hgCommit())); | 2183 this, SLOT(hgCommit())); |
2186 | 2184 |
2187 connect(m_hgTabs, SIGNAL(revert()), | 2185 connect(m_hgTabs, SIGNAL(revert()), |
2188 this, SLOT(hgRevert())); | 2186 this, SLOT(hgRevert())); |
2217 connect(m_hgTabs, SIGNAL(newBranch(QString)), | 2215 connect(m_hgTabs, SIGNAL(newBranch(QString)), |
2218 this, SLOT(hgNewBranch())); | 2216 this, SLOT(hgNewBranch())); |
2219 | 2217 |
2220 connect(m_hgTabs, SIGNAL(tag(QString)), | 2218 connect(m_hgTabs, SIGNAL(tag(QString)), |
2221 this, SLOT(hgTag(QString))); | 2219 this, SLOT(hgTag(QString))); |
2220 | |
2221 connect(m_hgTabs, SIGNAL(annotateFiles(QStringList)), | |
2222 this, SLOT(hgAnnotateFiles(QStringList))); | |
2223 | |
2224 connect(m_hgTabs, SIGNAL(diffFiles(QStringList)), | |
2225 this, SLOT(hgDiffFiles(QStringList))); | |
2226 | |
2227 connect(m_hgTabs, SIGNAL(commitFiles(QStringList)), | |
2228 this, SLOT(hgCommitFiles(QStringList))); | |
2229 | |
2230 connect(m_hgTabs, SIGNAL(revertFiles(QStringList)), | |
2231 this, SLOT(hgRevertFiles(QStringList))); | |
2232 | |
2233 connect(m_hgTabs, SIGNAL(addFiles(QStringList)), | |
2234 this, SLOT(hgAddFiles(QStringList))); | |
2235 | |
2236 connect(m_hgTabs, SIGNAL(removeFiles(QStringList)), | |
2237 this, SLOT(hgRemoveFiles(QStringList))); | |
2238 | |
2239 connect(m_hgTabs, SIGNAL(redoFileMerges(QStringList)), | |
2240 this, SLOT(hgRedoFileMerges(QStringList))); | |
2241 | |
2242 connect(m_hgTabs, SIGNAL(markFilesResolved(QStringList)), | |
2243 this, SLOT(hgMarkFilesResolved(QStringList))); | |
2244 | |
2245 connect(m_hgTabs, SIGNAL(ignoreFiles(QStringList)), | |
2246 this, SLOT(hgIgnoreFiles(QStringList))); | |
2247 | |
2248 connect(m_hgTabs, SIGNAL(unIgnoreFiles(QStringList)), | |
2249 this, SLOT(hgUnIgnoreFiles(QStringList))); | |
2222 } | 2250 } |
2223 | 2251 |
2224 void MainWindow::enableDisableActions() | 2252 void MainWindow::enableDisableActions() |
2225 { | 2253 { |
2226 DEBUG << "MainWindow::enableDisableActions" << endl; | 2254 DEBUG << "MainWindow::enableDisableActions" << endl; |
2281 m_hgAddAct -> setEnabled(m_localRepoActionsEnabled); | 2309 m_hgAddAct -> setEnabled(m_localRepoActionsEnabled); |
2282 m_hgRemoveAct -> setEnabled(m_localRepoActionsEnabled); | 2310 m_hgRemoveAct -> setEnabled(m_localRepoActionsEnabled); |
2283 m_hgUpdateAct -> setEnabled(m_localRepoActionsEnabled); | 2311 m_hgUpdateAct -> setEnabled(m_localRepoActionsEnabled); |
2284 m_hgCommitAct -> setEnabled(m_localRepoActionsEnabled); | 2312 m_hgCommitAct -> setEnabled(m_localRepoActionsEnabled); |
2285 m_hgMergeAct -> setEnabled(m_localRepoActionsEnabled); | 2313 m_hgMergeAct -> setEnabled(m_localRepoActionsEnabled); |
2286 m_hgAnnotateAct -> setEnabled(m_localRepoActionsEnabled); | |
2287 m_hgServeAct -> setEnabled(m_localRepoActionsEnabled); | 2314 m_hgServeAct -> setEnabled(m_localRepoActionsEnabled); |
2288 m_hgIgnoreAct -> setEnabled(m_localRepoActionsEnabled); | 2315 m_hgIgnoreAct -> setEnabled(m_localRepoActionsEnabled); |
2289 | 2316 |
2290 DEBUG << "m_localRepoActionsEnabled = " << m_localRepoActionsEnabled << endl; | 2317 DEBUG << "m_localRepoActionsEnabled = " << m_localRepoActionsEnabled << endl; |
2291 DEBUG << "canCommit = " << m_hgTabs->canCommit() << endl; | 2318 DEBUG << "canCommit = " << m_hgTabs->canCommit() << endl; |
2457 | 2484 |
2458 m_hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this); | 2485 m_hgMergeAct = new QAction(QIcon(":/images/merge.png"), tr("Merge"), this); |
2459 m_hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder")); | 2486 m_hgMergeAct->setStatusTip(tr("Merge the two independent sets of changes in the local repository into the working folder")); |
2460 | 2487 |
2461 //Advanced actions | 2488 //Advanced actions |
2462 //!!! needs to be modified for number | |
2463 m_hgAnnotateAct = new QAction(tr("Annotate"), this); | |
2464 m_hgAnnotateAct -> setStatusTip(tr("Show line-by-line version information for selected file")); | |
2465 | 2489 |
2466 m_hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this); | 2490 m_hgIgnoreAct = new QAction(tr("Edit .hgignore File"), this); |
2467 m_hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial")); | 2491 m_hgIgnoreAct -> setStatusTip(tr("Edit the .hgignore file, containing the names of files that should be ignored by Mercurial")); |
2468 | 2492 |
2469 m_hgServeAct = new QAction(tr("Serve via HTTP"), this); | 2493 m_hgServeAct = new QAction(tr("Serve via HTTP"), this); |