[PD-cvs] packages/darwin_app/patches extended-help-menu.patch, 1.4, 1.5
Hans-Christoph Steiner
eighthave at users.sourceforge.net
Wed Nov 16 06:35:59 CET 2005
Update of /cvsroot/pure-data/packages/darwin_app/patches
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20538
Modified Files:
extended-help-menu.patch
Log Message:
fixed a few bugs, including the one that was scattering -p around, the one that crashed Pd when it found a blank directory while building the Hlpe menu
Index: extended-help-menu.patch
===================================================================
RCS file: /cvsroot/pure-data/packages/darwin_app/patches/extended-help-menu.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** extended-help-menu.patch 15 Nov 2005 07:25:11 -0000 1.4
--- extended-help-menu.patch 16 Nov 2005 05:35:55 -0000 1.5
***************
*** 1,5 ****
! --- pd-0.38-3/src/u_main.tk Sun Feb 20 20:03:36 2005
! +++ u_main.tk Tue Nov 15 02:22:59 2005
! @@ -374,22 +374,40 @@
set help_directory $pd_guidir/doc
set help_top_directory $pd_guidir/doc
--- 1,8 ----
! Index: u_main.tk
! ===================================================================
! RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
! --- pd-0.38-4/src/u_main.tk Sun Feb 20 20:03:36 2005
! +++ u_main.tk Wed Nov 16 00:33:02 2005
! @@ -374,22 +374,41 @@
set help_directory $pd_guidir/doc
set help_top_directory $pd_guidir/doc
***************
*** 9,17 ****
+# in /tmp so that it can be opened from the Help->Pure Documentation... menu
+# under Mac OS X. It is meant to be run at startup.
! +# Damn you Apple and your "we know best" "features". <hans at at.or.at.>
+proc generate_menu_doc_link {} {
+ global help_directory
+
! + regsub -all "/" $help_directory "_" help_directory_alias
+ set help_directory_alias /tmp/$help_directory_alias
+ set help_directory_tmpdir $help_directory_alias/doc
--- 12,21 ----
+# in /tmp so that it can be opened from the Help->Pure Documentation... menu
+# under Mac OS X. It is meant to be run at startup.
! +# Damn you Apple and your "hide stuff from the user" "features".
! +# <hans at at.or.at.>
+proc generate_menu_doc_link {} {
+ global help_directory
+
! + regsub -all "/" $help_directory "." help_directory_alias
+ set help_directory_alias /tmp/$help_directory_alias
+ set help_directory_tmpdir $help_directory_alias/doc
***************
*** 21,25 ****
+ }
+ if { ! [ file isdirectory $help_directory_tmpdir ] } {
! + file mkdir -p $help_directory_tmpdir
+ }
+ foreach file [ lsort [ glob -dir $help_directory * ] ] {
--- 25,29 ----
+ }
+ if { ! [ file isdirectory $help_directory_tmpdir ] } {
! + file mkdir $help_directory_tmpdir
+ }
+ foreach file [ lsort [ glob -dir $help_directory * ] ] {
***************
*** 50,67 ****
if {[string first .txt $filename] >= 0} {
menu_opentext $filename
! @@ -411,38 +429,56 @@
set dirname $pd_guidir/$subdir
! - if {[regexp ".*\.(txt|c)$" $basename]} {
! + if {[regexp ".*\.(txt|c|css)$" $basename]} {
menu_opentext $dirname/$basename
} elseif {[regexp ".*\.html?$" $basename]} {
menu_openhtml $dirname/$basename
- + } elseif {[regexp ".*\.(wav|aif|aiff|jpg|jpeg|gif|png|mov|avi)$" $basename]} {
- + menu_openhtml $dirname/$basename
} else {
! pd [concat pd open [pdtk_enquote $basename] \
! [pdtk_enquote $dirname] \;]
}
}
--- 54,78 ----
if {[string first .txt $filename] >= 0} {
menu_opentext $filename
! @@ -411,35 +430,57 @@
set dirname $pd_guidir/$subdir
! + set file_type [file type $dirname/$basename]
! + if { $file_type == "directory" } {
! + pd [concat pd open [pdtk_enquote $basename] \
! + [pdtk_enquote $dirname] \;]
! + } else {
! if {[regexp ".*\.(txt|c)$" $basename]} {
menu_opentext $dirname/$basename
+ + } elseif {[regexp ".*\.(pd|max)$" $basename]} {
+ + pd [concat pd open [pdtk_enquote $basename] \
+ + [pdtk_enquote $dirname] \;]
} elseif {[regexp ".*\.html?$" $basename]} {
menu_openhtml $dirname/$basename
} else {
! - pd [concat pd open [pdtk_enquote $basename] \
! - [pdtk_enquote $dirname] \;]
! + menu_openhtml $dirname/$basename
! + }
}
}
***************
*** 81,102 ****
+ global help_top_directory
+
! + set menu_dir [file join $help_top_directory $base_dir $sub_dir]
! +
! + foreach file [ lsort [ glob -dir $menu_dir * ] ] {
+ set file_type [file type $file]
+ regsub {.*/(.*$)} $file {\1} file_name
! +# If links are going to be used then there needs to be a check to see if each
! +# link might cause this function to recurse forever <hans at at.or.at>
! +# if { $file_type == "link"} {
! +# puts stderr "LINK: $file"
! +# }
+ if { $file_type == "file" } {
+ # only put certain file types on the menu
! + if {[regexp ".*\.(htm|html|c|pd|txt|wav|aif|aiff)$" $file]} {
+ $helpmenu add command -label $file_name \
+ -command "menu_doc_open doc/$base_dir/$sub_dir $file_name"
+ }
+ } elseif { $file_type == "directory" } {
! + regsub -all "\\\." $file_name "" submenu
menu $helpmenu.$submenu -tearoff $pd_tearoff
- regsub -all "\\\." $subdir " " submenuname
--- 92,113 ----
+ global help_top_directory
+
! + set menu_dir $help_top_directory/$base_dir/$sub_dir
! +
! + foreach file [ lsort [ glob -nocomplain -dir $menu_dir * ] ] {
+ set file_type [file type $file]
+ regsub {.*/(.*$)} $file {\1} file_name
! + # If links are going to be used then there needs to be a check to see if each
! + # link might cause this function to recurse forever <hans at at.or.at>
! + # if { $file_type == "link"} {
! + # puts stderr "LINK: $file"
! + # }
+ if { $file_type == "file" } {
+ # only put certain file types on the menu
! + if {[regexp ".*\.(htm|html|c|pd|txt|pdf|wav|aif|aiff)$" $file]} {
+ $helpmenu add command -label $file_name \
+ -command "menu_doc_open doc/$base_dir/$sub_dir $file_name"
+ }
+ } elseif { $file_type == "directory" } {
! + regsub -all "\\\." [string tolower $file_name] "" submenu
menu $helpmenu.$submenu -tearoff $pd_tearoff
- regsub -all "\\\." $subdir " " submenuname
***************
*** 113,126 ****
- -command "menu_doc_open doc/$subdir $filename"
+ menu_doc_submenu $helpmenu.$submenu $base_dir/$sub_dir [file tail $file]
}
}
! +
! +}
! +
! ############# routine to add media, help, and apple menu items ###############
!
! proc menu_addstd {mbar} {
! @@ -494,7 +530,18 @@
--- 124,132 ----
- -command "menu_doc_open doc/$subdir $filename"
+ menu_doc_submenu $helpmenu.$submenu $base_dir/$sub_dir [file tail $file]
+ + }
}
}
! @@ -494,7 +535,18 @@
***************
*** 142,146 ****
# as a special menu with specific behaviors on different platforms.
# See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
! @@ -502,22 +549,9 @@
-command {menu_doc_open doc/1.manual 1.introduction.txt}
$mbar.help add command -label {Pure Documentation...} \
--- 148,152 ----
# as a special menu with specific behaviors on different platforms.
# See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
! @@ -502,22 +554,9 @@
-command {menu_doc_open doc/1.manual 1.introduction.txt}
$mbar.help add command -label {Pure Documentation...} \
More information about the Pd-cvs
mailing list