Escape angled brackets in playlist names for tooltips.

git-svn-id: svn://localhost/ardour2/branches/3.0@12672 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-06-12 14:19:35 +00:00
parent 1804efbd14
commit d7551a8f08
3 changed files with 18 additions and 2 deletions

View File

@ -1591,13 +1591,17 @@ RouteTimeAxisView::update_playlist_tip ()
take_name = take_name.substr (idx + group_string.length());
/* set the playlist button tooltip to the take name */
ARDOUR_UI::instance()->set_tip (playlist_button,string_compose(_("Take: %1.%2"), rg->name(), take_name));
ARDOUR_UI::instance()->set_tip (
playlist_button,
string_compose(_("Take: %1.%2"), escape_angled_brackets (rg->name()), escape_angled_brackets (take_name))
);
return;
}
}
/* set the playlist button tooltip to the playlist name */
ARDOUR_UI::instance()->set_tip (playlist_button, _("Playlist") + std::string(": ") + track()->playlist()->name());
ARDOUR_UI::instance()->set_tip (playlist_button, _("Playlist") + std::string(": ") + escape_angled_brackets (track()->playlist()->name()));
}

View File

@ -36,6 +36,7 @@
#include <gtkmm/label.h>
#include <gtkmm/paned.h>
#include <gtk/gtkpaned.h>
#include <boost/algorithm/string.hpp>
#include "pbd/file_utils.h"
@ -680,6 +681,16 @@ escape_underscores (string const & s)
return o;
}
/** Replace < and > with &lt; and &gt; respectively to make < > display correctly in markup strings */
string
escape_angled_brackets (string const & s)
{
string o = s;
boost::replace_all (o, "<", "&lt;");
boost::replace_all (o, ">", "&gt;");
return o;
}
Gdk::Color
unique_random_color (list<Gdk::Color>& used_colors)
{

View File

@ -79,6 +79,7 @@ void set_pango_fontsize ();
void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int);
std::string escape_underscores (std::string const &);
std::string escape_angled_brackets (std::string const &);
Gdk::Color unique_random_color (std::list<Gdk::Color> &);