rwdfoldeditor 0.05 → 0.07

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. data/code/01rwdcore/01rwdcore.rb +5 -4
  2. data/code/01rwdcore/02helptexthashbegin.rb +14 -2
  3. data/code/01rwdcore/03helptexthash.rb +18 -20
  4. data/code/01rwdcore/jumplinkcommand.rb +1 -0
  5. data/code/01rwdcore/openhelpwindow.rb +7 -0
  6. data/code/01rwdcore/runhelpabout.rb +6 -1
  7. data/code/01rwdcore/runopentinkerdocument.rb +1 -1
  8. data/code/01rwdcore/selectiontab.rb +2 -0
  9. data/code/01rwdcore/setuphelpaboutoptions.rb +2 -0
  10. data/code/01rwdcore/setuptinkerdocuments.rb +1 -0
  11. data/code/01rwdcore/uploadreturns.rb +3 -0
  12. data/code/dd0viewphoto/dd0viewphoto.rb +2 -0
  13. data/code/superant.com.foldeditor/0uninstallapplet.rb +8 -1
  14. data/code/superant.com.foldeditor/addzipfiles.rb +45 -0
  15. data/code/superant.com.foldeditor/helptexthashload.rb +22 -0
  16. data/code/superant.com.foldeditor/launchfoldeditorurl.rb +5 -3
  17. data/code/superant.com.foldeditor/openhelpwindowrwdhyernote.rb +6 -2
  18. data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +30 -102
  19. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +2 -0
  20. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +2 -0
  21. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +3 -1
  22. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +2 -0
  23. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +3 -1
  24. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +1 -0
  25. data/code/superant.com.rwdtinkerbackwindow/viewlogfile.rb +8 -5
  26. data/code/zz0applicationend/zz0end.rb +2 -1
  27. data/configuration/rwdtinker.dist +3 -2
  28. data/configuration/rwdwfoldeditor.dist +7 -5
  29. data/configuration/tinkerwin2variables.dist +5 -9
  30. data/gui/tinkerbackwindows/superant.com.foldeditor/60zipfoldfiles.rwd +31 -0
  31. data/gui/tinkerbackwindows/superant.com.slideshow/10appletbegin.rwd +4 -0
  32. data/gui/tinkerbackwindows/superant.com.slideshow/11viewnamedata.rwd +19 -0
  33. data/gui/tinkerbackwindows/superant.com.slideshow/13listnamerecordfiles.rwd +21 -0
  34. data/gui/tinkerbackwindows/superant.com.slideshow/16editrecord.rwd +39 -0
  35. data/gui/tinkerbackwindows/superant.com.slideshow/17viewvcardrecord.rwd +32 -0
  36. data/gui/tinkerbackwindows/superant.com.slideshow/18contactutilities.rwd +34 -0
  37. data/gui/tinkerbackwindows/superant.com.slideshow/81jumplinkcommands.rwd +17 -0
  38. data/gui/tinkerbackwindows/{superant.com.foldwords/z9end.rwd → superant.com.slideshow/9end.rwd} +0 -0
  39. data/init.rb +61 -164
  40. data/installed/rwdwfoldeditor.inf +3 -8
  41. data/lang/en/rwdcore/en.po +182 -0
  42. data/lang/en/rwdfoldeditor/en.po +28 -0
  43. data/lang/es/rwdcore/es.po +175 -0
  44. data/lang/fr/rwdcore/fr.po +169 -0
  45. data/lang/hi/rwdcore/hi.po +173 -0
  46. data/lang/ja/rwdcore/ja.po +171 -0
  47. data/lang/nl/rwdcore/nl.po +169 -0
  48. data/lib/rwdtinker/rwdcodedir.rb +56 -0
  49. data/lib/rwdtinker/rwdguidir.rb +57 -0
  50. data/lib/rwdtinker/rwdlangdir.rb +60 -0
  51. data/lib/rwdtinker/rwdtinkertools.rb +2 -1
  52. data/rwd_files/HowTo_FoldEditor.txt +9 -0
  53. data/rwd_files/HowTo_Tinker.txt +24 -6
  54. data/rwd_files/Tinkerhelptexthash.txt +82 -0
  55. data/rwd_files/rubylinks.fld +6 -0
  56. data/rwd_files/rwdapplications.html +23 -1
  57. data/rwd_files/rwdfoldeditorhelpfiles.txt +17 -0
  58. data/tests/makedist-rwdwfoldeditor.rb +1 -1
  59. data/tests/makedist.rb +1 -1
  60. data/zips/rwdwfoldeditor-0.07.zip +0 -0
  61. data/zips/rwdwmovies-0.98.zip +0 -0
  62. data/zips/rwdwmpd-0.07.zip +0 -0
  63. data/zips/temp.rb +1 -0
  64. data/zips/tinkerbellw-0.03.zip +0 -0
  65. data/zips/{wrubyslippers-1.07.zip → wrubyslippers-1.08.zip} +0 -0
  66. metadata +33 -29
  67. data/code/01rwdcore/04helptextend.rb +0 -6
  68. data/code/superant.com.foldback/clearhttpview3.rb +0 -9
  69. data/code/superant.com.foldback/dictlookup.rb +0 -20
  70. data/code/superant.com.foldback/eliza.rb +0 -8
  71. data/code/superant.com.foldback/helptexthashrwdhypernote.rb +0 -19
  72. data/code/superant.com.foldback/listwordlookup.rb +0 -37
  73. data/code/superant.com.foldback/openhelpwindowrwdhyernote.rb +0 -13
  74. data/code/superant.com.foldback/runrwdshellwindow.rb +0 -12
  75. data/code/superant.com.foldeditor/helptexthashrwdhypernote.rb +0 -38
  76. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +0 -61
  77. data/gui/tinkerbackwindows/superant.com.foldwords/1appname.rwd +0 -4
  78. data/gui/tinkerbackwindows/superant.com.foldwords/1dictionary.rwd +0 -19
  79. data/gui/tinkerbackwindows/superant.com.foldwords/3ai.rwd +0 -22
  80. data/gui/tinkerbackwindows/superant.com.foldwords/4thesaurus.rwd +0 -36
  81. data/gui/tinkerbackwindows/superant.com.foldwords/77jumplinkcommands.rwd +0 -17
  82. data/lang/en/rwdcore/languagefile.rb +0 -59
  83. data/lang/es/rwdcore/languagefile-es.rb +0 -63
  84. data/lang/fr/rwdcore/languagefile.rb +0 -65
  85. data/lang/jp/rwdcore/languagefile.rb +0 -73
  86. data/lang/nl/rwdcore/languagefile.rb +0 -76
  87. data/lib/dict.rb +0 -438
  88. data/lib/oothesaurus.rb +0 -76
  89. data/zips/rwdwgutenberg-0.11.zip +0 -0
  90. data/zips/rwdwhypernote-0.15.zip +0 -0
