Mercurial > hg > easyhg
comparison mainwindow.cpp @ 72:121cb1032717
* Bit more work on Open dialog
author | Chris Cannam |
---|---|
date | Thu, 18 Nov 2010 17:36:53 +0000 |
parents | 6d5a5571caec |
children | a773c6e7b301 |
comparison
equal
deleted
inserted
replaced
71:eaabc54de103 | 72:121cb1032717 |
---|---|
77 ColourSet *cs = ColourSet::instance(); | 77 ColourSet *cs = ColourSet::instance(); |
78 cs->clearDefaultNames(); | 78 cs->clearDefaultNames(); |
79 cs->addDefaultName(""); | 79 cs->addDefaultName(""); |
80 cs->addDefaultName(getUserInfo()); | 80 cs->addDefaultName(getUserInfo()); |
81 | 81 |
82 if (workFolderPath == "") { | |
83 open(); | |
84 } | |
85 | |
82 hgStat(); | 86 hgStat(); |
83 } | 87 } |
84 | 88 |
85 | 89 |
86 void MainWindow::closeEvent(QCloseEvent *) | 90 void MainWindow::closeEvent(QCloseEvent *) |
697 | 701 |
698 void MainWindow::open() | 702 void MainWindow::open() |
699 { | 703 { |
700 MultiChoiceDialog *d = new MultiChoiceDialog | 704 MultiChoiceDialog *d = new MultiChoiceDialog |
701 (tr("Open Repository"), | 705 (tr("Open Repository"), |
702 tr("What would you like to open?"), | 706 tr("<qt><big>What would you like to open?</big></qt>"), |
703 this); | 707 this); |
704 | 708 |
705 d->addChoice("remote", | 709 d->addChoice("remote", |
706 tr("<qt><center><img src=\":images/browser-64.png\"><br>Remote repository</center></qt>"), | 710 tr("<qt><center><img src=\":images/browser-64.png\"><br>Remote repository</center></qt>"), |
707 tr("Open an existing remote repository, by cloning a Mercurial repository URL into a local folder."), | 711 tr("Open a remote Mercurial repository, by cloning from its URL into a local folder."), |
708 MultiChoiceDialog::UrlArg); | 712 MultiChoiceDialog::UrlToDirectoryArg); |
709 | 713 |
710 d->addChoice("local", | 714 d->addChoice("local", |
711 tr("<qt><center><img src=\":images/hglogo-64.png\"><br>Local repository</center></qt>"), | 715 tr("<qt><center><img src=\":images/hglogo-64.png\"><br>Local repository</center></qt>"), |
712 tr("Open an existing local Mercurial repository."), | 716 tr("Open an existing local Mercurial repository."), |
713 MultiChoiceDialog::DirectoryArg); | 717 MultiChoiceDialog::DirectoryArg); |
724 QString choice = d->getCurrentChoice(); | 728 QString choice = d->getCurrentChoice(); |
725 QString arg = d->getArgument().trimmed(); | 729 QString arg = d->getArgument().trimmed(); |
726 | 730 |
727 if (choice == "local") { | 731 if (choice == "local") { |
728 workFolderPath = arg; | 732 workFolderPath = arg; |
729 } else { | 733 } else if (choice == "remote") { |
734 DEBUG << "clone " << arg << " to " << d->getAdditionalArgument().trimmed() << endl; | |
730 //!!! | 735 //!!! |
731 } | 736 } |
732 | 737 |
733 hgExp->clearLists(); | 738 hgExp->clearLists(); |
734 enableDisableActions(); | 739 enableDisableActions(); |
1027 break; | 1032 break; |
1028 | 1033 |
1029 case ACT_CLONEFROMREMOTE: | 1034 case ACT_CLONEFROMREMOTE: |
1030 MultiChoiceDialog::addRecentArgument("local", workFolderPath); | 1035 MultiChoiceDialog::addRecentArgument("local", workFolderPath); |
1031 MultiChoiceDialog::addRecentArgument("remote", remoteRepoPath); | 1036 MultiChoiceDialog::addRecentArgument("remote", remoteRepoPath); |
1037 MultiChoiceDialog::addRecentArgument("remote", workFolderPath, true); | |
1032 QMessageBox::information(this, "Clone", runner -> getStdOut()); | 1038 QMessageBox::information(this, "Clone", runner -> getStdOut()); |
1033 enableDisableActions(); | 1039 enableDisableActions(); |
1034 shouldHgStat = true; | 1040 shouldHgStat = true; |
1035 break; | 1041 break; |
1036 | 1042 |