Mercurial > hg > easyhg
comparison confirmcommentdialog.cpp @ 194:5ca49523892f
* Fixes to dialog return code handling
author | Chris Cannam |
---|---|
date | Mon, 20 Dec 2010 22:39:45 +0000 |
parents | ef5feb0d648f |
children | c9a7e4ec2f78 |
comparison
equal
deleted
inserted
replaced
193:ef5feb0d648f | 194:5ca49523892f |
---|---|
90 QMessageBox::Cancel, | 90 QMessageBox::Cancel, |
91 parent); | 91 parent); |
92 | 92 |
93 QPushButton *ok = box.addButton(QMessageBox::Ok); | 93 QPushButton *ok = box.addButton(QMessageBox::Ok); |
94 ok->setText(okButtonText); | 94 ok->setText(okButtonText); |
95 if (box.exec() == -1) return QMessageBox::Cancel; | 95 if (box.exec() == -1) return false; |
96 return box.standardButton(box.clickedButton()); | 96 return box.standardButton(box.clickedButton()) == QMessageBox::Ok; |
97 } | 97 } |
98 | 98 |
99 bool ConfirmCommentDialog::confirmDangerous(QWidget *parent, | 99 bool ConfirmCommentDialog::confirmDangerous(QWidget *parent, |
100 QString title, | 100 QString title, |
101 QString text, | 101 QString text, |
107 QMessageBox::Cancel, | 107 QMessageBox::Cancel, |
108 parent); | 108 parent); |
109 | 109 |
110 QPushButton *ok = box.addButton(QMessageBox::Ok); | 110 QPushButton *ok = box.addButton(QMessageBox::Ok); |
111 ok->setText(okButtonText); | 111 ok->setText(okButtonText); |
112 if (box.exec() == -1) return QMessageBox::Cancel; | 112 if (box.exec() == -1) return false; |
113 return box.standardButton(box.clickedButton()); | 113 return box.standardButton(box.clickedButton()) == QMessageBox::Ok; |
114 } | 114 } |
115 | 115 |
116 bool ConfirmCommentDialog::confirmFilesAction(QWidget *parent, | 116 bool ConfirmCommentDialog::confirmFilesAction(QWidget *parent, |
117 QString title, | 117 QString title, |
118 QString introText, | 118 QString introText, |