rwdgutenberg 0.03

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. data/Books/8sam810.txt +8522 -0
  2. data/Books/Sam2.gut +2 -0
  3. data/Readme.txt +94 -0
  4. data/bin/rwdgutenberg +19 -0
  5. data/code/01rwdcore/01rwdcore.rb +20 -0
  6. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  7. data/code/01rwdcore/03helptexthash.rb +31 -0
  8. data/code/01rwdcore/04helptextend.rb +6 -0
  9. data/code/01rwdcore/openhelpwindow.rb +31 -0
  10. data/code/01rwdcore/returntomain.rb +10 -0
  11. data/code/01rwdcore/rwdtinkerversion.rb +15 -0
  12. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  13. data/code/01rwdcore/uploadreturns.rb +62 -0
  14. data/code/superant.com.gutenberg/changegutenbergname.rb +16 -0
  15. data/code/superant.com.gutenberg/clearbookscreendisplay.rb +8 -0
  16. data/code/superant.com.gutenberg/copyfilename.rb +24 -0
  17. data/code/superant.com.gutenberg/createnewnote.rb +23 -0
  18. data/code/superant.com.gutenberg/deletegutenbergrecord.rb +21 -0
  19. data/code/superant.com.gutenberg/gutenbergcreatefile.rb +9 -0
  20. data/code/superant.com.gutenberg/helptexthashrwdgutenberg.rb +41 -0
  21. data/code/superant.com.gutenberg/listnamerecord.rb +15 -0
  22. data/code/superant.com.gutenberg/listtextfilesgutenberg.rb +58 -0
  23. data/code/superant.com.gutenberg/loadbookrecord.rb +21 -0
  24. data/code/superant.com.gutenberg/loadconfigurationrecord.rb +36 -0
  25. data/code/superant.com.gutenberg/loadconfigurationvariables.rb +13 -0
  26. data/code/superant.com.gutenberg/openhelpwindowgutenberg.rb +29 -0
  27. data/code/superant.com.gutenberg/returntomain.rb +10 -0
  28. data/code/superant.com.gutenberg/rungutenbergwindow.rb +42 -0
  29. data/code/superant.com.gutenberg/rwdgutenbergbackward.rb +27 -0
  30. data/code/superant.com.gutenberg/rwdhypernotehelpabout.rb +14 -0
  31. data/code/superant.com.gutenberg/saveconfigurationrecord.rb +18 -0
  32. data/code/superant.com.gutenberg/savegutenbergrecord.rb +20 -0
  33. data/code/superant.com.gutenberg/savelinkrecord.rb +23 -0
  34. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
  35. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +25 -0
  36. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
  37. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +24 -0
  38. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
  39. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
  40. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  41. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  42. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +11 -0
  43. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
  44. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -0
  45. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +13 -0
  46. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  47. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -0
  48. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
  49. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  50. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +32 -0
  51. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +12 -0
  52. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
  53. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +18 -0
  54. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  55. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  56. data/code/zz0applicationend/zz0end.rb +4 -0
  57. data/configuration/language.dist +7 -0
  58. data/configuration/rwdapplicationidentity.dist +3 -0
  59. data/configuration/rwdgutenberg.dist +12 -0
  60. data/configuration/rwdtinker.dist +15 -0
  61. data/configuration/tinkerwin2variables.dist +17 -0
  62. data/ev/browser.rb +109 -0
  63. data/ev/ftools.rb +170 -0
  64. data/ev/net.rb +750 -0
  65. data/ev/ruby.rb +819 -0
  66. data/ev/rwd.rb +1849 -0
  67. data/ev/sgml.rb +236 -0
  68. data/ev/thread.rb +63 -0
  69. data/ev/tree.rb +343 -0
  70. data/ev/xml.rb +4 -0
  71. data/extras/rconftool.rb +380 -0
  72. data/extras/zip/ioextras.rb +114 -0
  73. data/extras/zip/stdrubyext.rb +111 -0
  74. data/extras/zip/tempfile_bugfixed.rb +195 -0
  75. data/extras/zip/zip.rb +1377 -0
  76. data/extras/zip/zipfilesystem.rb +558 -0
  77. data/extras/zip/ziprequire.rb +61 -0
  78. data/gui/00coreguibegin/applicationguitop.rwd +4 -0
  79. data/gui/frontwindow0/superant.com.gutenberg/10viewnote.rwd +32 -0
  80. data/gui/frontwindow0/superant.com.gutenberg/20listfiles.rwd +35 -0
  81. data/gui/frontwindow0/superant.com.gutenberg/30booklistutilities.rwd +28 -0
  82. data/gui/frontwindow0/superant.com.gutenberg/35displaytab.rwd +10 -0
  83. data/gui/frontwindow0/superant.com.gutenberg/40rwdgutenberg.rwd +16 -0
  84. data/gui/frontwindow0/superant.com.gutenberg/67viewconfiguration.rwd +40 -0
  85. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +16 -0
  86. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -0
  87. data/gui/frontwindowselectionzend/viewselectionzend/viewselectionend.rwd +3 -0
  88. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +6 -0
  89. data/gui/frontwindowtdocuments/superant.com,rwdgutenbergdocument/rwdgutenbergdocument.rwd +5 -0
  90. data/gui/frontwindowtdocuments/superant.com.documents/uu5documents.rwd +15 -0
  91. data/gui/frontwindowtdocuments/superant.com.tinkerwin2documents/uu5documents.rwd +6 -0
  92. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +12 -0
  93. data/gui/frontwindowz1end/frontwindowend/xx0rwdfirsttab.rwd +6 -0
  94. data/gui/helpaboutbegin/superant.com.helpaboutbegin/ya0helpscreenstart.rwd +3 -0
  95. data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/1versionname.rwd +6 -0
  96. data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/5version.rwd +9 -0
  97. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +4 -0
  98. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +3 -0
  99. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +10 -0
  100. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/1appname.rwd +4 -0
  101. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +3 -0
  102. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/5version.rwd +10 -0
  103. data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +3 -0
  104. data/gui/tinkerbackwindows/superant.com.gutendisplay/gutendisplaywindow.rwd +9 -0
  105. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
  106. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +42 -0
  107. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
  108. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
  109. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
  110. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
  111. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  112. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +11 -0
  113. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
  114. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  115. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
  116. data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
  117. data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +4 -0
  118. data/init.rb +274 -0
  119. data/installed/rwdviewlogo-0.4.inf +4 -0
  120. data/lang/en/rwdcore/languagefile.rb +16 -0
  121. data/lang/es/rwdcore/languagefile-es.rb +14 -0
  122. data/lang/jp/rwdcore/languagefile.rb +9 -0
  123. data/lang/nl/rwdcore/languagefile.rb +19 -0
  124. data/lib/temp.rb +1 -0
  125. data/rwd_files/HowTo_Gutenberg.txt +94 -0
  126. data/rwd_files/HowTo_Tinker.txt +400 -0
  127. data/rwd_files/HowTo_TinkerWin2.txt +202 -0
  128. data/rwd_files/Readme.txt +57 -0
  129. data/rwd_files/favicon.ico +0 -0
  130. data/rwd_files/rdoc-style.css +175 -0
  131. data/rwd_files/rwdapplications.html +54 -0
  132. data/rwd_files/rwdindex.html +6 -0
  133. data/rwd_files/tinker.png +0 -0
  134. data/rwdconfig.dist +6 -0
  135. data/rwdgutenberg-0.03.gem +0 -0
  136. data/tests/checkdepends.sh +4 -0
  137. data/tests/cleancnf.sh +5 -0
  138. data/tests/makedist.rb +29 -0
  139. data/tests/rdep.rb +354 -0
  140. data/tests/rwdtinkertestEN.rb +163 -0
  141. data/tests/test.result +32 -0
  142. data/tests/totranslate.lang +93 -0
  143. data/zips/rwdahelloworld-0.5.zip +0 -0
  144. metadata +198 -0