@@ -1,4 +1,6 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
1
2
  # install rwdtinker applet from a long directory location
3
+
2
4
  def installgemapplet
3
5
  require 'fileutils'
4
6
  require 'lib/zip/zip'
@@ -1,4 +1,6 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
1
2
  # this code is to list the zips
3
+
2
4
  def fillzipappletname(inffile)
3
5
  applet = inffile.gsub(/\.zip$/, "")
4
6
  @a_installapplet = applet
@@ -1,4 +1,6 @@
1
- # this code is to list the applets that are installed
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
+ # this code is to list the applets that are installed
3
+
2
4
  def listinstalledfiles
3
5
  fileList = Dir.new("installed").entries.sort.reverse.delete_if { |x| ! (x =~ /inf$/) }
4
6
  @filesresult = fileList.rwd_method("fillappletname")
@@ -1,4 +1,6 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
1
2
  # this code is to list the zipped applets that can be installed
3
+
2
4
  def fillziptoinstallname(inffile)
3
5
  applet = inffile.gsub(/\.zip$/, "")
4
6
  @a_installapplet = applet
@@ -1,4 +1,6 @@
1
- # this method puts the configuration rexord on the screen
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
+ # this method puts the configuration rexord on the screen
3
+
2
4
  def loadconfigurationrecord
