diff options
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/selector.h | 16 | ||||
-rw-r--r-- | libs/gtkmm2ext/selector.cc | 17 | ||||
-rw-r--r-- | libs/pbd3/pbd/compose.h | 6 |
3 files changed, 22 insertions, 17 deletions
diff --git a/libs/gtkmm2ext/gtkmm2ext/selector.h b/libs/gtkmm2ext/gtkmm2ext/selector.h index f84c85cb4c..9eb07cfbfe 100644 --- a/libs/gtkmm2ext/gtkmm2ext/selector.h +++ b/libs/gtkmm2ext/gtkmm2ext/selector.h @@ -55,13 +55,21 @@ public: tview.columns_autosize (); } + struct Result { + Gtk::TreeView& view; + Glib::RefPtr<Gtk::TreeSelection> selection; + + Result (Gtk::TreeView& v, Glib::RefPtr<Gtk::TreeSelection> sel) + : view (v), selection (sel) {} + }; + /* selection is activated via a double click, choice via a single click. */ - sigc::signal<void,Gtk::TreeView&, Glib::RefPtr<Gtk::TreeSelection> > selection_made; - sigc::signal<void,Gtk::TreeView&, Glib::RefPtr<Gtk::TreeSelection> > choice_made; - sigc::signal<void,Gtk::TreeView&, Glib::RefPtr<Gtk::TreeSelection> > shift_made; - sigc::signal<void,Gtk::TreeView&, Glib::RefPtr<Gtk::TreeSelection> > control_made; + sigc::signal<void,Result*> selection_made; + sigc::signal<void,Result*> choice_made; + sigc::signal<void,Result*> shift_made; + sigc::signal<void,Result*> control_made; sigc::signal<void> update_contents; diff --git a/libs/gtkmm2ext/selector.cc b/libs/gtkmm2ext/selector.cc index 371c946fe7..00db129d6b 100644 --- a/libs/gtkmm2ext/selector.cc +++ b/libs/gtkmm2ext/selector.cc @@ -143,7 +143,8 @@ Selector::accept () Gtk::TreeModel::iterator iter = tree_sel->get_selected(); if (iter) { - selection_made (tview, tree_sel); + + selection_made (new Result (tview, tree_sel)); } else { cancel (); } @@ -151,13 +152,12 @@ Selector::accept () void Selector::chosen () - { Glib::RefPtr<Gtk::TreeSelection> tree_sel = tview.get_selection(); Gtk::TreeModel::iterator iter = tree_sel->get_selected(); - + if (iter) { - choice_made (tview, tree_sel); + choice_made (new Result (tview, tree_sel)); } else { cancel (); } @@ -165,13 +165,12 @@ Selector::chosen () void Selector::shift_clicked () - { Glib::RefPtr<Gtk::TreeSelection> tree_sel = tview.get_selection(); Gtk::TreeModel::iterator iter = tree_sel->get_selected(); if (iter) { - shift_made (tview, tree_sel); + shift_made (new Result (tview, tree_sel)); } else { cancel (); } @@ -179,13 +178,12 @@ Selector::shift_clicked () void Selector::control_clicked () - { Glib::RefPtr<Gtk::TreeSelection> tree_sel = tview.get_selection(); Gtk::TreeModel::iterator iter = tree_sel->get_selected(); if (iter) { - control_made (tview, tree_sel); + control_made (new Result (tview, tree_sel)); } else { cancel (); } @@ -193,12 +191,11 @@ Selector::control_clicked () void Selector::cancel () - { Glib::RefPtr<Gtk::TreeSelection> tree_sel = tview.get_selection(); tree_sel->unselect_all(); - selection_made (tview, tree_sel); + selection_made (new Result (tview, tree_sel)); } void diff --git a/libs/pbd3/pbd/compose.h b/libs/pbd3/pbd/compose.h index 9a65a3e0b1..08de602adc 100644 --- a/libs/pbd3/pbd/compose.h +++ b/libs/pbd3/pbd/compose.h @@ -197,8 +197,8 @@ namespace StringPrivate } // now for the real thing(s) -//namespace String -//{ +namespace PBD +{ // a series of functions which accept a format string on the form "text %1 // more %2 less %3" and a number of templated parameters and spits out the // composited string @@ -387,7 +387,7 @@ namespace StringPrivate .arg(o10).arg(o11).arg(o12).arg(o13).arg(o14).arg(o15); return c.str(); } -//} +} #endif // STRING_COMPOSE_H |