Example #1
0
void
MainWindow::closeEvent(QCloseEvent *event) {
  emit aboutToClose();

  auto ok =       mergeTool()->closeAllTabs();
  ok      = ok && headerEditorTool()->closeAllTabs();
  ok      = ok && chapterEditorTool()->closeAllTabs();
  ok      = ok && beforeCloseCheckRunningJobs();

  if (!ok) {
    event->ignore();
    return;
  }

  Util::saveWidgetGeometry(this);

  event->accept();
}
Example #2
0
void
MainWindow::closeEvent(QCloseEvent *event) {
  auto ok =       mergeTool()->closeAllTabs();
  ok      = ok && headerEditorTool()->closeAllTabs();
  ok      = ok && chapterEditorTool()->closeAllTabs();
  ok      = ok && beforeCloseCheckRunningJobs();

  if (!ok) {
    event->ignore();
    return;
  }

  auto reg  = Util::Settings::registry();
  auto tool = jobTool();
  if (tool)
    tool->model()->saveJobs(*reg);

  Util::saveWidgetGeometry(this);

  event->accept();
}