From 0825937a3e6f84b6f72b70c7c9fa3662f9c92380 Mon Sep 17 00:00:00 2001 From: redPanther Date: Fri, 23 Dec 2016 19:37:35 +0100 Subject: [PATCH] move 'name' to new config section general. (#345) * move name to general add a version for config file * start impl. config migrator * fix typo amd set access level * fix schemaa name * fix schema * add structure for config migrator --- assets/webconfig/content/general.html | 15 + assets/webconfig/i18n/de.json | 8 +- assets/webconfig/i18n/en.json | 9 +- assets/webconfig/index.html | 1 + assets/webconfig/js/content_general.js | 21 + assets/webconfig/js/content_index.js | 3 +- config/hyperion.config.json.commented | 9 +- config/hyperion.config.json.default | 5 + include/hyperion/Hyperion.h | 4 + libsrc/hyperion/Hyperion.cpp | 3 + libsrc/hyperion/hyperion.schema.json | 1241 +--------------- libsrc/hyperion/resource.qrc | 2 + .../hyperion/schemas/hyperion.schema-1.json | 386 +++++ .../hyperion/schemas/hyperion.schema-2.json | 1266 +++++++++++++++++ libsrc/jsonserver/JsonClientConnection.cpp | 2 +- src/hyperiond/CMakeLists.txt | 9 +- src/hyperiond/configMigrator.cpp | 19 + src/hyperiond/configMigrator.h | 17 + src/hyperiond/hyperiond.cpp | 52 +- src/hyperiond/hyperiond.h | 5 +- test/TestConfigFile.cpp | 6 +- 21 files changed, 1822 insertions(+), 1261 deletions(-) create mode 100644 assets/webconfig/content/general.html create mode 100644 assets/webconfig/js/content_general.js create mode 100644 libsrc/hyperion/schemas/hyperion.schema-1.json create mode 100644 libsrc/hyperion/schemas/hyperion.schema-2.json create mode 100644 src/hyperiond/configMigrator.cpp create mode 100644 src/hyperiond/configMigrator.h diff --git a/assets/webconfig/content/general.html b/assets/webconfig/content/general.html new file mode 100644 index 00000000..e752ef65 --- /dev/null +++ b/assets/webconfig/content/general.html @@ -0,0 +1,15 @@ +
+
+
+ +
+

+
+
+
+ +
+
+
+ + diff --git a/assets/webconfig/i18n/de.json b/assets/webconfig/i18n/de.json index b44f4ee9..66face1a 100644 --- a/assets/webconfig/i18n/de.json +++ b/assets/webconfig/i18n/de.json @@ -47,6 +47,7 @@ "dashboard_alert_message_confedit" : "Deine Hyperion Konfiguration wurde verändert. Um die Änderungen anzuwenden, starte Hyperion neu.", "main_menu_dashboard_token" : "Dashboard", "main_menu_configuration_token" : "Konfiguration", + "main_menu_general_conf_token" : "Allgemein", "main_menu_leds_conf_token" : "LED Hardware", "main_menu_grabber_conf_token" : "Aufnahme Hardware", "main_menu_effect_conf_token" : "Effekte", @@ -60,7 +61,9 @@ "main_menu_system_token" : "System", "main_menu_input_selection_token" : "Eingabeauswahl", "main_menu_logging_token" : "Protokoll", - "main_menu_webconfig_token" : "Webkonfiguration", + "main_menu_webconfig_token" : "Web konfiguration", + "conf_general_label_title" : "All Einstellungen", + "conf_general_label_intro" : " ", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Erklärung", "conf_effects_label_intro" : "Stelle einen Effekt oder Farbe ein, der beim Starten sichtbar sein soll. Stelle einen Hintergrundeffekt/Farbe ein der erst sichtbar wird, wenn alle Bildquellen abgeschaltet sind (Das gilt ebenfalls für temporäres abschalten mithilfe der Kodi Überwachung).", @@ -206,11 +209,12 @@ "InfoDialog_lang_text" : "Sollte dir die Vorauswahl der automatischen Spracherkennung nicht gefallen, kannst du die Sprache hier manuell festlegen.", "InfoDialog_access_title" : "Zugriffsstufe", "InfoDialog_access_text" : "Abhängig von der Stufe hast du Zugriff auf mehr oder weniger Einstellungen. Empfohlen ist 'Standard'.", + "edt_general_heading_title" : "Allgemeine Einstellungen", + "edt_general_name_title" : "Name der Konfiguration", "InfoDialog_nowrite_title" : "Fehler beim Schreibzugriff!", "InfoDialog_nowrite_text" : "Hyperion hat keinen Schreibzugriff auf die aktuell geladene Konfiguration. Bitte korrigiere die Dateizugriffsrechte um fortzufahren.", "InfoDialog_nowrite_foottext" : "Die Webkonfiguration wird automatisch wieder freigegeben, sobald das Problem behoben wurde!", "edt_dev_general_heading_title" : "Allgemeine Einstellungen", - "edt_dev_general_name_title" : "Name der Konfiguration", "edt_dev_general_ledCount_title" : "Anzahl Hardware LEDs", "edt_dev_general_colorOrder_title" : "RGB Byte Reihenfolge", "edt_dev_general_rewriteTime_title" : "Aktualisierungszeit", diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 31365e5d..a8bbd8ad 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -47,6 +47,7 @@ "dashboard_alert_message_confedit" : "Your Hyperion configuration has been modified. To apply it, restart Hyperion.", "main_menu_dashboard_token" : "Dashboard", "main_menu_configuration_token" : "Configuration", + "main_menu_general_conf_token" : "General", "main_menu_leds_conf_token" : "LED Hardware", "main_menu_grabber_conf_token" : "Capturing Hardware", "main_menu_effect_conf_token" : "Effects", @@ -58,9 +59,11 @@ "main_menu_support_token" : "Support", "main_menu_update_token" : "Update", "main_menu_system_token" : "System", - "main_menu_input_selection_token" : "Eingabeauswahl", + "main_menu_input_selection_token" : "Input Selection", "main_menu_logging_token" : "Log", - "main_menu_webconfig_token" : "Webconfiguration", + "main_menu_webconfig_token" : "Web configuration", + "conf_general_label_title" : "General setings", + "conf_general_label_intro" : " ", "conf_helptable_option" : "Option", "conf_helptable_expl" : "Explanation", "conf_effects_label_intro" : "Setting up a booteffect/color that is visible after Hyperion startup. Configure a background effect/color which is active, when all capture sources are disabled (also temporarily via Kodi Watch)", @@ -206,6 +209,8 @@ "InfoDialog_lang_text" : "If you don't like the result of the automatic language detection you could overwrite it here.", "InfoDialog_access_title" : "Level setting", "InfoDialog_access_text" : "Depending on settings level you could change more or less settings. Recommended is the default level.", + "edt_general_heading_title" : "General Settings", + "edt_general_name_title" : "Configuration name", "InfoDialog_nowrite_title" : "write permission error!", "InfoDialog_nowrite_text" : "Hyperion can't write to your current loaded configuration file. Please repair the file permissions to proceed.", "InfoDialog_nowrite_foottext" : "The WebUI will be unlocked automatically after you solved the problem!", diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 9c8a38b9..c1975827 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -185,6 +185,7 @@
  • Configuration