diff --git a/saoriconfiguredialog.cpp b/saoriconfiguredialog.cpp
index 45f7e79..303b0dc 100644
--- a/saoriconfiguredialog.cpp
+++ b/saoriconfiguredialog.cpp
@@ -59,6 +59,7 @@
ui->spinBox_reloadInterval->setValue(SaoriApplication::saori()->setting()->value(SAORI_SETTING_RELOADINT,SAORI_SETTING_RELOADINT_DEFAULT).toInt());
ui->checkBox_nsfw->setChecked(SaoriApplication::saori()->setting()->value(SAORI_SETTING_NSFWBLUR,SAORI_SETTING_NSFWBLUR_DEFAULT).toBool());
ui->spinBox_entriesCount->setValue(SaoriApplication::saori()->setting()->value(SAORI_SETTING_SHOWENTRIES,SAORI_SETTING_SHOWENTRIES_DEFAULT).toInt());
+ ui->checkBox_closebehide->setChecked(SaoriApplication::saori()->setting()->value(SAORI_SETTING_CLOSEBEHIDE,SAORI_SETTING_CLOSEBEHIDE_DEFAULT).toBool());
}
void SaoriConfigureDialog::setAccounts()
@@ -75,6 +76,7 @@
SaoriApplication::saori()->setting()->setValue(SAORI_SETTING_RELOADINT,ui->spinBox_reloadInterval->value());
SaoriApplication::saori()->setting()->setValue(SAORI_SETTING_NSFWBLUR,ui->checkBox_nsfw->isChecked());
SaoriApplication::saori()->setting()->setValue(SAORI_SETTING_SHOWENTRIES,ui->spinBox_entriesCount->value());
+ SaoriApplication::saori()->setting()->setValue(SAORI_SETTING_CLOSEBEHIDE,ui->checkBox_closebehide->isChecked());
hide();
}
diff --git a/saoriconfiguredialog.ui b/saoriconfiguredialog.ui
index 4c895b5..eec046c 100644
--- a/saoriconfiguredialog.ui
+++ b/saoriconfiguredialog.ui
@@ -89,12 +89,12 @@
-
- Minimize the window with the close button:
+ Hide the Mainwindow with close button:
-
-
+
diff --git a/saoridef.h b/saoridef.h
index d2d1f3a..a1b3c51 100644
--- a/saoridef.h
+++ b/saoridef.h
@@ -54,6 +54,8 @@
#define SAORI_SETTING_RELOADINT_DEFAULT 5
#define SAORI_SETTING_SHOWENTRIES "application/showentries"
#define SAORI_SETTING_SHOWENTRIES_DEFAULT 100
+#define SAORI_SETTING_CLOSEBEHIDE "application/closebehide"
+#define SAORI_SETTING_CLOSEBEHIDE_DEFAULT true
#define SAORI_SETTING_VIEW "view"
#define SAORI_SETTING_VIEW_PINED "/pined"
#define SAORI_SETTING_VIEW_GEOMETRY "/geometry"
diff --git a/saoriwindow.cpp b/saoriwindow.cpp
index 647eb4f..e3b39f9 100644
--- a/saoriwindow.cpp
+++ b/saoriwindow.cpp
@@ -180,6 +180,11 @@
sub->resize(view->pixmap()->size());
}
+void SaoriWindow::closeEvent(QCloseEvent *event)
+{
+ QMainWindow::closeEvent(event);
+}
+
void SaoriWindow::updateTimelineList()
{
ui->timelineTree->clear();
diff --git a/saoriwindow.h b/saoriwindow.h
index 2fa7dc1..17dc78b 100644
--- a/saoriwindow.h
+++ b/saoriwindow.h
@@ -51,6 +51,9 @@
void openView(const QStringList viewName);
void openMediaView(const QUrl url);
+protected:
+ virtual void closeEvent(QCloseEvent *event);
+
protected slots:
void updateTimelineList();