rwdmovies 0.7 → 0.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/Readme.txt +12 -2
  2. data/bin/rwdmovies +18 -18
  3. data/code/{ag1core/aa0begin.rb → 01rwdcore/01rwdcore.rb} +2 -0
  4. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  5. data/code/01rwdcore/03helptexthash.rb +31 -0
  6. data/code/01rwdcore/04helptextend.rb +6 -0
  7. data/code/01rwdcore/openhelpwindow.rb +31 -0
  8. data/code/01rwdcore/returntomain.rb +10 -0
  9. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  10. data/code/superant.com.rwdmovies/amazonsearch.rb +19 -0
  11. data/code/superant.com.rwdmovies/helptexthashrwdmovies.rb +24 -0
  12. data/code/{eo1rwdmovies → superant.com.rwdmovies}/listmoviefiles.rb +5 -1
  13. data/code/superant.com.rwdmovies/loadconfigurationrecord.rb +34 -0
  14. data/code/superant.com.rwdmovies/loadconfigurationvariables.rb +13 -0
  15. data/code/superant.com.rwdmovies/openhelpwindowrwdmovies.rb +22 -0
  16. data/code/{eo1rwdmovies → superant.com.rwdmovies}/openmoviedata.rb +1 -1
  17. data/code/superant.com.rwdmovies/returntomain.rb +10 -0
  18. data/code/superant.com.rwdmovies/runrwdmoviesbackwindow.rb +10 -0
  19. data/code/superant.com.rwdmovies/saveconfigurationrecord.rb +18 -0
  20. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +100 -0
  21. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +37 -0
  22. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/installapplet.rb +8 -8
  23. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +21 -0
  24. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  25. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationrecord.rb +1 -1
  26. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationvariables.rb +1 -1
  27. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  28. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +39 -0
  29. data/code/{xa5rwdtinkercallable/callable.rb → superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb} +2 -3
  30. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  31. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  32. data/configuration/rwdapplicationidentity.cnf +3 -0
  33. data/configuration/rwdmovies.cnf +7 -3
  34. data/configuration/rwdmoviesversion.cnf +1 -1
  35. data/configuration/rwdtinker.cnf +6 -2
  36. data/configuration/rwdtinkerversion.cnf +1 -1
  37. data/configuration/tinkerwin2variables.cnf +3 -3
  38. data/configuration/tinkerwin2version.cnf +1 -1
  39. data/ev/rwd.rb +4 -3
  40. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  41. data/gui/frontwindow0/superant.com.rwdmovies/1openmoviedata.rwd +2 -2
  42. data/gui/frontwindow0/superant.com.rwdmovies/6moviesearch.rwd +27 -0
  43. data/gui/frontwindow0/superant.com.rwdmovies/8viewconfiguration.rwd +37 -0
  44. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +1 -1
  45. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +1 -1
  46. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +5 -0
  47. data/gui/tinkerbackwindows/superant.com.rwdmovies/1openmoviedata.rwd +18 -0
  48. data/gui/tinkerbackwindows/superant.com.rwdmovies/2openmoviephoto.rwd +8 -0
  49. data/gui/tinkerbackwindows/superant.com.rwdmovies/3listmoviegfiles.rwd +12 -0
  50. data/gui/tinkerbackwindows/superant.com.rwdmovies/6editrecord.rwd +35 -0
  51. data/gui/tinkerbackwindows/superant.com.rwdmovies/6moviesearch.rwd +27 -0
  52. data/gui/tinkerbackwindows/superant.com.rwdmovies/7moviesutilities.rwd +33 -0
  53. data/gui/tinkerbackwindows/superant.com.rwdmovies/8viewconfiguration.rwd +37 -0
  54. data/gui/tinkerbackwindows/superant.com.rwdmovies/9returntab.rwd +11 -0
  55. data/gui/tinkerbackwindows/superant.com.rwdmovies/z9end.rwd +6 -0
  56. data/gui/tinkerbackwindows/superant.com.rwdmoviespicture/xx8moviephotoview.rwd +2 -1
  57. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +43 -0
  58. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +1 -1
  59. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
  60. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  61. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +1 -1
  62. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  63. data/init.rb +38 -2
  64. data/rwd_files/HowTo_Movies.txt +11 -1
  65. data/rwd_files/HowTo_Tinker.txt +56 -7
  66. data/rwd_files/moviestmp.jpg +0 -0
  67. data/zips/rwdwcalc-0.50.zip +0 -0
  68. metadata +108 -75
  69. data/configuration/rwdplayscriptsversion.cnf +0 -2
  70. data/gui/frontwindow0/superant.com.rwdmovies/viewconfiguration.rwd +0 -16
  71. data/gui/tinkerbackwindows/superant.com.tinercallablewindow/1appname.rwd +0 -17
  72. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40editconfiguration.rwd +0 -36
  73. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistzips.rwd +0 -35
  74. data/installed/rwdmovies-0.5.inf +0 -9
  75. data/installed/rwdmoviesdata1.inf +0 -8
  76. /data/code/{ag1core → 01rwdcore}/rwdtinkerversion.rb +0 -0
  77. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/attachtmpmoviepicture.rb +0 -0
  78. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/deletemovierecord.rb +0 -0
  79. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/eo2viewmoviephoto.rb +0 -0
  80. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/gl7clearscreendisplay.rb +0 -0
  81. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/loadeventrecord.rb +0 -0
  82. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/renamemovie.rb +0 -0
  83. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/rwdmovieshelpabout.rb +0 -0
  84. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/savemoviechanges.rb +0 -0
  85. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/viewrwdmoviesconfiguration.rb +0 -0
  86. /data/code/{eo1rwdmovies → superant.com.rwdmovies}/viewtmppictures.rb +0 -0
  87. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/diagnostictab.rb +0 -0
  88. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/listinstalledfiles.rb +0 -0
  89. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/listzips.rb +0 -0
  90. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/openappletname.rb +0 -0
  91. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/removeapplet.rb +0 -0
  92. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/rwdtinkerwin2version.rb +0 -0
  93. /data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/saveconfigurationrecord.rb +0 -0
  94. /data/gui/frontwindow0/superant.com.rwdmovies/{movieutilities.rwd → 7moviesutilities.rwd} +0 -0
  95. /data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/{3arwddiagnostics.rwd → 70rwddiagnostics.rwd} +0 -0
  96. /data/gui/tinkerbackwindows/{superant.com.tinercallablewindow → superant.com.tinkerhelpwindow}/9end.rwd +0 -0
  97. /data/movies/{Last Of The Mohicans.jpg → Last of the Mohicans.jpg} +0 -0
  98. /data/movies/{Last Of The Mohicans.nam → Last of the Mohicans.nam} +0 -0
