13
0

check for old configuration files and copy if user requests it.

A restart is required. There is a circular dependency between the config files and the GUI, and this restart breaks it
This commit is contained in:
Paul Davis 2015-03-12 17:45:31 -05:00
parent 9a05a0fbfb
commit b58c1df07d
2 changed files with 23 additions and 17 deletions

View File

@ -157,6 +157,21 @@ ARDOUR_UI *ARDOUR_UI::theArdourUI = 0;
sigc::signal<void, framepos_t, bool, framepos_t> ARDOUR_UI::Clock;
sigc::signal<void> ARDOUR_UI::CloseAllDialogs;
static bool
ask_about_configuration_copy (string const & old_dir, string const & new_dir, int version)
{
MessageDialog msg (string_compose (_("%1 %2.x has discovered configuration files from %1 %3.x.\n\n"
"Would you like to copy the relevant files before starting to use the program?\n\n"
"(This will require you to restart %1.)"),
PROGRAM_NAME, PROGRAM_VERSION, version), true);
msg.add_button (Gtk::Stock::NO, Gtk::RESPONSE_NO);
msg.show_all ();
return (msg.run() == Gtk::RESPONSE_OK);
}
ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
: Gtkmm2ext::UI (PROGRAM_NAME, argcp, argvp)
@ -223,6 +238,14 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
{
Gtkmm2ext::init(localedir);
if (ARDOUR::check_for_old_configuration_files (boost::bind (ask_about_configuration_copy, _1, _2, _3))) {
MessageDialog msg (string_compose (_("Your configuration files were copied. You can now restart %1."), PROGRAM_NAME), true);
msg.run ();
/* configuration was modified, exit immediately */
_exit (0);
}
splash = 0;
_numpad_locate_happening = false;

View File

@ -228,23 +228,6 @@ static void console_madness_end () {}
static void command_line_parse_error (int *argc, char** argv[]) {}
#endif
static bool
ask_about_configuration_copy (string const & old_dir, string const & new_dir, int version)
{
MessageDialog msg (string_compose (_("%1 %2.x has discovered configuration files from %1 %3.x.\n\n"
"Would you like to copy them before starting to use the program?\n\n"
"\n"
"(Note that not all files will be copied, since some are no longer relevant)"),
PROGRAM_NAME, PROGRAM_VERSION, version), true);
msg.add_button (Gtk::Stock::NO, Gtk::RESPONSE_NO);
msg.add_button (Gtk::Stock::YES, Gtk::RESPONSE_YES);
msg.show_all ();
return (msg.run() == Gtk::RESPONSE_YES);
}
#if (defined(COMPILER_MSVC) && defined(NDEBUG) && !defined(RDC_BUILD))
/*
* Release build with MSVC uses ardour_main()