summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-10-10 23:28:07 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-10-10 23:28:07 +0000
commit1a530550196050dfe4a67732965ae3ddc3e1b077 (patch)
treef2f7692e22eb276673541cc4901733f55a78d3a4
parent71b7326576c773a14300fad7564c4f24d9c23c04 (diff)
add the notion of a "tip widget" for all option editor elements, allowing us to add tooltips to each item; add one such proto-tool-tip
git-svn-id: svn://localhost/ardour2/branches/3.0@13236 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/option_editor.h22
-rw-r--r--gtk2_ardour/rc_option_editor.cc23
-rw-r--r--gtk2_ardour/search_path_option.h2
3 files changed, 39 insertions, 8 deletions
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index b896411a71..3e64e4f125 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -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 ();
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index 466f0ba49b..9365f8eedd 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -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 */
diff --git a/gtk2_ardour/search_path_option.h b/gtk2_ardour/search_path_option.h
index ca752be012..f7cf9b5dcf 100644
--- a/gtk2_ardour/search_path_option.h
+++ b/gtk2_ardour/search_path_option.h
@@ -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