data/Readme.txt CHANGED
@@ -47,9 +47,19 @@ steven@superant.com
47
47
 
48
48
  http://rwdapplications.rubyforge.org/wiki/wiki.pl
49
49
 
50
- == Changelog
50
+ == Changelog
51
+ version 0.9
52
+ added back Amazon search
53
+ changed width of text fields
54
+ updated for rwdtinker version 1.50 - remote control and finding free ports
55
+
56
+ version 0.8
57
+ added return from picture window
58
+ added features to configuration screen
59
+ added context sensitive help
60
+
51
61
  version 0.7
52
- updated for rwdtinker version 1.44
62
+ updated for rwdtinker 1.44
53
63
 
54
64
  version 0.6
55
65
  updated for rwdtinker version 1.4
data/bin/rwdmovies CHANGED
@@ -1,19 +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
-
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
19
  `ruby init.rb`
@@ -10,6 +10,8 @@ class RwdTinker < RWDialog
10
10
  @rwd_window = "main"
11
11
  @result = "idle"
12
12
  @display= "idle"
13
+
14
+
13
15
  end
14
16
 
15
17
  def inspect
@@ -0,0 +1,4 @@
1
+
2
+
3
+ Helptext = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
4
+ helpmessage = {
@@ -0,0 +1,31 @@
1
+ # Help files for RwdTinker core
2
+
3
+
4
+ :general_help => "You can work with Applets: go to 'Selection tab',
5
+ On that back screen you will find:
6
+ List Applets: you can see and delete installed applets
7
+ List Zips: you can see lists of applets that you can install
8
+ Edit Configuration: You can view the rwdtinker configuration and change it
9
+ Diagnostic Tab: You can view the environments variables that rwdtinker is running with
10
+ ",
11
+ :network_help => "Using over a Network: To serve the application over your local LAN,change the last line in the
12
+ init.rb file to something like:\n
13
+ RwdTinker.file(RWDFile).serve(8080, '-r' ? '.rwduids' : nil)\n
14
+ Then you should be able to login at: http://yourhostname:8080",
15
+
16
+
17
+ :documents_rwdtinker => "Documents:
18
+
19
+
20
+ when you click on a document name, the document should pop up in a
21
+ browser window, or in another browser tab.",
22
+ :remote_control => "Remote control gives you a way to determine what applications are running on which ports
23
+
24
+ The name of the application is set in the config file
25
+ You need to click the show remote command choices first - this will show the port and query choices
26
+ Then you can click in 'Run Command' to see if other applications are running.
27
+
28
+ The remote ports daemon will not be running unless you start it.
29
+
30
+ "
31
+
@@ -0,0 +1,6 @@
1
+
2
+ }
3
+ helpmessage.each { |kk, vv| Helptext[kk] = vv }
4
+
5
+
6
+
@@ -0,0 +1,31 @@
1
+ # this code is to call the help window
2
+ def runhelpwindow
3
+ $helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
4
+
5
+ if @rwd_window == "main"
6
+ if @rwd_tab == "documentsrwdtinkerone"
7
+ $help_topic = "documents_rwdtinker"
8
+ end
9
+
10
+ end
11
+
12
+ if @rwd_window == "rwdtinkerhelpwindow"
13
+ puts "in help window processing"
14
+ else
15
+ $previouswindow = @rwd_window
16
+ $previoustab = @rwd_tab
17
+ end
18
+
19
+
20
+ @rwdhelptopic = $help_topic
21
+ @rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
22
+ @rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
23
+ @rwd_window = "rwdtinkerhelpwindow"
24
+ end
25
+
26
+ def choosenewhelptopic(inffile)
27
+ $help_topic = inffile
28
+ runhelpwindow
29
+ end
30
+
31
+
@@ -0,0 +1,10 @@
1
+ # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
+ #
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def returntomain
7
+ @rwd_window = "main"
8
+ @rwd_tab = "selectiontab"
9
+ end
10
+
@@ -0,0 +1,11 @@
1
+ # this code is to return to the window back from the help window
2
+ def rwdwindowreturn
3
+
4
+
5
+ @rwd_window = "#{$previouswindow}"
6
+ @rwd_tab = "#{$previoustab}"
7
+ end
8
+
9
+
10
+
11
+
@@ -0,0 +1,19 @@
1
+
2
+
3
+ require 'amazon/search'
4
+
5
+ include Amazon::Search
6
+ def runmoviesearch
7
+
8
+ req = Request.new(DEV_TOKEN)
9
+ testmovie = @a_moviefilename
10
+ s = ['keyword_search', "#{testmovie}", 'video', LITE, 'Name']
11
+
12
+
13
+ s.pop
14
+
15
+ # parse and display the results of each search
16
+ response = req.send(*s) { |prod| @moviesearchdisplay = prod, '' }
17
+ # printf("Arguments returned from search were:\n\n%s\n", response.args.inspect)
18
+
19
+ end
@@ -0,0 +1,24 @@
1
+
2
+
3
+ Helptext.update( :rwdmovies_help => " Use the 'View Movies' tab
4
+ rwdmovies is meant to be used to keep track of your DVD and VHS collection.
5
+
6
+ You use the 'Edit Movie' tab for creating or editing an already saved movie record",
7
+ :rwdmovies_generalhelp => "
8
+ Click on the 'View Movies' tab to view movies.
9
+
10
+ rwdmovies is meant to be used to keep track of your DVD and VHS collection.
11
+
12
+ You can add movies and a poster for each movie.",
13
+ :rwdmovies_configuration => " click on 'Edit Configuration'
14
+ You can view the configuration file
15
+
16
+ You can edit the configuration
17
+
18
+ Remember to reload the configuration variables if you want your
19
+ changes used."
20
+
21
+
22
+
23
+
24
+ )
@@ -1,7 +1,11 @@
1
1
  # this code is to list the movie names
