forked from qt-creator/qt-creator
Modified IOptionsPage interface for Apply button
The previous interface wasn't sufficient to properly support the Apply button, since it didn't separate applying the changes from the cleanup phase. Designer settings pages still need some fixing. Fixes Apply button causing problems for certain plugins, for example the QuickOpen.
This commit is contained in:
@@ -435,13 +435,8 @@ void FontSettingsPage::delayedChange()
|
||||
emit changed(d_ptr->m_value);
|
||||
}
|
||||
|
||||
void FontSettingsPage::finished(bool accepted)
|
||||
void FontSettingsPage::apply()
|
||||
{
|
||||
if (!accepted) {
|
||||
d_ptr->m_value = d_ptr->m_lastValue;
|
||||
return;
|
||||
}
|
||||
|
||||
d_ptr->m_value.setFamily(d_ptr->ui.familyComboBox->currentText());
|
||||
|
||||
bool ok = true;
|
||||
@@ -460,6 +455,12 @@ void FontSettingsPage::finished(bool accepted)
|
||||
}
|
||||
}
|
||||
|
||||
void FontSettingsPage::finish()
|
||||
{
|
||||
// If changes were applied, these are equal. Otherwise restores last value.
|
||||
d_ptr->m_value = d_ptr->m_lastValue;
|
||||
}
|
||||
|
||||
const FontSettings &FontSettingsPage::fontSettings() const
|
||||
{
|
||||
return d_ptr->m_value;
|
||||
|
||||
Reference in New Issue
Block a user