From a5c6c9a35291f4eac0d08feb4f8e928fe23c0b58 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 8 Oct 2019 11:39:16 -0600 Subject: [PATCH] provide ArdourStartup with a Gtk::Dialog-like signal_response() 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 | 16 ++++------------ gtk2_ardour/startup.h | 13 +++++++------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index 9e04a305d9..bb03bc3c30 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -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)); } diff --git a/gtk2_ardour/startup.h b/gtk2_ardour/startup.h index 721557a10d..1e70e288ce 100644 --- a/gtk2_ardour/startup.h +++ b/gtk2_ardour/startup.h @@ -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& 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 icon_pixbuf; void setup_prerelease_page (); @@ -115,6 +114,8 @@ private: gint final_page_index; void move_along_now (); + + sigc::signal1 _signal_response; }; #endif /* __gtk2_ardour_startup_h__ */