mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 05:49:53 +08:00
SettingsDialog: finer grain restart prompt
This commit is contained in:
parent
1ca899d8ab
commit
cc8ee46efe
@ -13,9 +13,9 @@ IUnitedEntry::IUnitedEntry(const QString &p_name,
|
||||
const UnitedEntryMgr *p_mgr,
|
||||
QObject *p_parent)
|
||||
: QObject(p_parent),
|
||||
m_mgr(p_mgr),
|
||||
m_name(p_name),
|
||||
m_description(p_description),
|
||||
m_mgr(p_mgr)
|
||||
m_description(p_description)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ void AppearancePage::setupUI()
|
||||
mainLayout->addRow(m_systemTitleBarCheckBox);
|
||||
addSearchItem(label, m_systemTitleBarCheckBox->toolTip(), m_systemTitleBarCheckBox);
|
||||
connect(m_systemTitleBarCheckBox, &QCheckBox::stateChanged,
|
||||
this, &AppearancePage::pageIsChanged);
|
||||
this, &AppearancePage::pageIsChangedWithRestartNeeded);
|
||||
}
|
||||
|
||||
{
|
||||
@ -49,7 +49,7 @@ void AppearancePage::setupUI()
|
||||
mainLayout->addRow(label, m_toolBarIconSizeSpinBox);
|
||||
addSearchItem(label, m_toolBarIconSizeSpinBox->toolTip(), m_toolBarIconSizeSpinBox);
|
||||
connect(m_toolBarIconSizeSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
|
||||
this, &AppearancePage::pageIsChanged);
|
||||
this, &AppearancePage::pageIsChangedWithRestartNeeded);
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -37,7 +37,7 @@ void GeneralPage::setupUI()
|
||||
mainLayout->addRow(label, m_localeComboBox);
|
||||
addSearchItem(label, m_localeComboBox->toolTip(), m_localeComboBox);
|
||||
connect(m_localeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GeneralPage::pageIsChanged);
|
||||
this, &GeneralPage::pageIsChangedWithRestartNeeded);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
@ -54,7 +54,7 @@ void GeneralPage::setupUI()
|
||||
mainLayout->addRow(label, m_openGLComboBox);
|
||||
addSearchItem(label, m_openGLComboBox->toolTip(), m_openGLComboBox);
|
||||
connect(m_openGLComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GeneralPage::pageIsChanged);
|
||||
this, &GeneralPage::pageIsChangedWithRestartNeeded);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -64,10 +64,18 @@ void SettingsPage::pageIsChanged()
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void SettingsPage::pageIsChangedWithRestartNeeded()
|
||||
{
|
||||
m_changed = true;
|
||||
m_restartNeeded = true;
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void SettingsPage::load()
|
||||
{
|
||||
loadInternal();
|
||||
m_changed = false;
|
||||
m_restartNeeded = false;
|
||||
}
|
||||
|
||||
bool SettingsPage::save()
|
||||
@ -78,8 +86,6 @@ bool SettingsPage::save()
|
||||
|
||||
if (saveInternal()) {
|
||||
m_changed = false;
|
||||
// TODO: may need finer-grain check.
|
||||
m_restartNeeded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,8 @@ namespace vnotex
|
||||
protected slots:
|
||||
void pageIsChanged();
|
||||
|
||||
void pageIsChangedWithRestartNeeded();
|
||||
|
||||
private:
|
||||
struct SearchItem
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ void ThemePage::setupUI()
|
||||
this, [this](QListWidgetItem *p_current, QListWidgetItem *p_previous) {
|
||||
Q_UNUSED(p_previous);
|
||||
loadThemePreview(p_current ? p_current->data(Qt::UserRole).toString() : QString());
|
||||
pageIsChanged();
|
||||
pageIsChangedWithRestartNeeded();
|
||||
});
|
||||
|
||||
auto refreshBtn = new QPushButton(tr("Refresh"), this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user