summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-08 01:43:44 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-08 01:43:44 +0000
commit9fa8238d9d4ebda14d60cc2256d721a0405b5fa0 (patch)
tree857880a19b0f559941c5491e43b61601b2efc12b
parent5bd34bd84c69838dded18ba9c42db0a9d338f103 (diff)
Delay the writing of the been-here-before file until a bit later, in case the user cancels at some point during setup (#4434).
git-svn-id: svn://localhost/ardour2/branches/3.0@10489 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/startup.cc18
-rw-r--r--gtk2_ardour/startup.h4
2 files changed, 17 insertions, 5 deletions
diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc
index 37e62ca04f..77afb0fa17 100644
--- a/gtk2_ardour/startup.cc
+++ b/gtk2_ardour/startup.cc
@@ -121,9 +121,7 @@ Ardour will play NO role in monitoring"))
set_default_icon_list (window_icons);
}
- sys::path been_here_before = user_config_directory();
- been_here_before /= ".a3"; // XXXX use more specific version so we can catch upgrades
- new_user = !exists (been_here_before);
+ new_user = !exists (been_here_before_path ());
bool need_audio_setup = !EngineControl::engine_running();
@@ -141,8 +139,6 @@ Ardour will play NO role in monitoring"))
error << "Could not create user configuration directory" << endmsg;
}
- /* "touch" the file */
- ofstream fout (been_here_before.to_string().c_str());
setup_new_user_page ();
setup_first_time_config_page ();
setup_monitoring_choice_page ();
@@ -645,6 +641,9 @@ ArdourStartup::on_apply ()
Config->set_use_monitor_bus (use_monitor_section_button.get_active());
+ /* "touch" the been-here-before path now that we're about to save Config */
+ ofstream fout (been_here_before_path().to_string().c_str());
+
Config->save_state ();
}
@@ -1378,3 +1377,12 @@ ArdourStartup::existing_session_selected ()
set_page_complete (session_vbox, true);
move_along_now ();
}
+
+sys::path
+ArdourStartup::been_here_before_path () const
+{
+ sys::path b = user_config_directory();
+ b /= ".a3"; // XXXX use more specific version so we can catch upgrades
+ return b;
+}
+
diff --git a/gtk2_ardour/startup.h b/gtk2_ardour/startup.h
index 76183b5b5a..a7f1517f41 100644
--- a/gtk2_ardour/startup.h
+++ b/gtk2_ardour/startup.h
@@ -39,6 +39,8 @@
#include <gtkmm/liststore.h>
#include <gtkmm/combobox.h>
+#include "pbd/filesystem.h"
+
#include "ardour/utils.h"
class EngineControl;
@@ -85,6 +87,8 @@ class ArdourStartup : public Gtk::Assistant {
bool new_user;
bool new_only;
+ PBD::sys::path been_here_before_path () const;
+
void on_apply ();
void on_cancel ();
bool on_delete_event (GdkEventAny*);