Remove internal edit mode and add "content" tool.
[ardour.git] / gtk2_ardour / ardour_ui.cc
index 6f038dc27bb1175bc99ebb81b08da8ed36ceeaa8..3bfb204df49f1695ad07a0462ebeac21556ea612 100644 (file)
@@ -150,7 +150,6 @@ using namespace Gtk;
 using namespace std;
 
 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;
@@ -162,7 +161,7 @@ sigc::signal<void>      ARDOUR_UI::CloseAllDialogs;
 ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
 
        : Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
-       
+       , ui_config (new UIConfiguration)
        , gui_object_state (new GUIObjectState)
 
        , primary_clock (new MainClock (X_("primary"), false, X_("transport"), true, true, true, false, true))
@@ -203,7 +202,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        , editor_meter_peak_display()
 
        , speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
-       , theme_manager (X_("theme-manager"), _("Theme Manager"))
        , key_editor (X_("key-editor"), _("Key Bindings"))
        , rc_option_editor (X_("rc-options-editor"), _("Preferences"))
        , add_route_dialog (X_("add-routes"), _("Add Tracks/Busses"))
@@ -233,8 +231,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
                theArdourUI = this;
        }
 
-       ui_config = new UIConfiguration();
-
        ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
        boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
        ui_config->map_parameters (pc);
@@ -352,7 +348,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        const XMLNode* ui_xml = Config->extra_xml (X_("UI"));
 
        if (ui_xml) {
-               theme_manager.set_state (*ui_xml);
                key_editor.set_state (*ui_xml);
                rc_option_editor.set_state (*ui_xml);
                session_option_editor.set_state (*ui_xml);
@@ -368,7 +363,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
                midi_port_matrix.set_state (*ui_xml);
        }
 
-       WM::Manager::instance().register_window (&theme_manager);
        WM::Manager::instance().register_window (&key_editor);
        WM::Manager::instance().register_window (&rc_option_editor);
        WM::Manager::instance().register_window (&session_option_editor);
@@ -384,12 +378,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        WM::Manager::instance().register_window (&audio_port_matrix);
        WM::Manager::instance().register_window (&midi_port_matrix);
 
-       /* We need to instantiate the theme manager because it loads our
-          theme files. This should really change so that its window
-          and its functionality are separate 
-       */
-       
-       (void) theme_manager.get (true);
+       /* Trigger setting up the color scheme and loading the GTK RC file */
+
+       ARDOUR_UI::config()->load_rc_file (false);
        
        _process_thread = new ProcessThread ();
        _process_thread->init ();
@@ -575,9 +566,7 @@ ARDOUR_UI::post_engine ()
 
 ARDOUR_UI::~ARDOUR_UI ()
 {
-       if (ui_config->dirty()) {
-               ui_config->save_state();
-       }
+       ui_config->save_state();
 
        stop_video_server();
 
@@ -3170,6 +3159,46 @@ ARDOUR_UI::launch_reference ()
        PBD::open_uri (Config->get_reference_manual_url());
 }
 
+void
+ARDOUR_UI::launch_tracker ()
+{
+       PBD::open_uri ("http://tracker.ardour.org/bug_report_page.php");
+}
+
+void
+ARDOUR_UI::launch_cheat_sheet ()
+{
+#ifdef __APPLE__
+       PBD::open_uri ("http://manual.ardour.org/files/a3_mnemonic_cheat_sheet_osx.pdf");
+#else
+       PBD::open_uri ("http://manual.ardour.org/files/a3_mnemonic_cheatsheet.pdf");
+#endif
+}
+
+void
+ARDOUR_UI::launch_website ()
+{
+       PBD::open_uri ("http://ardour.org");
+}
+
+void
+ARDOUR_UI::launch_website_dev ()
+{
+       PBD::open_uri ("http://ardour.org/development.html");
+}
+
+void
+ARDOUR_UI::launch_forums ()
+{
+       PBD::open_uri ("https://community.ardour.org/forums");
+}
+
+void
+ARDOUR_UI::launch_howto_report ()
+{
+       PBD::open_uri ("http://ardour.org/reporting_bugs");
+}
+
 void
 ARDOUR_UI::loading_message (const std::string& msg)
 {
@@ -3902,8 +3931,8 @@ ARDOUR_UI::create_xrun_marker (framepos_t where)
 void
 ARDOUR_UI::halt_on_xrun_message ()
 {
-       MessageDialog msg (*editor,
-                          _("Recording was stopped because your system could not keep up."));
+        cerr << "HALT on xrun\n";
+       MessageDialog msg (*editor, _("Recording was stopped because your system could not keep up."));
        msg.run ();
 }