comparison 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
comparison
equal deleted inserted replaced
273:cc95394e2392 275:1244dc3107cb
49 49
50 QDialogButtonBox *bbox = new QDialogButtonBox(QDialogButtonBox::Ok | 50 QDialogButtonBox *bbox = new QDialogButtonBox(QDialogButtonBox::Ok |
51 QDialogButtonBox::Cancel); 51 QDialogButtonBox::Cancel);
52 layout->addWidget(bbox, 2, 0); 52 layout->addWidget(bbox, 2, 0);
53 m_ok = bbox->button(QDialogButtonBox::Ok); 53 m_ok = bbox->button(QDialogButtonBox::Ok);
54 m_ok->setDefault(true);
54 m_ok->setEnabled(initialComment != ""); 55 m_ok->setEnabled(initialComment != "");
55 m_ok->setText(okButtonText); 56 m_ok->setText(okButtonText);
57 bbox->button(QDialogButtonBox::Cancel)->setAutoDefault(false);
56 58
57 connect(bbox, SIGNAL(accepted()), this, SLOT(accept())); 59 connect(bbox, SIGNAL(accepted()), this, SLOT(accept()));
58 connect(bbox, SIGNAL(rejected()), this, SLOT(reject())); 60 connect(bbox, SIGNAL(rejected()), this, SLOT(reject()));
59 } 61 }
60 62
91 QMessageBox::Cancel, 93 QMessageBox::Cancel,
92 parent); 94 parent);
93 95
94 QPushButton *ok = box.addButton(QMessageBox::Ok); 96 QPushButton *ok = box.addButton(QMessageBox::Ok);
95 ok->setText(okButtonText); 97 ok->setText(okButtonText);
98 box.setDefaultButton(QMessageBox::Ok);
96 if (box.exec() == -1) return false; 99 if (box.exec() == -1) return false;
97 return box.standardButton(box.clickedButton()) == QMessageBox::Ok; 100 return box.standardButton(box.clickedButton()) == QMessageBox::Ok;
98 } 101 }
99 102
100 bool ConfirmCommentDialog::confirmDangerous(QWidget *parent, 103 bool ConfirmCommentDialog::confirmDangerous(QWidget *parent,
108 QMessageBox::Cancel, 111 QMessageBox::Cancel,
109 parent); 112 parent);
110 113
111 QPushButton *ok = box.addButton(QMessageBox::Ok); 114 QPushButton *ok = box.addButton(QMessageBox::Ok);
112 ok->setText(okButtonText); 115 ok->setText(okButtonText);
116 box.setDefaultButton(QMessageBox::Cancel);
113 if (box.exec() == -1) return false; 117 if (box.exec() == -1) return false;
114 return box.standardButton(box.clickedButton()) == QMessageBox::Ok; 118 return box.standardButton(box.clickedButton()) == QMessageBox::Ok;
115 } 119 }
116 120
117 bool ConfirmCommentDialog::confirmFilesAction(QWidget *parent, 121 bool ConfirmCommentDialog::confirmFilesAction(QWidget *parent,