From 7a6fd4bb1e7aa48c73eb4b0c9a6de817b03ff496 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 7 Oct 2013 17:43:53 -0700 Subject: [PATCH] Make saving transient UI state in the file optional It significantly increases the amount of noise when tracking subtitle files in source control. Closes #1535. --- aegisub/src/ass_file.cpp | 3 ++- aegisub/src/libresrc/default_config.json | 1 + aegisub/src/libresrc/osx/default_config.json | 1 + aegisub/src/preferences.cpp | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 59605822f..5c3e723d1 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -148,7 +148,8 @@ int AssFile::GetUIStateAsInt(std::string const& key) const { } void AssFile::SaveUIState(std::string const& key, std::string const& value) { - SetScriptInfo("Aegisub " + key, value); + if (OPT_GET("App/Save UI State")->GetBool()) + SetScriptInfo("Aegisub " + key, value); } void AssFile::SetScriptInfo(std::string const& key, std::string const& value) { diff --git a/aegisub/src/libresrc/default_config.json b/aegisub/src/libresrc/default_config.json index 2fbd8df57..13231d9cb 100644 --- a/aegisub/src/libresrc/default_config.json +++ b/aegisub/src/libresrc/default_config.json @@ -14,6 +14,7 @@ "Language" : "", "Maximized" : false, "Save Charset" : "UTF-8", + "Save UI State" : true, "Show Toolbar" : true, "Toolbar Icon Size" : 16 }, diff --git a/aegisub/src/libresrc/osx/default_config.json b/aegisub/src/libresrc/osx/default_config.json index ad2dc1032..45ab217d3 100644 --- a/aegisub/src/libresrc/osx/default_config.json +++ b/aegisub/src/libresrc/osx/default_config.json @@ -14,6 +14,7 @@ "Language" : "", "Maximized" : false, "Save Charset" : "UTF-8", + "Save UI State" : true, "Show Toolbar" : true, "Toolbar Icon Size" : 16 }, diff --git a/aegisub/src/preferences.cpp b/aegisub/src/preferences.cpp index bd8368bbd..5b76c45de 100644 --- a/aegisub/src/preferences.cpp +++ b/aegisub/src/preferences.cpp @@ -93,6 +93,8 @@ General::General(wxTreebook *book, Preferences *parent): OptionPage(book, parent wxFlexGridSizer *general = PageSizer(_("General")); OptionAdd(general, _("Check for updates on startup"), "App/Auto/Check For Updates"); OptionAdd(general, _("Show main toolbar"), "App/Show Toolbar"); + OptionAdd(general, _("Save UI state in subtitles files"), "App/Save UI State"); + CellSkip(general); OptionAdd(general, _("Toolbar Icon Size"), "App/Toolbar Icon Size"); wxString autoload_modes[] = { _("Never"), _("Always"), _("Ask") };