mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-14 01:06:09 -04:00
Merge branch 'master' into develop
This commit is contained in:
commit
16a11c3a7f
24 changed files with 1044 additions and 926 deletions
|
@ -35,7 +35,7 @@ Argon2Kdf::Argon2Kdf()
|
|||
, m_memory(1 << 16)
|
||||
, m_parallelism(static_cast<quint32>(QThread::idealThreadCount()))
|
||||
{
|
||||
m_rounds = 1;
|
||||
m_rounds = 10;
|
||||
}
|
||||
|
||||
quint32 Argon2Kdf::version() const
|
||||
|
|
|
@ -783,6 +783,9 @@ void DatabaseWidget::switchToMainView(bool previousDialogAccepted)
|
|||
}
|
||||
|
||||
m_newParent = nullptr;
|
||||
} else {
|
||||
// Workaround: ensure entries are focused so search doesn't reset
|
||||
m_entryView->setFocus();
|
||||
}
|
||||
|
||||
setCurrentWidget(m_mainWidget);
|
||||
|
|
|
@ -268,6 +268,9 @@ MainWindow::MainWindow()
|
|||
m_ui->actionEntryCopyURL->setShortcutVisibleInContextMenu(true);
|
||||
#endif
|
||||
|
||||
connect(m_ui->menuEntries, SIGNAL(aboutToHide()), SLOT(releaseContextFocusLock()));
|
||||
connect(m_ui->menuGroups, SIGNAL(aboutToHide()), SLOT(releaseContextFocusLock()));
|
||||
|
||||
// Control window state
|
||||
new QShortcut(Qt::CTRL + Qt::Key_M, this, SLOT(showMinimized()));
|
||||
new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_M, this, SLOT(hideWindow()));
|
||||
|
@ -560,8 +563,8 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
|
|||
switch (mode) {
|
||||
case DatabaseWidget::Mode::ViewMode: {
|
||||
// bool inSearch = dbWidget->isInSearchMode();
|
||||
bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1 && dbWidget->currentEntryHasFocus();
|
||||
bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0 && dbWidget->currentEntryHasFocus();
|
||||
bool singleEntrySelected = dbWidget->numberOfSelectedEntries() == 1 && (m_contextMenuFocusLock || dbWidget->currentEntryHasFocus());
|
||||
bool entriesSelected = dbWidget->numberOfSelectedEntries() > 0 && (m_contextMenuFocusLock || dbWidget->currentEntryHasFocus());
|
||||
bool groupSelected = dbWidget->isGroupSelected();
|
||||
bool recycleBinSelected = dbWidget->isRecycleBinSelected();
|
||||
|
||||
|
@ -894,7 +897,9 @@ void MainWindow::closeEvent(QCloseEvent* event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (config()->get("GUI/MinimizeOnClose").toBool() && !m_appExitCalled) {
|
||||
// Don't ignore close event when the app is hidden to tray.
|
||||
// This can occur when the OS issues close events on shutdown.
|
||||
if (config()->get("GUI/MinimizeOnClose").toBool() && !isHidden() && !m_appExitCalled) {
|
||||
event->ignore();
|
||||
hideWindow();
|
||||
return;
|
||||
|
@ -1008,13 +1013,20 @@ void MainWindow::updateTrayIcon()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::releaseContextFocusLock()
|
||||
{
|
||||
m_contextMenuFocusLock = false;
|
||||
}
|
||||
|
||||
void MainWindow::showEntryContextMenu(const QPoint& globalPos)
|
||||
{
|
||||
m_contextMenuFocusLock = true;
|
||||
m_ui->menuEntries->popup(globalPos);
|
||||
}
|
||||
|
||||
void MainWindow::showGroupContextMenu(const QPoint& globalPos)
|
||||
{
|
||||
m_contextMenuFocusLock = true;
|
||||
m_ui->menuGroups->popup(globalPos);
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ private slots:
|
|||
void selectPreviousDatabaseTab();
|
||||
void togglePasswordsHidden();
|
||||
void toggleUsernamesHidden();
|
||||
void releaseContextFocusLock();
|
||||
|
||||
private:
|
||||
static void setShortcut(QAction* action, QKeySequence::StandardKey standard, int fallback = 0);
|
||||
|
@ -150,6 +151,7 @@ private:
|
|||
|
||||
bool m_appExitCalled;
|
||||
bool m_appExiting;
|
||||
bool m_contextMenuFocusLock;
|
||||
uint m_lastFocusOutTime;
|
||||
QTimer m_trayIconTriggerTimer;
|
||||
QSystemTrayIcon::ActivationReason m_trayIconTriggerReason;
|
||||
|
|
|
@ -962,6 +962,7 @@ void EditEntryWidget::cancel()
|
|||
m_entry->setIcon(Entry::DefaultIconNumber);
|
||||
}
|
||||
|
||||
bool accepted = false;
|
||||
if (isModified()) {
|
||||
auto result = MessageBox::question(this,
|
||||
QString(),
|
||||
|
@ -969,18 +970,17 @@ void EditEntryWidget::cancel()
|
|||
MessageBox::Cancel | MessageBox::Save | MessageBox::Discard,
|
||||
MessageBox::Cancel);
|
||||
if (result == MessageBox::Cancel) {
|
||||
m_mainUi->passwordGenerator->reset();
|
||||
return;
|
||||
}
|
||||
if (result == MessageBox::Save) {
|
||||
commitEntry();
|
||||
setModified(false);
|
||||
} else if (result == MessageBox::Save) {
|
||||
accepted = true;
|
||||
if (!commitEntry()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
clear();
|
||||
|
||||
emit editFinished(!isModified());
|
||||
emit editFinished(accepted);
|
||||
}
|
||||
|
||||
void EditEntryWidget::clear()
|
||||
|
|
|
@ -139,17 +139,18 @@ void EntryView::keyPressEvent(QKeyEvent* event)
|
|||
}
|
||||
|
||||
int last = m_model->rowCount() - 1;
|
||||
if (last > 0) {
|
||||
if (event->key() == Qt::Key_Up && currentIndex().row() == 0) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(last, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Up && currentIndex().row() == 0) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(last, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Down && currentIndex().row() == last) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(0, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
if (event->key() == Qt::Key_Down && currentIndex().row() == last) {
|
||||
QModelIndex index = m_sortModel->mapToSource(m_sortModel->index(0, 0));
|
||||
setCurrentEntry(m_model->entryFromIndex(index));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTreeView::keyPressEvent(event);
|
||||
|
|
|
@ -72,6 +72,12 @@ void GroupView::dragMoveEvent(QDragMoveEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
void GroupView::focusInEvent(QFocusEvent* event)
|
||||
{
|
||||
emitGroupChanged();
|
||||
QTreeView::focusInEvent(event);
|
||||
}
|
||||
|
||||
Group* GroupView::currentGroup()
|
||||
{
|
||||
if (currentIndex() == QModelIndex()) {
|
||||
|
|
|
@ -47,6 +47,7 @@ private slots:
|
|||
|
||||
protected:
|
||||
void dragMoveEvent(QDragMoveEvent* event) override;
|
||||
void focusInEvent(QFocusEvent* event) override;
|
||||
|
||||
private:
|
||||
void recInitExpanded(Group* group);
|
||||
|
|
|
@ -159,9 +159,9 @@ QString Totp::writeSettings(const QSharedPointer<Totp::Settings>& settings,
|
|||
auto urlstring = QString("otpauth://totp/%1:%2?secret=%3&period=%4&digits=%5&issuer=%1")
|
||||
.arg(title.isEmpty() ? "KeePassXC" : QString(QUrl::toPercentEncoding(title)),
|
||||
username.isEmpty() ? "none" : QString(QUrl::toPercentEncoding(username)),
|
||||
QString(Base32::sanitizeInput(settings->key.toLatin1())))
|
||||
.arg(settings->step)
|
||||
.arg(settings->digits);
|
||||
QString(Base32::sanitizeInput(settings->key.toLatin1())),
|
||||
QString::number(settings->step),
|
||||
QString::number(settings->digits));
|
||||
|
||||
if (!settings->encoder.name.isEmpty()) {
|
||||
urlstring.append("&encoder=").append(settings->encoder.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue