rwdtinker 1.81 → 1.82

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,8 +30,6 @@ def initiateapplet(nametextlocal)
30
30
 
31
31
  $rwdtinkerlog.info "initiateapplet: starting config load with: #{nametextlocal}"
32
32
 
33
-
34
-
35
33
  Dir.chdir($progdir ) #changes the current working directory
36
34
 
37
35
  @confignew = "configuration/" + "#{nametextlocal}.cnf"
@@ -44,13 +42,10 @@ begin
44
42
 
45
43
  eval configfileload #load config file
46
44
 
47
-
48
-
49
45
  rescue
50
46
 
51
47
  $rwdtinkerlog.error "initiateapplet: error in initiateapplets - config load"
52
48
 
53
-
54
49
  debuginitiate += 1
55
50
  end
56
51
  $tempdoc = " "
@@ -58,80 +53,24 @@ $tempdoc = " "
58
53
  Dir.chdir($progdir) # change back to top program directory
59
54
 
60
55
  # build the English Language hash file from the parts
61
- languagehashvariable = 'Message.update('
62
- startlangdir = File.join(LangDir,"en")
63
- #get a list of the files and subdirectories on the starting directory only
64
- alanghash = Array.new(Dir[startlangdir].entries.sort)
65
- #loop through the list, ignore the files and add all new directories found
66
- alanghash.each do |x|
67
- #if a directory...
68
- if(test(?d,x))
69
- # add to the original list of directories
70
- @@tmproot = x + "/**"
71
- #adds the new ones to the array
72
- blanghash = Dir[@@tmproot].entries.sort
73
- blanghash.each do |x|
74
- if(test(?d,x))
75
- alanghash.push(x) #appends to the end of the array...
76
- end
77
- end
78
- end
79
- end
80
- alanghash.each do |x|
81
- #if it is a file...
82
- if(!test(?d,x))
83
- alanghash.delete(x)
84
- else #it is a directory...
85
- findfiles(x + "/**")
86
- end
87
- end
88
-
56
+ require 'lib/rwdtinker/rwdlangdir'
57
+
58
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en")
89
59
 
90
60
  #writes the contents of doc into the languagehashvariable
91
-
92
61
 
93
- languagehashvariable = languagehashvariable + $tempdoc + ' :rwdtinker => "Rwdtinker" ) ;'
62
+ languagehashvariable = tempdoc
94
63
 
95
64
  # END of en Lang building
96
65
  $tempdoc = " "
97
66
  Dir.chdir($progdir) # change back to top program directory
98
67
 
99
68
  # build the local Language hash file from the parts
100
- startlangdir = File.join(LangDir,$lang)
101
- #get a list of the files and subdirectories on the starting directory only
102
- alanghash = Array.new(Dir[startlangdir].entries.sort)
103
- #loop through the list, ignore the files and add all new directories found
104
- alanghash.each do |x|
105
- #if a directory...
106
- if(test(?d,x))
107
- # add to the original list of directories
108
- @@tmproot = x + "/**"
109
- #adds the new ones to the array
110
- blanghash = Dir[@@tmproot].entries.sort
111
- blanghash.each do |x|
112
- if(test(?d,x))
113
- alanghash.push(x) #appends to the end of the array...
114
- end
115
- end
116
- end
117
- end
118
- alanghash.each do |x|
119
- #if it is a file...
120
- if(!test(?d,x))
121
- alanghash.delete(x)
122
- else #it is a directory...
123
- findfiles(x + "/**")
124
- end
125
- end
126
-
69
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang)
127
70
 
128
- #writes the contents of doc into the variable
71
+ #writes the contents of doc into the variable
129
72
 
130
- languagehashvariable = languagehashvariable + " Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
131
-
132
-
133
-
134
- $tempdoc = " "
73
+ languagehashvariable = languagehashvariable + tempdoc
135
74
 
136
75
  Dir.chdir($progdir) # change back to top program directory