2
- def listmovierecordfiles
2
+ def listmovierecordfiles
3
+ begin
3
4
  fileList = Dir.new($rwdmovies_directory).entries.sort.delete_if { |x| ! (x =~ /nam$/) }
4
5
  @moviefilelistresult = fileList.rwd_method("fillrwdmovierecordname")
6
+ rescue
7
+ @moviefilelistresult = "file error"
8
+ end
5
9
  end
6
10
 
7
11
  def fillrwdmovierecordname(inffile)
@@ -0,0 +1,34 @@
1
+ # this method puts the configuration rexord on the screen
2
+ def loadrwdmoviesconfiguration
3
+
4
+ require 'fileutils'
5
+
6
+ @a_movconfigurationfilename = "rwdmovies.cnf"
7
+
8
+
9
+ begin # exception trapped block
10
+
11
+ Dir.chdir($progdir)
12
+ fileName = File.join(ConfigurationDir, "rwdmovies.cnf")
13
+
14
+
15
+ fd = File.open(fileName,"r")
16
+ @a_movconfigline1= fd.readline.chomp
17
+ @a_movconfigline2 = fd.readline.chomp
18
+ @a_movconfigline3 = fd.readline.chomp
19
+ @a_movconfigline4 = fd.readline.chomp
20
+ @a_movconfigline5 = fd.readline.chomp
21
+ @a_movconfigline6 = fd.readline.chomp
22
+ @a_movconfigline7 =fd.readline.chomp
23
+ @a_movconfigline8 = fd.readline.chomp
24
+ @a_movconfigline9 = fd.readline.chomp
25
+
26
+ while ! fd.eof?
27
+ @extramovconfigdatadisplay = fd.readline
28
+ end
29
+ fd.close
30
+ rescue SystemCallError, StandardError
31
+ $stderr.print "system call error: " + $!
32
+ end # exception rescue
33
+
34
+ end
@@ -0,0 +1,13 @@
1
+ # this method loads the on screen variables into the running class
2
+ def loadrwdmoviesconfigurationvariables
3
+
4
+ configfiletoload = File.join(ConfigurationDir,"rwdmovies.cnf")
5
+ begin
6
+ load configfiletoload
7
+ @extramovconfigdatadisplay = ""
8
+ @newmovconfigurationresult = "Config Variables loaded"
9
+ rescue
10
+ @extramovconfigdatadisplay = ""
11
+ @newmovconfigurationresult = "loading error"
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ # this code is to call the help window
2
+ def runhelpwindowrwdmovies
3
+
4
+ $help_topic = "rwdmovies_generalhelp"
5
+ if @rwd_tab == "viewnamedata"
6
+ $help_topic = "rwdmovies_help"
7
+ end
8
+ if @rwd_tab == "viewrwdmoviesconfiguration"
9
+ $help_topic = "rwdmovies_configuration"
10
+ end
11
+ $helptopicsarray = $helptopicsarray | ["rwdmovies_configuration","rwdmovies_generalhelp","rwdmovies_help"]
12
+
13
+
14
+
15
+ if @rwd_window != "rwdtinkerhelpwindow"
16
+ $previouswindow = @rwd_window
17
+ $previoustab = @rwd_tab
18
+ end
19
+ runhelpwindow
20
+ end
21
+
22
+
@@ -1,7 +1,7 @@
1
1
  def openmoviedata
