mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
Confirm with the user before exiting the runtime. Fixes #2443
This commit is contained in:
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
Block a user