13
0

Pop splash on dialog response - not d'tor.

A Dialog Window may not be tightly scoped, and may be around
for a while (query settings from the dialog instance). The destructor
may only be called  later.
This commit is contained in:
Robin Gareus 2017-04-01 16:40:07 +02:00
parent dae7e8dbd3
commit 3e43585fa1
3 changed files with 19 additions and 11 deletions

View File

@ -52,6 +52,22 @@ ArdourDialog::ArdourDialog (Gtk::Window& parent, string title, bool modal, bool
}
ArdourDialog::~ArdourDialog ()
{
pop_splash ();
Keyboard::the_keyboard().focus_out_window (0, this);
WM::Manager::instance().remove (proxy);
}
void
ArdourDialog::on_response (int response_id)
{
pop_splash ();
hide ();
Gtk::Dialog::on_response (response_id);
}
void
ArdourDialog::pop_splash ()
{
if (_splash_pushed) {
Splash* spl = Splash::instance();
@ -59,9 +75,8 @@ ArdourDialog::~ArdourDialog ()
if (spl) {
spl->pop_front();
}
_splash_pushed = false;
}
Keyboard::the_keyboard().focus_out_window (0, this);
WM::Manager::instance().remove (proxy);
}
bool

View File

@ -47,11 +47,13 @@ public:
bool on_delete_event (GdkEventAny*);
void on_unmap ();
void on_show ();
void on_response (int);
private:
WM::ProxyTemporary* proxy;
bool _splash_pushed;
void init ();
void pop_splash ();
static sigc::signal<void> CloseAllDialogs;
};

View File

@ -417,9 +417,6 @@ void
EngineControl::on_show ()
{
ArdourDialog::on_show ();
if (Splash::instance()) {
Splash::instance()->hide ();
}
if (!ARDOUR::AudioEngine::instance()->current_backend() || !ARDOUR::AudioEngine::instance()->running()) {
// re-check _have_control (jackd running) see #6041
backend_changed ();
@ -2736,9 +2733,6 @@ EngineControl::start_stop_button_clicked ()
start_engine ();
if (!ARDOUR_UI::instance()->session_loaded) {
ArdourDialog::on_response (RESPONSE_OK);
if (Splash::instance()) {
Splash::instance()->pop_front ();
}
}
}
}
@ -3152,9 +3146,6 @@ EngineControl::connect_disconnect_click()
start_engine ();
if (!ARDOUR_UI::instance()->session_loaded) {
ArdourDialog::on_response (RESPONSE_OK);
if (Splash::instance()) {
Splash::instance()->pop_front ();
}
}
}
}