Revision: 9615 http://pure-data.svn.sourceforge.net/pure-data/?rev=9615&view=rev Author: eighthave Date: 2008-03-20 18:50:30 -0700 (Thu, 20 Mar 2008)
Log Message: ----------- checked in IOhannes' morestartpaths.diff from patch #1810951 since Miller took this patch. It is a bit better than what was there before, but still has serious issues
Modified Paths: -------------- branches/pd-extended/v0-40/pd/src/s_path.c branches/pd-extended/v0-40/pd/src/u_main.tk
Modified: branches/pd-extended/v0-40/pd/src/s_path.c =================================================================== --- branches/pd-extended/v0-40/pd/src/s_path.c 2008-03-21 01:24:13 UTC (rev 9614) +++ branches/pd-extended/v0-40/pd/src/s_path.c 2008-03-21 01:50:30 UTC (rev 9615) @@ -531,12 +531,17 @@ char buf[MAXPDSTRING]; int i; t_namelist *nl; - - for (nl = sys_searchpath, i = 0; nl && i < 10; nl = nl->nl_next, i++) - sys_vgui("pd_set pd_path%d "%s"\n", i, nl->nl_string); - for (; i < 10; i++) - sys_vgui("pd_set pd_path%d ""\n", i);
+ sprintf(buf, "list"); + for (nl = sys_searchpath, i = 0; nl; nl = nl->nl_next, i++) { + if(nl->nl_string){ + strcat(buf, " ""); + strcat(buf, nl->nl_string); + strcat(buf, """); + } + } + sys_vgui("pd_set pd_path [%s]\n", buf); + sprintf(buf, "pdtk_path_dialog %%s %d %d\n", sys_usestdpath, sys_verbose); gfxstub_new(&glob_pdobject, (void *)glob_start_path_dialog, buf); } @@ -563,12 +568,17 @@ char buf[MAXPDSTRING]; int i; t_namelist *nl; - - for (nl = sys_externlist, i = 0; nl && i < 10; nl = nl->nl_next, i++) - sys_vgui("pd_set pd_startup%d "%s"\n", i, nl->nl_string); - for (; i < 10; i++) - sys_vgui("pd_set pd_startup%d ""\n", i);
+ sprintf(buf, "list"); + for (nl = sys_externlist, i = 0; nl; nl = nl->nl_next, i++) { + if(nl->nl_string){ + strcat(buf, " ""); + strcat(buf, nl->nl_string); + strcat(buf, """); + } + } + sys_vgui("pd_set pd_startup [%s]\n", buf); + sprintf(buf, "pdtk_startup_dialog %%s %d "%s"\n", sys_defeatrt, sys_flags->s_name); gfxstub_new(&glob_pdobject, (void *)glob_start_startup_dialog, buf);
Modified: branches/pd-extended/v0-40/pd/src/u_main.tk =================================================================== --- branches/pd-extended/v0-40/pd/src/u_main.tk 2008-03-21 01:24:13 UTC (rev 9614) +++ branches/pd-extended/v0-40/pd/src/u_main.tk 2008-03-21 01:50:30 UTC (rev 9615) @@ -4416,15 +4416,16 @@
proc path_apply {id} { global pd_extrapath pd_verbose - global pd_path0 pd_path1 pd_path2 pd_path3 pd_path4 - global pd_path5 pd_path6 pd_path7 pd_path8 pd_path9 + global pd_path_count + set pd_path {}
- pd [concat pd path-dialog $pd_extrapath $pd_verbose \ - [pdtk_encodedialog $pd_path0] [pdtk_encodedialog $pd_path1] \ - [pdtk_encodedialog $pd_path2] [pdtk_encodedialog $pd_path3] \ - [pdtk_encodedialog $pd_path4] [pdtk_encodedialog $pd_path5] \ - [pdtk_encodedialog $pd_path6] [pdtk_encodedialog $pd_path7] \ - [pdtk_encodedialog $pd_path8] [pdtk_encodedialog $pd_path9] ;] + for {set x 0} {$x < $pd_path_count} {incr x} { + global pd_path$x + set this_path [set pd_path$x] + if {0==[string match "" $this_path]} {lappend pd_path [pdtk_encodedialog $this_path]} + } + + pd [concat pd path-dialog $pd_extrapath $pd_verbose $pd_path ;] }
proc path_cancel {id} { @@ -4438,9 +4439,17 @@
proc pdtk_path_dialog {id extrapath verbose} { global pd_extrapath pd_verbose - global pd_path0 pd_path1 pd_path2 pd_path3 pd_path4 - global pd_path5 pd_path6 pd_path7 pd_path8 pd_path9 + global pd_path + global pd_path_count
+ set pd_path_count [expr [llength $pd_path] + 2] + if { $pd_path_count < 10 } { set pd_path_count 10 } + + for {set x 0} {$x < $pd_path_count} {incr x} { + global pd_path$x + set pd_path$x [lindex $pd_path $x] + } + set pd_extrapath $extrapath set pd_verbose $verbose toplevel $id @@ -4471,8 +4480,8 @@ -command "path_apply $id ; pd pd save-preferences \;" pack $id.extraframe.extra $id.extraframe.verbose $id.extraframe.save \ -side left -expand 1 - - for {set x 0} {$x < 10} {incr x} { + + for {set x 0} {$x < $pd_path_count} {incr x} { entry $id.f$x -textvariable pd_path$x -width 80 pack $id.f$x -side top } @@ -4489,16 +4498,16 @@
proc startup_apply {id} { global pd_nort pd_flags - global pd_startup0 pd_startup1 pd_startup2 pd_startup3 pd_startup4 - global pd_startup5 pd_startup6 pd_startup7 pd_startup8 pd_startup9 + global pd_startup_count
- pd [concat pd startup-dialog $pd_nort [pdtk_encodedialog $pd_flags] \ - [pdtk_encodedialog $pd_startup0] [pdtk_encodedialog $pd_startup1] \ - [pdtk_encodedialog $pd_startup2] [pdtk_encodedialog $pd_startup3] \ - [pdtk_encodedialog $pd_startup4] [pdtk_encodedialog $pd_startup5] \ - [pdtk_encodedialog $pd_startup6] [pdtk_encodedialog $pd_startup7] \ - [pdtk_encodedialog $pd_startup8] [pdtk_encodedialog $pd_startup9] ;] + set pd_startup {} + for {set x 0} {$x < $pd_startup_count} {incr x} { + global pd_startup$x + set this_startup [set pd_startup$x] + if {0==[string match "" $this_startup]} {lappend pd_startup [pdtk_encodedialog $this_startup]} + }
+ pd [concat pd startup-dialog $pd_nort [pdtk_encodedialog $pd_flags] $pd_startup ;] }
proc startup_cancel {id} { @@ -4512,9 +4521,17 @@
proc pdtk_startup_dialog {id nort flags} { global pd_nort pd_nt pd_flags - global pd_startup0 pd_startup1 pd_startup2 pd_startup3 pd_startup4 - global pd_startup5 pd_startup6 pd_startup7 pd_startup8 pd_startup9 + global pd_startup + global pd_startup_count
+ set pd_startup_count [expr [llength $pd_startup] + 2] + if { $pd_startup_count < 10 } { set pd_startup_count 10 } + + for {set x 0} {$x < $pd_startup_count} {incr x} { + global pd_startup$x + set pd_startup$x [lindex $pd_startup $x] + } + set pd_nort $nort set pd_flags $flags toplevel $id @@ -4555,8 +4572,11 @@ pack $id.nortframe.save -side left -expand 1 }
- for {set x 0} {$x < 10} {incr x} { - entry $id.f$x -textvariable pd_startup$x -width 80 + + + for {set x 0} {$x < $pd_startup_count} {incr x} { + entry $id.f$x -textvariable pd_startup$x -width 80 -borderwidth 1 -bg grey98 \ + -highlightthickness 1 -highlightcolor blue pack $id.f$x -side top }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.