Skip to content
Permalink
Browse files

MainWindow: add Cancel button to the "Minimize or Close?" message box.

  • Loading branch information...
rxl211 authored and mkrautz committed Jan 12, 2014
1 parent 1d0b1c8 commit d9d81a9972e61b2cf57db74de654bd809c2c13b5
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/mumble/MainWindow.cpp
@@ -398,13 +398,17 @@ void MainWindow::closeEvent(QCloseEvent *e) {
QMessageBox mb(QMessageBox::Warning, QLatin1String("Mumble"), tr("Mumble is currently connected to a server. Do you want to Close or Minimize it?"), QMessageBox::NoButton, this);
QPushButton *qpbClose = mb.addButton(tr("Close"), QMessageBox::YesRole);
QPushButton *qpbMinimize = mb.addButton(tr("Minimize"), QMessageBox::NoRole);
mb.setDefaultButton(qpbMinimize);
mb.setEscapeButton(qpbMinimize);
QPushButton *qpbCancel = mb.addButton(tr("Cancel"), QMessageBox::RejectRole);
mb.setDefaultButton(qpbCancel);
mb.setEscapeButton(qpbCancel);
mb.exec();
if (mb.clickedButton() != qpbClose) {
if (mb.clickedButton() == qpbMinimize) {
showMinimized();
e->ignore();
return;
} else if (mb.clickedButton() == qpbCancel) {
e->ignore();
return;
}
}
sh.reset();

0 comments on commit d9d81a9

Please sign in to comment.
You can’t perform that action at this time.