From d094619004d17f2338f7eab21b5a0426f8ce088b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 9 May 2019 00:05:58 +0200 Subject: [PATCH] moviebrowser: add interim message while reset to default settings It's not always a good idea to reset all mb settings. From own experience it is often not wanted and irritatingly when storage settings will be lost. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9f03c1d316d772db1e1bb36a1ef79c22b4508c9 Author: Thilo Graf Date: 2019-05-09 (Thu, 09 May 2019) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 12 ++++++++++++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 16 insertions(+) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f01725fd9..bb36327d8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2035,6 +2035,7 @@ moviebrowser.menu_save Veränderungen speichern moviebrowser.menu_save_all Starte Übernahme in allen sichtbaren Filminfos moviebrowser.menu_settings Einstellungen moviebrowser.menu_truncate Film kürzen +moviebrowser.message_keep_storage_settings Sollen die Depot-Einstellungen für verwendete und aktivierte Verzeichnisse beibehalten werden? moviebrowser.option_browser Anzeigeoptionen moviebrowser.reload_at_start Filminfos neu laden bei Start moviebrowser.remount_at_start Filmdepot verbinden bei Start diff --git a/data/locale/english.locale b/data/locale/english.locale index fbdefe22a..08f18760a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2035,6 +2035,7 @@ moviebrowser.menu_save Save changes moviebrowser.menu_save_all Start update of movie info files moviebrowser.menu_settings Settings moviebrowser.menu_truncate Truncate movie +moviebrowser.message_keep_storage_settings Do You want to keep storage settings for used and enabled directories? moviebrowser.option_browser Browser Options moviebrowser.reload_at_start Reload movie info at start moviebrowser.remount_at_start Remount at start diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 0d18c8d7d..4554ffb26 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -605,9 +605,21 @@ void CMovieBrowser::initRows(void) void CMovieBrowser::defaultSettings(MB_SETTINGS* /*settings*/) { + MBStorageSettings tmp_store; + bool keep = false; + + if (ShowMsg(LOCALE_MOVIEBROWSER_LOAD_DEFAULT, LOCALE_MOVIEBROWSER_MESSAGE_KEEP_STORAGE_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_QUESTION) == CMsgBox::mbrYes) + { + tmp_store = m_settings.store; + keep = true; + } + unlink(MOVIEBROWSER_SETTINGS_FILE); configfile.clear(); initGlobalSettings(); + + if (keep) + m_settings.store = tmp_store; } bool CMovieBrowser::loadSettings(MB_SETTINGS* settings) diff --git a/src/system/locals.h b/src/system/locals.h index f1b7d0b2a..3cd3885fe 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2062,6 +2062,7 @@ typedef enum LOCALE_MOVIEBROWSER_MENU_SAVE_ALL, LOCALE_MOVIEBROWSER_MENU_SETTINGS, LOCALE_MOVIEBROWSER_MENU_TRUNCATE, + LOCALE_MOVIEBROWSER_MESSAGE_KEEP_STORAGE_SETTINGS, LOCALE_MOVIEBROWSER_OPTION_BROWSER, LOCALE_MOVIEBROWSER_RELOAD_AT_START, LOCALE_MOVIEBROWSER_REMOUNT_AT_START, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 98d7edbc5..8aa2d0e83 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2062,6 +2062,7 @@ const char * locale_real_names[] = "moviebrowser.menu_save_all", "moviebrowser.menu_settings", "moviebrowser.menu_truncate", + "moviebrowser.message_keep_storage_settings", "moviebrowser.option_browser", "moviebrowser.reload_at_start", "moviebrowser.remount_at_start",