Add a couple of visibility specifiers that were missing
[ardour.git] / libs / gtkmm2ext / gtk_ui.cc
index a1b932af59543bf412349510a0c50032b95fe0b5..33841cd0beb6821c61a5927c2a848437e1eeb2f7 100644 (file)
 #include <cctype>
 
 #include <gtkmm.h>
-#include <pbd/error.h>
-#include <pbd/touchable.h>
-#include <pbd/failed_constructor.h>
-#include <pbd/pthread_utils.h>
-#include <pbd/replace_all.h>
-
-#include <gtkmm2ext/application.h>
-#include <gtkmm2ext/gtk_ui.h>
-#include <gtkmm2ext/textviewer.h>
-#include <gtkmm2ext/popup.h>
-#include <gtkmm2ext/utils.h>
-#include <gtkmm2ext/window_title.h>
-#include <gtkmm2ext/actions.h>
-#include <gtkmm2ext/activatable.h>
+
+#include "pbd/error.h"
+#include "pbd/touchable.h"
+#include "pbd/failed_constructor.h"
+#include "pbd/pthread_utils.h"
+#include "pbd/replace_all.h"
+
+#include "gtkmm2ext/application.h"
+#include "gtkmm2ext/gtk_ui.h"
+#include "gtkmm2ext/textviewer.h"
+#include "gtkmm2ext/popup.h"
+#include "gtkmm2ext/utils.h"
+#include "gtkmm2ext/window_title.h"
+#include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/activatable.h"
+#include "gtkmm2ext/actions.h"
+#include "gtkmm2ext/gui_thread.h"
 
 #include "i18n.h"
 
@@ -92,7 +95,7 @@ UI::UI (string namestr, int *argc, char ***argv)
 
        /* attach our request source to the default main context */
 
-       request_channel.ios()->attach (MainContext::get_default());
+       attach_request_source ();
 
        errors = new TextViewer (800,600);
        errors->text().set_editable (false);
@@ -118,9 +121,9 @@ UI::UI (string namestr, int *argc, char ***argv)
 
 UI::~UI ()
 {
+       _receiver.hangup ();
 }
 
-
 bool
 UI::caller_is_ui_thread ()
 {
@@ -263,12 +266,14 @@ UI::run (Receiver &old_receiver)
 
        Glib::signal_idle().connect (bind_return (mem_fun (old_receiver, &Receiver::hangup), false));
 
-       starting ();
+       if (starting ()) {
+               return;
+       }
+
        _active = true;
        theMain->run ();
        _active = false;
-       stopping ();
-       _receiver.hangup ();
+
        return;
 }
 
@@ -352,14 +357,11 @@ UI::set_tip (Widget *w, const gchar *tip, const gchar *hlp)
                Gtk::AccelKey key;
                ustring ap = action->get_accel_path();
                if (!ap.empty()) {
-                       bool has_key = ActionManager::lookup_entry(ap, key);
-                       if (has_key) {
-                               string  abbrev = key.get_abbrev();
-                               if (!abbrev.empty()) {
-                                       replace_all (abbrev, "<", "");
-                                       replace_all (abbrev, ">", "-");
-                                       msg.append(_("\n\nKey: ")).append (abbrev);
-                               }
+                       string shortcut = ActionManager::get_key_representation (ap, key);
+                       if (!shortcut.empty()) {
+                               replace_all (shortcut, "<", "");
+                               replace_all (shortcut, ">", "-");
+                               msg.append(_("\n\nShortcut: ")).append (shortcut);
                        }
                }
        }
@@ -690,7 +692,7 @@ UI::flush_pending ()
 }
 
 bool
-UI::just_hide_it (GdkEventAny */*ev*/, Window *win)
+UI::just_hide_it (GdkEventAny/*ev*/, Window *win)
 {
        win->hide ();
        return true;
@@ -740,7 +742,7 @@ UI::color_selection_done (bool status)
 }
 
 bool
-UI::color_selection_deleted (GdkEventAny */*ev*/)
+UI::color_selection_deleted (GdkEventAny/*ev*/)
 {
        Main::quit ();
        return true;