From 6650850db00fd37624456328a0aa4aa47bea6938 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Jul 2024 19:04:53 -0600 Subject: [PATCH] show a dedicated message dialog for WrongProgram exceptions --- gtk2_ardour/ardour_ui_session.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gtk2_ardour/ardour_ui_session.cc b/gtk2_ardour/ardour_ui_session.cc index e1f1381a86..c6ef804cb3 100644 --- a/gtk2_ardour/ardour_ui_session.cc +++ b/gtk2_ardour/ardour_ui_session.cc @@ -58,6 +58,7 @@ #include "ardour/session_utils.h" #include "ardour/session_state_utils.h" #include "ardour/session_directory.h" +#include "ardour/wrong_program.h" #include "ardour_message.h" #include "ardour_ui.h" @@ -463,6 +464,21 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s goto out; } + catch (ARDOUR::WrongProgram const & wp) { + + std::string first_word = wp.creator.substr (0, wp.creator.find (' ')); + + ArdourMessageDialog msg (string_compose ("%1\ncannot load sessions\nlast modified by\n%2", PROGRAM_NAME, first_word), + true, + Gtk::MESSAGE_ERROR, + BUTTONS_OK); + msg.set_title (_("Session not loaded")); + msg.set_position (Gtk::WIN_POS_CENTER); + + (void) msg.run (); + msg.hide (); + goto out; + } catch (Glib::Error const& e) { const std::string& glib_what = e.what(); gchar* escaped_error_txt = 0;