Skip to content

Commit

Permalink
fix #96766: Add a way to reset to factory settings from the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
lasconic committed Feb 3, 2016
1 parent 9a84346 commit c6efd2f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions mscore/musescore.cpp
Expand Up @@ -980,6 +980,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*>()) {
Expand Down Expand Up @@ -1104,6 +1106,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
//---------------------------------------------------------
Expand Down Expand Up @@ -4770,6 +4792,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
Expand Down
1 change: 1 addition & 0 deletions mscore/musescore.h
Expand Up @@ -422,6 +422,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();
Expand Down

0 comments on commit c6efd2f

Please sign in to comment.