mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-09-22 05:44:46 -04:00
Improve attachment handling when changes are discarded
This change avoids a situation where the open file has changed or an entry in the application has changed (possibly to be implemented in the future) and when you open that entry the editor shows you outdated data. * Fixes bug from previous attachments preview commit * Fix logic error when creating new attachment
This commit is contained in:
parent
046cb9bd70
commit
5ee5e4998a
4 changed files with 33 additions and 16 deletions
|
@ -33,9 +33,7 @@ NewEntryAttachmentsDialog::NewEntryAttachmentsDialog(QPointer<EntryAttachments>
|
|||
|
||||
setWindowTitle(tr("New entry attachment"));
|
||||
|
||||
m_ui->dialogButtons->clear();
|
||||
m_ui->dialogButtons->addButton(QDialogButtonBox::Ok);
|
||||
m_ui->dialogButtons->addButton(QDialogButtonBox::Cancel);
|
||||
m_ui->dialogButtons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
connect(m_ui->dialogButtons, SIGNAL(accepted()), this, SLOT(saveAttachment()));
|
||||
connect(m_ui->dialogButtons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
@ -67,7 +65,7 @@ void NewEntryAttachmentsDialog::saveAttachment()
|
|||
auto text = m_ui->attachmentTextEdit->toPlainText().toUtf8();
|
||||
|
||||
QString error;
|
||||
if (validateFileName(fileName, error)) {
|
||||
if (!validateFileName(fileName, error)) {
|
||||
QMessageBox::warning(this, tr("Save attachment"), error);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
DatabaseWidget:!active,
|
||||
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
|
||||
EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active,
|
||||
EntryPreviewWidget TagsEdit:!active, QStatusBar:!active {
|
||||
EntryPreviewWidget *:!active[blendIn="true"], QStatusBar:!active {
|
||||
background-color: #404042;
|
||||
}
|
||||
|
||||
DatabaseWidget:disabled,
|
||||
DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled,
|
||||
EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled,
|
||||
EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled {
|
||||
EntryPreviewWidget *:disabled[blendIn="true"], QStatusBar:disabled {
|
||||
background-color: #424242;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
DatabaseWidget:!active,
|
||||
DatabaseWidget #groupView:!active, DatabaseWidget #tagView:!active,
|
||||
EntryPreviewWidget QLineEdit:!active, EntryPreviewWidget QTextEdit:!active,
|
||||
EntryPreviewWidget TagsEdit:!active, QStatusBar:!active {
|
||||
EntryPreviewWidget *:!active[blendIn="true"], QStatusBar:!active {
|
||||
background-color: #FCFCFC;
|
||||
}
|
||||
|
||||
DatabaseWidget:disabled,
|
||||
DatabaseWidget #groupView:disabled, DatabaseWidget #tagView:disabled,
|
||||
EntryPreviewWidget QLineEdit:disabled, EntryPreviewWidget QTextEdit:disabled,
|
||||
EntryPreviewWidget TagsEdit:disabled, QStatusBar:disabled {
|
||||
EntryPreviewWidget *:disabled[blendIn="true"], QStatusBar:disabled {
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue