UI: Added option to reset all settings

This commit is contained in:
Souryo 2017-05-19 00:34:10 -04:00
parent f573009aca
commit 1ff6747e63
11 changed files with 85 additions and 10 deletions

View File

@ -301,5 +301,13 @@ namespace Mesen.GUI.Config
{
_dirtyConfig = _config.Clone();
}
public static void ResetSettings()
{
_dirtyConfig = new Configuration();
Config.InitializeDefaults();
ApplyChanges();
Config.ApplyConfig();
}
}
}

View File

@ -23,6 +23,8 @@
<Message ID="RiskyOptionHint">(not recommended)</Message>
<Message ID="ResetSettingsConfirmation">Warning: This will reset ALL of settings and cannot be undone!&#xA;&#xA;Continue?</Message>
<Message ID="RandomGameNoGameFound">Mesen could not find any games to load.</Message>
<Message ID="CheatsFound">{0} games and {1} cheats in database</Message>

View File

@ -347,6 +347,7 @@
<Control ID="chkHidePauseOverlay">Hide the pause screen</Control>
<Control ID="chkDisplayMovieIcons">Display play/record icon when playing or recording a movie</Control>
<Control ID="btnOpenMesenFolder">Abrir el directorio de Mesen</Control>
<Control ID="btnResetSettings">Reset All Settings</Control>
<Control ID="tpgFileAssociations">Asociación de archivos</Control>
<Control ID="grpFileAssociations">Asociación de archivos</Control>
<Control ID="chkNesFormat">.NES</Control>
@ -562,6 +563,8 @@
<Message ID="RiskyOptionHint">(not recommended)</Message>
<Message ID="ResetSettingsConfirmation">Warning: This will reset ALL of settings and cannot be undone!&#xA;&#xA;Continue?</Message>
<Message ID="RandomGameNoGameFound">Mesen no puede encontrar ningún juego para cargar.</Message>
<Message ID="NsfNextTrack">Pista siguiente (Espera para jugar más rápido)</Message>

View File

@ -350,6 +350,7 @@
<Control ID="chkHidePauseOverlay">Ne pas afficher l'écran de pause</Control>
<Control ID="chkDisplayMovieIcons">Afficher un icône lors de la lecture ou de l'enregistrement des films</Control>
<Control ID="btnOpenMesenFolder">Ouvrir le dossier de Mesen</Control>
<Control ID="btnResetSettings">Réinitialiser la configuration</Control>
<Control ID="tpgFileAssociations">Associations de fichiers</Control>
<Control ID="grpFileAssociations">Associations de fichiers</Control>
<Control ID="chkNesFormat">.NES</Control>
@ -394,7 +395,6 @@
<Control ID="chkNsfMoveToNextTrackAfterTime">Limiter la durée des pistes à</Control>
<Control ID="lblNsfSeconds">secondes</Control>
<Control ID="chkNsfDisableApuIrqs">Désactiver les IRQs du APU (Recommandé)</Control>
<Control ID="btnOK">OK</Control>
<Control ID="btnCancel">Annuler</Control>
@ -574,6 +574,8 @@
<Message ID="RiskyOptionHint">(déconseillé)</Message>
<Message ID="ResetSettingsConfirmation">Avertissement: Cette opération va réinitialiser TOUTE la configuration de Mesen!&#xA;&#xA;Voulez-vous continuer?</Message>
<Message ID="RandomGameNoGameFound">Mesen n'a pas trouvé de jeu sur votre disque.</Message>
<Message ID="CheatsFound">{0} jeux et {1} codes présents dans la base de données</Message>

View File

@ -349,6 +349,7 @@
<Control ID="chkHidePauseOverlay">ポーズ画面を隠す</Control>
<Control ID="chkDisplayMovieIcons">動画の録画や再生の際、アイコンを表示する</Control>
<Control ID="btnOpenMesenFolder">Mesenのフォルダを開く</Control>
<Control ID="btnResetSettings">初期化</Control>
<Control ID="tpgFileAssociations">ファイルの関連付け</Control>
<Control ID="grpFileAssociations">ファイルの関連付け</Control>
<Control ID="chkNesFormat">.NES (ファミコン)</Control>
@ -556,6 +557,8 @@
<Message ID="RiskyOptionHint">(推奨されません)</Message>
<Message ID="ResetSettingsConfirmation">注意:全ての設定が初期化されます。&#xA;&#xA;よろしいですか?</Message>
<Message ID="RandomGameNoGameFound">Mesenはゲームファイルを見つかりませんでした。</Message>
<Message ID="CheatsFound">ゲーム{0}個とチートコード{1}個を見つけました</Message>

View File

