mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-09 03:31:41 +00:00
GUI: use signal for saving state before quitting
This commit is contained in:
parent
f8c6f3f733
commit
73cd3dd911
@ -72,7 +72,6 @@ public:
|
||||
void startNextAutoJob();
|
||||
void startJobImmediately(Job &job);
|
||||
|
||||
void saveJobs();
|
||||
void loadJobs();
|
||||
|
||||
virtual Qt::DropActions supportedDropActions() const;
|
||||
@ -102,6 +101,8 @@ public slots:
|
||||
|
||||
void resetTotalProgress();
|
||||
|
||||
void saveJobs();
|
||||
|
||||
protected:
|
||||
QList<QStandardItem *> createRow(Job const &job) const;
|
||||
void setRowText(QList<QStandardItem *> const &items, Job const &job) const;
|
||||
|
@ -124,6 +124,7 @@ Tool::setupActions() {
|
||||
connect(ui->jobs, &QTreeView::doubleClicked, this, &Tool::onViewOutput);
|
||||
|
||||
connect(mw, &MainWindow::preferencesChanged, this, &Tool::retranslateUi);
|
||||
connect(mw, &MainWindow::aboutToClose, m_model, &Model::saveJobs);
|
||||
|
||||
connect(MainWindow::watchCurrentJobTab(), &WatchJobs::Tab::watchCurrentJobTabCleared, m_model, &Model::resetTotalProgress);
|
||||
}
|
||||
|
@ -332,6 +332,8 @@ MainWindow::beforeCloseCheckRunningJobs() {
|
||||
|
||||
void
|
||||
MainWindow::closeEvent(QCloseEvent *event) {
|
||||
emit aboutToClose();
|
||||
|
||||
auto ok = mergeTool()->closeAllTabs();
|
||||
ok = ok && headerEditorTool()->closeAllTabs();
|
||||
ok = ok && chapterEditorTool()->closeAllTabs();
|
||||
@ -342,10 +344,6 @@ MainWindow::closeEvent(QCloseEvent *event) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto tool = jobTool();
|
||||
if (tool)
|
||||
tool->model()->saveJobs();
|
||||
|
||||
Util::saveWidgetGeometry(this);
|
||||
|
||||
event->accept();
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
signals:
|
||||
void windowShown();
|
||||
void preferencesChanged();
|
||||
void aboutToClose();
|
||||
|
||||
public slots:
|
||||
virtual void changeToolToSender();
|
||||
|
Loading…
Reference in New Issue
Block a user