Use mnemonic-save API for menu-element texts

This commit is contained in:
Robin Gareus
2017-06-29 00:20:55 +02:00
parent 972e01f9c7
commit c3c4efaa09
4 changed files with 11 additions and 21 deletions

View 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

View 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())));
}
}
}

View 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;

View 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))));
}
}