aboutsummaryrefslogtreecommitdiffstats
path: root/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cpp')
-rw-r--r--mainwindow.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/mainwindow.cpp b/mainwindow.cpp
index 74fd645..da0c575 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -38,6 +38,9 @@ MainWindow::MainWindow()
/* List of binary Attachments */
attachmentDockCreated = false;
+ /* Variable containing if restart is needed */
+ this->slotSetRestartNeeded(false);
+
keyMgmt = new KeyMgmt(mCtx, this);
keyMgmt->hide();
/* test attachmentdir for files alll 15s */
@@ -1256,11 +1259,10 @@ void MainWindow::slotFileVerify()
void MainWindow::slotOpenSettingsDialog()
{
+ SettingsDialog *settingsdialog = new SettingsDialog(mCtx, this);
- QString preLang = settings.value("int/lang").toString();
- QString preKeydbPath = settings.value("gpgpaths/keydbpath").toString();
+ connect(settingsdialog, SIGNAL(signalRestartNeeded(bool)), this, SLOT(slotSetRestartNeeded(bool)));
- new SettingsDialog(mCtx, this);
// Iconsize
QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize();
this->setIconSize(iconSize);
@@ -1280,8 +1282,8 @@ void MainWindow::slotOpenSettingsDialog()
closeAttachmentDock();
}
- // restart mainwindow if langugage or keydbpath changed
- if((preLang != settings.value("int/lang").toString()) || preKeydbPath != settings.value("gpgpaths/keydbpath").toString()) {
+ // restart mainwindow if necessary
+ if(getRestartNeeded()) {
if(edit->maybeSaveAnyTab()) {
saveSettings();
qApp->exit(RESTART_CODE);
@@ -1294,7 +1296,6 @@ void MainWindow::slotOpenSettingsDialog()
} else {
this->menuBar()->insertAction(viewMenu->menuAction(), steganoMenu->menuAction());
}
-
}
void MainWindow::slotCleanDoubleLinebreaks()
@@ -1363,3 +1364,13 @@ void MainWindow::slotCutPgpHeader() {
edit->slotFillTextEditWithText(content.trimmed());
}
+
+void MainWindow::slotSetRestartNeeded(bool needed)
+{
+ this->restartNeeded = needed;
+}
+
+bool MainWindow::getRestartNeeded()
+{
+ return this->restartNeeded;
+}