Package: puredata / 0.46.2-1

debian_helpbrowser_puredata-doc.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Author: IOhannes m zmölnig
Description: fix menu-entries in case puredata-doc is not available
if the puredata-doc package is not installed, some of the menu-entries (namely
the manual section) will not work correctly.
This patch checks whether the files are there, and if not, a dialog is raised
asking the user to install puredata-doc
Forwarded: not-needed
--- puredata.orig/tcl/pd_menucommands.tcl
+++ puredata/tcl/pd_menucommands.tcl
@@ -195,10 +195,22 @@
     }
 }
 
+proc ::pd_menucommands::check_puredatadoc {file} {
+  if { [string compare "absolute" [file pathtype $file]] != 0 } {return true}
+  if {[file exists $file]} {
+	return true
+  } {
+    tk_messageBox -type ok -message "Unable to find '$file'.\nMaybe you need to install the 'puredata-doc' package"
+    return false
+  }
+}
+
+
 # parse the textfile for the About Pd page
 proc ::pd_menucommands::menu_aboutpd {} {
     set versionstring "Pd $::PD_MAJOR_VERSION.$::PD_MINOR_VERSION.$::PD_BUGFIX_VERSION$::PD_TEST_VERSION"
-    set filename "$::sys_libdir/doc/1.manual/1.introduction.txt"
+    set filename "/usr/share/puredata-gui/1.introduction.txt"
+    if {![check_puredatadoc $filename]} return
     if {[winfo exists .aboutpd]} {
         wm deiconify .aboutpd
         raise .aboutpd
@@ -246,6 +258,7 @@
 
 # open HTML docs from the menu using the OS-default HTML viewer
 proc ::pd_menucommands::menu_openfile {filename} {
+    if {![check_puredatadoc $filename]} return
     if {$::tcl_platform(os) eq "Darwin"} {
         exec sh -c [format "open '%s'" $filename]
     } elseif {$::tcl_platform(platform) eq "windows"} {