Mercurial > hg > easyhg
diff mainwindow.cpp @ 278:f7cdd5b31aed new-branches
Add "Start new branch" function. I'm not quite satisfied with the location of this one
author | Chris Cannam |
---|---|
date | Wed, 09 Feb 2011 12:03:15 +0000 |
parents | cc95394e2392 |
children | 5b4aa1c24407 |
line wrap: on
line diff
--- a/mainwindow.cpp Wed Feb 09 12:02:53 2011 +0000 +++ b/mainwindow.cpp Wed Feb 09 12:03:15 2011 +0000 @@ -447,14 +447,11 @@ QString MainWindow::filterTag(QString tag) { - for(int i = 0; i < tag.size(); i++) - { - if (tag[i].isLower() || tag[i].isUpper() || tag[i].isDigit() || (tag[i] == QChar('.'))) - { + for(int i = 0; i < tag.size(); i++) { + if (tag[i].isLower() || tag[i].isUpper() || + tag[i].isDigit() || (tag[i] == QChar('.'))) { //ok - } - else - { + } else { tag[i] = QChar('_'); } } @@ -462,6 +459,26 @@ } +void MainWindow::hgNewBranch(QString id) +{ + QStringList params; + QString branch; + + if (ConfirmCommentDialog::confirmAndGetShortComment + (this, + tr("New Branch"), + tr("Enter new branch name:"), + branch, + tr("Start Branch"))) { + if (!branch.isEmpty()) {//!!! do something better if it is empty + + params << "branch" << filterTag(branch); + runner->requestAction(HgAction(ACT_NEW_BRANCH, workFolderPath, params)); + } + } +} + + void MainWindow::hgTag(QString id) { QStringList params; @@ -1695,6 +1712,9 @@ case ACT_INCOMING: // returns non-zero code and no output if the check was // successful but there are no changes pending + + //!!! -- won't do, there may legitimately be warnings, + //!!! -- e.g. certificate not verified if (output.trimmed() == "") { showIncoming(""); return; @@ -1897,6 +1917,11 @@ shouldHgStat = true; break; + case ACT_NEW_BRANCH: + shouldHgStat = true; + hgTabs->showWorkTab(); + break; + case ACT_DIFF_SUMMARY: QMessageBox::information(this, tr("Change summary"), format3(tr("Summary of uncommitted changes"), @@ -2082,6 +2107,9 @@ connect(hgTabs, SIGNAL(mergeFrom(QString)), this, SLOT(hgMergeFrom(QString))); + connect(hgTabs, SIGNAL(newBranch(QString)), + this, SLOT(hgNewBranch(QString))); + connect(hgTabs, SIGNAL(tag(QString)), this, SLOT(hgTag(QString))); }