Confirm with the user before exiting the runtime. Fixes #2443
parent
8b543a58fe
commit
8a4b2ea953
|
|
@ -174,13 +174,20 @@ BrowserWindow::~BrowserWindow()
|
|||
// Save the window geometry on close
|
||||
void BrowserWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("Browser/Geometry", saveGeometry());
|
||||
settings.setValue("Browser/WindowState", saveState());
|
||||
QMainWindow::closeEvent(event);
|
||||
if (QMessageBox::Yes == QMessageBox::question(this, "Exit the application?", "Are you sure you want to exit the application?", QMessageBox::Yes | QMessageBox::No))
|
||||
{
|
||||
QSettings settings;
|
||||
settings.setValue("Browser/Geometry", saveGeometry());
|
||||
settings.setValue("Browser/WindowState", saveState());
|
||||
QMainWindow::closeEvent(event);
|
||||
event->accept();
|
||||
}
|
||||
else
|
||||
{
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create the actions for the window
|
||||
void BrowserWindow::createActions()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue