mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 01:06:27 -05:00
Display a Close button for history items.
Previously we had Ok and Cancel with the same action.
This commit is contained in:
parent
b9c9c56059
commit
f3d956ceed
@ -23,6 +23,7 @@ EditWidget::EditWidget(QWidget* parent)
|
||||
, m_ui(new Ui::EditWidget())
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
setReadOnly(false);
|
||||
|
||||
QFont headerLabelFont = m_ui->headerLabel->font();
|
||||
headerLabelFont.setBold(true);
|
||||
@ -68,3 +69,20 @@ QLabel* EditWidget::headlineLabel()
|
||||
{
|
||||
return m_ui->headerLabel;
|
||||
}
|
||||
|
||||
void EditWidget::setReadOnly(bool readOnly)
|
||||
{
|
||||
m_readOnly = readOnly;
|
||||
|
||||
if (readOnly) {
|
||||
m_ui->buttonBox->setStandardButtons(QDialogButtonBox::Close);
|
||||
}
|
||||
else {
|
||||
m_ui->buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditWidget::readOnly() const
|
||||
{
|
||||
return m_readOnly;
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
void setCurrentRow(int index);
|
||||
void setHeadline(const QString& text);
|
||||
QLabel* headlineLabel();
|
||||
void setReadOnly(bool readOnly);
|
||||
bool readOnly() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void accepted();
|
||||
@ -48,6 +50,7 @@ Q_SIGNALS:
|
||||
|
||||
private:
|
||||
const QScopedPointer<Ui::EditWidget> m_ui;
|
||||
bool m_readOnly;
|
||||
|
||||
Q_DISABLE_COPY(EditWidget)
|
||||
};
|
||||
|
@ -277,6 +277,7 @@ void EditEntryWidget::loadEntry(Entry* entry, bool create, bool history, const Q
|
||||
}
|
||||
|
||||
setForms(entry);
|
||||
setReadOnly(m_history);
|
||||
|
||||
setCurrentRow(0);
|
||||
setRowHidden(m_historyWidget, m_history);
|
||||
|
Loading…
Reference in New Issue
Block a user