@ -347,6 +347,7 @@
<Control ID="chkHidePauseOverlay">Hide the pause screen</Control>
<Control ID="chkDisplayMovieIcons">Display play/record icon when playing or recording a movie</Control>
<Control ID="btnOpenMesenFolder">Abrir a pasta de Mesen</Control>
<Control ID="btnResetSettings">Reset All Settings</Control>
<Control ID="tpgFileAssociations">Associação de arquivos</Control>
<Control ID="grpFileAssociations">Associação de arquivos</Control>
<Control ID="chkNesFormat">.NES</Control>
@ -562,6 +563,8 @@
<Message ID="RiskyOptionHint">(not recommended)</Message>
<Message ID="ResetSettingsConfirmation">Warning: This will reset ALL of settings and cannot be undone!&#xA;&#xA;Continue?</Message>
<Message ID="RandomGameNoGameFound">Mesen não encontrou nenhum jogo para carregar.</Message>
<Message ID="NsfNextTrack">Track seguinte (Esperar para jogar mais rápido)</Message>

View File

@ -349,6 +349,7 @@
<Control ID="chkHidePauseOverlay">Hide the pause screen</Control>
<Control ID="chkDisplayMovieIcons">Display play/record icon when playing or recording a movie</Control>
<Control ID="btnOpenMesenFolder">Открыть папку Mesen</Control>
<Control ID="btnResetSettings">Reset All Settings</Control>
<Control ID="tpgFileAssociations">Ассоциации файлов</Control>
<Control ID="grpFileAssociations">Ассоциации файлов</Control>
<Control ID="chkNesFormat">.NES</Control>
@ -564,6 +565,8 @@
<Message ID="RiskyOptionHint">(not recommended)</Message>
<Message ID="ResetSettingsConfirmation">Warning: This will reset ALL of settings and cannot be undone!&#xA;&#xA;Continue?</Message>
<Message ID="RandomGameNoGameFound">Mesen could not find any games to load.</Message>
<Message ID="CheatsFound">игр {0}, читов {1}</Message>

View File

@ -349,6 +349,7 @@
<Control ID="chkHidePauseOverlay">Приховати екран паузи</Control>
<Control ID="chkDisplayMovieIcons">Відображати значок відтворення/запису при відтворенні або запису відео</Control>
<Control ID="btnOpenMesenFolder">Відкрити папку Mesen</Control>
<Control ID="btnResetSettings">Reset All Settings</Control>
<Control ID="tpgFileAssociations">Асоціації файлів</Control>
<Control ID="grpFileAssociations">Асоціації файлів</Control>
<Control ID="chkNesFormat">.NES</Control>
@ -563,6 +564,8 @@
<Message ID="RiskyOptionHint">(не рекомендовано)</Message>
<Message ID="ResetSettingsConfirmation">Warning: This will reset ALL of settings and cannot be undone!&#xA;&#xA;Continue?</Message>
<Message ID="RandomGameNoGameFound">Mesen не зміг знайти будь-які ігри для завантаження.</Message>
<Message ID="CheatsFound">iгр {0}, читiв {1}</Message>

View File

