diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-09 21:54:21 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-07-09 21:54:21 +0000 |
commit | 3dcbdc0fe624f92121e9931365be75921f301b8c (patch) | |
tree | 895645a2fbc7050c44e6932af72bd631995c4d77 /gtk2_ardour | |
parent | c300fa98affc58a97fec1c7a0797c2c6e37d03cb (diff) |
cleaner version of splash display changes
git-svn-id: svn://localhost/ardour2/branches/3.0@13004 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 54 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 5 | ||||
-rw-r--r-- | gtk2_ardour/splash.cc | 34 | ||||
-rw-r--r-- | gtk2_ardour/splash.h | 5 |
4 files changed, 46 insertions, 52 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 959101ac57..1b108100d9 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -794,6 +794,8 @@ If you still wish to quit, please use the\n\n\ */ save_ardour_state (); + loading_message (_("Please wait while Ardour cleans up...")); + if (_session) { // _session->set_deletion_in_progress (); _session->set_clean (); @@ -2401,11 +2403,11 @@ ARDOUR_UI::loading_message (const std::string& msg) return; } - show_splash (); - if (splash) { - splash->message (msg); - flush_pending (); + if (!splash) { + show_splash (); } + + splash->message (msg); } /** @param quit_on_cancel true if exit() should be called if the user clicks `cancel' in the new session dialog */ @@ -2830,34 +2832,9 @@ ARDOUR_UI::about_signal_response (int /*response*/) hide_about(); } -bool -ARDOUR_UI::wakeup_from_splash_sleep (void* arg) -{ - cerr << "idle after splash\n"; - ((ARDOUR_UI*)arg)->_wakeup_from_splash_sleep (); - return false; -} - -void -ARDOUR_UI::_wakeup_from_splash_sleep () -{ - splash_done_visible = true; - cerr << "Set sdv to " << splash_done_visible << endl; -} - -bool -ARDOUR_UI::splash_visible (GdkEventAny*) -{ - cerr << "Splash now mapped\n"; - g_idle_add ((gboolean (*)(void*))ARDOUR_UI::wakeup_from_splash_sleep, this); - return false; -} - void ARDOUR_UI::show_splash () { - cerr << "Show splash!\n"; - if (splash == 0) { try { splash = new Splash; @@ -2866,24 +2843,7 @@ ARDOUR_UI::show_splash () } } - bool was_mapped = splash->is_mapped (); - - if (!was_mapped) { - splash_expose = splash->signal_map_event().connect (sigc::mem_fun (this, &ARDOUR_UI::splash_visible), false); - splash_done_visible = false; - } - - splash->pop_front (); - splash->present (); - - if (!was_mapped) { - while (!splash_done_visible) { - cerr << "nested iteration. sdv = " << splash_done_visible << endl; - gtk_main_iteration (); - } - } - - cerr << "show splash done\n"; + splash->display (); } void diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 3d29eebc2f..92e7295514 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -611,11 +611,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr About* about; Splash* splash; - bool splash_done_visible; - static bool wakeup_from_splash_sleep (void *); - void _wakeup_from_splash_sleep (); - bool splash_visible (GdkEventAny*); - sigc::connection splash_expose; void pop_back_splash (Gtk::Window&); diff --git a/gtk2_ardour/splash.cc b/gtk2_ardour/splash.cc index 5643adbd6a..cd09be0574 100644 --- a/gtk2_ardour/splash.cc +++ b/gtk2_ardour/splash.cc @@ -85,6 +85,40 @@ Splash::~Splash () the_splash = 0; } +bool +Splash::wakeup_from_splash_sleep () +{ + splash_done_visible = true; + return false; +} + +bool +Splash::splash_mapped (GdkEventAny*) +{ + Glib::signal_idle().connect (sigc::mem_fun (this, &Splash::wakeup_from_splash_sleep)); + return false; +} + +void +Splash::display () +{ + bool was_mapped = is_mapped (); + + if (!was_mapped) { + signal_map_event().connect (sigc::mem_fun (this, &Splash::splash_mapped), false); + splash_done_visible = false; + } + + pop_front (); + present (); + + if (!was_mapped) { + while (!splash_done_visible) { + gtk_main_iteration (); + } + } +} + void Splash::pop_back_for (Gtk::Window& win) { diff --git a/gtk2_ardour/splash.h b/gtk2_ardour/splash.h index bb3e7b6f6a..fcb211d81d 100644 --- a/gtk2_ardour/splash.h +++ b/gtk2_ardour/splash.h @@ -38,6 +38,7 @@ class Splash : public Gtk::Window static Splash* instance() { return the_splash; } + void display (); void pop_back_for (Gtk::Window&); void pop_front (); @@ -56,6 +57,10 @@ class Splash : public Gtk::Window void boot_message (std::string); PBD::ScopedConnection msg_connection; + + bool splash_done_visible; + bool wakeup_from_splash_sleep (); + bool splash_mapped (GdkEventAny*); }; #endif /* __ardour_gtk_splash_h__ */ |