diff confirmcommentdialog.cpp @ 275:1244dc3107cb more_information_dialog

* Some work on separating out the "more information" component from dialog messages. Will need work on layouts
author Chris Cannam
date Mon, 31 Jan 2011 17:23:10 +0000
parents 8fd71f570884
children fd9dc5a457d8
line wrap: on
line diff
--- a/confirmcommentdialog.cpp	Tue Jan 25 16:41:40 2011 +0000
+++ b/confirmcommentdialog.cpp	Mon Jan 31 17:23:10 2011 +0000
@@ -51,8 +51,10 @@
                                                   QDialogButtonBox::Cancel);
     layout->addWidget(bbox, 2, 0);
     m_ok = bbox->button(QDialogButtonBox::Ok);
+    m_ok->setDefault(true);
     m_ok->setEnabled(initialComment != "");
     m_ok->setText(okButtonText);
+    bbox->button(QDialogButtonBox::Cancel)->setAutoDefault(false);
 
     connect(bbox, SIGNAL(accepted()), this, SLOT(accept()));
     connect(bbox, SIGNAL(rejected()), this, SLOT(reject()));
@@ -93,6 +95,7 @@
 
     QPushButton *ok = box.addButton(QMessageBox::Ok);
     ok->setText(okButtonText);
+    box.setDefaultButton(QMessageBox::Ok);
     if (box.exec() == -1) return false;
     return box.standardButton(box.clickedButton()) == QMessageBox::Ok;
 }
@@ -110,6 +113,7 @@
 
     QPushButton *ok = box.addButton(QMessageBox::Ok);
     ok->setText(okButtonText);
+    box.setDefaultButton(QMessageBox::Cancel);
     if (box.exec() == -1) return false;
     return box.standardButton(box.clickedButton()) == QMessageBox::Ok;
 }