@ -106,9 +106,11 @@ namespace Mesen.GUI.Forms.Config
this.nudRewindBufferSize = new System.Windows.Forms.NumericUpDown();
this.lblRewindMinutes = new System.Windows.Forms.Label();
this.chkFdsAutoInsertDisk = new System.Windows.Forms.CheckBox();
this.tmrSyncDateTime = new System.Windows.Forms.Timer(this.components);
this.chkShowGameTimer = new System.Windows.Forms.CheckBox();
this.chkShowFrameCounter = new System.Windows.Forms.CheckBox();
this.tmrSyncDateTime = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.btnResetSettings = new System.Windows.Forms.Button();
this.tlpMain.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.tabMain.SuspendLayout();
@ -140,6 +142,7 @@ namespace Mesen.GUI.Forms.Config
this.tableLayoutPanel1.SuspendLayout();
this.flowLayoutPanel6.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudRewindBufferSize)).BeginInit();
this.tableLayoutPanel5.SuspendLayout();
this.SuspendLayout();
//
// baseConfigPanel
@ -154,7 +157,6 @@ namespace Mesen.GUI.Forms.Config
this.tlpMain.Controls.Add(this.lblPauseBackgroundSettings, 0, 3);
this.tlpMain.Controls.Add(this.chkSingleInstance, 0, 2);
this.tlpMain.Controls.Add(this.chkAutomaticallyCheckForUpdates, 0, 1);
this.tlpMain.Controls.Add(this.btnOpenMesenFolder, 0, 13);
this.tlpMain.Controls.Add(this.flowLayoutPanel2, 0, 0);
this.tlpMain.Controls.Add(this.lblMiscSettings, 0, 8);
this.tlpMain.Controls.Add(this.chkAutoLoadIps, 0, 9);
@ -164,6 +166,7 @@ namespace Mesen.GUI.Forms.Config
this.tlpMain.Controls.Add(this.chkAllowBackgroundInput, 0, 7);
this.tlpMain.Controls.Add(this.chkPauseWhenInBackground, 0, 6);
this.tlpMain.Controls.Add(this.chkPauseOnMovieEnd, 0, 5);
this.tlpMain.Controls.Add(this.tableLayoutPanel5, 0, 13);
this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpMain.Location = new System.Drawing.Point(3, 3);
this.tlpMain.Name = "tlpMain";
@ -220,9 +223,9 @@ namespace Mesen.GUI.Forms.Config
// btnOpenMesenFolder
//
this.btnOpenMesenFolder.AutoSize = true;
this.btnOpenMesenFolder.Location = new System.Drawing.Point(3, 311);
this.btnOpenMesenFolder.Location = new System.Drawing.Point(3, 3);
this.btnOpenMesenFolder.Name = "btnOpenMesenFolder";
this.btnOpenMesenFolder.Size = new System.Drawing.Size(117, 23);
this.btnOpenMesenFolder.Size = new System.Drawing.Size(110, 23);
this.btnOpenMesenFolder.TabIndex = 16;
this.btnOpenMesenFolder.Text = "Open Mesen Folder";
this.btnOpenMesenFolder.UseVisualStyleBackColor = true;
@ -1080,11 +1083,6 @@ namespace Mesen.GUI.Forms.Config
this.chkFdsAutoInsertDisk.Text = "Automatically switch disks for FDS games";
this.chkFdsAutoInsertDisk.UseVisualStyleBackColor = true;
//
// tmrSyncDateTime
//
this.tmrSyncDateTime.Enabled = true;
this.tmrSyncDateTime.Tick += new System.EventHandler(this.tmrSyncDateTime_Tick);
//
// chkShowGameTimer
//
this.chkShowGameTimer.AutoSize = true;
@ -1105,6 +1103,39 @@ namespace Mesen.GUI.Forms.Config
this.chkShowFrameCounter.Text = "Show frame counter";
this.chkShowFrameCounter.UseVisualStyleBackColor = true;
//
// tmrSyncDateTime
//
this.tmrSyncDateTime.Enabled = true;
this.tmrSyncDateTime.Tick += new System.EventHandler(this.tmrSyncDateTime_Tick);
//
// tableLayoutPanel5
//
this.tableLayoutPanel5.ColumnCount = 3;
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel5.Controls.Add(this.btnOpenMesenFolder, 0, 0);
this.tableLayoutPanel5.Controls.Add(this.btnResetSettings, 2, 0);
this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel5.Location = new System.Drawing.Point(0, 308);
this.tableLayoutPanel5.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.tableLayoutPanel5.Name = "tableLayoutPanel5";
this.tableLayoutPanel5.RowCount = 1;
this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel5.Size = new System.Drawing.Size(473, 29);
this.tableLayoutPanel5.TabIndex = 24;
//
// btnResetSettings
//
this.btnResetSettings.AutoSize = true;
this.btnResetSettings.Location = new System.Drawing.Point(370, 3);
this.btnResetSettings.Name = "btnResetSettings";
this.btnResetSettings.Size = new System.Drawing.Size(100, 23);
this.btnResetSettings.TabIndex = 17;
this.btnResetSettings.Text = "Reset All Settings";
this.btnResetSettings.UseVisualStyleBackColor = true;
this.btnResetSettings.Click += new System.EventHandler(this.btnResetSettings_Click);
//
// frmPreferences
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1164,6 +1195,8 @@ namespace Mesen.GUI.Forms.Config
this.flowLayoutPanel6.ResumeLayout(false);
this.flowLayoutPanel6.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudRewindBufferSize)).EndInit();
this.tableLayoutPanel5.ResumeLayout(false);
this.tableLayoutPanel5.PerformLayout();
this.ResumeLayout(false);
}
@ -1248,5 +1281,7 @@ namespace Mesen.GUI.Forms.Config
private System.Windows.Forms.CheckBox chkFdsAutoInsertDisk;
private System.Windows.Forms.CheckBox chkShowGameTimer;
private System.Windows.Forms.CheckBox chkShowFrameCounter;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel5;
private System.Windows.Forms.Button btnResetSettings;
}
}

View File

@ -157,5 +157,13 @@ namespace Mesen.GUI.Forms.Config
nudAutoSave.Enabled = chkAutoSave.Checked;
chkAutoSaveNotify.Enabled = chkAutoSave.Checked;
}
private void btnResetSettings_Click(object sender, EventArgs e)
{
if(MesenMsgBox.Show("ResetSettingsConfirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) {
ConfigManager.ResetSettings();
this.Close();
}
}
}
}

View File

@ -1232,6 +1232,11 @@ namespace Mesen.GUI.Forms
InitializeFdsDiskMenu();
InitializeNsfMode(true);
ctrlRecentGames.UpdateGameInfo();
} else {
UpdateVideoSettings();
UpdateMenus();
UpdateRecentFiles();
UpdateViewerSize();
}
}