ViewPropertiesDialog: disable Apply button on startup

We call `markAsDirty(false)` at the end of `loadSettings()` but that's
not enough, because `m_isDirty` is initialized to false (as it should be).
This means `isDirtyChanged` is not emitted and the button is not disabled.

By disabling it explicitly, we make it consistent with the Apply button
in the settings dialog (which is also initially disabled).
This commit is contained in:
Elvis Angelaccio 2018-06-13 23:16:33 +02:00
parent 615838083d
commit 32b8b19ba5

View file

@ -196,6 +196,7 @@ ViewPropertiesDialog::ViewPropertiesDialog(DolphinView* dolphinView) :
okButton->setDefault(true);
auto applyButton = buttonBox->button(QDialogButtonBox::Apply);
applyButton->setEnabled(false);
connect(applyButton, &QPushButton::clicked, this, &ViewPropertiesDialog::slotApply);
connect(this, &ViewPropertiesDialog::isDirtyChanged, applyButton, [applyButton](bool isDirty) {
applyButton->setEnabled(isDirty);