137
76
 
@@ -142,44 +81,18 @@ $tempdoc = " "
142
81
  begin # error trap
143
82
 
144
83
  # build the actual GUI from the gui parts
145
- $tempdoc = " "
146
- #get a list of the files and subdirectories on the starting directory only
147
- a = Array.new(Dir[GuiDir].entries.sort)
148
- #loop through the list, ignore the files and add all new directories found
149
- a.each do |x|
150
- #if a directory...
151
- if(test(?d,x))
152
- #use this new dir find to add to the original list of directories
153
- @@root = x + "/**"
154
- #adds the new ones to the array
155
- b = Dir[@@root].entries.sort
156
- b.each do |x|
157
- if(test(?d,x))
158
- a.push(x) #appends to the end of the array...
159
- end
160
- end
161
- end
162
- end
163
- a.each do |x|
164
- #if it is a file...
165
- if(!test(?d,x))
166
- a.delete(x)
167
-
168
- else #it is a directory...
169
- loadguifile(x + "/**")
170
-
171
-
172
- end
173
- end
174
-
175
- $rwd_gui_tinker = $tempdoc
176
-
84
+ tempdoc = " "
85
+
86
+ require 'lib/rwdtinker/rwdguidir'
87
+
88
+ tempdoc = RwdtinkerTools.findguifiles(GuiDir)
89
+
90
+ $rwd_gui_tinker = tempdoc
177
91
 
178
92
  rescue
179
93
  $rwd_gui_tinker = tempguistorage # restore old gui
180
94
 
181
95
  $rwdtinkerlog.error "error in initiateapplets - gui building"
182
-
183
96
 
184
97
  debuginitiate += 1
185
98
  end
@@ -237,5 +150,21 @@ begin # error trap
237
150
  end
238
151
 
239
152
 
153
+ def findfiles(d)
154
+ a = Array.new(Dir[d].entries.sort)
155
+ #loop through and get the files names
156
+ a.each do |x|
157
+ #adjust the filters to the files you want to see...
158
+ if(!test(?d,x))
159
+ # only rwd files
160
+ if x =~ /rb|rwd|txt/
161
+ fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
162
+ $tempdoc+=fileA.read #reads the file into the doc string
163
+ fileA.close
164
+ end
165
+ end
166
+ end
167
+ end
168
+
240
169
 
241
170
 
@@ -1,4 +1,4 @@
1
- ##VERSION: (1.81)
1
+ ##VERSION: (1.82)
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.81"
13
+ ##NAME: (RwdTinkerVersion):(1.82)
14
+ RwdTinkerVersion = "1.82"
14
15
 
@@ -1,4 +1,4 @@
1
- ##VERSION: (1.81)
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
@@ -19,9 +19,5 @@ $rwdapplicationidentity = "rwdtinker main application"
19
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"]
data/init.rb CHANGED
@@ -32,38 +32,7 @@ require 'lib/rconftool'
32
32
 
33
33
  $progdir = File::expand_path( File.dirname(__FILE__))
34
34
 
35
- $tempdoc = " "
36
-
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/
60
-
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
35
+ tempdoc = " "
67
36
 
68
37
  # integrate the new configuration files
69
38
  MAINconfignew = "rwdconfig.cnf"
@@ -99,148 +68,70 @@ Rconftool::install(configdist,confignew) #integrates new file with old
99
68
 
100
69
  Dir.chdir($progdir) # change back to top program directory
101
70
 
71
+
102
72
  # 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
73
+ Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
74
+ langmessage = { :clear => "Clear", :rwdtinker => "Rwdtinker" } ; langmessage.each { |kk, vv| Message[kk] = vv }
75
+
76
+ def msgid(programkey)
77
+ $programkey = programkey
130
78
  end
