provide ArdourStartup with a Gtk::Dialog-like signal_response()
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 8 Oct 2019 17:39:16 +0000 (11:39 -0600)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 10 Oct 2019 22:52:00 +0000 (16:52 -0600)
It is not a Dialog (instead, an Assistant which IS-A Window), but
we want to be able to interact with it as if it is.

Also remove unused singleton and session info cruft

gtk2_ardour/startup.cc
gtk2_ardour/startup.h

index 9e04a305d9354bb080970c2dd3e3e1037c3ed10d..bb03bc3c309624cf1f8bd9ed47774629db62fc33 100644 (file)
@@ -69,11 +69,8 @@ using namespace PBD;
 using namespace ARDOUR;
 using namespace ARDOUR_UI_UTILS;
 
-ArdourStartup* ArdourStartup::the_startup = 0;
-
 ArdourStartup::ArdourStartup ()
-       : _response (RESPONSE_OK)
-       , config_modified (false)
+       : config_modified (false)
        , default_dir_chooser (0)
        , monitor_via_hardware_button (string_compose (_("Use an external mixer or the hardware mixer of your audio interface.\n"
                                                         "%1 will play NO role in monitoring"), PROGRAM_NAME))
@@ -115,8 +112,6 @@ ArdourStartup::ArdourStartup ()
        setup_monitoring_choice_page ();
        setup_monitor_section_choice_page ();
        setup_final_page ();
-
-       the_startup = this;
 }
 
 ArdourStartup::~ArdourStartup ()
@@ -452,15 +447,13 @@ ArdourStartup::discover_plugins () {
 void
 ArdourStartup::on_cancel ()
 {
-       _response = RESPONSE_CANCEL;
-       gtk_main_quit ();
+       _signal_response (int (RESPONSE_CANCEL));
 }
 
 bool
 ArdourStartup::on_delete_event (GdkEventAny*)
 {
-       _response = RESPONSE_CLOSE;
-       gtk_main_quit ();
+       _signal_response (int (RESPONSE_CLOSE));
        return true;
 }
 
@@ -501,8 +494,7 @@ ArdourStartup::on_apply ()
 
        }
 
-       _response = RESPONSE_OK;
-       gtk_main_quit ();
+       _signal_response (int (RESPONSE_OK));
 }
 
 
index 721557a10d26ca9afeb418f74b29399a2a993f6a..1e70e288ce072800f703098097f6b23f7e8b1f64 100644 (file)
@@ -44,12 +44,13 @@ public:
 
        static bool required ();
 
-       gint response () const {
-               return  _response;
-       }
+       /* It's not a dialog so we have to fake this to make it behave like a
+        * dialog. This allows the StartupFSM to treat everything similarly.
+        */
+
+       sigc::signal1<void,int>& signal_response() { return _signal_response; }
 
 private:
-       gint _response;
        bool config_modified;
        bool new_user;
 
@@ -58,8 +59,6 @@ private:
        bool on_delete_event (GdkEventAny*);
        void discover_plugins ();
 
-       static ArdourStartup *the_startup;
-
        Glib::RefPtr<Gdk::Pixbuf> icon_pixbuf;
 
        void setup_prerelease_page ();
@@ -115,6 +114,8 @@ private:
        gint final_page_index;
 
        void move_along_now ();
+
+       sigc::signal1<void,int> _signal_response;
 };
 
 #endif /* __gtk2_ardour_startup_h__ */