From 97677c561e263772693496b0fce637634e7ed83a Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Tue, 30 Apr 2013 22:44:16 -0700 Subject: [PATCH] Timeline: Don't allow import attempt when no project is loaded. --- timeline/src/TLE.fl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/timeline/src/TLE.fl b/timeline/src/TLE.fl index 220ba7b..a744648 100644 --- a/timeline/src/TLE.fl +++ b/timeline/src/TLE.fl @@ -261,7 +261,7 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {} label {Non Timeline} callback {if ( Fl::event_key() != FL_Escape ) timeline->command_quit();} open - xywh {200 266 1025 770} type Double resizable + xywh {202 266 1025 770} type Double resizable code0 {o->xclass( APP_NAME );} class TLE_Window size_range {900 300 0 0} visible } { @@ -390,12 +390,19 @@ Project::compact();} } { MenuItem {} { label {Import Ardour Session} - callback {if ( timeline->ntracks() ) + callback {if ( !Project::open() ) +{ + fl_alert( "You must create a new project before importing" ); + return; +} + +if ( timeline->ntracks() ) { fl_alert( "You can only import into an empty session!" ); return; } + pid_t pid; if ( ! (pid = fork()) ) { @@ -415,7 +422,7 @@ while ( 0 == waitpid( pid, &status, WNOHANG ) ) Project::open(path); -free(path);} +free(path);} selected xywh {20 20 40 25} } } @@ -823,7 +830,7 @@ ab.run();} } } Fl_Box {} { - label {} selected + label {} xywh {0 75 1025 692} box FLAT_BOX color 47 labeltype NO_LABEL labelsize 100 resizable code0 {timeline = o;} class Timeline