rsence 2.0.9.23 → 2.1.0
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.
- data/INSTALL.rdoc +61 -49
- data/README.rdoc +20 -4
- data/VERSION +1 -1
- data/conf/default_conf.yaml +8 -0
- data/conf/rsence_command_strings.yaml +31 -20
- data/docs/ExampleGuiPlugin.rdoc +2 -2
- data/js/comm/comm.js +27 -5
- data/js/comm/transporter/transporter.js +1 -1
- data/js/comm/values/values.js +12 -5
- data/js/controls/button/button.js +12 -2
- data/js/controls/dialogs/alert_sheet/alert_sheet.js +13 -1
- data/js/controls/dialogs/confirm_sheet/confirm_sheet.js +13 -2
- data/js/controls/dialogs/sheet/sheet.js +35 -28
- data/js/controls/imageview/imageview.js +13 -13
- data/js/controls/progress/progressindicator/progressindicator.js +5 -5
- data/js/controls/sliders/slider/slider.js +4 -31
- data/js/controls/stepper/stepper.js +12 -19
- data/js/controls/textcontrol/textcontrol.js +0 -50
- data/js/controls/textcontrol/themes/default/textcontrol.html +1 -1
- data/js/controls/window/window.js +1 -1
- data/js/core/elem/elem.js +146 -160
- data/js/core/rsence_ns/rsence_ns.js +7 -0
- data/js/foundation/control/eventresponder/eventresponder.js +8 -7
- data/js/foundation/eventmanager/eventmanager.js +81 -48
- data/js/foundation/geom/rect/rect.js +1 -1
- data/js/foundation/json_renderer/json_renderer.js +4 -1
- data/js/foundation/system/system.js +37 -34
- data/js/foundation/view/morphanimation/morphanimation.js +53 -43
- data/js/foundation/view/view.js +119 -118
- data/js/lists/listitems/listitems.js +10 -10
- data/js/lists/propertylist/js.inc +0 -0
- data/js/lists/propertylist/propertylist.js +574 -0
- data/js/lists/propertylist/propertylisteditor/js.inc +0 -0
- data/js/lists/propertylist/propertylisteditor/propertylisteditor.js +233 -0
- data/js/lists/radiobuttonlist/radiobuttonlist.js +15 -8
- data/js/menus/minimenu/js.inc +0 -0
- data/js/menus/minimenu/minimenu.js +139 -0
- data/js/menus/minimenu/minimenuitem/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/minimenuitem.js +33 -0
- data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem.css +45 -0
- data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem.html +4 -0
- data/js/menus/minimenu/minimenuitem/themes/default/minimenuitem_checkmark.png +0 -0
- data/js/menus/minimenu/themes/default/minimenu.css +63 -0
- data/js/menus/minimenu/themes/default/minimenu.html +7 -0
- data/js/menus/minimenu/themes/default/minimenu.png +0 -0
- data/js/util/reloadapp/reloadapp.js +1 -1
- data/lib/conf/argv.rb +40 -11
- data/lib/daemon/daemon.rb +63 -22
- data/lib/plugins/gui_plugin.rb +28 -31
- data/lib/plugins/guiparser.rb +37 -7
- data/lib/plugins/plugin.rb +260 -28
- data/lib/plugins/plugin_base.rb +14 -0
- data/lib/plugins/plugin_plugins.rb +11 -1
- data/lib/plugins/pluginmanager.rb +127 -44
- data/lib/plugins/plugins.rb +10 -1
- data/lib/session/msg.rb +25 -1
- data/lib/session/sessionmanager.rb +11 -2
- data/lib/session/sessionstorage.rb +14 -14
- data/lib/transporter/transporter.rb +29 -13
- data/lib/values/hvalue.rb +30 -0
- data/plugins/client_pkg/info.yaml +2 -2
- data/plugins/{index_html → main}/img/loading.gif +0 -0
- data/plugins/{index_html → main}/img/riassence.gif +0 -0
- data/plugins/main/info.yaml +5 -4
- data/plugins/main/main.rb +180 -24
- data/plugins/{index_html → main}/tmpl/index.html +4 -2
- data/plugins/ticket/info.yaml +2 -2
- data/plugins/ticket/lib/upload.rb +57 -5
- data/plugins/ticket/ticket.rb +10 -4
- data/setup/welcome/info.yaml +2 -2
- data/setup/welcome/text/welcome.html +1 -1
- metadata +22 -11
- data/plugins/index_html/index_html.rb +0 -120
- data/plugins/index_html/info.yaml +0 -18
@@ -0,0 +1,45 @@
|
|
1
|
+
|
2
|
+
.minimenuitem_control,
|
3
|
+
.minimenuitem_label,
|
4
|
+
.minimenuitem_state {
|
5
|
+
position: absolute;
|
6
|
+
top: 0px; height: 15px;
|
7
|
+
}
|
8
|
+
|
9
|
+
.minimenuitem_control {
|
10
|
+
left: 0px; right: 0px;
|
11
|
+
cursor: pointer;
|
12
|
+
}
|
13
|
+
.minimenuitem_control:hover {
|
14
|
+
background-color: #fff;
|
15
|
+
}
|
16
|
+
|
17
|
+
.minimenuitem_state {
|
18
|
+
left: 0px; top: 1px; height: 12px; width: 12px;
|
19
|
+
background-image: #{this.getCssFilePath('minimenuitem_checkmark.png')};
|
20
|
+
}
|
21
|
+
.checked .minimenuitem_state {
|
22
|
+
visibility: inherit;
|
23
|
+
}
|
24
|
+
.unchecked .minimenuitem_state {
|
25
|
+
visibility: hidden;
|
26
|
+
}
|
27
|
+
|
28
|
+
.minimenuitem_label {
|
29
|
+
left: 14px; right: 11px; top: 0px;
|
30
|
+
height: 15px; line-height: 15px;
|
31
|
+
text-align: left;
|
32
|
+
text-overflow: ellipsis;
|
33
|
+
overflow: hidden;
|
34
|
+
white-space:nowrap;
|
35
|
+
vertical-align: middle;
|
36
|
+
font-family: Arial, sans-serif;
|
37
|
+
font-size: 11px;
|
38
|
+
color: #333;
|
39
|
+
}
|
40
|
+
.minimenuitem_label:hover {
|
41
|
+
color: #000;
|
42
|
+
}
|
43
|
+
.disabled .minimenuitem_control {
|
44
|
+
opacity: 0.8;
|
45
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
|
2
|
+
.minimenu_control,
|
3
|
+
.minimenu_edge_left,
|
4
|
+
.minimenu_center,
|
5
|
+
.minimenu_edge_right,
|
6
|
+
.minimenu_label,
|
7
|
+
.minimenu_antiselect {
|
8
|
+
position: absolute;
|
9
|
+
top: 0px; height: 15px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.minimenu_control {
|
13
|
+
left: 0px; right: 0px;
|
14
|
+
cursor: pointer;
|
15
|
+
}
|
16
|
+
.disabled .minimenu_control {
|
17
|
+
cursor: default;
|
18
|
+
}
|
19
|
+
|
20
|
+
.minimenu_edge_left,
|
21
|
+
.minimenu_center,
|
22
|
+
.minimenu_edge_right {
|
23
|
+
background-image: #{this.getCssFilePath('minimenu.png')};
|
24
|
+
}
|
25
|
+
|
26
|
+
.minimenu_edge_left {
|
27
|
+
left: 0px; width: 7px;
|
28
|
+
background-position: 0px 0px;
|
29
|
+
}
|
30
|
+
|
31
|
+
.minimenu_edge_right {
|
32
|
+
right: 0px; width: 13px;
|
33
|
+
background-position: -7px 0px;
|
34
|
+
}
|
35
|
+
|
36
|
+
.minimenu_center {
|
37
|
+
left: 7px; right: 13px;
|
38
|
+
background-position: 0px -15px;
|
39
|
+
background-repeat: repeat-x;
|
40
|
+
}
|
41
|
+
|
42
|
+
.minimenu_label {
|
43
|
+
left: 6px; right: 11px; top: 0px;
|
44
|
+
height: 15px; line-height: 15px;
|
45
|
+
text-align: left;
|
46
|
+
text-overflow: ellipsis;
|
47
|
+
overflow: hidden;
|
48
|
+
white-space:nowrap;
|
49
|
+
vertical-align: middle;
|
50
|
+
font-family: Arial, sans-serif;
|
51
|
+
font-size: 11px;
|
52
|
+
color: #333;
|
53
|
+
}
|
54
|
+
.minimenu_control:hover > .minimenu_label {
|
55
|
+
color: #000;
|
56
|
+
}
|
57
|
+
.disabled .minimenu_control {
|
58
|
+
opacity: 0.8;
|
59
|
+
}
|
60
|
+
|
61
|
+
.minimenu_antiselect {
|
62
|
+
left: 0px; right: 0px;
|
63
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<div class="minimenu_control" id="control#{_ID}">
|
2
|
+
<div class="minimenu_edge_left"></div>
|
3
|
+
<div class="minimenu_center"></div>
|
4
|
+
<div class="minimenu_edge_right"></div>
|
5
|
+
<div class="minimenu_label" id="label#{_ID}">#{this.label}</div>
|
6
|
+
<div class="minimenu_antiselect"></div>
|
7
|
+
</div>
|
Binary file
|
data/lib/conf/argv.rb
CHANGED
@@ -19,6 +19,25 @@ module RSence
|
|
19
19
|
return (not ['i386-mingw32','x86-mingw32'].include?(RUBY_PLATFORM))
|
20
20
|
end
|
21
21
|
|
22
|
+
# @private Returns true, if platform is linux
|
23
|
+
def self.linux?
|
24
|
+
return RUBY_PLATFORM.end_with?('-linux')
|
25
|
+
end
|
26
|
+
|
27
|
+
# @private Returns true, if platform is Mac OS X
|
28
|
+
def self.darwin?
|
29
|
+
return RUBY_PLATFORM.include?('-darwin')
|
30
|
+
end
|
31
|
+
|
32
|
+
# @private Returns signal name that resembles INFO or PWR (extra signal to poll for server status)
|
33
|
+
def self.info_signal_name
|
34
|
+
if self.linux?
|
35
|
+
return 'PWR'
|
36
|
+
else
|
37
|
+
return 'INFO'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
22
41
|
# @private ARGVParser is the "user interface" as a command-line argument parser.
|
23
42
|
# It parses the command-line arguments and sets up things accordingly.
|
24
43
|
class ARGVParser
|
@@ -32,10 +51,10 @@ module RSence
|
|
32
51
|
# system that fully implements POSIX standard signals.
|
33
52
|
# These are necessary to send signals to the background process.
|
34
53
|
if not RSence.pid_support?
|
35
|
-
@@cmds = [ :run, :initenv, :version, :help ]
|
54
|
+
@@cmds = [ :run, :init, :initenv, :version, :help ]
|
36
55
|
else
|
37
56
|
@@cmds = [ :run, :status, :start, :stop, :restart, :save,
|
38
|
-
:initenv, :version, :help ]
|
57
|
+
:init, :initenv, :version, :help ]
|
39
58
|
end
|
40
59
|
|
41
60
|
help_avail_cmds = @@cmds.map{|cmd|cmd.to_s}.join("\n ")
|
@@ -315,7 +334,12 @@ module RSence
|
|
315
334
|
if RUBY_VERSION.to_f >= 1.9
|
316
335
|
sock = TCPSocket.open( addr, port )
|
317
336
|
else
|
318
|
-
|
337
|
+
begin
|
338
|
+
sock = TCPsocket.open( addr, port )
|
339
|
+
rescue NameError => e
|
340
|
+
warn "TCPsocket not available, trying TCPSocket.."
|
341
|
+
sock = TCPSocket.open( addr, port )
|
342
|
+
end
|
319
343
|
end
|
320
344
|
sock.close
|
321
345
|
return true
|
@@ -327,7 +351,8 @@ module RSence
|
|
327
351
|
end
|
328
352
|
end
|
329
353
|
|
330
|
-
# Main argument parser for the status command, sends the
|
354
|
+
# Main argument parser for the status command, sends the INFO (or PWR on linux) POSIX signal to
|
355
|
+
# the process, if running.
|
331
356
|
# Checks if the process responds on the port and address it's configured for.
|
332
357
|
def parse_status_argv
|
333
358
|
init_args
|
@@ -406,8 +431,9 @@ module RSence
|
|
406
431
|
pid_fn = config[:daemon][:pid_fn]
|
407
432
|
if File.exists?( pid_fn )
|
408
433
|
pid = File.read( pid_fn ).to_i
|
434
|
+
sig_name = RSence.info_signal_name
|
409
435
|
pid_status = RSence::SIGComm.wait_signal_response(
|
410
|
-
pid, pid_fn,
|
436
|
+
pid, pid_fn, sig_name, 3
|
411
437
|
)
|
412
438
|
else
|
413
439
|
warn @@strs[:messages][:no_pid_file] if @args[:verbose]
|
@@ -504,7 +530,7 @@ module RSence
|
|
504
530
|
pid = File.read( pid_fn ).to_i
|
505
531
|
saving_message = @@strs[:messages][:saving_message]
|
506
532
|
pid_status = RSence::SIGComm.wait_signal_response(
|
507
|
-
pid, pid_fn, '
|
533
|
+
pid, pid_fn, 'USR2', 30, saving_message, '.', 0.1, true
|
508
534
|
)
|
509
535
|
else
|
510
536
|
warn @@strs[:messages][:no_pid_file] if @args[:verbose]
|
@@ -703,10 +729,13 @@ module RSence
|
|
703
729
|
run_dir = File.expand_path( 'run', env_dir )
|
704
730
|
Dir.mkdir( run_dir )
|
705
731
|
unless create_blank
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
732
|
+
print @@strs[:initenv][:install_welcome]
|
733
|
+
if yesno(true)
|
734
|
+
welcome_plugin_dir = File.join( SERVER_PATH, 'setup', 'welcome' )
|
735
|
+
welcome_plugin_dst = File.join( plugins_dir, 'welcome' )
|
736
|
+
puts ERB.new( @@strs[:initenv][:installing_welcome_plugin] ).result( binding )
|
737
|
+
FileUtils.cp_r( welcome_plugin_dir, welcome_plugin_dst )
|
738
|
+
end
|
710
739
|
end
|
711
740
|
puts @@strs[:initenv][:creating_files]
|
712
741
|
conf_file = File.join( conf_dir, 'config.yaml' )
|
@@ -768,7 +797,7 @@ module RSence
|
|
768
797
|
parse_status_argv
|
769
798
|
elsif cmd == :save
|
770
799
|
parse_save_argv
|
771
|
-
elsif cmd == :initenv
|
800
|
+
elsif cmd == :initenv or cmd == :init
|
772
801
|
parse_initenv_argv
|
773
802
|
end
|
774
803
|
else
|
data/lib/daemon/daemon.rb
CHANGED
@@ -47,7 +47,7 @@ module RSence
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.responds?( daemon )
|
50
|
-
wait_signal_response( daemon,
|
50
|
+
wait_signal_response( daemon, RSence.info_signal_name )
|
51
51
|
end
|
52
52
|
|
53
53
|
# Reads the pid file and calls the process.
|
@@ -111,10 +111,22 @@ module RSence
|
|
111
111
|
daemon.usr1
|
112
112
|
write_signal_response( daemon, 'USR1' )
|
113
113
|
end
|
114
|
-
Signal.trap('USR2') do
|
114
|
+
Signal.trap( 'USR2' ) do
|
115
115
|
daemon.usr2
|
116
116
|
write_signal_response( daemon, 'USR2' )
|
117
117
|
end
|
118
|
+
# Signal.trap( 'PWR' ) do
|
119
|
+
# daemon.pwr
|
120
|
+
# write_signal_response( daemon, 'PWR' )
|
121
|
+
# end
|
122
|
+
Signal.trap( 'ALRM' ) do
|
123
|
+
daemon.alrm
|
124
|
+
write_signal_response( daemon, 'ALRM' )
|
125
|
+
end
|
126
|
+
Signal.trap( RSence.info_signal_name ) do
|
127
|
+
daemon.info
|
128
|
+
write_signal_response( daemon, RSence.info_signal_name )
|
129
|
+
end
|
118
130
|
['INT', 'TERM', 'KILL'].each do | signal |
|
119
131
|
Signal.trap( signal ) do
|
120
132
|
puts "RSence killed with signal #{signal.inspect}" if RSence.args[:verbose]
|
@@ -194,12 +206,12 @@ module RSence
|
|
194
206
|
sleep 1 while true
|
195
207
|
end
|
196
208
|
|
197
|
-
# Sends the
|
209
|
+
# Sends the PWR signal to the process, which in turn
|
198
210
|
# calls the save method of the daemon.
|
199
211
|
def self.save( daemon )
|
200
212
|
status_ = status( daemon )
|
201
213
|
if status_
|
202
|
-
if wait_signal_response( daemon, '
|
214
|
+
if wait_signal_response( daemon, 'PWR', 10, 'saving.', 'saved', 0.3 )
|
203
215
|
puts "Session data saved."
|
204
216
|
else
|
205
217
|
puts "Warning: saving timed out! Session data not saved."
|
@@ -256,10 +268,19 @@ module RSence
|
|
256
268
|
|
257
269
|
# @private Simple process control, constructed here and called from Daemon::Controller
|
258
270
|
class HTTPDaemon
|
259
|
-
|
271
|
+
|
272
|
+
def ps_name
|
273
|
+
config = RSence.config
|
274
|
+
url = "http://#{config[:http_server][:bind_address]}:#{config[:http_server][:port]}#{config[:base_url]}"
|
275
|
+
env_path = RSence.args[:env_path]
|
276
|
+
"RSence-#{RSence.version} on #{url} in #{env_path}"
|
277
|
+
end
|
278
|
+
|
260
279
|
# RSence top-level run handler. Almost identical to start.
|
261
280
|
def run
|
262
|
-
|
281
|
+
|
282
|
+
$0 = ps_name
|
283
|
+
|
263
284
|
puts "Starting as a foreground process." if RSence.args[:verbose]
|
264
285
|
puts "Press CTRL-C to terminate."
|
265
286
|
|
@@ -278,30 +299,32 @@ module RSence
|
|
278
299
|
)
|
279
300
|
|
280
301
|
end
|
281
|
-
|
302
|
+
|
282
303
|
# Returns the pid file path.
|
283
304
|
def pid_fn
|
284
305
|
RSence.config[:daemon][:pid_fn]
|
285
306
|
end
|
286
|
-
|
307
|
+
|
287
308
|
# Returns the log path.
|
288
309
|
def log_fn
|
289
310
|
RSence.config[:daemon][:log_fn]
|
290
311
|
end
|
291
|
-
|
312
|
+
|
292
313
|
# Returns the configured bind address
|
293
314
|
def addr
|
294
315
|
RSence.config[:http_server][:bind_address]
|
295
316
|
end
|
296
|
-
|
317
|
+
|
297
318
|
# Returns the configured port.
|
298
319
|
def port
|
299
320
|
RSence.config[:http_server][:port]
|
300
321
|
end
|
301
|
-
|
322
|
+
|
302
323
|
# Called by Controller#start, contains RSence-specific operations
|
303
324
|
def start
|
304
|
-
|
325
|
+
|
326
|
+
$0 = ps_name
|
327
|
+
|
305
328
|
@transporter = Transporter.new
|
306
329
|
|
307
330
|
conf = RSence.config[:http_server]
|
@@ -321,17 +344,40 @@ module RSence
|
|
321
344
|
yield @broker
|
322
345
|
|
323
346
|
end
|
324
|
-
|
347
|
+
|
325
348
|
# Called by Controller#stop, contains RSence-specific operations
|
326
349
|
def stop
|
327
350
|
@transporter.shutdown
|
328
351
|
end
|
329
|
-
|
330
|
-
# Called on
|
352
|
+
|
353
|
+
# # Called on PWR signals (save data)
|
354
|
+
# def pwr
|
355
|
+
# save
|
356
|
+
# end
|
357
|
+
|
358
|
+
# Called on INFO (PWR) signals ("Alive?")
|
359
|
+
def info
|
360
|
+
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- RSence version #{RSence.version} is running."
|
361
|
+
end
|
362
|
+
|
363
|
+
# Called on ALRM signals (save data, reload all plugins manually)
|
364
|
+
def alrm
|
365
|
+
save
|
366
|
+
@transporter.plugins.shutdown
|
367
|
+
@transporter.plugins.init_bundles!
|
368
|
+
end
|
369
|
+
|
370
|
+
# Called on usr1 signals (updates bundles manually, like the regular intervals of the -a switch and forces client to be rebuilt)
|
331
371
|
def usr1
|
372
|
+
@transporter.plugins.update_bundles!
|
373
|
+
# @transporter.plugins.client_pkg.rebuild_client
|
374
|
+
end
|
375
|
+
|
376
|
+
# Called on USR2 signals
|
377
|
+
def usr2
|
332
378
|
save
|
333
379
|
end
|
334
|
-
|
380
|
+
|
335
381
|
# Save state
|
336
382
|
def save
|
337
383
|
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- Saving state..."
|
@@ -342,12 +388,7 @@ module RSence
|
|
342
388
|
@transporter.online = transporter_state
|
343
389
|
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- State saved."
|
344
390
|
end
|
345
|
-
|
346
|
-
# Called on USR2 signals ("Alive?")
|
347
|
-
def usr2
|
348
|
-
puts "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} -- RSence version #{RSence.version} is running."
|
349
|
-
end
|
350
|
-
|
391
|
+
|
351
392
|
# Main entry point, daemonizes itself using Controller.
|
352
393
|
def daemonize!
|
353
394
|
Daemon.daemonize( self )
|
data/lib/plugins/gui_plugin.rb
CHANGED
@@ -29,27 +29,20 @@ module RSence
|
|
29
29
|
# @return [:GUIPlugin]
|
30
30
|
def self.bundle_type; :GUIPlugin; end
|
31
31
|
|
32
|
-
|
33
|
-
# @private Placeholder for actual gui yaml file.
|
34
|
-
@@default_yaml_src = <<-END
|
35
|
-
type: GUITree
|
36
|
-
version: 0.6
|
37
|
-
|
38
|
-
class: RSence.GUIApp
|
39
|
-
options:
|
40
|
-
label: "Dummy Application"
|
41
|
-
|
42
|
-
END
|
43
|
-
|
44
32
|
# In addition to {Plugin__#init Plugin#init}, also automatically initializes a {GUIParser} instance as +@gui+
|
45
33
|
#
|
46
34
|
# @return [nil]
|
47
35
|
def init
|
48
36
|
super
|
49
37
|
yaml_src = file_read( "gui/#{@name}.yaml" )
|
50
|
-
|
51
|
-
|
52
|
-
|
38
|
+
unless yaml_src
|
39
|
+
yaml_src = file_read( "gui/main.yaml" )
|
40
|
+
end
|
41
|
+
if yaml_src
|
42
|
+
@gui = GUIParser.new( self, yaml_src, @name )
|
43
|
+
else
|
44
|
+
@gui = nil
|
45
|
+
end
|
53
46
|
@client_pkgs = false
|
54
47
|
end
|
55
48
|
|
@@ -79,13 +72,14 @@ options:
|
|
79
72
|
# end
|
80
73
|
#
|
81
74
|
def gui_params( msg )
|
75
|
+
return unless @gui
|
82
76
|
{ :values => @gui.values( get_ses( msg ) ) }
|
83
77
|
end
|
84
78
|
|
85
79
|
# @private Method that implements +client_pkgs.yaml+ loading
|
86
80
|
def install_client_pkgs
|
87
81
|
if @client_pkgs
|
88
|
-
warn "install_client_pkgs: called with @client_pkgs defined; returning"
|
82
|
+
warn "install_client_pkgs: called with @client_pkgs defined (#{@client_pkgs.inspect}); returning" if RSence.args[:debug]
|
89
83
|
return
|
90
84
|
end
|
91
85
|
@client_pkgs = yaml_read( 'client_pkgs.yaml' )
|
@@ -93,14 +87,14 @@ options:
|
|
93
87
|
if @client_pkgs.has_key?(:src_dirs)
|
94
88
|
@client_pkgs[:src_dirs].each do |src_dir|
|
95
89
|
src_dir = bundle_path( src_dir[2..-1] ) if src_dir.start_with?('./')
|
96
|
-
|
90
|
+
client_pkg.add_src_dir( src_dir )
|
97
91
|
end
|
98
92
|
end
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
93
|
+
client_pkg.add_packages( @client_pkgs[:packages ] ) if @client_pkgs.has_key?(:packages )
|
94
|
+
client_pkg.add_themes( @client_pkgs[:theme_names ] ) if @client_pkgs.has_key?(:theme_names )
|
95
|
+
client_pkg.add_gfx_formats( @client_pkgs[:gfx_formats ] ) if @client_pkgs.has_key?(:gfx_formats )
|
96
|
+
client_pkg.add_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
|
97
|
+
client_pkg.rebuild_client
|
104
98
|
end
|
105
99
|
end
|
106
100
|
|
@@ -112,14 +106,14 @@ options:
|
|
112
106
|
if @client_pkgs.has_key?(:src_dirs)
|
113
107
|
@client_pkgs[:src_dirs].each do |src_dir|
|
114
108
|
src_dir = bundle_path( src_dir[2..-1] ) if src_dir.start_with?('./')
|
115
|
-
|
109
|
+
client_pkg.del_src_dir( src_dir )
|
116
110
|
end
|
117
111
|
end
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
112
|
+
client_pkg.del_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
|
113
|
+
client_pkg.del_gfx_formats( @client_pkgs[:gfx_formats ] ) if @client_pkgs.has_key?(:gfx_formats )
|
114
|
+
client_pkg.del_themes( @client_pkgs[:theme_names ] ) if @client_pkgs.has_key?(:theme_names )
|
115
|
+
client_pkg.del_packages( @client_pkgs[:packages].keys ) if @client_pkgs.has_key?(:packages )
|
116
|
+
client_pkg.rebuild_client
|
123
117
|
end
|
124
118
|
@client_pkgs = false
|
125
119
|
end
|
@@ -136,9 +130,10 @@ options:
|
|
136
130
|
uninstall_client_pkgs if @client_pkgs
|
137
131
|
end
|
138
132
|
|
139
|
-
# @private
|
140
|
-
def
|
141
|
-
|
133
|
+
# @private Returns structured, processed gui tree to the caller.
|
134
|
+
def struct_ui( msg )
|
135
|
+
return {} unless @gui
|
136
|
+
@gui.struct( msg, gui_params( msg ) )
|
142
137
|
end
|
143
138
|
|
144
139
|
# Automatically inits the UI using {GUIParser#init}
|
@@ -147,11 +142,13 @@ options:
|
|
147
142
|
#
|
148
143
|
# @return [nil]
|
149
144
|
def init_ui( msg )
|
145
|
+
return unless @gui
|
150
146
|
@gui.init( msg, gui_params( msg ) )
|
151
147
|
end
|
152
148
|
|
153
149
|
# @private Automatically kills the UI using {GUIParser#kill}
|
154
150
|
def kill_ui( msg )
|
151
|
+
return unless @gui
|
155
152
|
@gui.kill( msg )
|
156
153
|
end
|
157
154
|
|