Add Locale config preferences and rearrange UI prefs
authorRobin Gareus <robin@gareus.org>
Wed, 28 Dec 2016 12:38:35 +0000 (13:38 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 28 Dec 2016 12:38:49 +0000 (13:38 +0100)
gtk2_ardour/option_editor.cc
gtk2_ardour/option_editor.h
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/rc_option_editor.h

index f34bab1b2be40abf7d53f9b3aec56c82135a0dd2..1317d166c4f2fed56b91d02a09e65e5caeaa79c0 100644 (file)
@@ -103,9 +103,15 @@ OptionEditorHeading::add_to_page (OptionEditorPage* p)
 {
        int const n = p->table.property_n_rows();
        p->table.resize (n + 2, 3);
+       if (!_note.empty ()) {
+               p->table.resize (n + 3, 3);
+       } else {
+               p->table.resize (n + 2, 3);
+       }
 
        p->table.attach (*manage (new Label ("")), 0, 3, n, n + 1, FILL | EXPAND);
        p->table.attach (*_label, 0, 3, n + 1, n + 2, FILL | EXPAND);
+       maybe_add_note (p, n + 2);
 }
 
 void
index b5d44d577ca048d3b94fb44cc8ddda13bb0c1fdd..e32c489f27694fe20d5de440ee2da8df5243344d 100644 (file)
@@ -79,7 +79,7 @@ public:
 
         virtual Gtk::Widget& tip_widget() = 0;
 
-private:
+protected:
        void maybe_add_note (OptionEditorPage *, int);
 
        std::string _note;
index db6699e9addba4bb78660ed9d3710cda1e5e5d3e..574933738f53530f2d0cf44a1cbe92a517590214 100644 (file)
@@ -3116,30 +3116,6 @@ if (!ARDOUR::Profile->get_mixbus()) {
 
        add_option (_("MIDI"), audition_synth);
 
-       /* USER INTERACTION */
-
-       if (
-#ifdef PLATFORM_WINDOWS
-                       true
-#else
-                       getenv ("ARDOUR_BUNDLED")
-#endif
-          )
-       {
-               add_option (_("User interaction"),
-                           new BoolOption (
-                                   "enable-translation",
-                                   string_compose (_("Use translations of %1 messages\n"
-                                                     "   <i>(requires a restart of %1 to take effect)</i>\n"
-                                                     "   <i>(if available for your language preferences)</i>"), PROGRAM_NAME),
-                                   sigc::ptr_fun (ARDOUR::translations_are_enabled),
-                                   sigc::ptr_fun (ARDOUR::set_translations_enabled)));
-       }
-
-       add_option (_("User interaction"), new OptionEditorHeading (_("Keyboard")));
-
-       add_option (_("User interaction"), new KeyboardOptions);
-
        /* Control Surfaces */
 
        add_option (_("Control Surfaces"), new ControlSurfacesOptions);
@@ -3479,6 +3455,40 @@ if (!ARDOUR::Profile->get_mixbus()) {
                     sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_default_narrow_ms)
                     ));
 
+#ifdef ENABLE_NLS
+       OptionEditorHeading* i18n_head = new OptionEditorHeading (_("Internationalization"));
+       i18n_head->set_note (string_compose (_("These settings will only take effect after %1 is restarted (if available for your language preferences)."), PROGRAM_NAME));
+
+       add_option (_("GUI/Translation"), i18n_head);
+
+       bo = new BoolOption (
+                       "enable-translation",
+                       _("Use translations"),
+                       sigc::ptr_fun (ARDOUR::translations_are_enabled),
+                       sigc::ptr_fun (ARDOUR::set_translations_enabled)
+                       );
+
+       add_option (_("GUI/Translation"), bo);
+
+       _l10n = new ComboOption<ARDOUR::LocaleMode> (
+               "locale-mode",
+               _("Localization"),
+               sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_locale_mode),
+               sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_locale_mode)
+               );
+
+       _l10n->add (ARDOUR::SET_LC_ALL, _("Set complete locale"));
+       _l10n->add (ARDOUR::SET_LC_MESSAGES, _("Enable only message translation"));
+       _l10n->add (ARDOUR::SET_LC_MESSAGES_AND_LC_NUMERIC, _("Translate messages and format numeric format"));
+       _l10n->set_note (_("This setting is provided for plugin compatibility. e.g. some plugins on some systems expect the decimal point to be a dot."));
+
+       add_option (_("GUI/Translation"), _l10n);
+       parameter_changed ("enable-translation");
+#endif // ENABLE_NLS
+
+       add_option (_("GUI/Keyboard"), new OptionEditorHeading (_("Keyboard")));
+       add_option (_("GUI/Keyboard"), new KeyboardOptions);
+
        add_option (_("GUI/Toolbar"), new OptionEditorHeading (_("Main Transport Items")));
 
        add_option (_("GUI/Toolbar"),
@@ -3763,6 +3773,10 @@ RCOptionEditor::parameter_changed (string const & p)
        } else if (p == "open-gui-after-adding-plugin" || p == "show-inline-display-by-default") {
 #if (defined LV2_SUPPORT && defined LV2_EXTENDED)
                _plugin_prefer_inline->set_sensitive (UIConfiguration::instance().get_open_gui_after_adding_plugin() && UIConfiguration::instance().get_show_inline_display_by_default());
+#endif
+#ifdef ENABLE_NLS
+       } else if (p == "enable-translation") {
+               _l10n->set_sensitive (ARDOUR::translations_are_enabled ());
 #endif
        }
 }
index d6c5bed4a7f4744cc4125691b9be4632fec13640..e0d0116c36da204b0c40fad46468e8df1c88b4ec 100644 (file)
@@ -60,6 +60,7 @@ private:
        Gtk::Adjustment* _ltc_volume_adjustment;
        BoolOption* _ltc_send_continuously;
        BoolOption* _plugin_prefer_inline;
+       ComboOption<ARDOUR::LocaleMode>* _l10n;
 
        PBD::ScopedConnection parameter_change_connection;
        PBD::ScopedConnection engine_started_connection;