rwdmovies 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/Readme.txt +57 -0
  2. data/bin/rwdmovies +19 -0
  3. data/code/ag1core/aa0begin.rb +18 -0
  4. data/code/ag1core/rwdtinkerversion.rb +15 -0
  5. data/code/eo1rwdmovies/attachtmpmoviepicture.rb +24 -0
  6. data/code/eo1rwdmovies/deletemovierecord.rb +24 -0
  7. data/code/eo1rwdmovies/eo2viewmoviephoto.rb +4 -0
  8. data/code/eo1rwdmovies/gl7clearscreendisplay.rb +15 -0
  9. data/code/eo1rwdmovies/listmoviefiles.rb +15 -0
  10. data/code/eo1rwdmovies/loadeventrecord.rb +30 -0
  11. data/code/eo1rwdmovies/openmoviedata.rb +27 -0
  12. data/code/eo1rwdmovies/renamemovie.rb +13 -0
  13. data/code/eo1rwdmovies/rwdmovieshelpabout.rb +14 -0
  14. data/code/eo1rwdmovies/savemoviechanges.rb +19 -0
  15. data/code/eo1rwdmovies/viewrwdmoviesconfiguration.rb +21 -0
  16. data/code/eo1rwdmovies/viewtmppictures.rb +12 -0
  17. data/code/gh9calendar/gh9calendar.rb +16 -0
  18. data/code/xa5rwdtinkercallable/callable.rb +13 -0
  19. data/code/xb1rwdtinkerbackwindow/05listinstalledfiles.rb +11 -0
  20. data/code/xb1rwdtinkerbackwindow/diagnostictab.rb +21 -0
  21. data/code/xb1rwdtinkerbackwindow/ll1openname.rb +18 -0
  22. data/code/xb1rwdtinkerbackwindow/ll5listzips.rb +14 -0
  23. data/code/xb1rwdtinkerbackwindow/lm1installapplet.rb +20 -0
  24. data/code/xb1rwdtinkerbackwindow/mm1removeapplet.rb +28 -0
  25. data/code/xb1rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
  26. data/code/zz0applicationend/zz0end.rb +4 -0
  27. data/configuration/aa0rwdframework.cnf +14 -0
  28. data/configuration/ab1tinkerwin2.cnf +4 -0
  29. data/configuration/rwdmovies.cnf +4 -0
  30. data/ev/browser.rb +109 -0
  31. data/ev/ftools.rb +170 -0
  32. data/ev/net.rb +750 -0
  33. data/ev/ruby.rb +819 -0
  34. data/ev/rwd.rb +1848 -0
  35. data/ev/sgml.rb +236 -0
  36. data/ev/thread.rb +63 -0
  37. data/ev/tree.rb +343 -0
  38. data/ev/xml.rb +4 -0
  39. data/gui/aa2core/aa0rwdtop.rwd +4 -0
  40. data/gui/ee1rwdmovies/1openmoviedata.rwd +18 -0
  41. data/gui/ee1rwdmovies/2openmoviephoto.rwd +8 -0
  42. data/gui/ee1rwdmovies/3listmoviegfiles.rwd +12 -0
  43. data/gui/ee1rwdmovies/6editrecord.rwd +35 -0
  44. data/gui/ee1rwdmovies/movieutilities.rwd +33 -0
  45. data/gui/ee1rwdmovies/viewconfiguration.rwd +16 -0
  46. data/gui/ll1selectiontabbegin/selectiontabbegin.rwd +16 -0
  47. data/gui/ll5rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -0
  48. data/gui/lz1selectiontabend/endselectiontab.rwd +3 -0
  49. data/gui/tt0documentsbegin/tt0documentbegin.rwd +6 -0
  50. data/gui/uu5rwddocuments/uu5documents.rwd +15 -0
  51. data/gui/uu6rwdtinkerwin2documents/uu5documents.rwd +6 -0
  52. data/gui/uv7rwdmovies/uv7docmovies.rwd +4 -0
  53. data/gui/ww0documentsend/ww0documentend.rwd +7 -0
  54. data/gui/wz6finaltabs/xx0rwdfirsttab.rwd +6 -0
  55. data/gui/xa1versionwindow/1appname.rwd +19 -0
  56. data/gui/xa5rwdtinkercallablewindow/1appname.rwd +17 -0
  57. data/gui/xa5rwdtinkercallablewindow/9end.rwd +4 -0
  58. data/gui/xb1rwdtinkerbackwindow/1appname.rwd +5 -0
  59. data/gui/xb1rwdtinkerbackwindow/2tab1.rwd +11 -0
  60. data/gui/xb1rwdtinkerbackwindow/3arwddiagnostics.rwd +33 -0
  61. data/gui/xb1rwdtinkerbackwindow/4arwdlistapplets.rwd +44 -0
  62. data/gui/xb1rwdtinkerbackwindow/4arwdlistzips.rwd +35 -0
  63. data/gui/xb1rwdtinkerbackwindow/9backend.rwd +6 -0
  64. data/gui/xx8rwdmoviespicture/xx8moviephotoview.rwd +5 -0
  65. data/gui/ya1helpaboutbegin/ya0helpscreenstart.rwd +3 -0
  66. data/gui/yg5rwdhelpabout/1appname.rwd +4 -0
  67. data/gui/yg5rwdhelpabout/3copyright.rwd +3 -0
  68. data/gui/yg5rwdhelpabout/5version.rwd +10 -0
  69. data/gui/yg6rwdwin2helpabout/1appname.rwd +4 -0
  70. data/gui/yg6rwdwin2helpabout/3copyright.rwd +3 -0
  71. data/gui/yg6rwdwin2helpabout/5version.rwd +10 -0
  72. data/gui/yl2rwdmovieshelpabout/1movies.rwd +4 -0
  73. data/gui/yl2rwdmovieshelpabout/2movies.rwd +3 -0
  74. data/gui/yl2rwdmovieshelpabout/5version.rwd +9 -0
  75. data/gui/yy5helpaboutend/helpscreenend.rwd +3 -0
  76. data/gui/za1applicationend/yy9rwdend.rwd +4 -0
  77. data/init.rb +233 -0
  78. data/installed/rubyslippers-0.94.inf +9 -0
  79. data/installed/rwdcalendar-0.5.inf +8 -0
  80. data/installed/rwdmovies-0.5.inf +9 -0
  81. data/installed/rwdmoviesdata1.inf +8 -0
  82. data/installed/rwdtinkerwin2-0.5.inf +8 -0
  83. data/lang/alanguagehashbegin.rb +4 -0
  84. data/lang/en/rwdcalendar/calendar-nl.rb +6 -0
  85. data/lang/en/rwdcore/languagefile.rb +16 -0
  86. data/lang/es/rwdcalendar/calendar-nl.rb +6 -0
  87. data/lang/es/rwdcore/languagefile-es.rb +14 -0
  88. data/lang/languagehash.rb +4 -0
  89. data/lang/nl/rwdcalendar/calendar-nl.rb +6 -0
  90. data/lang/nl/rwdcore/languagefile-nl.rb +4 -0
  91. data/lang/templangfile.rb +22 -0
  92. data/lang/vlanguagehashend.rb +6 -0
  93. data/lang/wlocallangstart.rb +5 -0
  94. data/lang/xlocallangfile.rb +10 -0
  95. data/lang/zlocallangend.rb +2 -0
  96. data/lib/temp.rb +1 -0
  97. data/movies/Cold Mountain.jpg +0 -0
  98. data/movies/Cold Mountain.nam +8 -0
  99. data/movies/Last Of The Mohicans.jpg +0 -0
  100. data/movies/Last Of The Mohicans.nam +9 -0
  101. data/movies/Zulu.jpg +0 -0
  102. data/movies/Zulu.nam +8 -0
  103. data/movies/nophoto.jpg +0 -0
  104. data/rwd_files/HowTo_Movies.txt +72 -0
  105. data/rwd_files/HowTo_Tinker.txt +276 -0
  106. data/rwd_files/HowTo_TinkerWin2.txt +202 -0
  107. data/rwd_files/Readme.txt +57 -0
  108. data/rwd_files/favicon.ico +0 -0
  109. data/rwd_files/moviestmp.jpg +0 -0
  110. data/rwd_files/rdoc-style.css +175 -0
  111. data/rwd_files/rwdapplications.html +54 -0
  112. data/rwd_files/rwdindex.html +6 -0
  113. data/tests/totranslate.lang +93 -0
  114. data/zips/rwdacalendar-0.5.zip +0 -0
  115. data/zips/rwdhelloworld-0.3.zip +0 -0
  116. data/zips/rwdwshell-0.91.zip +0 -0
  117. data/zips/wrubyslippers-0.93.zip +0 -0
  118. metadata +157 -0
