prompt for restart after changing theme

This commit is contained in:
Le Tan 2019-04-05 10:30:09 +08:00
parent 18a8927efb
commit b33564726c
3 changed files with 19 additions and 2 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
VNote.pro.user
VNote.pro.user*
CMakeLists.txt.user

View File

@ -3127,9 +3127,11 @@ void VMainWindow::initThemeMenu(QMenu *p_menu)
QActionGroup *ag = new QActionGroup(this);
connect(ag, &QActionGroup::triggered,
this, [](QAction *p_action) {
this, [this](QAction *p_action) {
QString data = p_action->data().toString();
g_config->setTheme(data);
promptForVNoteRestart();
});
QList<QString> themes = g_config->getThemes();
@ -3585,3 +3587,16 @@ void VMainWindow::collectUserStat() const
});
}
void VMainWindow::promptForVNoteRestart()
{
int ret = VUtils::showMessage(QMessageBox::Information,
tr("Restart Needed"),
tr("Do you want to restart VNote now?"),
tr("VNote needs to restart to apply new configurations."),
QMessageBox::Ok | QMessageBox::No,
QMessageBox::Ok,
this);
if (ret == QMessageBox::Ok) {
restartVNote();
}
}

View File

@ -331,6 +331,8 @@ private:
void updateFontOfAllTabs();
void promptForVNoteRestart();
// Captain mode functions.
// Popup the attachment list if it is enabled.