From 5490d1acbde7014ec0f3d2255984bff49e5af079 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 3 Jun 2019 16:57:03 +0200 Subject: Remember whether help/news was open --- src/dialog.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/dialog.cpp') diff --git a/src/dialog.cpp b/src/dialog.cpp index 08af827..5e68e10 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -55,8 +55,10 @@ Dialog::Dialog(QWidget *parent) // ui->filterEdit->installEventFilter(this); QCoreApplication::instance()->installEventFilter(this); - ui->helpBox->hide(); - ui->newsBox->hide(); + if (!UserConfig::isNewsHelpOpen()) { + ui->helpBox->hide(); + ui->newsBox->hide(); + } ui->lblAutoQuit->hide(); this->addStatusString(STR_LOADING); @@ -194,6 +196,7 @@ void Dialog::on_treeView_doubleClicked(const QModelIndex& index) } UserConfig::addLastSession(s->uuid().isEmpty() ? s->shortDescription() : s->uuid()); UserConfig::setLastTab(activeTab_); + UserConfig::setNewsHelpOpen(!ui->helpBox->isHidden()); centerTimer_->stop(); // Stop the auto-center/auto-quit timer, so we don't kill the session :> setVisible(false); } else { @@ -422,7 +425,7 @@ void Dialog::onCenterTimer() { } else if (autoQuit_ < 60) { ui->lblAutoQuit->setText(trUtf8("Auto logout in %1").arg(autoQuit_)); ui->lblAutoQuit->show(); - } else if (ui->lblAutoQuit->isVisible()) { + } else if (!ui->lblAutoQuit->isHidden()) { ui->lblAutoQuit->hide(); } } @@ -550,7 +553,7 @@ void Dialog::downloadData(const QString& locationIds) { + infoNode.text() + "

")); } - if (UserConfig::getLastNewsTime() < timestamp.toTime_t()) { + if (ui->helpBox->isHidden() && UserConfig::getLastNewsTime() < timestamp.toTime_t()) { // show news if not seen before on_helpNewsButton_clicked(); } @@ -797,7 +800,7 @@ void Dialog::setListModel(SessionTreeModel *model) { } void Dialog::on_helpNewsButton_clicked() { - if (ui->helpBox->isVisible()) { + if (!ui->helpBox->isHidden()) { ui->helpBox->hide(); ui->newsBox->hide(); } else { -- cgit v1.2.3-55-g7522