Minimize-On-Startup: add function to minimize mainwindow if all four tray settings are true

This commit is contained in:
Frank Nießen 2015-10-08 19:25:42 +02:00
parent 0f0af12353
commit 3cf1a16398
2 changed files with 12 additions and 0 deletions

View File

@ -307,6 +307,17 @@ void MainWindow::openDatabase(const QString& fileName, const QString& pw, const
m_ui->tabWidget->openDatabase(fileName, pw, keyFile); m_ui->tabWidget->openDatabase(fileName, pw, keyFile);
} }
void MainWindow::configuredMinimizeWindow()
{
bool minimize = isTrayIconEnabled() &&
config()->get("GUI/MinimizeToTray").toBool() &&
config()->get("GUI/MinimizeOnClose").toBool() &&
config()->get("GUI/MinimizeOnStartup").toBool();
if (minimize) {
hide();
}
}
void MainWindow::setMenuActionState(DatabaseWidget::Mode mode) void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
{ {
bool inDatabaseTabWidget = (m_ui->stackedWidget->currentIndex() == 0); bool inDatabaseTabWidget = (m_ui->stackedWidget->currentIndex() == 0);

View File

@ -38,6 +38,7 @@ class MainWindow : public QMainWindow
public: public:
MainWindow(); MainWindow();
~MainWindow(); ~MainWindow();
void configuredMinimizeWindow();
public Q_SLOTS: public Q_SLOTS:
void openDatabase(const QString& fileName, const QString& pw = QString(), void openDatabase(const QString& fileName, const QString& pw = QString(),