From 0100e482c5d06f73951085f22a8606c27bdb31cf Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 19 Jul 2008 11:41:24 -0500 Subject: [PATCH] Don't carry project settings over from old project when creating a new one. --- Timeline/TLE.fl | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index ef2c99b..2ca84d1 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -99,14 +99,22 @@ if ( r < 0 ) fl_alert( "Could not open project \\"%s\\":\\n\\n\\t%s", name, s ); }} {} } - Function {save_timeline_settings()} {} { + Function {save_timeline_settings()} {open + } { code {if ( Project::open() ) { // save project local options (Timeline menu) ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Project/Se&ttings" ), "options" ); + + + char path[256]; + snprintf( path, sizeof( path ), "%s/%s", user_config_dir, ".default_project_settings" ); + + ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Project/Se&ttings" ), path ); }} {} } - Function {load_timeline_settings()} {} { + Function {load_timeline_settings()} {open + } { code {if ( Project::open() ) { ((Fl_Menu_Settings*)menubar)->load( menubar->find_item( "&Project/Se&ttings" ), "options" ); @@ -126,11 +134,13 @@ Fl::lock(); // Fl::run();} {} } - Function {TLE()} {} { + Function {TLE()} {open + } { code {Fl::visual( FL_DOUBLE | FL_RGB8 ); make_window(); + Fl::visible_focus( 0 ); Fl::get_system_colors(); @@ -173,15 +183,25 @@ free( path ); menubar->add( "&Timeline", 0, 0, const_cast< Fl_Menu_Item *>( timeline->menu->menu() ), FL_SUBMENU_POINTER ); -Loggable::progress_callback( &TLE::progress_cb, this );} {} +// save a copy of the project settings menu so that we can restore the defaults later +{ + char path[512]; + snprintf( path, sizeof( path ), "%s/%s", user_config_dir, ".default_project_settings" ); + + ((Fl_Menu_Settings*)menubar)->dump( menubar->find_item( "&Project/Se&ttings" ), path ); +} + + +Loggable::progress_callback( &TLE::progress_cb, this );} {selected + } } Function {make_window()} {open } { Fl_Window main_window { - label Timeline + label Timeline open private xywh {254 117 1025 770} type Double resizable xclass Non_DAW visible } { - Fl_Menu_Bar menubar { + Fl_Menu_Bar menubar {open private xywh {0 0 1024 25} } { Submenu {} { @@ -770,7 +790,7 @@ while ( _window->shown() ) Function {make_window()} {open } { Fl_Window _window { - label {New Project} open selected + label {New Project} open xywh {615 414 550 195} type Double modal xclass Non_DAW visible } { Fl_File_Input _name { @@ -926,7 +946,7 @@ window->do_callback();} xywh {330 700 74 25} } Fl_Output {} { - label {Last Modified On} selected + label {Last Modified On} xywh {320 130 180 25} box UP_BOX labeltype SHADOW_LABEL align 1 textfont 11 textsize 12 code0 {time_t t = modification_time( "history" );} code1 {static char s[40];}