3
5
 
4
6
  require 'fileutils'
@@ -1,3 +1,4 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
1
2
  #view contents of a tinker applet
2
3
  def viewappletcontents
3
4
  require 'fileutils'
@@ -1,13 +1,16 @@
1
+ #view the log on the tab
2
+
1
3
  def rwdtinkerrunviewlog
2
4
  require 'lib/rwdtinker/rwdtinkertools'
3
5
 
6
+ logfilelocation = File.join(LogDirectory, 'rwdtinker.log')
4
7
  if @a_rwdtinkerlognumber == nil
5
8
  @a_rwdtinkerlognumber = 11
6
- @returnlogdisplay = RwdtinkerTools.tail("rwd_files/log/rwdtinker.log",@a_rwdtinkerlognumber.to_i)
9
+
10
+ end
11
+
12
+ @returnlogdisplay = RwdtinkerTools.tail(logfilelocation , @a_rwdtinkerlognumber.to_i)
7
13
 
8
- else
9
- @returnlogdisplay = RwdtinkerTools.tail("rwd_files/log/rwdtinker.log",@a_rwdtinkerlognumber.to_i)
10
-
11
- end
14
+
12
15
  end
13
16
 
@@ -1,4 +1,5 @@
1
-
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
+ # end of rwdtinker class
2
3
 
3
4
  end # end of rwdtinker class
4
5
 
@@ -1,4 +1,4 @@
1
- ##VERSION: (1.80)
1
+ ##VERSION: (1.83)
2
2
  ConfigurationDir = "configuration" # for use in program - init.rb has this value without using this constant
3
3
  CodeName = "rwdtinker"
4
4
  CodeNameFile = CodeName + ".rb"
@@ -10,5 +10,6 @@ LangDir = "lang"
10
10
  $prevouswindow ="main"
11
11
  $rwdcontrolports =["13713","13714","13715","13716"] # remote control code not actived 2007
12
12
  $port = 7705
13
- RwdTinkerVersion = "1.80"
13
+ ##NAME: (RwdTinkerVersion):(1.83)
14
+ RwdTinkerVersion = "1.83"
14
15
 
@@ -1,4 +1,4 @@
1
- ##VERSION: (0.05)
1
+ ##VERSION: (0.07)
2
2
  ##NAME: ($rwdfoldeditor_directory):(0.04)
3
3
  $rwdfoldeditor_directory = "rwd_files"
4
4
  ##NAME: ($foldeditorbrowser):(0.04)
@@ -7,8 +7,10 @@ $testharnessarray << "rwdfoldeditor_all_tests"
7
7
  $tinkerhelpaboutarray << "RwdFoldEditor"
8
8
  $tinkerdocumentsarray << "HowTo_FoldEditor.txt"
9
9
  ##NAME: (JumpLink.update):(0.04)
10
- JumpLink.update(:RwdFoldEditor=>"runrwdfoldeditorwindow", :FoldBackWindow=> "rwdfoldbackwindow")
11
- $rwdjumplink << "RwdFoldEditor" << "FoldBackWindow"
12
- ##NAME: (RwdFoldEditorVersion):(0.05)
13
- RwdFoldEditorVersion = "0.05"
10
+ JumpLink.update(:RwdFoldEditor=>"runrwdfoldeditorwindow")
11
+ $rwdjumplink << "RwdFoldEditor"
12
+ ##NAME: (DeleteFoldEditorConfig):(0.06)
13
+ DeleteFoldEditorConfig = true
14
+ ##NAME: (RwdFoldEditorVersion):(0.07)
15
+ RwdFoldEditorVersion = "0.07"
14
16
 