data/Readme.txt ADDED
@@ -0,0 +1,57 @@
1
+ rwdapplications are web brower applications
2
+
3
+ The GUI interface used is RubyWebDialogs
4
+
5
+ RubyWebDialogs is a platform independent graphical user interface for Ruby applications. It generates HTML and serves it with an internal HTTP server, so you can use your favorite web browser as the front end for your Ruby application. All this means, that it can be used on almost every platform, like Ruby itself. http://www.erikveen.dds.nl/rubywebdialogs/
6
+
7
+
8
+ Start the program by:
9
+ changing to the directory and
10
+ ruby init.rb
11
+
12
+ Then point your web browser to:
13
+ http://localhost:7701/
14
+
15
+ Or to the port that shows on the console or in the config.cnf file
16
+
17
+ Requirements:
18
+ RubyWebDialogs - I am using 0.0.11 2004-3-9
19
+ This package you downloaded should have a runtime version of
20
+ the needed rubywebdialog files
21
+
22
+ Ruby I am using version 1.8.2
23
+
24
+ I have tested this under Linux-Debian kernel 2.6.9
25
+
26
+ Operation:
27
+ The code files reside in the code directory and are combined before
28
+ the main Class is loaded
29
+
30
+ The rwd files in gui are combined before the gui is activated
31
+
32
+ Trouble shooting:
33
+
34
+ untar the file
35
+ tar zxvf rwdapplication-x.y.tar.gz
36
+ then cd to the directory
37
+ cd rwdapplication-x.y
38
+ then start the init.rb program file
39
+ ruby init.rb
40
+
41
+
42
+ If the program is not working, try looking at the ev subdirectory. That is where
43
+ the runtime of rubywebdialogs are.
44
+
45
+ for long term installation, I would suggest putting most files in a lib directory
46
+ like /usr/lib/rwdshell
47
+ then make a writable directory the local directory for command files to be written
48
+ like ~/rwdshell
49
+
50
+
51
+ Closing the browser doesn't terminate the application. You have to use the application's close-button And terminating the application doesn't terminate the application when running in network mode. You just log out.
52
+
53
+ Don't use the back-button of the browser! Strange and unpredictable things may and will happen!
54
+
55
+ Steven Gibson
56
+ stevengibson@superant.com
57
+ http://rwdapplications.rubyforge.org/
data/bin/rwdmovies ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ #--
3
+ # Copyright 2004 Steven Gibson <steven@superant.com>
4
+ # RwdTinker application
5
+ #
6
+ # This program is free software. It may be redistributed and/or modified under
7
+ # the terms of the GPL version 2 (or later), or the
8
+ # Ruby licence.
9
+ #
10
+ #++
11
+
12
+
13
+ $progdir = File::expand_path( File.dirname(__FILE__))
14
+
15
+ Dir.chdir($progdir)
16
+
17
+ Dir.chdir("..")
18
+
19
+ `ruby init.rb`
@@ -0,0 +1,18 @@
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
+ # This class is the top class for the RwdTinker application
6
+
7
+ class RwdTinker < RWDialog
8
+
9
+ def main
10
+ @rwd_window = "main"
11
+ @result = "idle"
12
+ @display= "idle"
13
+ end
14
+
15
+ def inspect
16
+ "Rwdtinker Application "
17
+ end
18
+
@@ -0,0 +1,15 @@
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
+ # return the version constant defined in the config file
7
+ def runrwdtinkerversion
8
+ @rwd_window = "applicationversion"
9
+ @versionappnamedisplay = "RwdTinker"
10
+ @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
11
+ @versionnumberdisplay = "Version " + RwdTinkerVersion
12
+
13
+ end
14
+
15
+
@@ -0,0 +1,24 @@
1
+ # this code is to attach a photo from the tmp directory
2
+ def attachtmpmoviepicture
3
+ if @a_moviefilename
4
+ $currentmovietext = @a_moviefilename
5
+ end
6
+ if $currentmovietext
7
+ tmpmoviepictureName = $tmpmoviepicture_directory + "/" + @a_tmppicturename
8
+ begin
9
+ if File.exist?(tmpmoviepictureName)
10
+ newmoviepictureName = $tmpmoviepicture_directory + "/" + $currentmovietext + ".jpg"
11
+ if ! (tmpmoviepictureName == newmoviepictureName )
12
+ File.rename(tmpmoviepictureName, newmoviepictureName)
13
+ end
14
+ @listpicturesfromtmp = "Picture attached"
15
+ FileUtils.cp(newmoviepictureName , $rwdmovies_directory)
16
+ else
17
+ @listpicturesfromtmp = "attachment failed"
18
+ end
19
+ rescue
20
+ @listpicturesfromtmp = "attachment failed"
21
+ end
22
+ end
23
+ end
24
+
@@ -0,0 +1,24 @@
1
+ # this method views an existing address record
2
+ def deletemovierecord
3
+
4
+ require 'fileutils'
5
+
6
+ if @a_moviefilename
7
+ $currentmovietext = @a_moviefilename
8
+ end
9
+
10
+ fileName = $rwdmovies_directory + "/" + $currentmovietext + ".nam"
11
+
12
+
13
+ begin # exception trapped block
14
+
15
+ File.delete(fileName)
16
+ fileNamephoto = $rwdmovies_directory + "/" + $currentmovietext + ".jpg"
17
+ if File.exist?(fileNamephoto)
18
+ File.delete(fileNamephoto)
19
+ end
20
+ rescue SystemCallError, StandardError
21
+ $stderr.print "system call error: " + $!
22
+ end # exception rescue
23
+
24
+ end
@@ -0,0 +1,4 @@
1
+ def viewmoviephoto
2
+ @rwd_window = "moviephoto"
3
+
4
+ end
@@ -0,0 +1,15 @@
1
+ # this method clears the on screen variables
2
+ def clearmoviescreendisplay
3
+
4
+ @a_moviefilename = ""
5
+ @a_moviename = ""
6
+ @a_moviedirector = ""
7
+ @a_movieactors = ""
8
+ @a_movieyear = ""
9
+ @a_moviestudio = ""
10
+ @a_moviecomment1 = ""
11
+ @a_moviecomment2 =""
12
+ @a_moviecomment3 = ""
13
+
14
+
15
+ end
@@ -0,0 +1,15 @@
1
+ # this code is to list the movie names
2
+ def listmovierecordfiles
3
+ fileList = Dir.new($rwdmovies_directory).entries.sort.delete_if { |x| ! (x =~ /nam$/) }
4
+ @moviefilelistresult = fileList.rwd_method("fillrwdmovierecordname")
5
+ end
6
+
7
+ def fillrwdmovierecordname(inffile)
8
+ applet = inffile.gsub(/\.nam$/, "")
9
+ @a_moviefilename = applet
10
+ @a_moviedisplay = applet
11
+ end
12
+
13
+
14
+
15
+
@@ -0,0 +1,30 @@
1
+ # this method views an existing record
2
+ def loadmovierecord
3
+
4
+ require 'fileutils'
5
+ @a_moviefilename = $currentmovietext
6
+
7
+ begin # exception trapped block
8
+
9
+
10
+ fileName = $rwdmovies_directory + "/" + $currentmovietext + ".nam"
11
+
12
+ fd = File.open(fileName,"r")
13
+ @a_moviename = fd.readline.chomp
14
+ @a_moviedirector = fd.readline.chomp
15
+ @a_movieactors = fd.readline.chomp
16
+ @a_movieyear = fd.readline.chomp
17
+ @a_moviestudio = fd.readline.chomp
18
+ @a_moviecomment1 = fd.readline.chomp
19
+ @a_moviecomment2 =fd.readline.chomp
20
+ @a_moviecomment3 = fd.readline.chomp
21
+
22
+ while ! fd.eof?
23
+ @extramoviedatadisplay = fd.readline
24
+ end
25
+ fd.close
26
+ rescue SystemCallError, StandardError
27
+ $stderr.print "system call error: " + $!
28
+ end # exception rescue
29
+
30
+ end
@@ -0,0 +1,27 @@
1
+ def openmoviedata
2
+ require 'fileutils'
3
+
4
+ $currentmovietext = "%s" % [@a_moviedisplay]
5
+ photoname = $currentmovietext + ".jpg"
6
+ begin # exception trapped block
7
+ path_to = File.join( "rwd_files", "moviestmp.jpg" )
8
+ path_from = File.join( $rwdmovies_directory, photoname )
9
+ if ! File.exist?(path_from)
10
+ path_from = File.join($rwdmovies_directory,"nophoto.jpg" )
11
+ end
12
+ if File.exist?(path_from)
13
+ FileUtils.cp(path_from, path_to)
14
+ end
15
+ fileName = $rwdmovies_directory + "/" + $currentmovietext + ".nam"
16
+
17
+ fd = File.open(fileName,"r")
18
+ @moviedatadisplay = " "
19
+ while ! fd.eof?
20
+ @moviedatadisplay = fd.read
21
+ end
22
+ fd.close
23
+ rescue SystemCallError, StandardError
24
+ $stderr.print "system call error: " + $!
25
+ end # exception rescue
26
+
27
+ end
@@ -0,0 +1,13 @@
1
+ # this code is to change the record name
2
+ def changemoviedata
3
+ oldName = $rwdmovies_directory + "/" + @a_moviefilename + ".nam"
4
+ newName = $rwdmovies_directory + "/" + @a_changemoviedata + ".nam"
5
+ File.rename(oldName, newName)
6
+ oldphotoName = $rwdmovies_directory + "/" + @a_moviefilename + ".jpg"
7
+ newphotoName = $rwdmovies_directory + "/" + @a_changemoviedata + ".jpg"
8
+ if File.exist?(oldphotoName)
9
+ File.rename(oldphotoName, newphotoName)
10
+ end
11
+ end
12
+
13
+
@@ -0,0 +1,14 @@
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
+ # return the version constant defined in the config file
7
+ def runrwdmoviesversion
8
+ @rwd_window = "applicationversion"
9
+ @versionappnamedisplay = "RwdMovies"
10
+ @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
11
+ @versionnumberdisplay = "Version " + RwdMoviesVersion
12
+
13
+ end
14
+
@@ -0,0 +1,19 @@
1
+ # this method adds a new record
2
+ def savemovierecord
3
+ require 'fileutils'
4
+ if @a_moviefilename
5
+ newname = "%s" % [@a_moviefilename] # grab the new filename to create
6
+ newdata =@a_moviename.to_s + "\n" + @a_moviedirector.to_s + "\n" + @a_movieactors.to_s + "\n" + @a_movieyear.to_s + "\n" + @a_moviestudio.to_s + "\n" + @a_moviecomment1.to_s + "\n" + @a_moviecomment2.to_s + "\n" + @a_moviecomment3.to_s + "\n"
7
+
8
+ fullnewname = newname + ".nam"
9
+ begin # exception trapped block
10
+ fileName = File.join( $rwdmovies_directory, fullnewname )
11
+ fd = File.open(fileName,"w")
12
+ fd.print(newdata) # save the record info to the file
13
+ fd.close
14
+ @changedmovieresult=newdata # show the record info in the browser
15
+ rescue SystemCallError, StandardError
16
+ $stderr.print "system call error: " + $!
17
+ end # exception rescue
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ def viewrwdmoviesconfiguration
2
+ require 'fileutils'
3
+ begin # exception trapped block
4
+
5
+ Dir.chdir($progdir)
6
+ rwdmoviesconfigurationfile = File.join( "configuration", "rwdmovies.cnf" )
7
+ if File.exist?(rwdmoviesconfigurationfile)
8
+ fd = File.open(rwdmoviesconfigurationfile,"r")
9
+ @rwdmoviesconfigurationtext = " "
10
+ while ! fd.eof?
11
+ @rwdmoviesconfigurationtext = fd.read
12
+ end
13
+ fd.close
14
+ else
15
+ @rwdmoviesconfigurationtext = "File error"
16
+ end
17
+ rescue SystemCallError, StandardError
18
+ $stderr.print "system call error: " + $!
19
+ @rwdmoviesconfigurationtext = "File error"
20
+ end # exception rescue
21
+ end
@@ -0,0 +1,12 @@
1
+ # this code is to list the picture names
2
+ def viewtmppicture
3
+ fileList = Dir.new($tmpmoviepicture_directory).entries.sort.delete_if { |x| ! (x =~ /jpg$/) }
4
+ @moviefilelistresult = ""
5
+ @listpicturesfromtmp = fileList.rwd_method("filltmpmoviespicture")
6
+ end
7
+
8
+ def filltmpmoviespicture(inffile)
9
+ applet = inffile.gsub(/\.nam$/, "")
10
+ @a_tmppicturename = applet
11
+ end
12
+
@@ -0,0 +1,16 @@
1
+ require 'fileutils'
2
+
3
+ def showmonth
4
+
5
+ begin # begin rescue monitored block
6
+
7
+ command_file_path = File.join( $extras_directory, 'cal.rb' )
8
+
9
+ @showmonthresult = `ruby #{command_file_path} -c #{$lang} #{@a_month.to_i} #{@a_year.to_i} `
10
+
11
+ rescue # process exeption
12
+ @showmonthresult = "\n" + "error in eval"
13
+ end # end of rescue process # of rescure monitored block
14
+
15
+ end
16
+
@@ -0,0 +1,13 @@
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
+ # call the rwdtinker helpwindow
7
+ def runrwdtinkerhelpwindow
8
+ @rwd_window = "rwdtinkerhelpwindow"
9
+ end
10
+ def runrwdtinkerbackwindow
11
+ @rwd_window = "tinkerbackwindow"
12
+ end
13
+
@@ -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,21 @@
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
+ # return the Ruby constant
7
+ def runrubyversion
8
+ @rubyversion = "Version " + VERSION
9
+ end
10
+
11
+ # return the platform constan
12
+ def runviewplatform
13
+ @platformdisplay = "Platform is " + RUBY_PLATFORM
14
+ end
15
+
16
+ # return Rwdtinker version to diagnostic tab
17
+ def rwdtinkerversiondiagnostic
18
+ @rwdtinkerversionreturn = "rwdtinker version " + RwdTinkerVersion
19
+ end
20
+
21
+
@@ -0,0 +1,18 @@
1
+ def openname
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,14 @@
1
+ # this code is to list the zipped applets that can be installed
2
+ def listzipfilestoinstall
3
+ fileList = Dir.new("zips").entries.sort.reverse.delete_if { |x| ! (x =~ /zip$/) }
4
+ @zipslistresult = fileList.rwd_method("fillziptoinstallname")
5
+ end
6
+
7
+ def fillziptoinstallname(inffile)
8
+ applet = inffile.gsub(/\.zip$/, "")
9
+ @a_installapplet = applet
10
+
11
+ end
12
+
13
+
14
+
@@ -0,0 +1,20 @@
1
+ def installapplet
2
+ require 'fileutils'
3
+ nametext = "%s" % [@a_installapplet]
4
+
5
+ begin # exception trapped block
6
+ fileName = "zips/" + nametext + ".zip"
7
+
8
+ commandline = "unzip -o " + fileName
9
+ system( commandline+' > temp.output' )
10
+
11
+
12
+
13
+ system(commandline)
14
+ @installapplettext = Message[:applet_installed]
15
+
16
+ rescue
17
+ @installapplettext = "Done! - Check applet list - restart rwd to activate the new applet"
18
+ end # exception rescue
19
+
20
+ end
@@ -0,0 +1,28 @@
1
+ def removeapplet
2
+ require 'fileutils'
3
+ nametext = "%s" % [@a_removeapplet]
4
+
5
+ begin # exception trapped block
6
+ fileName = "installed/" + nametext + ".inf"
7
+ count = 0
8
+ fd = File.open(fileName,"r")
9
+
10
+
11
+ fd.each { |oneline|
12
+ if count == 1
13
+ commandline = "rm -r " + oneline
14
+ system( commandline+' > temp.output' )
15
+ end
16
+ count = 1
17
+ }
18
+ fd.close
19
+ commandline = "rm " + fileName
20
+
21
+ system(commandline)
22
+ @removeapplettext = "applet files removed! - restart rwd to finish uninstalling"
23
+
24
+ rescue
25
+ @removeapplettext = "\n" + "error"
26
+ end # exception rescue
27
+
28
+ end
@@ -0,0 +1,14 @@
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
+ # return the version constant defined in the config file
7
+ def runrwdtinkerwin2version
8
+ @rwd_window = "applicationversion"
9
+ @versionappnamedisplay = "RwdTinkerWin2"
10
+ @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
11
+ @versionnumberdisplay = "Version " + RwdTinkerWin2Version
12
+
13
+ end
14
+
@@ -0,0 +1,4 @@
1
+
2
+
3
+ end # end of rwdtinker class
4
+
@@ -0,0 +1,14 @@
1
+
2
+ RwdTinkerVersion = "1.4"
3
+ CodeName = "rwdtinker"
4
+ CodeNameFile = CodeName + ".rb"
5
+ LangNameFile = "rwdlanguage.rb"
6
+ RWDFile = "rwdtinker.rwd"
7
+ $lang = "nl"
8
+ @@codedir = "code"
9
+ @@guidir = "gui"
10
+ @@langdir = "lang"
11
+
12
+ TempLangHashFile = @@langdir + "/" + "templangfile.rb"
13
+ LocalLangHashFile = @@langdir + "/" + "xlocallangfile.rb"
14
+ $port = 7705
@@ -0,0 +1,4 @@
1
+
2
+ RwdTinkerWin2Version = "0.5"
3
+ ZipsLocation = "zips" # not yet functional
4
+
@@ -0,0 +1,4 @@
1
+
2
+ RwdMoviesVersion = "0.6"
3
+ $rwdmovies_directory="movies"
4
+ $tmpmoviepicture_directory = "/tmp"
data/ev/browser.rb ADDED
@@ -0,0 +1,109 @@
1
+ require "ev/ruby"
2
+ require "ev/net"
3
+
4
+ begin
5
+ require "win32ole"
6
+ require "win32/registry"
7
+ rescue LoadError
8
+ $".push "win32ole.so"
9
+ $".push "win32/registry.rb"
10
+ end
11
+
12
+ def windowsbrowser
13
+ $stderr.puts "Looking for default browser..."
14
+
15
+ filetype = "htmlfile"
16
+ application = nil
17
+
18
+ begin
19
+ Win32::Registry::HKEY_CLASSES_ROOT.open('.html') do |reg|
20
+ filetype = reg[""]
21
+ end
22
+
23
+ Win32::Registry::HKEY_CLASSES_ROOT.open(filetype + '\shell\open\command') do |reg|
24
+ application = reg[""]
25
+ end
26
+ rescue NameError
27
+ $stderr.puts "Only available for Windows."
28
+ end
29
+
30
+ application
31
+ end
32
+
33
+ def linuxbrowser
34
+ application = ""
35
+
36
+ application = `which galeon 2> /dev/null`.chomp if application.empty?
37
+ application = `which mozilla 2> /dev/null`.chomp if application.empty?
38
+ application = `which firefox 2> /dev/null`.chomp if application.empty?
39
+ application = `which opera 2> /dev/null`.chomp if application.empty?
40
+ application = `which konqueror 2> /dev/null`.chomp if application.empty?
41
+ application = `which htmlview 2> /dev/null`.chomp if application.empty?
42
+ application = nil if application.empty?
43
+
44
+ application
45
+ end
46
+
47
+ def defaultbrowser
48
+ res = nil
49
+ res = windowsbrowser if windows?
50
+ res = linuxbrowser if linux?
51
+ res
52
+ end
53
+
54
+ def showinbrowser(html, browser=defaultbrowser)
55
+ port, io = TCPServer.freeport(7701, 7709)
56
+
57
+ unless browser.nil?
58
+ Thread.new do
59
+ begin
60
+ #command = "1234 \"http://localhost:#{port}\"" if linux?
61
+ #command = "L:/prog/MozillaFirefox/firefox.exe \"http://localhost:#{port}\"" if cygwin?
62
+ #command = Win32::Registry::HKEY_CLASSES_ROOT.open('htmlfile\shell\open\command')[0] + " \"http://localhost:#{port}/\"" if windows?
63
+
64
+ command = "#{browser} \"http://localhost:#{port}\""
65
+
66
+ Thread.pass
67
+
68
+ system(command)
69
+ rescue
70
+ end
71
+ end
72
+ end
73
+
74
+ HTTPServer.serve([port, io]) do |req, resp|
75
+ resp << html
76
+
77
+ resp.stop
78
+ end
79
+ end
80
+
81
+ def tab2html(tab)
82
+ res = ""
83
+
84
+ tab = tab.to_html(false)
85
+
86
+ res << "<html>\n"
87
+ res << "<body>\n"
88
+ res << "<table align='center' border='1' cellspacing='0' cellpadding='3'>\n"
89
+ res << "<tbody>\n"
90
+
91
+ tab.split(/\r*\n/).each do |line|
92
+ res << "<tr>\n"
93
+
94
+ line.split(/\t/, -1).each do |veld|
95
+ veld = "&nbsp;" if veld.compress.empty?
96
+
97
+ res << "<td>%s</td>\n" % veld
98
+ end
99
+
100
+ res << "</tr>\n"
101
+ end
102
+
103
+ res << "</tbody>\n"
104
+ res << "</table>\n"
105
+ res << "</body>\n"
106
+ res << "</html>\n"
107
+
108
+ res
109
+ end