diff --git a/Timeline/Loggable.C b/Timeline/Loggable.C index 64c8412..3f2ba88 100644 --- a/Timeline/Loggable.C +++ b/Timeline/Loggable.C @@ -120,6 +120,9 @@ Loggable::replay ( FILE *fp ) _progress_callback( current * 100 / total, _progress_callback_arg ); } + if ( _progress_callback ) + _progress_callback( 0, _progress_callback_arg ); + return true; } @@ -127,7 +130,6 @@ Loggable::replay ( FILE *fp ) bool Loggable::close ( void ) { - DMESSAGE( "closing journal and destroying all journaled objects" ); if ( ! _fp ) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index c0ec13b..5b609e7 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -103,7 +103,7 @@ main_window->show(); Fl::lock(); -Fl::run();} {} +// Fl::run();} {} } Function {TLE()} {open } { @@ -152,7 +152,10 @@ asprintf( &path, "%s/options", user_config_dir ); free( path ); -menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER );} {} +menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER ); + + +Loggable::progress_callback( &TLE::progress_cb, this );} {} } Function {make_window()} {open } { @@ -191,9 +194,6 @@ main_window->redraw();} if ( ! name ) return; -progress->show(); -timeline->hide(); -Loggable::progress_callback( progress_cb, this ); if ( ! Project::validate( name ) ) { @@ -204,9 +204,7 @@ else if ( ! Project::open( name ) ) fl_alert( "Could not open \\"%s\\" as a Non-DAW project!", name ); // we are in a somewhar ambiguous state now with no project open. -} -progress->hide(); -timeline->show();} +}} selected xywh {10 10 40 25} } MenuItem {} { @@ -679,8 +677,7 @@ project_name->redraw();} {} snprintf( s, 5, "%d%%", (int)v ); -p->label( s );} {selected - } +p->label( s );} {} } Function {update_status()} {open } { @@ -807,7 +804,20 @@ exit( 0 );} {} } Function {progress_cb( int p, void *arg )} {open return_type {static void} } { - code {Fl_Progress *progress = ((TLE*)arg)->progress; + code {((TLE*)arg)->progress_cb( p );} {} + } + Function {progress_cb( int p )} {open return_type void + } { + code {if ( ! progress->visible() ) +{ + timeline->hide(); + progress->show(); +} +else if ( 0 == p ) +{ + timeline->show(); + progress->hide(); +} static char pat[10]; diff --git a/Timeline/main.C b/Timeline/main.C index 56174b2..6cdd605 100644 --- a/Timeline/main.C +++ b/Timeline/main.C @@ -135,15 +135,17 @@ main ( int argc, char **argv ) lash->init( APP_NAME, APP_TITLE, &argc, &argv ); + MESSAGE( "Starting GUI" ); + + tle->run(); + if ( argc > 1 ) if ( ! Project::open( argv[ 1 ] ) ) FATAL( "Could not open project specified on command line" ); /* FIXME: open project in /tmp if none is given? */ - MESSAGE( "Starting GUI" ); - - tle->run(); + Fl::run(); MESSAGE( "Your fun is over" ); }