2
2
  require 'fileutils'
3
3
 
4
- $currentmovietext = "%s" % [@a_moviedisplay]
4
+ $currentmovietext = "%s" % [@a_moviefilename]
5
5
  photoname = $currentmovietext + ".jpg"
6
6
  begin # exception trapped block
7
7
  path_to = File.join( "rwd_files", "moviestmp.jpg" )
@@ -0,0 +1,10 @@
1
+ # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
+ # This application is a contact book
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # return to main
6
+ def returntomain
7
+ @rwd_window = "main"
8
+ @rwd_tab="selectiontab"
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
+ # This application is a contact book
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def runrwdmoviesbackwindow
7
+ @rwd_window = "rwdmovieswindow"
8
+ @rwd_tab= "viewrwdmovielist"
9
+ end
10
+
@@ -0,0 +1,18 @@
1
+ # this method adds a new address record
2
+ def saverwdmoviesconfiguration
3
+ require 'fileutils'
4
+
5
+ newname = "rwdmovies.cnf" # grab the filename to create
6
+ newdata =@a_movconfigline1.to_s + "\n" + @a_movconfigline2.to_s + "\n" + @a_movconfigline3.to_s + "\n" + @a_movconfigline4.to_s + "\n" + @a_movconfigline5.to_s + "\n" + @a_movconfigline6.to_s + "\n" + @a_movconfigline7.to_s + "\n" + @a_movconfigline8.to_s + "\n" + @a_movconfigline9.to_s + "\n"
7
+
8
+ begin # exception trapped block
9
+ fileName = File.join( ConfigurationDir, newname )
10
+ fd = File.open(fileName,"w")
11
+ fd.print(newdata) # save the record info to the file
12
+ fd.close
13
+ @newmovconfigurationresult=newdata # show the record info in the browser
14
+ rescue SystemCallError, StandardError
15
+ $stderr.print "system call error: " + $!
16
+ end # exception rescue
17
+
18
+ end
@@ -0,0 +1,100 @@
1
+ #
2
+
3
+ def runcontrolcommand
4
+ require 'socket'
5
+
6
+ # Change this line...
7
+ ip = '127.0.0.1'
8
+ # And this one...
9
+ port = $rwdcontrolport1
10
+ if @a_remoteportinput
11
+ port = @a_remoteportinput.to_i
12
+ end
13
+ # Done!
14
+
15
+
16
+ commandtext = @a_remotecommandinput.to_s
17
+
18
+ remotehostnotfound = true
19
+
20
+ client = UDPSocket::new()
21
+ client.send(commandtext, 0, ip, port)
22
+
23
+
24
+ if (commandtext == "stop")
25
+ begin
26
+ @socket = UDPSocket::new()
27
+ @socket.bind(ip, port)
28
+ # Rescue the "Address in use" error
29
+ rescue Errno::EADDRINUSE
30
+
31
+ databack, info = client.recv(128)
32
+ @remotecommandresult = databack
33
+ @lastremotecommand = "rwdtinker remote:: Port #{port} on host #{ip} ."
34
+ remotehostnotfound = false
35
+
36
+ # Rescue the "Address not available" error
37
+ rescue Errno::EADDRNOTAVAIL
38
+ puts "Network plugin: Address #{host} is not available to bind."
39
+
40
+ # Rescue "permission denied errors
41
+ rescue Errno::EACCES
42
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
43
+
44
+ # Rescue all other errors
45
+ rescue
46
+ puts "Network plugin: An error occured."
47
+
48
+ # Rescue all other errors
49
+ end
50
+ if remotehostnotfound
51
+ @remotecommandresult = "Remote Host not running"
52
+ end
53
+ @socket.close
54
+ end
55
+
56
+ remotehostnotfound = true
57
+ if (commandtext == "query")
58
+ begin
59
+ @socket = UDPSocket::new()
60
+ @socket.bind(ip, port)
61
+ # Rescue the "Address in use" error
62
+ rescue Errno::EADDRINUSE
63
+
64
+
65
+ databack, info = client.recv(128)
66
+ @remotecommandresult = databack
67
+ @lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
68
+ remotehostnotfound = false
69
+
70
+ # Rescue the "Address not available' error
71
+ rescue Errno::EADDRNOTAVAIL
72
+ puts "Network plugin: Address #{host} is not available to bind."
73
+
74
+ # Rescue "permission denied errors
75
+ rescue Errno::EACCES
76
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
77
+
78
+ # Rescue all other errors
79
+ rescue
80
+ puts "Network plugin: An error occured."
81
+
82
+ # Rescue all other errors
83
+ end
84
+ @socket.close
85
+ end
86
+ if remotehostnotfound
87
+ @remotecommandresult = "Remote Host not running"
88
+ end
89
+ # Close the socket after use
90
+ client.close()
91
+
92
+ end
93
+
94
+ def showremoteportoptions
95
+
96
+ @remoteportoptions = $rwdcontrolports.rwd_options
97
+ @remotecommandoptions = ["query","stop"].rwd_options
98
+ end
99
+
100
+
@@ -0,0 +1,37 @@
1
+
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
+ :applet_viewing => "You can get a list of all installed applets by clicking the 'listfiles button'
10
+ To see the text of a install file
11
+ Type in the name of the file you want.
12
+
13
+ type it without the inf ending
14
+ rwdapplet-0.1
15
+
16
+ Then click the 'View Installed File' button
17
+
18
+ If it finds the file it will open it. It displays the text the search box.
19
+
20
+ You can uninstall applets on this screen",
21
+
22
+ :applet_installation => " You can download an applet created by someone else\n
23
+ put the file in the zips directory\n
24
+
25
+ click on the 'list zips' tab\n
26
+ click on 'list applets available for installing'\n
27
+
28
+ chose the applet you want\n
29
+ click on 'install applet'\n
30
+ If all goes well the applet should be installed.\n
31
+ You will need to restart rwdtinker to see the new screens",
32
+ :applet_tinkerbackeditconfiguration => " You can edit the configuration
33
+
34
+ Remember to reload the configuration variables if you want your
35
+ changes used."
36
+
37
+ )
@@ -1,21 +1,21 @@
1
1
  def installapplet
