mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-04 21:17:43 +03: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
8 changed files with 125 additions and 127 deletions
|
@ -116,10 +116,8 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
|||
m_previewView->hide();
|
||||
connect(this, SIGNAL(pressedEntry(Entry*)), m_previewView, SLOT(setEntry(Entry*)));
|
||||
connect(this, SIGNAL(pressedGroup(Group*)), m_previewView, SLOT(setGroup(Group*)));
|
||||
connect(this,
|
||||
SIGNAL(currentModeChanged(DatabaseWidget::Mode)),
|
||||
m_previewView,
|
||||
SLOT(setDatabaseMode(DatabaseWidget::Mode)));
|
||||
connect(this, SIGNAL(currentModeChanged(DatabaseWidget::Mode)),
|
||||
m_previewView, SLOT(setDatabaseMode(DatabaseWidget::Mode)));
|
||||
connect(m_previewView, SIGNAL(errorOccurred(QString)), this, SLOT(showErrorMessage(QString)));
|
||||
|
||||
auto* vLayout = new QVBoxLayout(rightHandSideWidget);
|
||||
|
@ -138,8 +136,6 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent)
|
|||
|
||||
rightHandSideWidget->setLayout(vLayout);
|
||||
|
||||
setTabOrder(m_entryView, m_groupView);
|
||||
|
||||
m_mainSplitter->addWidget(m_groupView);
|
||||
m_mainSplitter->addWidget(rightHandSideWidget);
|
||||
|
||||
|
@ -1342,29 +1338,16 @@ QStringList DatabaseWidget::customEntryAttributes() const
|
|||
}
|
||||
|
||||
/*
|
||||
* Restores the focus on the group and entry that was focused
|
||||
* before the database was locked or reloaded.
|
||||
* Restores the focus on the group and entry provided
|
||||
*/
|
||||
void DatabaseWidget::restoreGroupEntryFocus(const QUuid& groupUuid, const QUuid& entryUuid)
|
||||
{
|
||||
Group* restoredGroup = nullptr;
|
||||
const QList<Group*> groups = m_db->rootGroup()->groupsRecursive(true);
|
||||
for (Group* group : groups) {
|
||||
if (group->uuid() == groupUuid) {
|
||||
restoredGroup = group;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
auto group = m_db->resolveGroup(groupUuid);
|
||||
if (group) {
|
||||
m_groupView->setCurrentGroup(group);
|
||||
auto entry = group->findEntryByUuid(entryUuid);
|
||||
if (entry) {
|
||||
m_entryView->setCurrentEntry(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue