diff mainwindow.cpp @ 193:ef5feb0d648f

* Give all of the substantial confirmation dialogs meaningful labels for their OK buttons
author Chris Cannam
date Mon, 20 Dec 2010 22:37:42 +0000
parents 702ca6dafcbe
children 5ca49523892f
line wrap: on
line diff
--- a/mainwindow.cpp	Mon Dec 20 21:33:42 2010 +0000
+++ b/mainwindow.cpp	Mon Dec 20 22:37:42 2010 +0000
@@ -330,7 +330,8 @@
          tr("<h3>%1</h3><p>%2").arg(cf)
          .arg(tr("You are about to commit %n file(s).", "", reportFiles.size())),
          reportFiles,
-         comment)) {
+         comment,
+         tr("Commit"))) {
 
         if (!justMerged && !files.empty()) {
             // User wants to commit selected file(s) (and this is not
@@ -374,7 +375,8 @@
         (this,
          tr("Tag"),
          tr("Enter tag:"),
-         tag)) {
+         tag,
+         tr("Add Tag"))) {
         if (!tag.isEmpty()) {//!!! do something better if it is empty
 
             params << "tag" << "--user" << getUserInfo();
@@ -594,7 +596,8 @@
          .arg(tr("You are about to <b>revert</b> the following files to their previous committed state.<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed:")),
          tr("<h3>%1</h3><p>%2").arg(rf)
          .arg(tr("You are about to <b>revert</b> %n file(s).<br><br>This will <b>throw away any changes</b> that you have made to these files but have not committed.", "", files.size())),
-         files)) {
+         files,
+         tr("Revert"))) {
 
         lastRevertedFiles = files;
         
@@ -762,26 +765,9 @@
     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 (confirm
+    if (ConfirmCommentDialog::confirm
         (this, tr("Confirm pull"),
          format3(tr("Confirm pull from remote repository"),
                  tr("You are about to pull changes from the following remote repository:"),
@@ -796,7 +782,7 @@
 
 void MainWindow::hgPush()
 {
-    if (confirm
+    if (ConfirmCommentDialog::confirm
         (this, tr("Confirm push"),
          format3(tr("Confirm push to remote repository"),
                  tr("You are about to push your changes to the following remote repository:"),