Display a Close button for history items.

Previously we had Ok and Cancel with the same action.
This commit is contained in:
Felix Geyer 2015-05-03 18:59:19 +02:00
parent b9c9c56059
commit f3d956ceed
3 changed files with 22 additions and 0 deletions

View file

@ -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;
}