mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-25 23:39:45 -05:00
Fix issues with Entry Editing
* Fix #10653 - prevent category switching if no category was actually hidden/visible. Also properly select a new category when a change is made instead of just changing the widget page. * Fix apply button still being enabled after it is pressed and successfully committed
This commit is contained in:
parent
1896883382
commit
6b62beab6e
@ -94,16 +94,19 @@ void EditWidget::setPageHidden(QWidget* widget, bool hidden)
|
||||
}
|
||||
}
|
||||
|
||||
if (index != -1) {
|
||||
m_ui->categoryList->setCategoryHidden(index, hidden);
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (index == m_ui->stackedWidget->currentIndex()) {
|
||||
bool changed = m_ui->categoryList->isCategoryHidden(index) != hidden;
|
||||
m_ui->categoryList->setCategoryHidden(index, hidden);
|
||||
|
||||
if (changed && index == m_ui->stackedWidget->currentIndex()) {
|
||||
int newIndex = m_ui->stackedWidget->currentIndex() - 1;
|
||||
if (newIndex < 0) {
|
||||
newIndex = m_ui->stackedWidget->count() - 1;
|
||||
}
|
||||
m_ui->stackedWidget->setCurrentIndex(newIndex);
|
||||
m_ui->categoryList->setCurrentCategory(newIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1173,21 +1173,23 @@ bool EditEntryWidget::commitEntry()
|
||||
toKeeAgentSettings(m_sshAgentSettings);
|
||||
#endif
|
||||
|
||||
// Begin entry update
|
||||
if (!m_create) {
|
||||
m_entry->beginUpdate();
|
||||
}
|
||||
|
||||
#ifdef WITH_XC_BROWSER
|
||||
if (config()->get(Config::Browser_Enabled).toBool()) {
|
||||
updateBrowser();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!m_create) {
|
||||
m_entry->beginUpdate();
|
||||
}
|
||||
|
||||
updateEntryData(m_entry);
|
||||
|
||||
if (!m_create) {
|
||||
m_entry->endUpdate();
|
||||
}
|
||||
// End entry update
|
||||
|
||||
m_historyModel->setEntries(m_entry->historyItems(), m_entry);
|
||||
setPageHidden(m_historyWidget, m_history || m_entry->historyItems().count() < 1);
|
||||
@ -1195,6 +1197,9 @@ bool EditEntryWidget::commitEntry()
|
||||
|
||||
showMessage(tr("Entry updated successfully."), MessageWidget::Positive);
|
||||
setModified(false);
|
||||
// Prevent a reload due to entry modified signals
|
||||
m_entryModifiedTimer.stop();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user