13
0

fix return type in last commit for AutomationLine::control_point_box_size(); catch attempts to use new session dialog to open existing sessions

git-svn-id: svn://localhost/ardour2/trunk@1042 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-10-31 21:48:51 +00:00
parent 5170c9d8d9
commit 34cd3457a2
4 changed files with 41 additions and 8 deletions

View File

@ -1608,18 +1608,22 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
int response = Gtk::RESPONSE_NONE;
new_session_dialog->set_modal(true);
new_session_dialog->set_name(predetermined_path);
new_session_dialog->set_name (predetermined_path);
new_session_dialog->reset_recent();
new_session_dialog->show();
do {
response = new_session_dialog->run ();
_session_is_new = false;
if (response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
if(response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
quit();
return;
} else if (response == Gtk::RESPONSE_NONE) {
/* Clear was pressed */
new_session_dialog->reset();
@ -1671,8 +1675,6 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
} else {
_session_is_new = true;
if (session_name.empty()) {
response = Gtk::RESPONSE_NONE;
continue;
@ -1688,14 +1690,43 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
} else {
session_path = new_session_dialog->session_folder();
}
//XXX This is needed because session constructor wants a
//non-existant path. hopefully this will be fixed at some point.
session_path = Glib::build_filename (session_path, session_name);
if (g_file_test (session_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) {
Glib::ustring str = string_compose (_("This session\n%1\nalready exists. Do you want to open it?"), session_path);
MessageDialog msg (str,
false,
Gtk::MESSAGE_WARNING,
Gtk::BUTTONS_YES_NO,
true);
msg.set_name (X_("CleanupDialog"));
msg.set_wmclass (_("existing_session"), "Ardour");
msg.set_position (Gtk::WIN_POS_MOUSE);
switch (msg.run()) {
case RESPONSE_YES:
load_session (session_path, session_name);
goto done;
break;
default:
response = RESPONSE_NONE;
new_session_dialog->reset ();
continue;
}
}
_session_is_new = true;
std::string template_name = new_session_dialog->session_template_name();
if (new_session_dialog->use_session_template()) {
@ -1755,6 +1786,7 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
} while (response == Gtk::RESPONSE_NONE);
done:
show();
new_session_dialog->get_window()->set_cursor();
new_session_dialog->hide();

View File

@ -294,7 +294,7 @@ AutomationLine::hide ()
_visible = false;
}
uint32_t
double
AutomationLine::control_point_box_size ()
{
if (_height > TimeAxisView::hLarger) {

View File

@ -217,7 +217,7 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
void reset_line_coords (ControlPoint&);
void update_line ();
uint32_t control_point_box_size ();
double control_point_box_size ();
struct ModelRepresentation {
ARDOUR::AutomationList::iterator start;

View File

@ -334,6 +334,7 @@ Session::Session (AudioEngine &eng,
first_stage_init (fullpath, snapshot_name);
new_session = !g_file_test (_path.c_str(), GFileTest (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR));
if (new_session) {
if (create (new_session, 0, initial_length)) {
throw failed_constructor ();