131
-
79
+
80
+ def msgstr(programmsg)
81
+ if programmsg == ""
82
+ $rwdtinkerlog.info "msgstr: no translation for #{$programkey}"
83
+ else
84
+ Message.update( $programkey.to_sym => programmsg )
85
+ end
86
+ end
87
+
88
+ require 'lib/rwdtinker/rwdlangdir'
89
+
90
+ tempdoc = " "
91
+ #go get all the po language file files in english
92
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en")
132
93
 
133
94
  #writes the contents of doc into the languagehashvariable
134
- languagehashvariable = languagehashvariable + $tempdoc + "} ; langmessage.each { |kk, vv| Message[kk] = vv }"
95
+ languagehashvariable = tempdoc
135
96
 
136
97
  # END of en Lang building
137
- $tempdoc = " "
98
+ tempdoc = " "
138
99
  Dir.chdir($progdir) # change back to top program directory
139
100
 
140
101
  # 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
102
+
103
+ $lang = $langarray[0] # pick the language of choice
104
+
105
+ # Go get all the po files for the language of choice
106
+ tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang)
107
+ # the contents of doc into the variable
108
+ languagehashvariable = languagehashvariable + tempdoc
176
109
 
177
- temp = eval( languagehashvariable )
110
+ Dir.chdir($progdir) # change back to top program directory
111
+
112
+ # lets read those po files, first english then the chosen language
113
+ temp = eval( languagehashvariable )
178
114
 
179
- $tempdoc = " "
115
+
180
116
 
181
117
  # 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
-
118
+ require 'lib/rwdtinker/rwdcodedir'
119
+
120
+ tempdoc = RwdtinkerTools.findprogramfiles(CodeDir)
208
121
 
209
122
  # load the program file
210
- tempcoderesult = eval( $tempdoc )
123
+
124
+ tempcoderesult = eval( tempdoc )
211
125
 
212
126
  # 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
127
+ require 'lib/rwdtinker/rwdguidir'
128
+
129
+ tempdoc = RwdtinkerTools.findguifiles(GuiDir)
130
+
240
131
 
241
132
  # gui variable is done
242
133
  guiRWD = ""
243
- $rwd_gui_tinker = $tempdoc
134
+ $rwd_gui_tinker = tempdoc
244
135
  require 'socket' # Network stuff
245
136
  host = "127.0.0.1"
246
137
  port = $port
@@ -275,7 +166,7 @@ Rconftool::install(configdist,confignew) #integrates new file with old
275
166
  $rwdtinkerlog.warn "trying port: #{port}"
276
167
  # Rescue all other errors
277
168
  end
278
-
169
+ $port = port
279
170
  end
280
171
 
281
172
 
