Fix the new project dialog.

This commit is contained in:
Jonathan Moore Liles 2010-01-24 15:54:53 -06:00
parent 2bb7d737b9
commit e945a3893c
3 changed files with 40 additions and 26 deletions

View File

@ -34,11 +34,17 @@ class New_Project_Dialog {open
} {
Function {New_Project_Dialog()} {open
} {
code {make_window();} {}
code {_default_path = 0;
path = 0;
make_window();} {}
}
Function {run()} {open return_type void
} {
code {_window->show();
code {
_directory->value( _default_path );
_window->show();
while ( _window->shown() )
Fl::wait();} {}
@ -68,8 +74,7 @@ while ( _window->shown() )
path = strdup( pat );
_default_path = strdup( _directory->value() );
_default_path = _directory->value() ? strdup( _directory->value() ) : 0;
//if ( ! Project::create( pat, _template->text( _template->value() ) ) )
// fl_alert( "Error creating project!" );
@ -143,6 +148,6 @@ nsd.run();
*default_path = strdup( nsd.default_path() );
*selected_template = strdup( nsd.selected_template() );
return strdup( nsd.path );} {selected
return nsd.path;} {selected
}
}

View File

@ -72,18 +72,23 @@ void Mixer::cb_menu(Fl_Widget* o) {
char *default_path;
char *selected_template;
// read_line( user_config_dir, "default_path", &default_path );
read_line( user_config_dir, "default_path", &default_path );
char *path = new_project_chooser( templates, &default_path, &selected_template );
if ( path )
{
if ( ! Project::create( path, selected_template ) )
fl_alert( "Error creating project!" );
free( path );
free( selected_template );
free( default_path );
}
// write_line( user_config_dir, "default_path", default_path );
if ( default_path )
{
write_line( user_config_dir, "default_path", default_path );
free( default_path );
}
}
else if (! strcmp( picked, "&Project/&Open" ) )

View File

@ -221,7 +221,7 @@ Loggable::progress_callback( &TLE::progress_cb, this );} {}
label Timeline
callback {if ( Fl::event_key() != FL_Escape )
o->hide();} open
private xywh {703 114 1025 770} type Double resizable xclass Non_DAW visible
private xywh {705 125 1025 770} type Double resizable xclass Non_DAW visible
} {
Fl_Menu_Bar menubar {open
private xywh {0 0 1024 25}
@ -294,15 +294,20 @@ read_line( user_config_dir, "default_path", &default_path );
char *path = new_project_chooser( templates, &default_path, &selected_template );
if ( path )
{
if ( ! Project::create( path, selected_template ) )
fl_alert( "Error creating project!" );
free( path );
free( selected_template );
free( default_path );
}
if ( default_path )
{
write_line( user_config_dir, "default_path", default_path );
free( default_path );
}
load_timeline_settings();
@ -838,8 +843,7 @@ sm_blinker->value( timeline->session_manager_name() != NULL );
sm_blinker->tooltip( timeline->session_manager_name() );
selected_blinker->value( timeline->nselected() );} {selected
seek_blinker->value( timeline->seek_pending() );
project_name->redraw();} {selected
}
project_name->redraw();} {}
}
Function {update_cb( void *v )} {open private return_type {static void}
} {
@ -927,7 +931,7 @@ if ( logo_box->image() )
((Fl_Shared_Image*)logo_box->image())->release();
logo_box->image( NULL );
}} open
private xywh {655 259 520 740} type Double modal visible
private xywh {761 214 520 740} type Double modal visible
} {
Fl_Value_Output {} {
label {Sample Rate}