Moving access error to MainWindow.

This commit is contained in:
Louis-Bertrand Varin 2017-03-13 22:12:00 -04:00
parent da85252347
commit 55a32c58a9
4 changed files with 6 additions and 19 deletions

View File

@ -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);

View File

@ -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()

View File

@ -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);
}

View File

@ -23,9 +23,6 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="MessageWidget" name="messageWidget" native="true"/>
</item>
<item>
<widget class="QTabWidget" name="generalSettingsTabWidget">
<property name="currentIndex">
@ -371,12 +368,6 @@
<extends>QLineEdit</extends>
<header>autotype/ShortcutWidget.h</header>
</customwidget>
<customwidget>
<class>MessageWidget</class>
<extends>QWidget</extends>
<header>gui/MessageWidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>