@@ -1,4 +1,4 @@
1
- ##VERSION: (1.80)
1
+ ##VERSION: (1.82)
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
3
  ##NAME: ($zipslocation):(1.78)
4
4
  $zipslocation = "zips" # location of applets to add
@@ -14,14 +14,10 @@ $zipslocation = "zips" # location of applets to add
14
14
  # $geminstalled_directory = "/ruby/lib/ruby/gems/1.8/gems" # XP machine
15
15
  $geminstalled_directory = "/var/lib/gems/1.8/gems" # Debian Linux
16
16
 
17
- $rwdapplicationidentity = "RwdFoldeditor main application"
17
+ $rwdapplicationidentity = "rwdtinker main application"
18
18
 
19
- RwdTinkerWin2Version = "1.80"
19
+ RwdTinkerWin2Version = "1.81"
20
20
  Browser_Exe = 'mozilla '
21
21
  #language selection file
22
- ##NAME: ($lang):(1.78)
23
- #$lang = "jp"
24
- $lang= "en"
25
- #$lang= "nl"
26
- #$lang= "es"
27
- #$lang= "fr"
22
+ ##NAME: ($langarray):(1.82)
23
+ $langarray = [ "en","ja", "nl","es", "fr","hi"]
@@ -0,0 +1,31 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"foldeditorzipslister\" caption=#{Message[:zipfoldfile_tab]}>
4
+
5
+ <table>
6
+ <row> <p align=\"right\">#{Message[:foldfile_name]}</p> <text size=50 name=\"a_viewfoldlinkfile\"/> </row>
7
+
8
+ </table>
9
+
10
+ <table>
11
+ <horizontal>
12
+
13
+ <button caption=#{Message[:viewfoldfile_contents]} action=\"loadrwdfoldeditlinkfile\"/>
14
+ <button caption=#{Message[:zipfold_file]} action=\"zipfoldeditorfile\"/>
15
+ <button caption=#{Message[:help]} action=\"runhelpwindowrwdfoldeditor\"/>
16
+ </horizontal>
17
+ </table>
18
+ </table>
19
+ <row> <p align=\"left\"> %a_zipfoldeditorlinkfile% </p></row>
20
+ </table>
21
+
22
+
23
+ <p>%a_foldeditorlinkfile%</p>
24
+
25
+
26
+
27
+
28
+ </tab>"
29
+
30
+
31
+
@@ -0,0 +1,4 @@
1
+ $rwdguivar=
2
+ "<application>
3
+ <window name=\"rwdslideshowwindow\" title=\"RwdSlideShow RwdTinker\">
4
+ <tabs>"
@@ -0,0 +1,19 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"Viewnamedata\" caption=\"View Contact\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewnamedata\"/> </row>
7
+
8
+ </table>
9
+
10
+ <horizontal>
11
+ <button caption=\"Open\" action=\"viewnamedata\"/>
12
+ <button caption=\"View Photo\" action=\"viewcontactphoto\"/>
13
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
14
+
15
+ </horizontal>
16
+
17
+ "
18
+
19
+
@@ -0,0 +1,21 @@
1
+ $rwdguivar=
2
+ "
3
+ <table>
4
+
5
+
6
+
7
+ <p>%viewnamedatadisplay%</p>
8
+ </table>
9
+ <table>
10
+ <image src=\"contacttmp.jpg\"></image>
11
+ </table>
12
+ <table>
13
+ <horizontal>
14
+ <button caption=\"List Contacts\" action=\"listnamerecordfiles\"/>
15
+ </horizontal>
16
+ <p>%%listnamerecordfilesresult%%</p>
17
+ </table>
18
+ </tab>"
19
+
20
+
21
+
@@ -0,0 +1,39 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"editnamerecordfile\" caption=\"Edit Contact\">
4
+ <table>
5
+ <row> <p> </row>
6
+ <row> <p align=\"right\">You can create a new record here or edit one</row>
7
+ <row> <p> </row>
8
+ <horizontal>
9
+ <button caption=\"Fill Record\" action=\"loadnamerecord\"/>
10
+ <button caption=\"Save Changes\" action=\"createnewnamerecord\"/>
11
+ <button caption=\"Clear\" action=\"clearnamescreendisplay\"/>
12
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
13
+
14
+
15
+
16
+
17
+ </horizontal>
18
+ <table>
19
+ <row> <p align=\"right\">FileName:</p> <text size=50 name=\"a_filename\"/> </row>
20
+ <row> <p align=\"right\">Contact Name:</p> <text size=70 name=\"a_name\"/> </row>
21
+ <row> <p align=\"right\">Address:</p> <text size=70 name=\"a_address\"/> </row>
22
+ <row> <p align=\"right\">CityStateZip:</p> <text size=70 name=\"a_citystatezip\"/> </row>
23
+ <row> <p align=\"right\">Phone:</p> <text size=70 name=\"a_phone\"/> </row>
24
+ <row> <p align=\"right\">Email:</p> <text size=70 name=\"a_email\"/> </row>
25
+ <row> <p align=\"right\">Comment1:</p> <text size=70 name=\"a_comment1\"/> </row>
26
+ <row> <p align=\"right\">Comment2:</p> <text size=70 name=\"a_comment2\"/> </row>
27
+ <row> <p align=\"right\">Comment3:</p> <text size=70 name=\"a_comment3\"/> </row>
28
+
29
+ </table>
30
+ <horizontal>
31
+ <button caption=\"Export vCard\" action=\"savevcardrecord\"/>
32
+
33
+
34
+ </horizontal>
35
+ <p>%extranamedatadisplay%</p>
36
+ <p>
37
+ <p>%createnewnamerecorddisplay%</p>
38
+ </tab>"
39
+
@@ -0,0 +1,32 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"Viewvcardrecord\" caption=\"View vCard Record\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewvcarddata\"/> </row>
7
+
8
+ </table>
9
+
10
+ <horizontal>
11
+ <button caption=\"Open\" action=\"viewvcarddata\"/>
12
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
13
+
14
+ </horizontal>
15
+
16
+
17
+ <table>
18
+
19
+
20
+ <p>%viewvcarddatadisplay%</p>
21
+
22
+
23
+ </table>
24
+ <horizontal>
25
+ <button caption=\"List vCard Records\" action=\"listvcardrecordfiles\"/>
26
+ </horizontal>
27
+ <p>%%listvcardrecordfilesresult%%</p>
28
+
29
+ </tab>"
30
+
31
+
32
+
@@ -0,0 +1,34 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"contactutilitiesrwdaddresses\" caption=\"Contact Utilities\">
4
+
5
+ <table>
6
+ <row> <p align=\"right\">Contact Name:</p> <text name=\"a_viewnamedata\"/> </row>
7
+ <row> <p align=\"right\">New Name:</p> <text name=\"a_changenamedata\"/> </row>
8
+
9
+ </table>
10
+
11
+ <horizontal>
12
+ <button caption=\"Rename Record\" action=\"changenamedata\"/>
13
+ <button caption=\"Delete Record\" action=\"deletecontactrecord\"/>
14
+ </horizontal>
15
+ <table>
16
+
17
+ <row> <p align=\"right\">Photo Name:</p> <text name=\"a_tmpphotoname\"/> </row>
18
+ </table>
19
+
20
+ <horizontal>
21
+ <button caption=\"Attach Photo\" action=\"attachtmpcontactphoto\"/>
22
+ <button caption=\"Help\" action=\"runhelpwindowrwdaddresses\"/>
23
+ </horizontal>
24
+
25
+ <horizontal>
26
+ <button caption=\"List Contacts\" action=\"listnamerecordfiles\"/>
27
+
28
+
29
+ <button caption=\"List Photos\" action=\"viewtmpcontactphoto\"/>
30
+ </horizontal>
31
+
32
+ <p>%%listnamerecordfilesresult%%</p>
33
+ <p>%%listphotosfromtmp%%</p>
34
+ </tab>"
@@ -0,0 +1,17 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=selectiontab caption=#{Message[:selection_tab]}>
4
+ <horizontal>
5
+ <button caption=#{Message[:showjump_links]} action=\"showjumplinkoptions\"/>
6
+
7
+ </horizontal>
8
+ <table>
9
+ <select name=\"a_jumplinkinput\"> %%jumplinkoptions%% </select>
10
+
11
+ </table>
12
+
13
+ <horizontal>
14
+ <button caption=#{Message[:jumptoapplication_location]} action=\"runjumplinkcommand\"/>
15
+ </horizontal>
16
+ </tab>
17
+ "
data/init.rb CHANGED
@@ -23,47 +23,22 @@
23
23
 
