show() widgets explicitly in gtk2_ardour/analysis_window.cc
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 10f6a2fe7ad07adb5feb88f2ca33ad92b2bb4bf2..7359b4908170c73b47f1fc07d360e348d8e0d434 100644 (file)
 
 #include <pbd/error.h>
 #include <pbd/compose.h>
-#include <pbd/pathscanner.h>
 #include <pbd/failed_constructor.h>
 #include <pbd/enumwriter.h>
 #include <pbd/memento_command.h>
+#include <pbd/file_utils.h>
 
 #include <gtkmm2ext/gtk_ui.h>
 #include <gtkmm2ext/utils.h>
@@ -68,6 +68,7 @@
 #include <ardour/port.h>
 #include <ardour/audio_track.h>
 #include <ardour/midi_track.h>
+#include <ardour/filesystem_paths.h>
 
 #include "actions.h"
 #include "ardour_ui.h"
@@ -84,6 +85,7 @@
 #include "gui_thread.h"
 #include "theme_manager.h"
 
+
 #include "i18n.h"
 
 using namespace ARDOUR;
@@ -93,12 +95,12 @@ using namespace Gtk;
 using namespace sigc;
 
 ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
+UIConfiguration *ARDOUR_UI::ui_config = 0;
 
 sigc::signal<void,bool> ARDOUR_UI::Blink;
 sigc::signal<void>      ARDOUR_UI::RapidScreenUpdate;
 sigc::signal<void>      ARDOUR_UI::SuperRapidScreenUpdate;
 sigc::signal<void,nframes_t, bool, nframes_t> ARDOUR_UI::Clock;
-sigc::signal<int,string> ThemeChanged;
 
 ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
 
@@ -166,14 +168,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
                theArdourUI = this;
        }
 
-       /* load colors */
-
+       ui_config = new UIConfiguration();
        theme_manager = new ThemeManager();
-
-       //std::string color_file = ARDOUR::find_config_file("ardour.colors");
-
-       //theme_manager->load (color_file);
-
+       
        editor = 0;
        mixer = 0;
        session = 0;
@@ -191,9 +188,15 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        have_disk_speed_dialog_displayed = false;
        session_loaded = false;
        last_speed_displayed = -1.0f;
-       keybindings_path = ARDOUR::find_config_file ("ardour.bindings");
        ab_direction = true;
 
+       sys::path key_bindings_file;
+
+       find_file_in_search_path (ardour_search_path() + system_config_search_path(),
+                       "ardour.bindings", key_bindings_file);
+
+       keybindings_path = key_bindings_file.to_string();
+
        can_save_keybindings = false;
 
        last_configure_time.tv_sec = 0;
@@ -209,8 +212,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
        gettimeofday (&last_peak_grab, 0);
        gettimeofday (&last_shuttle_request, 0);
 
-       ThemeChanged.connect (mem_fun(*this, &ARDOUR_UI::load_rcfile));
-
        ARDOUR::Diskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
        ARDOUR::Diskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
 
@@ -571,6 +572,7 @@ If you still wish to quit, please use the\n\n\
        }
        engine->stop (true);
        Config->save_state();
+       ARDOUR_UI::config()->save_state();
        quit ();
 }
 
@@ -1244,7 +1246,7 @@ ARDOUR_UI::transport_record ()
                        break;
                case Session::Recording:
                case Session::Enabled:
-                       session->disable_record (true);
+                       session->disable_record (false, true);
                }
        }
 }
@@ -1510,24 +1512,6 @@ ARDOUR_UI::do_engine_start ()
 void
 ARDOUR_UI::setup_theme ()
 {
-       string rcfile;
-       char* env;
-
-       if ((env = getenv ("ARDOUR2_UI_RC")) != 0 && strlen (env)) {
-               rcfile = env;
-       } else {
-               rcfile = Config->get_ui_rc_file();
-       }
-
-       rcfile = find_config_file (rcfile);
-       
-       if (rcfile.empty()) {
-               warning << _("Without a UI style file, ardour will look strange.\n Please set ARDOUR2_UI_RC to point to a valid UI style file") << endmsg;
-       } else {
-               cerr << "Loading ui configuration file " << rcfile << endl;
-       }
-
-       ThemeChanged (rcfile); //EMIT SIGNAL
        theme_manager->setup_theme();
 }