forked from qt-creator/qt-creator
Fixes: Use apply()/finish() of Designer settings page interface
RevBy: Thorbjorn
This commit is contained in:
@@ -39,8 +39,7 @@
|
|||||||
using namespace Designer::Internal;
|
using namespace Designer::Internal;
|
||||||
|
|
||||||
SettingsPage::SettingsPage(QDesignerOptionsPageInterface *designerPage) :
|
SettingsPage::SettingsPage(QDesignerOptionsPageInterface *designerPage) :
|
||||||
m_designerPage(designerPage),
|
m_designerPage(designerPage)
|
||||||
m_applyOnFinish(false)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,17 +64,15 @@ QString SettingsPage::trCategory() const
|
|||||||
|
|
||||||
QWidget *SettingsPage::createPage(QWidget *parent)
|
QWidget *SettingsPage::createPage(QWidget *parent)
|
||||||
{
|
{
|
||||||
m_applyOnFinish = false;
|
|
||||||
return m_designerPage->createPage(parent);
|
return m_designerPage->createPage(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsPage::apply()
|
void SettingsPage::apply()
|
||||||
{
|
{
|
||||||
// FIXME: Since no cleanup should be done here, we can't call finish(true)
|
m_designerPage->apply();
|
||||||
m_applyOnFinish = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsPage::finish()
|
void SettingsPage::finish()
|
||||||
{
|
{
|
||||||
m_designerPage->finish(m_applyOnFinish);
|
m_designerPage->finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,13 +58,12 @@ public:
|
|||||||
QString category() const;
|
QString category() const;
|
||||||
QString trCategory() const;
|
QString trCategory() const;
|
||||||
|
|
||||||
QWidget *createPage(QWidget *parent);
|
virtual QWidget *createPage(QWidget *parent);
|
||||||
void apply();
|
virtual void apply();
|
||||||
void finish();
|
virtual void finish();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDesignerOptionsPageInterface *m_designerPage;
|
QDesignerOptionsPageInterface *m_designerPage;
|
||||||
bool m_applyOnFinish;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
Reference in New Issue
Block a user