From ae0dcdc0c5d13483271065c360e378202d20170a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 14 Sep 2017 19:22:44 +0200 Subject: [PATCH] Fix various tooltip markup (ampersand) entity-escape: * track/port names * plugin-names * MIDI patch-names --- gtk2_ardour/meter_strip.cc | 4 ++-- gtk2_ardour/mixer_strip.cc | 2 +- gtk2_ardour/patch_change_widget.cc | 4 +++- gtk2_ardour/plugin_pin_dialog.cc | 2 +- gtk2_ardour/processor_box.cc | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc index 5e2ee92e4f..cf981763fa 100644 --- a/gtk2_ardour/meter_strip.cc +++ b/gtk2_ardour/meter_strip.cc @@ -184,8 +184,8 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr rt) name_label.set_layout_ellipsize_width(48 * PANGO_SCALE); name_label.set_size_request(PX_SCALE(18, 18), PX_SCALE(50, 50)); name_label.set_alignment(-1.0, .5); - set_tooltip (name_label, _route->name()); - set_tooltip (*level_meter, _route->name()); + set_tooltip (name_label, Gtkmm2ext::markup_escape_text (_route->name())); + set_tooltip (*level_meter, Gtkmm2ext::markup_escape_text (_route->name())); number_label.set_corner_radius(2); number_label.set_elements((ArdourButton::Element)(ArdourButton::Edge|ArdourButton::Body|ArdourButton::Text|ArdourButton::Inactive)); diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 6d127262b3..a58aa81211 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1860,7 +1860,7 @@ MixerStrip::name_changed () break; } - set_tooltip (name_button, _route->name()); + set_tooltip (name_button, Gtkmm2ext::markup_escape_text(_route->name())); if (_session->config.get_track_name_number()) { const int64_t track_number = _route->track_number (); diff --git a/gtk2_ardour/patch_change_widget.cc b/gtk2_ardour/patch_change_widget.cc index 75f42ea546..f82db6a27a 100644 --- a/gtk2_ardour/patch_change_widget.cc +++ b/gtk2_ardour/patch_change_widget.cc @@ -32,6 +32,7 @@ #include "ardour/plugin_insert.h" #include "gtkmm2ext/menu_elems.h" +#include "gtkmm2ext/utils.h" #include "widgets/tooltips.h" #include "gui_thread.h" @@ -268,7 +269,8 @@ PatchChangeWidget::refill_program_list () const uint8_t pgm = key.program(); _program_btn[pgm].set_text (n); - set_tooltip (_program_btn[pgm], string_compose (_("%1 (Pgm-%2)"), n, (int)(pgm +1))); + set_tooltip (_program_btn[pgm], string_compose (_("%1 (Pgm-%2)"), + Gtkmm2ext::markup_escape_text (n), (int)(pgm +1))); unset_notes.reset (pgm); } } diff --git a/gtk2_ardour/plugin_pin_dialog.cc b/gtk2_ardour/plugin_pin_dialog.cc index b1e8d850db..d9591732bd 100644 --- a/gtk2_ardour/plugin_pin_dialog.cc +++ b/gtk2_ardour/plugin_pin_dialog.cc @@ -570,7 +570,7 @@ uint32_t PluginPinWidget::add_port_to_table (boost::shared_ptr p, uint32_t r, bool can_remove) { std::string lbl; - std::string tip = p->name (); + std::string tip = Gtkmm2ext::markup_escape_text (p->name ()); std::vector cns; bool single_source = true; p->get_connections (cns); diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index f496070537..ca1e448b58 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -884,7 +884,7 @@ ProcessorEntry::Control::set_tooltip () std::string tt = _name + ": " + ARDOUR::value_as_string (c->desc(), c->get_value ()); string sm = Gtkmm2ext::markup_escape_text (tt); _slider_persistant_tooltip.set_tip (sm); - ArdourWidgets::set_tooltip (_button, sm); + ArdourWidgets::set_tooltip (_button, Gtkmm2ext::markup_escape_text (sm)); } void