13
0

show a dedicated message dialog for WrongProgram exceptions

This commit is contained in:
Paul Davis 2024-07-11 19:04:53 -06:00
parent 54f810f90e
commit 68ebcc36a9

View File

@ -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 ("<span size=\"large\">%1\ncannot load sessions\nlast modified by\n%2</span>", 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;