mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-09 03:08:32 -05:00
Multiple fixes to MainWindow and some cleanup
* Fix MainWindow startup when minimize to tray was enabled * Reduce duplicate code in DatabaseWidget.cpp * Fix snapcraft build dependencies * Add support for CTRL+TAB, CTRL+PGUP, CTRL+SHIFT+TAB, CTRL+PGDN to control database tabs from any focus location * Add CTRL+SHIFT+M shortcut to minimize to tray * Allow minimize instead of app exit without tray icon
This commit is contained in:
parent
c749f7018e
commit
a44138dd5c
@ -38,8 +38,8 @@ parts:
|
|||||||
- g++
|
- g++
|
||||||
- libgcrypt20-dev
|
- libgcrypt20-dev
|
||||||
- libqt5x11extras5-dev
|
- libqt5x11extras5-dev
|
||||||
|
- libqt5svg5-dev
|
||||||
- qtbase5-dev
|
- qtbase5-dev
|
||||||
- qtsvg5-dev
|
|
||||||
- qttools5-dev
|
- qttools5-dev
|
||||||
- qttools5-dev-tools
|
- qttools5-dev-tools
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
@ -59,6 +59,7 @@ parts:
|
|||||||
- libsodium23
|
- libsodium23
|
||||||
- libxtst6
|
- libxtst6
|
||||||
- libqt5x11extras5
|
- libqt5x11extras5
|
||||||
|
- libqt5svg5
|
||||||
- libusb-1.0-0
|
- libusb-1.0-0
|
||||||
- qtwayland5
|
- qtwayland5
|
||||||
override-build: |
|
override-build: |
|
||||||
|
@ -71,20 +71,10 @@ void bootstrapApplication()
|
|||||||
void restoreMainWindowState(MainWindow& mainWindow)
|
void restoreMainWindowState(MainWindow& mainWindow)
|
||||||
{
|
{
|
||||||
// start minimized if configured
|
// start minimized if configured
|
||||||
bool minimizeOnStartup = config()->get("GUI/MinimizeOnStartup").toBool();
|
if (config()->get("GUI/MinimizeOnStartup").toBool()) {
|
||||||
bool minimizeToTray = config()->get("GUI/MinimizeToTray").toBool();
|
mainWindow.showMinimized();
|
||||||
#ifndef Q_OS_LINUX
|
} else {
|
||||||
if (minimizeOnStartup) {
|
mainWindow.bringToFront();
|
||||||
#else
|
|
||||||
// On some Linux systems, the window should NOT be minimized and hidden (i.e. not shown), at
|
|
||||||
// the same time (which would happen if both minimize on startup and minimize to tray are set)
|
|
||||||
// since otherwise it causes problems on restore as seen on issue #1595. Hiding it is enough.
|
|
||||||
if (minimizeOnStartup && !minimizeToTray) {
|
|
||||||
#endif
|
|
||||||
mainWindow.setWindowState(Qt::WindowMinimized);
|
|
||||||
}
|
|
||||||
if (!(minimizeOnStartup && minimizeToTray)) {
|
|
||||||
mainWindow.show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) {
|
if (config()->get("OpenPreviousDatabasesOnStartup").toBool()) {
|
||||||
|
@ -159,7 +159,7 @@ void ApplicationSettingsWidget::loadSettings()
|
|||||||
m_generalUi->systrayShowCheckBox->setChecked(config()->get("GUI/ShowTrayIcon").toBool());
|
m_generalUi->systrayShowCheckBox->setChecked(config()->get("GUI/ShowTrayIcon").toBool());
|
||||||
m_generalUi->systrayDarkIconCheckBox->setChecked(config()->get("GUI/DarkTrayIcon").toBool());
|
m_generalUi->systrayDarkIconCheckBox->setChecked(config()->get("GUI/DarkTrayIcon").toBool());
|
||||||
m_generalUi->systrayMinimizeToTrayCheckBox->setChecked(config()->get("GUI/MinimizeToTray").toBool());
|
m_generalUi->systrayMinimizeToTrayCheckBox->setChecked(config()->get("GUI/MinimizeToTray").toBool());
|
||||||
m_generalUi->systrayMinimizeOnCloseCheckBox->setChecked(config()->get("GUI/MinimizeOnClose").toBool());
|
m_generalUi->minimizeOnCloseCheckBox->setChecked(config()->get("GUI/MinimizeOnClose").toBool());
|
||||||
m_generalUi->systrayMinimizeOnStartup->setChecked(config()->get("GUI/MinimizeOnStartup").toBool());
|
m_generalUi->systrayMinimizeOnStartup->setChecked(config()->get("GUI/MinimizeOnStartup").toBool());
|
||||||
m_generalUi->autoTypeAskCheckBox->setChecked(config()->get("security/autotypeask").toBool());
|
m_generalUi->autoTypeAskCheckBox->setChecked(config()->get("security/autotypeask").toBool());
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ void ApplicationSettingsWidget::saveSettings()
|
|||||||
config()->set("GUI/ShowTrayIcon", m_generalUi->systrayShowCheckBox->isChecked());
|
config()->set("GUI/ShowTrayIcon", m_generalUi->systrayShowCheckBox->isChecked());
|
||||||
config()->set("GUI/DarkTrayIcon", m_generalUi->systrayDarkIconCheckBox->isChecked());
|
config()->set("GUI/DarkTrayIcon", m_generalUi->systrayDarkIconCheckBox->isChecked());
|
||||||
config()->set("GUI/MinimizeToTray", m_generalUi->systrayMinimizeToTrayCheckBox->isChecked());
|
config()->set("GUI/MinimizeToTray", m_generalUi->systrayMinimizeToTrayCheckBox->isChecked());
|
||||||
config()->set("GUI/MinimizeOnClose", m_generalUi->systrayMinimizeOnCloseCheckBox->isChecked());
|
config()->set("GUI/MinimizeOnClose", m_generalUi->minimizeOnCloseCheckBox->isChecked());
|
||||||
config()->set("GUI/MinimizeOnStartup", m_generalUi->systrayMinimizeOnStartup->isChecked());
|
config()->set("GUI/MinimizeOnStartup", m_generalUi->systrayMinimizeOnStartup->isChecked());
|
||||||
|
|
||||||
config()->set("security/autotypeask", m_generalUi->autoTypeAskCheckBox->isChecked());
|
config()->set("security/autotypeask", m_generalUi->autoTypeAskCheckBox->isChecked());
|
||||||
@ -299,5 +299,4 @@ void ApplicationSettingsWidget::enableSystray(bool checked)
|
|||||||
{
|
{
|
||||||
m_generalUi->systrayDarkIconCheckBox->setEnabled(checked);
|
m_generalUi->systrayDarkIconCheckBox->setEnabled(checked);
|
||||||
m_generalUi->systrayMinimizeToTrayCheckBox->setEnabled(checked);
|
m_generalUi->systrayMinimizeToTrayCheckBox->setEnabled(checked);
|
||||||
m_generalUi->systrayMinimizeOnCloseCheckBox->setEnabled(checked);
|
|
||||||
}
|
}
|
||||||
|
@ -186,6 +186,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="minimizeOnCloseCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Minimize instead of app exit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="systrayShowCheckBox">
|
<widget class="QCheckBox" name="systrayShowCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -193,6 +200,42 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="sizeConstraint">
|
||||||
|
<enum>QLayout::SetMaximumSize</enum>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="systrayDarkIconCheckBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Dark system tray icon</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="systraySettings" native="true">
|
<widget class="QWidget" name="systraySettings" native="true">
|
||||||
<layout class="QVBoxLayout" name="systrayLayout">
|
<layout class="QVBoxLayout" name="systrayLayout">
|
||||||
@ -250,78 +293,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMaximumSize</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="systrayMinimizeOnCloseCheckBox">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Hide window to system tray instead of app exit</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMaximumSize</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="systrayDarkIconCheckBox">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Dark system tray icon</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -116,10 +116,8 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
|||||||
m_previewView->hide();
|
m_previewView->hide();
|
||||||
connect(this, SIGNAL(pressedEntry(Entry*)), m_previewView, SLOT(setEntry(Entry*)));
|
connect(this, SIGNAL(pressedEntry(Entry*)), m_previewView, SLOT(setEntry(Entry*)));
|
||||||
connect(this, SIGNAL(pressedGroup(Group*)), m_previewView, SLOT(setGroup(Group*)));
|
connect(this, SIGNAL(pressedGroup(Group*)), m_previewView, SLOT(setGroup(Group*)));
|
||||||
connect(this,
|
connect(this, SIGNAL(currentModeChanged(DatabaseWidget::Mode)),
|
||||||
SIGNAL(currentModeChanged(DatabaseWidget::Mode)),
|
m_previewView, SLOT(setDatabaseMode(DatabaseWidget::Mode)));
|
||||||
m_previewView,
|
|
||||||
SLOT(setDatabaseMode(DatabaseWidget::Mode)));
|
|
||||||
connect(m_previewView, SIGNAL(errorOccurred(QString)), this, SLOT(showErrorMessage(QString)));
|
connect(m_previewView, SIGNAL(errorOccurred(QString)), this, SLOT(showErrorMessage(QString)));
|
||||||
|
|
||||||
auto* vLayout = new QVBoxLayout(rightHandSideWidget);
|
auto* vLayout = new QVBoxLayout(rightHandSideWidget);
|
||||||
@ -138,8 +136,6 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
|||||||
|
|
||||||
rightHandSideWidget->setLayout(vLayout);
|
rightHandSideWidget->setLayout(vLayout);
|
||||||
|
|
||||||
setTabOrder(m_entryView, m_groupView);
|
|
||||||
|
|
||||||
m_mainSplitter->addWidget(m_groupView);
|
m_mainSplitter->addWidget(m_groupView);
|
||||||
m_mainSplitter->addWidget(rightHandSideWidget);
|
m_mainSplitter->addWidget(rightHandSideWidget);
|
||||||
|
|
||||||
@ -1342,29 +1338,16 @@ QStringList DatabaseWidget::customEntryAttributes() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Restores the focus on the group and entry that was focused
|
* Restores the focus on the group and entry provided
|
||||||
* before the database was locked or reloaded.
|
|
||||||
*/
|
*/
|
||||||
void DatabaseWidget::restoreGroupEntryFocus(const QUuid& groupUuid, const QUuid& entryUuid)
|
void DatabaseWidget::restoreGroupEntryFocus(const QUuid& groupUuid, const QUuid& entryUuid)
|
||||||
{
|
{
|
||||||
Group* restoredGroup = nullptr;
|
auto group = m_db->resolveGroup(groupUuid);
|
||||||
const QList<Group*> groups = m_db->rootGroup()->groupsRecursive(true);
|
if (group) {
|
||||||
for (Group* group : groups) {
|
m_groupView->setCurrentGroup(group);
|
||||||
if (group->uuid() == groupUuid) {
|
auto entry = group->findEntryByUuid(entryUuid);
|
||||||
restoredGroup = group;
|
if (entry) {
|
||||||
break;
|
m_entryView->setCurrentEntry(entry);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (restoredGroup != nullptr) {
|
|
||||||
m_groupView->setCurrentGroup(restoredGroup);
|
|
||||||
|
|
||||||
const QList<Entry*> entries = restoredGroup->entries();
|
|
||||||
for (Entry* entry : entries) {
|
|
||||||
if (entry->uuid() == entryUuid) {
|
|
||||||
m_entryView->setCurrentEntry(entry);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>EntryPreviewWidget</class>
|
<class>EntryPreviewWidget</class>
|
||||||
<widget class="QWidget" name="EntryPreviewWidget">
|
<widget class="QWidget" name="EntryPreviewWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>280</width>
|
||||||
|
<height>267</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@ -107,6 +115,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="entryTotpButton">
|
<widget class="QToolButton" name="entryTotpButton">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Generate TOTP Token</string>
|
<string>Generate TOTP Token</string>
|
||||||
</property>
|
</property>
|
||||||
@ -120,6 +131,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QToolButton" name="entryCloseButton">
|
<widget class="QToolButton" name="entryCloseButton">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Close</string>
|
<string>Close</string>
|
||||||
</property>
|
</property>
|
||||||
@ -135,6 +149,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="entryTabWidget">
|
<widget class="QTabWidget" name="entryTabWidget">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::ClickFocus</enum>
|
||||||
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -732,6 +749,13 @@
|
|||||||
<header>gui/widgets/ElidedLabel.h</header>
|
<header>gui/widgets/ElidedLabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>entryTotpButton</tabstop>
|
||||||
|
<tabstop>entryAutotypeTree</tabstop>
|
||||||
|
<tabstop>entryTabWidget</tabstop>
|
||||||
|
<tabstop>groupCloseButton</tabstop>
|
||||||
|
<tabstop>groupTabWidget</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
@ -207,6 +207,11 @@ MainWindow::MainWindow()
|
|||||||
m_ui->actionEntryCopyURL->setShortcut(Qt::CTRL + Qt::ALT + Qt::Key_U);
|
m_ui->actionEntryCopyURL->setShortcut(Qt::CTRL + Qt::ALT + Qt::Key_U);
|
||||||
|
|
||||||
new QShortcut(Qt::CTRL + Qt::Key_M, this, SLOT(showMinimized()));
|
new QShortcut(Qt::CTRL + Qt::Key_M, this, SLOT(showMinimized()));
|
||||||
|
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_M, this, SLOT(hideWindow()));
|
||||||
|
new QShortcut(Qt::CTRL + Qt::Key_Tab, this, SLOT(selectNextDatabaseTab()));
|
||||||
|
new QShortcut(Qt::CTRL + Qt::Key_PageUp, this, SLOT(selectNextDatabaseTab()));
|
||||||
|
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this, SLOT(selectPreviousDatabaseTab()));
|
||||||
|
new QShortcut(Qt::CTRL + Qt::Key_PageDown, this, SLOT(selectPreviousDatabaseTab()));
|
||||||
|
|
||||||
m_ui->actionDatabaseNew->setIcon(filePath()->icon("actions", "document-new"));
|
m_ui->actionDatabaseNew->setIcon(filePath()->icon("actions", "document-new"));
|
||||||
m_ui->actionDatabaseOpen->setIcon(filePath()->icon("actions", "document-open"));
|
m_ui->actionDatabaseOpen->setIcon(filePath()->icon("actions", "document-open"));
|
||||||
@ -697,6 +702,30 @@ void MainWindow::databaseStatusChanged(DatabaseWidget*)
|
|||||||
updateTrayIcon();
|
updateTrayIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::selectNextDatabaseTab()
|
||||||
|
{
|
||||||
|
if (m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) {
|
||||||
|
int index = m_ui->tabWidget->currentIndex() + 1;
|
||||||
|
if (index >= m_ui->tabWidget->count()) {
|
||||||
|
m_ui->tabWidget->setCurrentIndex(0);
|
||||||
|
} else {
|
||||||
|
m_ui->tabWidget->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MainWindow::selectPreviousDatabaseTab()
|
||||||
|
{
|
||||||
|
if (m_ui->stackedWidget->currentIndex() == DatabaseTabScreen) {
|
||||||
|
int index = m_ui->tabWidget->currentIndex() - 1;
|
||||||
|
if (index < 0) {
|
||||||
|
m_ui->tabWidget->setCurrentIndex(m_ui->tabWidget->count() - 1);
|
||||||
|
} else {
|
||||||
|
m_ui->tabWidget->setCurrentIndex(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::databaseTabChanged(int tabIndex)
|
void MainWindow::databaseTabChanged(int tabIndex)
|
||||||
{
|
{
|
||||||
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) {
|
if (tabIndex != -1 && m_ui->stackedWidget->currentIndex() == WelcomeScreen) {
|
||||||
@ -716,15 +745,9 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool minimizeOnClose = isTrayIconEnabled() && config()->get("GUI/MinimizeOnClose").toBool();
|
if (config()->get("GUI/MinimizeOnClose").toBool() && !m_appExitCalled) {
|
||||||
if (minimizeOnClose && !m_appExitCalled) {
|
event->ignore();
|
||||||
event->accept();
|
|
||||||
hideWindow();
|
hideWindow();
|
||||||
|
|
||||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
|
||||||
m_ui->tabWidget->lockDatabases();
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -908,7 +931,12 @@ void MainWindow::hideWindow()
|
|||||||
// TODO: Add an explanation for why this is also not done on Mac (or remove the check)
|
// TODO: Add an explanation for why this is also not done on Mac (or remove the check)
|
||||||
setWindowState(windowState() | Qt::WindowMinimized);
|
setWindowState(windowState() | Qt::WindowMinimized);
|
||||||
#endif
|
#endif
|
||||||
QTimer::singleShot(0, this, SLOT(hide()));
|
// Only hide if tray icon is active, otherwise window will be gone forever
|
||||||
|
if (isTrayIconEnabled()) {
|
||||||
|
hide();
|
||||||
|
} else {
|
||||||
|
showMinimized();
|
||||||
|
}
|
||||||
|
|
||||||
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
if (config()->get("security/lockdatabaseminimize").toBool()) {
|
||||||
m_ui->tabWidget->lockDatabases();
|
m_ui->tabWidget->lockDatabases();
|
||||||
|
@ -69,6 +69,8 @@ public slots:
|
|||||||
void hideGlobalMessage();
|
void hideGlobalMessage();
|
||||||
void showYubiKeyPopup();
|
void showYubiKeyPopup();
|
||||||
void hideYubiKeyPopup();
|
void hideYubiKeyPopup();
|
||||||
|
void hideWindow();
|
||||||
|
void toggleWindow();
|
||||||
void bringToFront();
|
void bringToFront();
|
||||||
void closeAllDatabases();
|
void closeAllDatabases();
|
||||||
void lockAllDatabases();
|
void lockAllDatabases();
|
||||||
@ -103,13 +105,13 @@ private slots:
|
|||||||
void rememberOpenDatabases(const QString& filePath);
|
void rememberOpenDatabases(const QString& filePath);
|
||||||
void applySettingsChanges();
|
void applySettingsChanges();
|
||||||
void trayIconTriggered(QSystemTrayIcon::ActivationReason reason);
|
void trayIconTriggered(QSystemTrayIcon::ActivationReason reason);
|
||||||
void hideWindow();
|
|
||||||
void toggleWindow();
|
|
||||||
void lockDatabasesAfterInactivity();
|
void lockDatabasesAfterInactivity();
|
||||||
void forgetTouchIDAfterInactivity();
|
void forgetTouchIDAfterInactivity();
|
||||||
void hideTabMessage();
|
void hideTabMessage();
|
||||||
void handleScreenLock();
|
void handleScreenLock();
|
||||||
void showErrorMessage(const QString& message);
|
void showErrorMessage(const QString& message);
|
||||||
|
void selectNextDatabaseTab();
|
||||||
|
void selectPreviousDatabaseTab();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
|
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user