Cabana: confirm exit without saving (#26452)

* confirm exit without saving

* typo
pull/26454/head
Dean Lee 2 years ago committed by GitHub
parent 2961f8a7d8
commit e08896c45d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      tools/cabana/mainwin.cc

@ -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();

Loading…
Cancel
Save