mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
Cabana: confirm exit without saving (#26452)
* confirm exit without saving * typo old-commit-hash: e08896c45d84f4005de156317ae902d601e9b895
This commit is contained in:
@@ -227,6 +227,16 @@ void MainWindow::dockCharts(bool dock) {
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
if (detail_widget->undo_stack->index() > 0) {
|
||||
auto ret = QMessageBox::question(this, tr("Unsaved Changes"),
|
||||
tr("Are you sure you want to exit without saving?\nAny unsaved changes will be lost."),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if (ret == QMessageBox::No) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
main_win = nullptr;
|
||||
if (floating_window)
|
||||
floating_window->deleteLater();
|
||||
|
||||
Reference in New Issue
Block a user