From 55a32c58a972760d5861163ccc3403c6dd69a3e2 Mon Sep 17 00:00:00 2001 From: Louis-Bertrand Varin Date: Mon, 13 Mar 2017 22:12:00 -0400 Subject: [PATCH] Moving access error to MainWindow. --- src/core/Config.cpp | 4 ---- src/gui/MainWindow.cpp | 6 ++++++ src/gui/SettingsWidget.cpp | 6 ------ src/gui/SettingsWidgetGeneral.ui | 9 --------- 4 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index e3a1cb633..e074df6cb 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -102,10 +102,6 @@ void Config::init(const QString& fileName) { m_settings.reset(new QSettings(fileName, QSettings::IniFormat)); - if (hasAccessError()) { - qWarning("Access error with config file %s", qPrintable(fileName)); - } - m_defaults.insert("RememberLastDatabases", true); m_defaults.insert("RememberLastKeyFiles", true); m_defaults.insert("OpenPreviousDatabasesOnStartup", true); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 442c04735..adb1ae297 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -314,6 +314,12 @@ MainWindow::MainWindow() connect(m_ui->tabWidget, SIGNAL(messageDismissTab()), this, SLOT(hideTabMessage())); updateTrayIcon(); + + if (config()->hasAccessError()) { + m_ui->globalMessageWidget->showMessage( + tr("Access error for config file ") + config()->getFileName(), MessageWidget::Error); + } + } MainWindow::~MainWindow() diff --git a/src/gui/SettingsWidget.cpp b/src/gui/SettingsWidget.cpp index d68a11e98..62af276e8 100644 --- a/src/gui/SettingsWidget.cpp +++ b/src/gui/SettingsWidget.cpp @@ -62,12 +62,6 @@ SettingsWidget::SettingsWidget(QWidget* parent) addPage(tr("General"), FilePath::instance()->icon("categories", "preferences-other"), m_generalWidget); addPage(tr("Security"), FilePath::instance()->icon("status", "security-high"), m_secWidget); - m_generalUi->messageWidget->setVisible(false); - if (config()->hasAccessError()) { - m_generalUi->messageWidget->showMessage( - tr("Access error with config file ") + config()->getFileName(), MessageWidget::Error); - } - if (!autoType()->isAvailable()) { m_generalUi->generalSettingsTabWidget->removeTab(1); } diff --git a/src/gui/SettingsWidgetGeneral.ui b/src/gui/SettingsWidgetGeneral.ui index fb9fb1709..88d7cad45 100644 --- a/src/gui/SettingsWidgetGeneral.ui +++ b/src/gui/SettingsWidgetGeneral.ui @@ -23,9 +23,6 @@ 0 - - - @@ -371,12 +368,6 @@ QLineEdit
autotype/ShortcutWidget.h
- - MessageWidget - QWidget -
gui/MessageWidget.h
- 1 -