diff confirmcommentdialog.cpp @ 298:fd9dc5a457d8

* Make "More Details" button non-auto-default in more-info dialog * Make Incoming dialog show same message as in Pull dialog when no changes are pending * Try to make the confirm-push/pull dialogs look more in-keeping on OS/X... but mostly we end up making their text too small. Hmm.
author Chris Cannam
date Tue, 22 Feb 2011 15:12:56 +0000
parents 1244dc3107cb
children
line wrap: on
line diff
--- a/confirmcommentdialog.cpp	Mon Feb 21 19:22:29 2011 +0000
+++ b/confirmcommentdialog.cpp	Tue Feb 22 15:12:56 2011 +0000
@@ -73,26 +73,33 @@
 QString ConfirmCommentDialog::buildFilesText(QString intro, QStringList files)
 {
     QString text;
-    text = "<qt>" + intro;
-    text += "<p><code>";
+
+    if (intro == "") text = "<qt>";
+    else text = "<qt>" + intro + "<p>";
+
+    text += "<code>";
     foreach (QString file, files) {
         text += "&nbsp;&nbsp;&nbsp;" + xmlEncode(file) + "<br>";
     }
     text += "</code></qt>";
+
     return text;
 }
 
 bool ConfirmCommentDialog::confirm(QWidget *parent,
                                    QString title,
+                                   QString head,
                                    QString text,
                                    QString okButtonText)
 {
     QMessageBox box(QMessageBox::Question,
                     title,
-                    text,
+                    head,
                     QMessageBox::Cancel,
                     parent);
 
+    box.setInformativeText(text);
+
     QPushButton *ok = box.addButton(QMessageBox::Ok);
     ok->setText(okButtonText);
     box.setDefaultButton(QMessageBox::Ok);
@@ -102,15 +109,18 @@
 
 bool ConfirmCommentDialog::confirmDangerous(QWidget *parent,
                                             QString title,
+                                            QString head,
                                             QString text,
                                             QString okButtonText)
 {
     QMessageBox box(QMessageBox::Warning,
                     title,
-                    text,
+                    head,
                     QMessageBox::Cancel,
                     parent);
 
+    box.setInformativeText(text);
+
     QPushButton *ok = box.addButton(QMessageBox::Ok);
     ok->setText(okButtonText);
     box.setDefaultButton(QMessageBox::Cancel);
@@ -131,7 +141,7 @@
     } else {
         text = "<qt>" + introTextWithCount + "</qt>";
     }
-    return confirm(parent, title, text, okButtonText);
+    return confirm(parent, title, text, "", okButtonText);
 }
 
 bool ConfirmCommentDialog::confirmDangerousFilesAction(QWidget *parent,
@@ -147,7 +157,7 @@
     } else {
         text = "<qt>" + introTextWithCount + "</qt>";
     }
-    return confirmDangerous(parent, title, text, okButtonText);
+    return confirmDangerous(parent, title, text, "", okButtonText);
 }
 
 bool ConfirmCommentDialog::confirmAndGetShortComment(QWidget *parent,