# HG changeset patch # User Chris Cannam # Date 1291050689 0 # Node ID f41bbd0c7c2758a2101bed52cd96310fea5f4ddb # Parent 63c2f3f61c79e84287ec4f95c7502f41c908ba1b * Add confirm dialogs for pull and push diff -r 63c2f3f61c79 -r f41bbd0c7c27 mainwindow.cpp --- a/mainwindow.cpp Mon Nov 29 17:03:17 2010 +0000 +++ b/mainwindow.cpp Mon Nov 29 17:11:29 2010 +0000 @@ -587,24 +587,34 @@ runner->requestAction(HgAction(ACT_INCOMING, workFolderPath, params)); } - void MainWindow::hgPull() { - QStringList params; + if (QMessageBox::question + (this, tr("Confirm pull"), + format3(tr("Confirm pull from remote repository"), + tr("You are about to pull from the following remote repository:"), + remoteRepoPath), + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { - params << "pull" << remoteRepoPath; - - runner->requestAction(HgAction(ACT_PULL, workFolderPath, params)); + QStringList params; + params << "pull" << remoteRepoPath; + runner->requestAction(HgAction(ACT_PULL, workFolderPath, params)); + } } - void MainWindow::hgPush() { - QStringList params; + if (QMessageBox::question + (this, tr("Confirm push"), + format3(tr("Confirm push to remote repository"), + tr("You are about to push to the following remote repository:"), + remoteRepoPath), + QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { - params << "push" << remoteRepoPath; - - runner->requestAction(HgAction(ACT_PUSH, workFolderPath, params)); + QStringList params; + params << "push" << remoteRepoPath; + runner->requestAction(HgAction(ACT_PUSH, workFolderPath, params)); + } } QString MainWindow::listAllUpIpV4Addresses() @@ -1043,6 +1053,9 @@ if (intro == "") { return QString("

%1

%2") .arg(head).arg(xmlEncode(code).replace("\n", "
")); + } else if (code == "") { + return QString("

%1

%2

") + .arg(head).arg(intro); } else { return QString("

%1

%2

%3") .arg(head).arg(intro).arg(xmlEncode(code).replace("\n", "
"));