Use mnemonic-save API for menu-element texts
authorRobin Gareus <robin@gareus.org>
Wed, 28 Jun 2017 22:20:55 +0000 (00:20 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 28 Jun 2017 22:22:42 +0000 (00:22 +0200)
gtk2_ardour/mixer_strip.cc
gtk2_ardour/patch_change.cc
gtk2_ardour/plugin_pin_dialog.cc
gtk2_ardour/processor_box.cc

index 195a9de04e561d5727dd6f79e26553c1ce27bebf..6f02710e42d2673bc13bd059a48ac2f85b38a265 100644 (file)
@@ -33,6 +33,7 @@
 #include <gtkmm2ext/doi.h>
 #include <gtkmm2ext/slider_controller.h>
 #include <gtkmm2ext/bindable_button.h>
+#include "gtkmm2ext/menu_elems.h"
 
 #include "ardour/amp.h"
 #include "ardour/audio_track.h"
@@ -1094,11 +1095,7 @@ MixerStrip::maybe_add_bundle_to_input_menu (boost::shared_ptr<Bundle> b, ARDOUR:
        input_menu_bundles.push_back (b);
 
        MenuList& citems = input_menu.items();
-
-       std::string n = b->name ();
-       replace_all (n, "_", " ");
-
-       citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_chosen), b)));
+       citems.push_back (MenuElemNoMnemonic (b->name (), sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_input_chosen), b)));
 }
 
 void
@@ -1122,11 +1119,7 @@ MixerStrip::maybe_add_bundle_to_output_menu (boost::shared_ptr<Bundle> b, ARDOUR
        output_menu_bundles.push_back (b);
 
        MenuList& citems = output_menu.items();
-
-       std::string n = b->name ();
-       replace_all (n, "_", " ");
-
-       citems.push_back (MenuElem (n, sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_chosen), b)));
+       citems.push_back (MenuElemNoMnemonic (b->name (), sigc::bind (sigc::mem_fun(*this, &MixerStrip::bundle_output_chosen), b)));
 }
 
 void
index fb3507ae6454dbb3a2c4dc69bcc43930a502fffe..3070011380f9edcc96f7bc780acab52305adb23a 100644 (file)
@@ -24,6 +24,7 @@
 #include <glibmm/regex.h>
 
 #include "gtkmm2ext/keyboard.h"
+#include "gtkmm2ext/menu_elems.h"
 #include "gtkmm2ext/utils.h"
 
 #include "midi++/midnam_patch.h"
@@ -137,14 +138,8 @@ PatchChange::initialize_popup_menus()
                for (PatchNameList::const_iterator patch = patches.begin();
                     patch != patches.end();
                     ++patch) {
-                       std::string name = (*patch)->name();
-                       boost::replace_all (name, "_", " ");
-
-                       patch_menus.push_back (
-                               Gtk::Menu_Helpers::MenuElem (
-                                       name,
-                                       sigc::bind (sigc::mem_fun(*this, &PatchChange::on_patch_menu_selected),
-                                                   (*patch)->patch_primary_key())));
+                       patch_menus.push_back (Gtkmm2ext::MenuElemNoMnemonic ((*patch)->name(),
+                                               sigc::bind (sigc::mem_fun(*this, &PatchChange::on_patch_menu_selected), (*patch)->patch_primary_key())));
                }
        }
 }
index ed15db2a761295b28d34900c433e0d8a955663e7..5b7ed436bdd841ff88f6287062f8817966a63605 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "gtkmm2ext/utils.h"
 #include "gtkmm2ext/rgb_macros.h"
+#include "gtkmm2ext/menu_elems.h"
 
 #include "ardour/amp.h"
 #include "ardour/audioengine.h"
@@ -1822,7 +1823,7 @@ PluginPinWidget::maybe_add_route_to_input_menu (boost::shared_ptr<Route> r, Data
        /* we're going to create the new send pre-fader, so check the route amp's data type.  */
        const ChanCount& rc (r->amp ()->input_streams ());
        if (!already_present && rc.get (dt) > 0) {
-               citems.push_back (MenuElem (r->name (), sigc::bind (sigc::mem_fun (*this, &PluginPinWidget::add_send_from), wp, boost::weak_ptr<Route> (r))));
+               citems.push_back (MenuElemNoMnemonic (r->name (), sigc::bind (sigc::mem_fun (*this, &PluginPinWidget::add_send_from), wp, boost::weak_ptr<Route> (r))));
                ++added;
        }
        return added;
index d9bf1a974969062d4a723cfe5ad613992945adac..f1dd84a84dac4f754ed6dc8eff9655d5a7ea9113 100644 (file)
@@ -35,6 +35,7 @@
 #include <gtkmm/messagedialog.h>
 
 #include <gtkmm2ext/gtk_ui.h>
+#include "gtkmm2ext/menu_elems.h"
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/choice.h>
 #include <gtkmm2ext/utils.h>
@@ -728,7 +729,7 @@ ProcessorEntry::build_controls_menu ()
        }
 
        for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
-               items.push_back (CheckMenuElem ((*i)->name ()));
+               items.push_back (CheckMenuElemNoMnemonic ((*i)->name ()));
                Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem*> (&items.back ());
                c->set_active ((*i)->visible ());
                c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ProcessorEntry::toggle_control_visibility), *i));
@@ -2107,7 +2108,7 @@ ProcessorBox::build_possible_aux_menu ()
 
        for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) {
                if (!_route->internal_send_for (*r) && *r != _route) {
-                       items.push_back (MenuElem ((*r)->name(), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_choose_aux), boost::weak_ptr<Route>(*r))));
+                       items.push_back (MenuElemNoMnemonic ((*r)->name(), sigc::bind (sigc::ptr_fun (ProcessorBox::rb_choose_aux), boost::weak_ptr<Route>(*r))));
                }
        }