24
24
  require 'logger'
25
25
 
26
- $rwdtinkerlog = Logger.new( 'rwd_files/log/rwdtinker.log', 'weekly' )
26
+ LogDirectory = 'rwd_files/log/'
27
+ logfilelocation = File.join(LogDirectory, 'rwdtinker.log')
28
+
29
+ $rwdtinkerlog = Logger.new( logfilelocation , 'weekly' )
27
30
  $rwdtinkerlog.level = Logger::INFO
28
31
 
29
32
  require "lib/rwd/rwd"
30
33
  require 'fileutils'
31
34
  require 'lib/rconftool'
32
35
 
33
- $progdir = File::expand_path( File.dirname(__FILE__))
34
-
35
- $tempdoc = " "
36
+ $KCODE = 'u'
37
+ require 'jcode'
36
38
 
37
- def findfiles(d)
38
- a = Array.new(Dir[d].entries.sort)
39
- #loop through and get the files names
40
- a.each do |x|
41
- #adjust the filters to the files you want to see...
42
- if(!test(?d,x))
43
- # only rwd files
44
- if x =~ /rb|rwd|txt/
45
- fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
46
- $tempdoc+=fileA.read #reads the file into the doc string
47
- fileA.close
48
- end
49
- end
50
- end
51
- end
52
- def loadguifile(d)
53
- a = Array.new(Dir[d].entries.sort)
54
- #loop through and get the files names
55
- a.each do |x|
56
- #adjust the filters to the files you want to see...
57
- if(!test(?d,x))
58
- # only rwd files
59
- if x =~ /rb|rwd|txt/
39
+ $progdir = File::expand_path( File.dirname(__FILE__))
60
40
 
