Mercurial > hg > easyhg
comparison confirmcommentdialog.cpp @ 296:d40294e164da status_outside_tabs
Merge from the default branch
author | Chris Cannam |
---|---|
date | Tue, 22 Feb 2011 13:03:03 +0000 |
parents | 1244dc3107cb |
children | fd9dc5a457d8 |
comparison
equal
deleted
inserted
replaced
287:3fbafca196e4 | 296:d40294e164da |
---|---|
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, |