fix #96766: Add a way to reset to factory settings from the UI

This commit is contained in:
lasconic 2016-02-03 22:20:45 +04:00
parent c857066909
commit cf44c208a4
2 changed files with 24 additions and 0 deletions

View file

@ -982,6 +982,8 @@ MuseScore::MuseScore()
menuHelp->addSeparator();
menuHelp->addAction(getAction("resource-manager"));
menuHelp->addSeparator();
menuHelp->addAction(tr("Revert to factory settings"), this, SLOT(resetAndRestart()));
//accessibility for menus
foreach (QMenu* menu, mb->findChildren<QMenu*>()) {
@ -1106,6 +1108,26 @@ void MuseScore::helpBrowser1() const
QDesktopServices::openUrl(QUrl(help));
}
//---------------------------------------------------------
// resetAndRestart
//---------------------------------------------------------
void MuseScore::resetAndRestart()
{
int ret = QMessageBox::question(0, tr("Are you sure?"),
tr("This will reset all your preferences.\n"
"Custom palettes, custom shortcuts, and the list of recent scores will be deleted. "
"MuseScore will restart with its default settings.\n"
"Reverting will not remove any scores from your computer.\n"
"Are you sure you want to proceed?"),
QMessageBox::Yes|QMessageBox::No, QMessageBox::NoButton);
if (ret == QMessageBox::Yes ) {
close();
QStringList args("-F");
QProcess::startDetached(qApp->arguments()[0], args);
}
}
//---------------------------------------------------------
// aboutQt
//---------------------------------------------------------
@ -4789,6 +4811,7 @@ int main(int argc, char* av[])
QSettings settings;
QFile::remove(settings.fileName() + ".lock"); //forcibly remove lock
QFile::remove(settings.fileName());
settings.clear();
}
// create local plugin directory

View file

@ -423,6 +423,7 @@ class MuseScore : public QMainWindow, public MuseScoreCore {
void cmd(QAction* a, const QString& cmd);
void autoSaveTimerTimeout();
void helpBrowser1() const;
void resetAndRestart();
void about();
void aboutQt();
void aboutMusicXML();