61
- load x #opens the file thats in fileName and reads it
62
- $tempdoc += $rwdguivar # adds the file into the doc string
63
- end
64
- end
65
- end
66
- end
41
+ tempdoc = " "
67
42
 
68
43
  # integrate the new configuration files
69
44
  MAINconfignew = "rwdconfig.cnf"
@@ -99,148 +74,70 @@ Rconftool::install(configdist,confignew) #integrates new file with old
99
74
 
100
75
  Dir.chdir($progdir) # change back to top program directory
101
76
 
77
+
102
78
  # build the English Language hash file from the parts
103
- languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
104
- langmessage = {' + "\n"
105
- startlangdir = File.join(LangDir,"en")
106
- #get a list of the files and subdirectories on the starting directory only
107
- alanghash = Array.new(Dir[startlangdir].entries.sort)
108
- #loop through the list, ignore the files and add all new directories found
109
- alanghash.each do |x|
110
- #if a directory...
111
- if(test(?d,x))
112
- # add to the original list of directories
113
- @@tmproot = x + "/**"
114
- #adds the new ones to the array
115
- blanghash = Dir[@@tmproot].entries.sort
116
- blanghash.each do |x|
117
- if(test(?d,x))
118
- alanghash.push(x) #appends to the end of the array...
119
- end
120
- end
121
- end
122
- end
123
- alanghash.each do |x|
124
- #if it is a file...
125
- if(!test(?d,x))
126
- alanghash.delete(x)
127
- else #it is a directory...
128
- findfiles(x + "/**")
129
- end
79
+ Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
80
+ langmessage = { :clear => "Clear", :rwdtinker => "Rwdtinker" } ; langmessage.each { |kk, vv| Message[kk] = vv }
81
+
82
+ def msgid(programkey)
83
+ $programkey = programkey
130
84
  end
131
-
85
+
86
+ def msgstr(programmsg)
87
+ if programmsg == ""
88
+ $rwdtinkerlog.info "msgstr: no translation for #{$programkey}"
89
+ else
90
+ Message.update( $programkey.to_sym => programmsg )
91
+ end
92
+ end
93
+
94
+ require 'lib/rwdtinker/rwdlangdir'
95
+
96
+ tempdoc = " "
97
+ #go get all the po language file files in english
98
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en")
132
99
 
133
100
  #writes the contents of doc into the languagehashvariable
134
- languagehashvariable = languagehashvariable + $tempdoc + "} ; langmessage.each { |kk, vv| Message[kk] = vv }"
101
+ languagehashvariable = tempdoc
135
102
 
136
103
  # END of en Lang building
137
- $tempdoc = " "
104
+ tempdoc = " "
138
105
  Dir.chdir($progdir) # change back to top program directory
139
106
 
140
107
  # build the local Language hash file from the parts
141
- startlangdir = File.join(LangDir,$lang)
142
- #get a list of the files and subdirectories on the starting directory only
143
- alanghash = Array.new(Dir[startlangdir].entries.sort)
144
- #loop through the list, ignore the files and add all new directories found
145
- alanghash.each do |x|
146
- #if a directory...
147
- if(test(?d,x))
148
- # add to the original list of directories
149
- @@tmproot = x + "/**"
150
- #adds the new ones to the array
151
- blanghash = Dir[@@tmproot].entries.sort
152
- blanghash.each do |x|
153
- if(test(?d,x))
154
- alanghash.push(x) #appends to the end of the array...
155
- end
156
- end
157
- end
158
- end
159
- alanghash.each do |x|
160
- #if it is a file...
161
- if(!test(?d,x))
162
- alanghash.delete(x)
163
- else #it is a directory...
164
- findfiles(x + "/**")
165
- end
166
- end
167
-
168
-
169
- #writes the contents of doc into the variable
170
- languagehashvariable = languagehashvariable + " ; Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
171
-
172
-
173
- $tempdoc = " "
174
-
175
- Dir.chdir($progdir) # change back to top program directory
108
+
109
+ $lang = $langarray[0] # pick the language of choice
110
+
111
+ # Go get all the po files for the language of choice
112
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang)
113
+ # the contents of doc into the variable
114
+ languagehashvariable = languagehashvariable + tempdoc
176
115
 
