Fix #4396: "5.4-RC1 stuck on release notes panel"

Now the alert windows pops after closing the splash window
This commit is contained in:
Hombre
2018-02-18 01:13:49 +01:00
parent fc751a0cce
commit cb0798502b
4 changed files with 22 additions and 11 deletions

View File

@@ -347,17 +347,6 @@ RTWindow *create_rt_window()
//gdk_threads_enter (); //gdk_threads_enter ();
RTWindow *rtWindow = new RTWindow(); RTWindow *rtWindow = new RTWindow();
// alerting users if the default raw and image profiles are missing
if (options.is_defProfRawMissing()) {
Gtk::MessageDialog msgd (Glib::ustring::compose (M ("OPTIONS_DEFRAW_MISSING"), options.defProfRaw), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run ();
}
if (options.is_defProfImgMissing()) {
Gtk::MessageDialog msgd (Glib::ustring::compose (M ("OPTIONS_DEFIMG_MISSING"), options.defProfImg), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run ();
}
return rtWindow; return rtWindow;
} }

View File

@@ -321,6 +321,7 @@ void RTWindow::on_realize ()
vMajor.emplace_back(v, 0, v.find_first_not_of("0123456789.")); vMajor.emplace_back(v, 0, v.find_first_not_of("0123456789."));
} }
bool waitForSplash = false;
if (vMajor.size() == 2 && vMajor[0] != vMajor[1]) { if (vMajor.size() == 2 && vMajor[0] != vMajor[1]) {
// Update the version parameter with the right value // Update the version parameter with the right value
options.version = versionString; options.version = versionString;
@@ -330,6 +331,7 @@ void RTWindow::on_realize ()
splash->signal_delete_event().connect ( sigc::mem_fun (*this, &RTWindow::splashClosed) ); splash->signal_delete_event().connect ( sigc::mem_fun (*this, &RTWindow::splashClosed) );
if (splash->hasReleaseNotes()) { if (splash->hasReleaseNotes()) {
waitForSplash = true;
splash->showReleaseNotes(); splash->showReleaseNotes();
splash->show (); splash->show ();
} else { } else {
@@ -337,8 +339,25 @@ void RTWindow::on_realize ()
splash = nullptr; splash = nullptr;
} }
} }
if (!waitForSplash) {
showErrors();
}
} }
void RTWindow::showErrors()
{
// alerting users if the default raw and image profiles are missing
if (options.is_defProfRawMissing()) {
Gtk::MessageDialog msgd (*this, Glib::ustring::compose (M ("OPTIONS_DEFRAW_MISSING"), options.defProfRaw), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run ();
}
if (options.is_defProfImgMissing()) {
Gtk::MessageDialog msgd (*this, Glib::ustring::compose (M ("OPTIONS_DEFIMG_MISSING"), options.defProfImg), true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msgd.run ();
}
}
bool RTWindow::on_configure_event (GdkEventConfigure* event) bool RTWindow::on_configure_event (GdkEventConfigure* event)
{ {
if (!is_maximized() && is_visible()) { if (!is_maximized() && is_visible()) {
@@ -875,6 +894,7 @@ bool RTWindow::splashClosed (GdkEventAny* event)
{ {
delete splash; delete splash;
splash = nullptr; splash = nullptr;
showErrors();
return true; return true;
} }

View File

@@ -59,6 +59,7 @@ private:
bool splashClosed (GdkEventAny* event); bool splashClosed (GdkEventAny* event);
bool isEditorPanel (Widget* panel); bool isEditorPanel (Widget* panel);
bool isEditorPanel (guint pageNum); bool isEditorPanel (guint pageNum);
void showErrors ();
Glib::ustring versionStr; Glib::ustring versionStr;
#if defined(__APPLE__) #if defined(__APPLE__)

View File

@@ -281,4 +281,5 @@ void Splash::showReleaseNotes()
void Splash::closePressed() void Splash::closePressed()
{ {
hide(); hide();
close();
} }