summaryrefslogtreecommitdiff
path: root/gtk2_ardour/mixer_strip.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-15 19:50:42 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-15 19:50:42 +0000
commita609ea41db7cc339c522728918214b0a17308a08 (patch)
tree640f28016cf8e5f3d743f6e4d0ed52eea8a8eab7 /gtk2_ardour/mixer_strip.cc
parente2757229a74a17a76682b6c72868d8e4822b7678 (diff)
Remove ambiguous checkbutton from Comments... menu item
(does it mean the comments window is open, or that there are comments?) (part of #4416). git-svn-id: svn://localhost/ardour2/branches/3.0@10625 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r--gtk2_ardour/mixer_strip.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 3f20a479ad..160efaf3bb 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -267,7 +267,7 @@ MixerStrip::init ()
group_label.set_name ("MixerGroupButtonLabel");
_comment_button.set_name (X_("MixerCommentButton"));
- _comment_button.signal_clicked().connect (sigc::mem_fun (*this, &MixerStrip::toggle_comment));
+ _comment_button.signal_clicked().connect (sigc::mem_fun (*this, &MixerStrip::toggle_comment_editor));
global_vpacker.set_border_width (0);
global_vpacker.set_spacing (0);
@@ -1316,19 +1316,24 @@ MixerStrip::comment_editor_done_editing ()
}
void
-MixerStrip::toggle_comment ()
+MixerStrip::toggle_comment_editor ()
{
if (ignore_toggle) {
return;
}
- if (comment_window == 0) {
- setup_comment_editor ();
+ if (comment_window && comment_window->is_visible ()) {
+ comment_window->hide ();
+ } else {
+ open_comment_editor ();
}
+}
- if (comment_window->is_visible ()) {
- comment_window->hide ();
- return;
+void
+MixerStrip::open_comment_editor ()
+{
+ if (comment_window == 0) {
+ setup_comment_editor ();
}
string title;
@@ -1444,16 +1449,14 @@ MixerStrip::build_route_ops_menu ()
MenuList& items = route_ops_menu->items();
- items.push_back (CheckMenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::toggle_comment)));
- CheckMenuItem* i = dynamic_cast<CheckMenuItem*> (&items.back ());
- i->set_active (comment_window && comment_window->is_visible ());
+ items.push_back (MenuElem (_("Comments..."), sigc::mem_fun (*this, &MixerStrip::open_comment_editor)));
items.push_back (MenuElem (_("Save As Template..."), sigc::mem_fun(*this, &RouteUI::save_as_template)));
items.push_back (MenuElem (_("Rename..."), sigc::mem_fun(*this, &RouteUI::route_rename)));
rename_menu_item = &items.back();
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active")));
- i = dynamic_cast<CheckMenuItem *> (&items.back());
+ CheckMenuItem* i = dynamic_cast<CheckMenuItem *> (&items.back());
i->set_active (_route->active());
i->signal_activate().connect (sigc::bind (sigc::mem_fun (*this, &RouteUI::set_route_active), !_route->active(), false));