2
2
  require 'fileutils'
3
+ require 'extras/zip/zip'
3
4
  nametext = "%s" % [@a_installapplet]
4
5
 
5
6
  begin # exception trapped block
6
7
  fullname = nametext + ".zip"
7
8
  fileName = File.join($zipslocation,fullname)
8
-
9
- commandline = $unzipprogram + fileName
10
- system( commandline+' > temp.output' )
11
-
12
-
13
-
14
- system(commandline)
9
+
10
+ zf = Zip::ZipFile.new(fileName)
11
+ zf.sort.each {
12
+ |entry|
13
+ zf.extract(entry.to_s, entry.to_s)
14
+ }
15
15
  @installapplettext = Message[:applet_installed]
16
16
 
17
17
  rescue
18
- @installapplettext = "Done! - Check applet list - restart rwd to activate the new applet"
18
+ @installapplettext = "unzip error - applet may not be installed correctly"
19
19
  end # exception rescue
20
20
 
21
21
  end
@@ -0,0 +1,21 @@
1
+ def installgemapplet
2
+ require 'fileutils'
3
+ require 'extras/zip/zip'
4
+ nametext = "%s" % [@a_installapplet]
5
+
6
+ begin # exception trapped block
7
+ fullname = nametext + ".zip"
8
+
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
+
21
+ end
@@ -0,0 +1,54 @@
1
+ # this code is to list the zips
2
+
3
+
4
+ def fillhypernotename(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("fillhypernotename")
54
+ end
@@ -1,4 +1,4 @@
1
- # this method views an existing address record
1
+ # this method puts the configuration rexord on the screen
2
2
  def loadconfigurationrecord
3
3
 
4
4
  require 'fileutils'
@@ -1,4 +1,4 @@
1
- # this method clears the on screen variables
1
+ # this method loads the on screen variables into the running class
2
2
  def loadconfigurationvariables
3
3
 
4
4
  configfiletoload = File.join(ConfigurationDir,TinkerWin2ConfigurationFileName)