177
- temp = eval( languagehashvariable )
116
+ Dir.chdir($progdir) # change back to top program directory
117
+
118
+ # lets read those po files, first english then the chosen language
119
+ temp = eval( languagehashvariable )
178
120
 
179
- $tempdoc = " "
121
+
180
122
 
181
123
  # build the actual program from the code parts
182
- #get a list of the files and subdirectories on the starting directory only
183
- a = Array.new(Dir[CodeDir].entries.sort)
184
- #loop through the list, ignore the files and add all new directories found
185
- a.each do |x|
186
- #if a directory...
187
- if(test(?d,x))
188
- # add to the original list of directories
189
- @@root = x + "/**"
190
- #adds the new ones to the array
191
- b = Dir[@@root].entries.sort
192
- b.each do |x|
193
- if(test(?d,x))
194
- a.push(x) #appends to the end of the array...
195
- end
196
- end
197
- end
198
- end
199
- a.each do |x|
200
- #if it is a file...
201
- if(!test(?d,x))
202
- a.delete(x)
203
- else #it is a directory...
204
- findfiles(x + "/**")
205
- end
206
- end
207
-
124
+ require 'lib/rwdtinker/rwdcodedir'
125
+
126
+ tempdoc = RwdtinkerTools.findprogramfiles(CodeDir)
208
127
 