@@ -0,0 +1,25 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
+ # This application is a framework for writing programs from RubyWebDialogs
3
+ # http://www.erikveen.dds.nl/rubywebdialogs/index.html
4
+ # For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
5
+
6
+
7
+
8
+
9
+ require 'resolv'
10
+ require 'date'
11
+
12
+ # return the platform information
13
+ def runviewplatform
14
+ @platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
15
+ @platformdisplay = @platformdisplay + "Ruby Version " + VERSION + "\n"
16
+ @platformdisplay = @platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
17
+ @platformdisplay = @platformdisplay + "program directory " + $progdir + "\n"
18
+ @platformdisplay = @platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
19
+ @platformdisplay = @platformdisplay + "application name " + $rwdapplicationidentity + "\n"
20
+ @platformdisplay = @platformdisplay + "Date " + Date.today().to_s
21
+
22
+ end
23
+
24
+
25
+
@@ -0,0 +1,61 @@
1
+ # help text files used by context sensitive help
2
+
3
+ Helptext.update( :tinkerwin2_help => " You can view the list of applets you can install
4
+ by clicking on the list files button
5
+
6
+ You can download an applet created by someone else
7
+
8
+ put the file in the zips directory
9
+
10
+ rwdtinker applets packaged as RubyGems can be used if you have RubyGems installed.
11
+ You can download rwdtinker gems at the 'Install Remote Applets' tab
12
+ to install applets you need the ruby zlib library installed
13
+ ",
14
+ :applet_viewing => "You can get a list of all installed applets by clicking the 'listfiles button'
15
+ To see the text of a install file
16
+ Type in the name of the file you want.
17
+
18
+ type it without the inf ending
19
+ rwdapplet-0.1
20
+
21
+ Then click the 'View Installed File' button
22
+
23
+ If it finds the file it will open it. It displays the text the search box.
24
+
25
+ You can uninstall applets on this screen",
26
+
27
+ :applet_installation => " You can download an applet created by someone else\n
28
+ put the file in the zips directory\n
29
+
30
+ click on the 'list zips' tab\n
31
+ click on 'list applets available for installing'\n
32
+
33
+ chose the applet you want\n
34
+ click on 'install applet'\n
35
+ If all goes well the applet should be installed.\n
36
+ You will need to restart rwdtinker to see the new screens
37
+ to install applets you need the ruby zlib library installed",
38
+
39
+ :applet_tinkerbackeditconfiguration => " You can edit the configuration
40
+
41
+ Remember to reload the configuration variables if you want your
42
+ changes used.",
43
+ :remotegemapplet_install => " To download and install use the 'Install Remote Applets'
44
+
45
+ First click on 'List applets in the Remote GEM Repository available for downloading'
46
+ then go to the very bottom to click on the applet you want
47
+ then on the top click 'install remote Gem applet package'
48
+
49
+ This installs the package in the Gem system
50
+ You still need to install it into rwdtinker - do that in the 'List Zips' tab
51
+
52
+ For this feature to work, you need
53
+ RubyGems installed
54
+ Variables set correctly in the tinerwin2.cnf file
55
+ $xpcommand, $gemdirectory_withgemfiles and $geminstalled_directory
56
+ the defaults as shipped will normally be for a Debian Linux system
57
+ On Debian Linux, you would usually need to be running rwdtinker as root in order to install RubyGems
58
+
59
+ You can view the list of rwdtinker applets you have installed already by clicking 'view already installed GEM applets'
60
+ "
61
+ )
@@ -0,0 +1,24 @@
1
+ # code in install rwdtinker applets - now uses ruby.zip module
2
+ def installapplet
3
+
4
+ nametext = "%s" % [@a_installapplet]
5
+
6
+ begin # exception trapped block
7
+
8
+
9
+ require 'extras/zip/zip'
10
+ fullname = nametext + ".zip"
11
+ fileName = File.join($zipslocation,fullname)
12
+
13
+ zf = Zip::ZipFile.new(fileName)
14
+ zf.sort.each {
15
+ |entry|
16
+ zf.extract(entry.to_s, entry.to_s)
17
+ }
18
+ @installapplettext = Message[:applet_installed]
19
+
20
+ rescue
21
+ @installapplettext = "unzip error - applet may not be installed correctly"
22
+ end # exception rescue
23
+
24
+ end
@@ -0,0 +1,20 @@
1
+ # install rwdtinker applet from a long directory location
2
+ def installgemapplet
3
+ require 'fileutils'
4
+ require 'extras/zip/zip'
5
+ nametext = "%s" % [@a_installapplet]
6
+
7
+ begin # exception trapped block
8
+ fullname = nametext + ".zip"
9
+
10
+ zf = Zip::ZipFile.new(fullname)
11
+ zf.sort.each {
12
+ |entry|
13
+ zf.extract(entry.to_s, entry.to_s)
14
+ }
15
+ @installapplettext = Message[:applet_installed]
16
+
17
+ rescue
18
+ @installapplettext = "unzip error - applet may not be installed correctly"
19
+ end # exception rescue
20
+ end
@@ -0,0 +1,19 @@
1
+ # download gem of rwdtinker applet
2
+ def superantcominstallremotegemapplet
3
+ require 'fileutils'
4
+
5
+ tempnametext = "%s" % [@superantcominstallremoteappletinput]
6
+ temparray = tempnametext.split(/ /)
7
+ nametext = temparray[0]
8
+ begin # exception trapped block
9
+
10
+
11
+ commandline = $xpcommand + "gem install " + nametext
12
+
13
+ @superantcominstallremotegemappletresult = `#{commandline}`
14
+
15
+ rescue
16
+ @superantcominstallremotegemappletresult = "error during gem install!"
17
+ end # exception rescue
18
+
19
+ end
@@ -0,0 +1,12 @@
1
+ # this code is to list the gem directories that are installed
2
+ def superantcomshowgemfiledirs
3
+
4
+ fileList = Dir.new($gemdirectory_withgemfiles).entries.sort.delete_if { |x| ! (x =~ /\Arwdzip/) }
5
+ @superantcomshowgemappletdirsresult = fileList.rwd_method("superantcomshowgemappletdirsname")
6
+ end
7
+
8
+ def superantcomshowgemappletdirsname(inffile)
9
+ applet = inffile
10
+ @a_gemfiledirsinput = applet
11
+
12
+ end
@@ -0,0 +1,54 @@
1
+ # this code is to list the zips
2
+
3
+
4
+ def fillzipappletname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+ def findzipfiles(d)
11
+ a = Array.new(Dir[d].entries.sort)
12
+ #loop through and get the files names
13
+ a.each do |x|
14
+ #adjust the filters to the files you want to see...
15
+ if(!test(?d,x))
16
+ # only zip files
17
+ if x =~ /\.zip/
18
+ puts "#{x}" #opens the file thats in fileName as read only
19
+ $zipsarray = $zipsarray | ["#{x}"]
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def listgemzips
26
+ startlangdir = $geminstalled_directory
27
+ #get a list of the files and subdirectories on the starting directory only
28
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
29
+ p alanghash
30
+ #loop through the list, ignore the files and add all new directories found
31
+ alanghash.each do |x|
32
+ #if a directory...
33
+ if(test(?d,x))
34
+ # add to the original list of directories
35
+ @@tmproot = x + "/**"
36
+ #adds the new ones to the array
37
+ blanghash = Dir[@@tmproot].entries.sort
38
+ blanghash.each do |x|
39
+ if(test(?d,x))
40
+ alanghash.push(x) #appends to the end of the array...
41
+ end
42
+ end
43
+ end
44
+ end
45
+ alanghash.each do |x|
46
+ #if it is a file...
47
+ if(!test(?d,x))
48
+ alanghash.delete(x)
49
+ else #it is a directory...
50
+ findzipfiles(x + "/**")
51
+ end
52
+ end
53
+ @zipslistresult = $zipsarray.rwd_method("fillzipappletname")
54
+ end
@@ -0,0 +1,11 @@
1
+ # this code is to list the applets that are installed
2
+ def listinstalledfiles
3
+ fileList = Dir.new("installed").entries.sort.reverse.delete_if { |x| ! (x =~ /inf$/) }
4
+ @filesresult = fileList.rwd_method("fillappletname")
5
+ end
6
+
7
+ def fillappletname(inffile)
8
+ applet = inffile.gsub(/\.inf$/, "")
9
+ @a_installlist = applet
10
+ @a_removeapplet = applet
11
+ end
@@ -0,0 +1,31 @@
1
+ # this code is to list the zipped applets that can be installed
2
+
3
+
4
+ def fillziptoinstallname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+
11
+
12
+
13
+ def listzipfilestoinstall
14
+ startlangdir = File.join($progdir, $zipslocation )
15
+ #get a list of the files and subdirectories on the starting directory only
16
+
17
+
18
+ a = Array.new(Dir["#{startlangdir}/*"].entries.sort)
19
+
20
+ #loop through and get the files names
21
+ a.each do |x|
22
+ # only zip files
23
+ if x =~ /\.zip/
24
+ # puts "#{x}" #adds the file to the array to display on the screen
25
+ $zipsarraylocal = $zipsarraylocal | ["#{x}"]
26
+ end
27
+
28
+ end
29
+
30
+ @zipslistresult = $zipsarraylocal.rwd_method("fillziptoinstallname")
31
+ end
@@ -0,0 +1,32 @@
1
+ # this method puts the configuration rexord on the screen
2
+ def loadconfigurationrecord
3
+
4
+ require 'fileutils'
5
+ if TinkerWin2ConfigurationFileName
6
+ @a_configurationfilename = TinkerWin2ConfigurationFileName
7
+ end
8
+
9
+ begin # exception trapped block
10
+
11
+ Dir.chdir($progdir)
12
+ fileName = File.join(ConfigurationDir, TinkerWin2ConfigurationFileName)
13
+
14
+ fd = File.open(fileName,"r")
15
+ @a_configline1= fd.readline.chomp
16
+ @a_configline2 = fd.readline.chomp
17
+ @a_configline3 = fd.readline.chomp
18
+ @a_configline4 = fd.readline.chomp
19
+ @a_configline5 = fd.readline.chomp
20
+ @a_configline6 = fd.readline.chomp
21
+ @a_configline7 =fd.readline.chomp
22
+ @a_configline8 = fd.readline.chomp
23
+
24
+ while ! fd.eof?
25
+ @extraconfigdatadisplay = fd.readline
26
+ end
27
+ fd.close
28
+ rescue SystemCallError, StandardError
29
+ $stderr.print "system call error: " + $!
30
+ end # exception rescue
31
+
32
+ end
@@ -0,0 +1,13 @@
1
+ # this method loads the on screen variables into the running class
2
+ def loadconfigurationvariables
3
+
4
+ configfiletoload = File.join(ConfigurationDir,TinkerWin2ConfigurationFileName)
5
+ begin
6
+ load configfiletoload
7
+ @extraconfigdatadisplay = ""
8
+ @newconfigurationresult = "Config Variables loaded"
9
+ rescue
10
+ @extraconfigdatadisplay = ""
11
+ @newconfigurationresult = "loading error"
12
+ end
13
+ end
@@ -0,0 +1,87 @@
1
+ #!ruby
2
+ require 'socket' # Network stuff
3
+ require 'timeout' # Timeout functions
4
+
5
+ def network_start
6
+ if RUBY_PLATFORM != "i386-mswin32"
7
+ processone = fork {
8
+ network_demon }
9
+ Process.detach(processone)
10
+
11
+ else
12
+ puts "fork not tried winXP?"
13
+ end
14
+ @viewremotecommandresult = "starting controller on next available port"
15
+ end
16
+
17
+ def network_demon
18
+ # Find configuration variables
19
+ host = "127.0.0.1"
20
+ port = $rwdcontrolports[0].to_i
21
+
22
+ openportfound = false
23
+ until openportfound
24
+
25
+ # Create a socket to listen on and bind it to the host and port
26
+ begin
27
+ @socket = UDPSocket::new()
28
+ @socket.bind(host, port)
29
+ # Rescue the "Address in use" error
30
+ openportfound = true
31
+
32
+ rescue Errno::EADDRINUSE
33
+ puts "controller startup: Port #{port} on host #{host} is already in use."
34
+ port=port+1
35
+ # Rescue the "Address not available' error
36
+ rescue Errno::EADDRNOTAVAIL
37
+ puts "Network plugin: Address #{host} is not available to bind."
38
+ port=port+1
39
+ # Rescue "permission denied errors
40
+ rescue Errno::EACCES
41
+ puts "controller startup: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
42
+ port=port+1
43
+ # Rescue all other errors
44
+ rescue
45
+ puts "Network plugin: An error occured."
46
+ port = port+1
47
+ # Rescue all other errors
48
+ end
49
+
50
+ end
51
+
52
+
53
+ # Get all acceptable hosts
54
+ hosts = ["localhost","vaio-sag"]
55
+ # Do some nice errorchecking
56
+ if(hosts.type != Array)
57
+ puts "Network plugin: No hosts found in networkConfig/acceptHosts. Shutting down plugin."
58
+ return -1 # Return the errorcode for plugin failure
59
+ end
60
+
61
+ # Main loop
62
+ while(true)
63
+ # Get data and client data from the client
64
+ data, info = @socket.recvfrom(256)
65
+
66
+ # Is this an acceptable IP address?
67
+ if(hosts.include?(info[2]) || hosts.include?(info[3]))
68
+ command, parameter = data.split(';')
69
+
70
+ # Command actions
71
+ command.downcase!()
72
+ case command
73
+
74
+ when 'stop'
75
+ @socket.send("hello world",0,info[3],info[1].to_i)
76
+
77
+ when 'query'
78
+ @socket.send("#{$rwdapplicationidentity} on port #{$port}",0,info[3],info[1].to_i)
79
+
80
+
81
+ end # case command
82
+
83
+ end # Access control if
84
+ end # while(true)
85
+
86
+ end # Network::start()
87
+
@@ -0,0 +1,18 @@
1
+ def openappletname
2
+ require 'fileutils'
3
+ nametext = "%s" % [@a_installlist]
4
+
5
+ begin # exception trapped block
6
+ fileName = "installed/" + nametext + ".inf"
7
+
8
+ fd = File.open(fileName,"r")
9
+ @displaytext = " "
10
+ while ! fd.eof?
11
+ @displaytext = fd.read
12
+ end
13
+ fd.close
14
+ rescue
15
+ @displaytext = "\n" + "error"
16
+ end # exception rescue
17
+
18
+ end
@@ -0,0 +1,42 @@
1
+ # this code is to call the help window
2
+ def runhelpwindowtinkerwin2
3
+
4
+ # $helptopicsarray = $helptopicsarray | [""]
5
+
6
+ $help_topic = "tinkerwin2_help"
7
+ if @rwd_tab == "rwdzipslister"
8
+ $help_topic = "tinkerwin2_help"
9
+ end
10
+
11
+ if @rwd_tab == "filelister"
12
+ $help_topic = "applet_viewing"
13
+
14
+ end
15
+ if @rwd_tab == "zipslister"
16
+ $help_topic = "applet_installation"
17
+
18
+ end
19
+ if @rwd_tab == "editconfigurationfile"
20
+ $help_topic = "applet_tinkerbackeditconfiguration"
21
+
22
+ end
23
+ if @rwd_tab == "rwdremotecontrol"
24
+ $help_topic = "remote_control"
25
+
26
+ end
27
+ if @rwd_tab == "superantcomremotezipsinstall"
28
+ $help_topic = "remotegemapplet_install"
29
+ end
30
+
31
+
32
+ if @rwd_window != "rwdtinkerhelpwindow"
33
+ $previouswindow = @rwd_window
34
+ $previoustab = @rwd_tab
35
+ else
36
+ $previouswindow = @rwd_window
37
+ $previoustab = @rwd_tab
38
+ end
39
+ runhelpwindow
40
+ end
41
+
42
+