add tooltips to editor region list, but so that it doesn't mark carl grimmace
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 2 Dec 2011 13:29:11 +0000 (13:29 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 2 Dec 2011 13:29:11 +0000 (13:29 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10858 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_regions.cc

index ae9c48cc3a871f8af6752ff59604cb866845fd20..cfc56a30823c0dc7d8bf8dbc65dd2306b6990cc4 100644 (file)
@@ -59,6 +59,12 @@ using namespace Glib;
 using namespace Editing;
 using Gtkmm2ext::Keyboard;
 
+struct ColumnInfo {
+    int         index;
+    const char* label;
+    const char* tooltip;
+};
+
 EditorRegions::EditorRegions (Editor* e)
        : EditorComponent (e)
        , old_focus (0)
@@ -101,64 +107,29 @@ EditorRegions::EditorRegions (Editor* e)
        TreeViewColumn* col;
        Gtk::Label* l;
 
-       col = _display.get_column (0);
-       l = manage (new Label (_("Regions")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region name, with number of channels in []'s"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (1);
-       l = manage (new Label(_("Position")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Length of the region"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (2);
-       l = manage (new Label(_("End")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Length of the region"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (3);
-       l = manage (new Label(_("End")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Length of the region"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (4);
-       l = manage (new Label(_("Sync")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Position of region sync point, relative to start of the region"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (5);
-       l = manage (new Label(_("Sync")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region fade-in enabled?"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (6);
-       l = manage (new Label(_("Fade In")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region fade-out enabled?"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (7);
-       l = manage (new Label(_("L")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region position locked?"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (8);
-       l = manage (new Label(_("G")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region position glued to Bars|Beats time?"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (9);
-       l = manage (new Label(_("M")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region muted?"));
-       col->set_widget (*l);
-       l->show ();
-       col = _display.get_column (10);
-       l = manage (new Label(_("O")));
-       ARDOUR_UI::instance()->set_tip (*l, _("Region opaque (blocks regions below it from being heard)?"));
-       col->set_widget (*l);
-       l->show ();
-
-       // _display.append_column (_("Used"), _columns.used);
-       // _display.append_column (_("Path"), _columns.path);
+       ColumnInfo ci[] = {
+               { 0, _("Region"), _("Region name, with number of channels in []'s") },
+               { 1, _("Position"),  _("Length of the region") },
+               { 2, _("End"),  _("Length of the region") },
+               { 3, _("End"),  _("Length of the region") },
+               { 4, _("Sync"),  _("Position of region sync point, relative to start of the region") },
+               { 5, _("Sync"),  _("Region fade-in enabled?") },
+               { 6, _("Fade In"),  _("Region fade-out enabled?") },
+               { 7, _("L"),  _("Region position locked?") },
+               { 8, _("G"),  _("Region position glued to Bars|Beats time?") },
+               { 9, _("M"),  _("Region muted?") },
+               { 10, _("O"),  _("Region opaque (blocks regions below it from being heard)?") },
+               { -1, 0, 0 }
+       };
+       
+       for (int i = 0; ci[i].index >= 0; ++i) {
+               col = _display.get_column (ci[i].index);
+               l = manage (new Label (ci[i].label));
+               ARDOUR_UI::instance()->set_tip (*l, ci[i].tooltip);
+               col->set_widget (*l);
+               l->show ();
+       }
+
        _display.set_headers_visible (true);
        //_display.set_grid_lines (TREE_VIEW_GRID_LINES_BOTH);