From 78b495c85deacc66d3935177b37f372448886ea2 Mon Sep 17 00:00:00 2001 From: Andrey Tsarev Date: Sun, 13 Nov 2016 19:05:43 +0300 Subject: [PATCH] remarks --- dialogs/helpdialog.cpp | 10 +++++++--- mainwindow.cpp | 6 +----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dialogs/helpdialog.cpp b/dialogs/helpdialog.cpp index 3977944..5406c43 100644 --- a/dialogs/helpdialog.cpp +++ b/dialogs/helpdialog.cpp @@ -45,10 +45,14 @@ HelpDialog::HelpDialog(const QString& path, const QString& page, QWidget* parent void HelpDialog::showPage(const QString& path, const QString& page, QWidget* parent) { - HelpDialog *helpDialog = new HelpDialog(path, page, parent); - helpDialog->exec(); - + QSettings settings; + bool hideHelpDialog = settings.value("hideHelpDialog", false).toBool(); + if (!hideHelpDialog){ + HelpDialog *helpDialog = new HelpDialog(path, page, parent); + helpDialog->exec(); + } } + void HelpDialog::checkBoxToggled(bool checked) { QSettings settings; diff --git a/mainwindow.cpp b/mainwindow.cpp index 2ed2043..81f2207 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -538,9 +538,5 @@ void MainWindow::closeEvent(QCloseEvent *event) } void MainWindow::slotActionHelp(){ - QSettings settings; - bool showHelpDialog = settings.value("hideHelpDialog","true").toBool(); - if (showHelpDialog){ - HelpDialog::showPage("qrc:/docs","/usage_tips.html", this); - } + HelpDialog::showPage("qrc:/docs","/usage_tips.html", this); }