add the notion of a "tip widget" for all option editor elements, allowing us to add...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Oct 2012 23:28:07 +0000 (23:28 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Oct 2012 23:28:07 +0000 (23:28 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@13236 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/option_editor.h
gtk2_ardour/rc_option_editor.cc
gtk2_ardour/search_path_option.h

index b896411a710226bb5ee7a00bf1ed371a25e0ae7c..3e64e4f125fff7c664847eedee3179b7b935ba75 100644 (file)
@@ -74,6 +74,8 @@ public:
 
        void set_note (std::string const &);
 
+        virtual Gtk::Widget& tip_widget() = 0;
+
 private:
        void maybe_add_note (OptionEditorPage *, int);
        
@@ -90,6 +92,8 @@ public:
        void set_state_from_config () {}
        void add_to_page (OptionEditorPage *);
 
+        Gtk::Widget& tip_widget() { return *_label; }
+
 private:
        Gtk::Label* _label; ///< the label used for the heading
 };
@@ -110,6 +114,8 @@ public:
        void set_state_from_config () = 0;
        void add_to_page (OptionEditorPage *);
 
+        Gtk::Widget& tip_widget() { return *_box->children().front().get_widget(); }
+
 protected:
 
        Gtk::VBox* _box; ///< constituent box for subclasses to add widgets to
@@ -163,6 +169,8 @@ public:
                _button->set_sensitive (yn);
        }
 
+        Gtk::Widget& tip_widget() { return *_button; }
+
 private:
 
        void toggled ();
@@ -181,6 +189,8 @@ public:
        void set_state_from_config ();
        void add_to_page (OptionEditorPage*);
 
+        Gtk::Widget& tip_widget() { return *_entry; }
+
 private:
 
        void activated ();
@@ -263,6 +273,8 @@ public:
                _combo->set_sensitive (yn);
        }
 
+        Gtk::Widget& tip_widget() { return *_combo; }
+
 private:
 
        sigc::slot<T> _get;
@@ -294,6 +306,8 @@ public:
        void changed ();
        void set_sensitive (bool);
 
+        Gtk::Widget& tip_widget() { return *_combo; }
+
 private:
 
        sigc::slot<bool> _get;
@@ -370,6 +384,8 @@ public:
                _set (static_cast<T> (_spin->get_value ()) * _scale);
        }
 
+        Gtk::Widget& tip_widget() { return *_spin; }
+
 private:
        sigc::slot<T> _get;
        sigc::slot<bool, T> _set;
@@ -387,6 +403,8 @@ public:
        void set_state_from_config ();
        void add_to_page (OptionEditorPage *);
 
+        Gtk::Widget& tip_widget() { return *_db_slider; }
+
 private:
        void db_changed ();
 
@@ -410,6 +428,8 @@ public:
        void add_to_page (OptionEditorPage *);
        void set_session (ARDOUR::Session *);
 
+        Gtk::Widget& tip_widget() { return _clock; }
+
 private:
        Gtk::Label _label;
        AudioClock _clock;
@@ -425,6 +445,8 @@ public:
        void set_state_from_config ();
        void add_to_page (OptionEditorPage *);
 
+        Gtk::Widget& tip_widget() { return _file_chooser; }
+
 private:
        void file_set ();
        void current_folder_set ();
index 466f0ba49bbdb071a722451c5d61d28341342151..9365f8eeddfab19fab2c048827e3374d2e24274e 100644 (file)
@@ -26,6 +26,7 @@
 #include <gtkmm/scale.h>
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/slider_controller.h>
+#include <gtkmm2ext/gtk_ui.h>
 
 #include "pbd/fpu.h"
 #include "pbd/cpus.h"
@@ -837,6 +838,8 @@ public:
                add_widget_to_page (p, _visibility_group->list_view ());
        }
 
+        Gtk::Widget& tip_widget() { return *_visibility_group->list_view (); }
+
 private:
        void changed ()
        {
@@ -1016,19 +1019,23 @@ RCOptionEditor::RCOptionEditor ()
 
        BoolOption* tsf = new BoolOption (
                     "timecode-sync-frame-rate",
-                    _("Force Ardour's timecode rate to match an external source"),
+                    _("Force Ardour's timecode rate to match an external timecode source"),
                     sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_sync_frame_rate),
                     sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_sync_frame_rate)
                     );
-       tsf->set_note (_("If off, slaving to timecode will cause Ardour to chase the external sync source\nbut it will use its own timecode frame rate"));
+       tsf->set_note (_("If off, slaving to timecode will cause Ardour to chase the external timecode\nsource but it will use its own timecode frame rate"));
        add_option (_("Transport"), tsf);
 
-       add_option (_("Transport"), new BoolOption (
-                           "timecode-source-is-synced",
-                           _("Timecode source shares sample clock with audio interface"),
-                           sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_source_is_synced),
-                           sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_source_is_synced)
-                           ));
+       tsf = new BoolOption (
+               "timecode-source-is-synced",
+               _("Timecode source shares sample clock with audio interface"),
+               sigc::mem_fun (*_rc_config, &RCConfiguration::get_timecode_source_is_synced),
+               sigc::mem_fun (*_rc_config, &RCConfiguration::set_timecode_source_is_synced)
+               );
+       Gtkmm2ext::UI::instance()->set_tip (tsf->tip_widget(), 
+                                   _("If on, Ardour will assume that the timecode source shares an external sync\nsource (Blackburst, Word Clock, etc.) with your audio interface."
+                                     "\nThis is a preferable configuration but may not match your equipment"));
+       add_option (_("Transport"), tsf);
 
        /* EDITOR */
 
index ca752be0120b28a365af38d888997ee1e83eb73f..f7cf9b5dcf8602551d450acf318ab3816d1078c2 100644 (file)
@@ -40,6 +40,8 @@ class SearchPathOption : public Option
         void add_to_page (OptionEditorPage*);
         void clear ();
 
+        Gtk::Widget& tip_widget() { return add_chooser; }
+
   protected:
        sigc::slot<std::string> _get; ///< slot to get the configuration variable's value
        sigc::slot<bool, std::string> _set;  ///< slot to set the configuration variable's value