209
128
  # load the program file
210
- tempcoderesult = eval( $tempdoc )
129
+
130
+ tempcoderesult = eval( tempdoc )
211
131
 
212
132
  # build the actual GUI from the gui parts
213
- $tempdoc = " "
214
- #get a list of the files and subdirectories on the starting directory only
215
- a = Array.new(Dir[GuiDir].entries.sort)
216
- #loop through the list, ignore the files and add all new directories found
217
- a.each do |x|
218
- #if a directory...
219
- if(test(?d,x))
220
- #use this new dir find to add to the original list of directories
221
- @@root = x + "/**"
222
- #adds the new ones to the array
223
- b = Dir[@@root].entries.sort
224
- b.each do |x|
225
- if(test(?d,x))
226
- a.push(x) #appends to the end of the array...
227
- end
228
- end
229
- end
230
- end
231
- a.each do |x|
232
- #if it is a file...
233
- if(!test(?d,x))
234
- a.delete(x)
235
-
236
- else #it is a directory...
237
- loadguifile(x + "/**")
238
- end
239
- end
133
+ require 'lib/rwdtinker/rwdguidir'
134
+
135
+ tempdoc = RwdtinkerTools.findguifiles(GuiDir)
136
+
240
137
 
241
138
  # gui variable is done
242
139
  guiRWD = ""
243
- $rwd_gui_tinker = $tempdoc
140
+ $rwd_gui_tinker = tempdoc
244
141
  require 'socket' # Network stuff
245
142
  host = "127.0.0.1"
246
143
  port = $port
@@ -255,27 +152,27 @@ Rconftool::install(configdist,confignew) #integrates new file with old
255
152
  $port = port
256
153
  # Rescue the "Address in use" error
257
154
  rescue Errno::EADDRINUSE
258
- puts "RWD Startup: Port #{port} on host #{host} is already in use."
155
+ $rwdtinkerlog.warn "RWD Startup: Port #{port} on host #{host} is already in use."
259
156
  port=port +1
260
- puts "trying port: #{port}"
157
+ $rwdtinkerlog.warn "trying port: #{port}"
261
158
  # Rescue the "Address not available' error
262
159
  rescue Errno::EADDRNOTAVAIL
263
- puts "RWD Startup: Address #{host} is not available to bind."
160
+ $rwdtinkerlog.warn "RWD Startup: Address #{host} is not available to bind."
264
161
  port =port + 1
265
- puts "trying port: #{port}"
162
+ $rwdtinkerlog.warn "trying port: #{port}"
266
163
  # Rescue "permission denied errors
267
164
  rescue Errno::EACCES
268
- puts "RWD Startup: Access denied when binding interface addresses. ?"
165
+ $rwdtinkerlog.warn "RWD Startup: Access denied when binding interface addresses. ?"
269
166
  port =port + 1
270
- puts "trying port: #{port}"
167
+ $rwdtinkerlog.warn "trying port: #{port}"
271
168
  # Rescue all other errors
272
169
  rescue
273
- puts "RWD Startup: An error occured."
170
+ $rwdtinkerlog.warn "RWD Startup: An error occured."
274
171
  port =port + 1
275
- puts "trying port: #{port}"
172
+ $rwdtinkerlog.warn "trying port: #{port}"
276
173
  # Rescue all other errors
277
174
  end
278
-
175
+ $port = port
279
176
  end
280
177
 
281
178