Move ARDOUR_UI::ThemeChanged signal into Gtkmm2ext::UI
[ardour.git] / libs / gtkmm2ext / gtk_ui.cc
index 55a6bebb02ba1313a48543054f118e9b39bbe730..2e130f066eacbbd0090085801edd551af8dc2066 100644 (file)
@@ -37,6 +37,7 @@
 #include <gtkmm2ext/textviewer.h>
 #include <gtkmm2ext/popup.h>
 #include <gtkmm2ext/utils.h>
+#include <gtkmm2ext/window_title.h>
 
 #include "i18n.h"
 
@@ -60,7 +61,7 @@ BaseUI::RequestType Gtkmm2ext::AddTimeout = BaseUI::new_request_type();
 #include <pbd/abstract_ui.cc>  /* instantiate the template */
 
 
-UI::UI (string namestr, int *argc, char ***argv, string rcfile
+UI::UI (string namestr, int *argc, char ***argv) 
        : AbstractUI<UIRequest> (namestr, true)
 {
        theMain = new Main (argc, argv);
@@ -87,17 +88,18 @@ UI::UI (string namestr, int *argc, char ***argv, string rcfile)
        errors->text().set_editable (false); 
        errors->text().set_name ("ErrorText");
 
-       string title;
-       title = namestr;
-       title += ": Log";
-       errors->set_title (title);
+       Glib::set_application_name(namestr);
+
+       WindowTitle title(Glib::get_application_name());
+       title += _("Log");
+       errors->set_title (title.get_string());
 
        errors->dismiss_button().set_name ("ErrorLogCloseButton");
        errors->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), (Window *) errors));
 
        register_thread (pthread_self(), X_("GUI"));
 
-       load_rcfile (rcfile);
+       //load_rcfile (rcfile);
 }
 
 UI::~UI ()
@@ -197,6 +199,11 @@ UI::load_rcfile (string path)
        info_mtag->property_foreground_gdk().set_value(style->get_fg(STATE_NORMAL));
        info_mtag->property_background_gdk().set_value(style->get_bg(STATE_NORMAL));
 
+
+       RC::reset_styles(Gtk::Settings::get_default());
+       
+       theme_changed.emit();
+
        return 0;
 }
 
@@ -253,7 +260,11 @@ static bool idle_quit ()
 void
 UI::do_quit ()
 {
-       Glib::signal_idle().connect (sigc::ptr_fun (idle_quit));
+       if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) {
+               Main::quit ();
+       } else {
+               Glib::signal_idle().connect (sigc::ptr_fun (idle_quit));
+       }
 }
 
 void