@@ -0,0 +1,166 @@
1
+ # English Language files for RwdTinker core
2
+
3
+ msgid "applet_installed"
4
+ msgstr '"applet installed!"'
5
+
6
+ msgid "application_version"
7
+ msgstr "Application Version"
8
+
9
+ msgid "cancel"
10
+ msgstr "Cancel"
11
+
12
+ msgid "clickfor_version"
13
+ msgstr "Click for Version"
14
+
15
+ msgid "clickbelowtoviewlistof_zip"
16
+ msgstr "click below to view lists of zips"
17
+
18
+ msgid "documents"
19
+ msgstr "Documents"
20
+
21
+ msgid "edit"
22
+ msgstr "edit"
23
+
24
+ msgid "file_name"
25
+ msgstr "File Name:"
26
+
27
+ msgid "fill_record"
28
+ msgstr "Fill Record"
29
+
30
+ msgid "help"
31
+ msgstr "Help"
32
+
33
+ msgid "help_about"
34
+ msgstr '"Help About"'
35
+
36
+ msgid "install_applet"
37
+ msgstr '"install (rwdtinker) applet"'
38
+
39
+ msgid "jumptoapplication_location"
40
+ msgstr '"Jump to Application Location"'
41
+
42
+ msgid "list_applets"
43
+ msgstr '"Remove Applets"'
44
+
45
+ msgid "listappletsinthegem_directory"
46
+ msgstr '"List applets in the Gem Directory"'
47
+
48
+ msgid "listappletsavailablefor_installation"
49
+ msgstr '"List applets available for installation"'
50
+
51
+ msgid "list_files"
52
+ msgstr '"List Files"'
53
+
54
+ msgid "list_installed_gems "
55
+ msgstr '"List installed Gems"'
56
+
57
+ msgid "list_photos"
58
+ msgstr '"List Photos"'
59
+
60
+ msgid "list_zips"
61
+ msgstr '"List Zips"'
62
+
63
+ msgid "listzipdirappletsavailable"
64
+ msgstr '"List (zip directory) applets available for installation"'
65
+
66
+ msgid "menu_panel"
67
+ msgstr '"Menu Panel"'
68
+
69
+ msgid "module_unknown"
70
+ msgstr '"Unknown Module"'
71
+
72
+ msgid "next"
73
+ msgstr "Next"
74
+
75
+ msgid "open"
76
+ msgstr "Open"
77
+
78
+ msgid "open_document"
79
+ msgstr '"Open Document"'
80
+
81
+ msgid "openselectedhelp_about"
82
+ msgstr '"Open selected help about"'
83
+
84
+ msgid "reload_variables"
85
+ msgstr '"Reload Variables"'
86
+
87
+ msgid "remove_applet"
88
+ msgstr '"remove applet"'
89
+
90
+ msgid "return"
91
+ msgstr "Return"
92
+
93
+ msgid "rwdtinker_window_2"
94
+ msgstr '"RwdTinker Window 2"'
95
+
96
+ msgid "rwdtinker"
97
+ msgstr "RwdTinker"
98
+
99
+ msgid "rwdtinker_back_window"
100
+ msgstr '"RwdTinker Back Window"'
101
+
102
+ msgid "rwdtinker_help"
103
+ msgstr '"RwdTinker Help"'
104
+
105
+ msgid "rwdtinker_help_window"
106
+ msgstr '"RwdTinker Help Window"'
107
+
108
+ msgid "showjump_links"
109
+ msgstr '"Show Jump Links"'
110
+
111
+ msgid "showdocument_list"
112
+ msgstr '"Show Document List"'
113
+
114
+ msgid "showhelpabout_links"
115
+ msgstr '"Show Help About Links"'
116
+
117
+ msgid "save"
118
+ msgstr "Save"
119
+
120
+ msgid "save_changes"
121
+ msgstr '"Save Changes"'
122
+
123
+ msgid "selection_panel"
124
+ msgstr '"Menu Panel"'
125
+
126
+ msgid "selection_tab"
127
+ msgstr '"Menu Tab"'
128
+
129
+ msgid "tinker_logo"
130
+ msgstr '"Tinker Logo"'
131
+
132
+ msgid "tinkerback_window"
133
+ msgstr '"Tinker Back Window"'
134
+
135
+ msgid "viewapplet_contents"
136
+ msgstr '"View Applet Contents"'
137
+
138
+ msgid "viewalreadyinstalled_applications"
139
+ msgstr '"View already installed GEM applications"'
140
+
141
+ msgid "viewinstalled_text"
142
+ msgstr '"View Install Text"'
143
+
144
+ msgid "view_platform"
145
+ msgstr '"view platform"'
146
+
147
+ msgid "viewplatform_information"
148
+ msgstr '"View Platform Information"'
149
+
150
+ msgid "viewlogger_information"
151
+ msgstr '"View Logger Information"'
152
+
153
+ msgid "view_event"
154
+ msgstr '"View event"'
155
+
156
+ msgid "viewinstall_text"
157
+ msgstr '"View Install Text"'
158
+
159
+ msgid "viewlistinstall_files"
160
+ msgstr '"View List of Installed Files"'
161
+
162
+ msgid "view_photo"
163
+ msgstr '"View Photo"'
164
+
165
+ msgid "window"
166
+ msgstr "Window"