# HG changeset patch # User Chris Cannam # Date 1292880822 0 # Node ID 702ca6dafcbe8150a0c7e386c00ac98274bef6d8 # Parent b2fae1f16002525e9b048af6e926217d66cf09f6 * Make OK buttons on push/pull dialogs say Push and Pull diff -r b2fae1f16002 -r 702ca6dafcbe mainwindow.cpp --- a/mainwindow.cpp Mon Dec 20 21:23:13 2010 +0000 +++ b/mainwindow.cpp Mon Dec 20 21:33:42 2010 +0000 @@ -762,14 +762,31 @@ runner->requestAction(HgAction(ACT_INCOMING, workFolderPath, params)); } +static QMessageBox::StandardButton confirm(QWidget *parent, + QString title, + QString text, + QString okButtonText) +{ + QMessageBox box(QMessageBox::Question, + title, + text, + QMessageBox::Cancel, + parent); + + QPushButton *ok = box.addButton(QMessageBox::Ok); + ok->setText(okButtonText); + if (box.exec() == -1) return QMessageBox::Cancel; + return box.standardButton(box.clickedButton()); +} + void MainWindow::hgPull() { - if (QMessageBox::question + if (confirm (this, tr("Confirm pull"), format3(tr("Confirm pull from remote repository"), - tr("You are about to pull from the following remote repository:"), + tr("You are about to pull changes from the following remote repository:"), remoteRepoPath), - QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { + tr("Pull")) == QMessageBox::Ok) { QStringList params; params << "pull" << remoteRepoPath; @@ -779,12 +796,12 @@ void MainWindow::hgPush() { - if (QMessageBox::question + if (confirm (this, tr("Confirm push"), format3(tr("Confirm push to remote repository"), - tr("You are about to push to the following remote repository:"), + tr("You are about to push your changes to the following remote repository:"), remoteRepoPath), - QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Ok) { + tr("Push")) == QMessageBox::Ok) { QStringList params; params << "push" << "--new-branch" << remoteRepoPath;