mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-12 07:49:55 -05:00
Also remove redudant code for minimizing to tray
This commit is contained in:
parent
405b82588b
commit
9261d8ae9d
@ -58,6 +58,12 @@ DatabaseOpenWidget::~DatabaseOpenWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::showEvent(QShowEvent* event)
|
||||
{
|
||||
DialogyWidget::showEvent(event);
|
||||
m_ui->editPassword->setFocus();
|
||||
}
|
||||
|
||||
void DatabaseOpenWidget::load(const QString& filename)
|
||||
{
|
||||
m_filename = filename;
|
||||
|
@ -45,6 +45,7 @@ Q_SIGNALS:
|
||||
void editFinished(bool accepted);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
CompositeKey databaseKey();
|
||||
|
||||
protected Q_SLOTS:
|
||||
|
@ -333,15 +333,6 @@ void MainWindow::openDatabase(const QString& fileName, const QString& pw, const
|
||||
m_ui->tabWidget->openDatabase(fileName, pw, keyFile);
|
||||
}
|
||||
|
||||
void MainWindow::minimizeWindow()
|
||||
{
|
||||
if (isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool()) {
|
||||
hide();
|
||||
} else {
|
||||
setWindowState(Qt::WindowMinimized);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
||||
{
|
||||
int currentIndex = m_ui->stackedWidget->currentIndex();
|
||||
|
@ -38,7 +38,6 @@ class MainWindow : public QMainWindow
|
||||
public:
|
||||
MainWindow();
|
||||
~MainWindow();
|
||||
void minimizeWindow();
|
||||
|
||||
public Q_SLOTS:
|
||||
void openDatabase(const QString& fileName, const QString& pw = QString(),
|
||||
|
10
src/main.cpp
10
src/main.cpp
@ -91,6 +91,11 @@ int main(int argc, char** argv)
|
||||
|
||||
QObject::connect(&app, SIGNAL(openFile(QString)), &mainWindow, SLOT(openDatabase(QString)));
|
||||
|
||||
// start minimized if configured
|
||||
if (config()->get("GUI/MinimizeOnStartup").toBool()) {
|
||||
mainWindow.setWindowState(Qt::WindowMinimized);
|
||||
}
|
||||
|
||||
for (int ii=0; ii < args.length(); ii++) {
|
||||
QString filename = args[ii];
|
||||
if (!filename.isEmpty() && QFile::exists(filename)) {
|
||||
@ -112,10 +117,5 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
// start minimized if configured
|
||||
if (config()->get("GUI/MinimizeOnStartup").toBool()) {
|
||||
mainWindow.minimizeWindow();
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user