nota_nuc 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +48 -0
  5. data/README.md +41 -0
  6. data/Rakefile +5 -0
  7. data/db/Quarrier.rb +430 -0
  8. data/db/create_db_Penrhyn.rb +186 -0
  9. data/features/commands.feature +119 -0
  10. data/features/cucumber_LICENCE +22 -0
  11. data/features/offline.feature +65 -0
  12. data/features/passwords.feature +37 -0
  13. data/features/step_definitions/command_steps.rb +142 -0
  14. data/features/step_definitions/offline_steps.rb +211 -0
  15. data/features/step_definitions/password_steps.rb +45 -0
  16. data/images/arrowleft_image.png +0 -0
  17. data/images/arrowright_image.png +0 -0
  18. data/images/arrowright_imageone.png +0 -0
  19. data/images/arrowright_imagetwo.png +0 -0
  20. data/images/blue_light.png +0 -0
  21. data/images/error_symbol.png +0 -0
  22. data/images/gift_glow2.png +0 -0
  23. data/images/gift_nonglow2.png +0 -0
  24. data/images/gift_nonglow2_bottom.png +0 -0
  25. data/images/green_light.png +0 -0
  26. data/images/key_glow.png +0 -0
  27. data/images/key_nonglow.png +0 -0
  28. data/images/lock_image.png +0 -0
  29. data/images/new_slate_icon.png +0 -0
  30. data/images/pencil_glow image.png +0 -0
  31. data/images/pencil_glow_image_red.png +0 -0
  32. data/images/pencil_nonglow.png +0 -0
  33. data/images/red_light.png +0 -0
  34. data/images/settings_icon.png +0 -0
  35. data/images/typing_image.png +0 -0
  36. data/images/updating_image.png +0 -0
  37. data/images/yellow_light.png +0 -0
  38. data/lib/Billboard_module.rb +372 -0
  39. data/lib/Exercitus_romanorum.rb +572 -0
  40. data/lib/error_choose_a_slate.rb +20 -0
  41. data/lib/final_eye.rb +777 -0
  42. data/lib/nota_nuc.rb +5 -0
  43. data/lib/nota_nuc/version.rb +3 -0
  44. data/log/history.log +3 -0
  45. data/log/slate.log +3 -0
  46. data/nota_nuc.gemspec +36 -0
  47. metadata +196 -0
@@ -0,0 +1,20 @@
1
+ class Error_Choose_Slate < Billboard
2
+ require 'green_shoes'
3
+
4
+
5
+ Shoes.app width: 180, height: 140, title: 'error' do
6
+ background tomato
7
+ stack do
8
+ para "ERROR", align: 'center'
9
+ para "You must choose a slate"
10
+ @b1 = button "back", margin_left: 68
11
+ @b1.click{exit}
12
+ end
13
+ end
14
+ end
15
+
16
+
17
+
18
+ #Developer : Mark Focella (m.focella@gmail.com)
19
+ #Date : February 17, 2014
20
+
data/lib/final_eye.rb ADDED
@@ -0,0 +1,777 @@
1
+ =begin
2
+ green shoes
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
6
+ =end
7
+
8
+
9
+
10
+ require 'green_shoes'
11
+ require_relative '../db/Quarrier.rb'
12
+ include Quarrier
13
+ require_relative '../lib/Exercitus_romanorum.rb'
14
+ include Exercitus_romanorum
15
+ require_relative '../lib/Billboard_module.rb'
16
+ include Billboard
17
+
18
+
19
+
20
+ #this is to keep the size of the history log file down
21
+ logger = Logger.new("../log/history.log", 1, 500000)
22
+ logger.close
23
+
24
+ ####
25
+
26
+
27
+ def update_history(command)
28
+ historyfile = File.open("../log/history.log", "a")
29
+ historyfile.puts "#{command}"
30
+ historyfile.close
31
+ end
32
+
33
+ def enforce_barrier
34
+ if get_admin_status == 1
35
+ if is_admin? == 1
36
+ return false
37
+ else
38
+ return true
39
+ end
40
+ else
41
+ return false
42
+ end
43
+ end
44
+
45
+ def unlock_admin
46
+ Shoes.app width: 280, height: 180, title: " " do
47
+ background black
48
+ stack do
49
+ stack height: 40 do
50
+ #spacer
51
+ end
52
+ flow do
53
+ @edit1 = edit_line width: 6, margin_left: 136
54
+ end
55
+ stack height: 30 do
56
+ #spacer
57
+ end
58
+ @statusflow = flow do
59
+ @status = para "denied", stroke: red, align: 'center'
60
+ end
61
+ end
62
+ keypress do |k|
63
+ if k == "\n"
64
+ if @edit1.text == "#{get_admin_password}"
65
+ @statusflow.clear{@status = para "You now have Admin Abilities!", stroke: limegreen, align: 'center' }
66
+ set_admin("1")
67
+ else
68
+ @edit1.text = ""
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+
75
+
76
+
77
+
78
+ def admin_barrier(win)
79
+ if enforce_barrier
80
+ Shoes.app width: 280, height: 180, title: " " do
81
+ background black
82
+ stack do
83
+ stack height: 40 do
84
+ #spacer
85
+ end
86
+ flow do
87
+ @edit1 = edit_line width: 6, margin_left: 136
88
+ end
89
+ stack height: 30 do
90
+ #spacer
91
+ end
92
+ @statusflow = flow do
93
+ @status = para "denied", stroke: red, align: 'center'
94
+ end
95
+ end
96
+
97
+ keypress do |k|
98
+ if k == "\n"
99
+ if @edit1.text == "#{get_admin_password}"
100
+ @statusflow.clear{@status = para "proceed", stroke: limegreen, align: 'center' }
101
+ if win == 'generalsettings_win'
102
+ generalsettings
103
+ elsif win == 'newslate_win'
104
+ newslate
105
+ elsif win == 'acceptgifts_win'
106
+ acceptgifts
107
+ elsif win == 'sendgifts_win'
108
+ sendgifts
109
+ end
110
+ @edit1.text = ""
111
+ else
112
+ @edit1.text = ""
113
+ #later on find a way for the denied para to hide for a second and reappear
114
+ end
115
+ end
116
+ end
117
+ end
118
+ else
119
+ if win == 'generalsettings_win'
120
+ generalsettings
121
+ elsif win == 'newslate_win'
122
+ newslate
123
+ elsif win == 'acceptgifts_win'
124
+ acceptgifts
125
+ elsif win == 'sendgifts_win'
126
+ sendgifts
127
+ end
128
+ end
129
+ end
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+ def generalsettings
139
+
140
+ window title: "General Settings", height: 500, width: 700 do
141
+
142
+ background "#0E0E0E"
143
+
144
+ stack do
145
+ flow do
146
+ stack height: 250, width: 350 do #slates area with settings buttons
147
+ stack height: 40 do
148
+ #spacer
149
+ end
150
+ =begin
151
+ flow do
152
+ stack width: 200 do
153
+ para "Slates", margin_left: 98, stroke: "#BB27FF"
154
+ namesofslates = []
155
+ namesofslates = list_slates
156
+ @slatelist_box = list_box items: namesofslates, width: 150, margin_left: 50
157
+ end
158
+ stack width: 150 do
159
+ @settingsb1 = button "settings", width: 100, height: 40, margin_left: 22, margin_top: 24
160
+ @settingsb1.click{slatesettings("#{@slatelist_box.text}")}
161
+ flow do
162
+ @addb1 = button "add", margin_left: 22
163
+ @addb1.click {newslate}
164
+ @removeb1 = button "remove"
165
+ @removeb1.click do
166
+ @numofslates = slatecount
167
+ if @numofslates <= 3
168
+ return nil
169
+ else
170
+ if viewing?("#{@slatelist_box.text}") == 1
171
+ previous = previousslate
172
+ set_viewing("#{previous}")
173
+ end
174
+ remove_slate("#{@slatelist_box.text}")
175
+ namesofslates = []
176
+ namesofslates = list_slates
177
+ @slatelist_box.items = nameofslates
178
+ end
179
+ end
180
+ end
181
+ #@cloneb1 = button "clone", width: 80, height: 35, margin_left: 22
182
+ #@cloneb1.click {}
183
+ #buttons section
184
+ end
185
+ end
186
+ =end
187
+ end
188
+ stack height: 250, width: 350 do #password and connectivity area
189
+ stack height: 30 do
190
+ #spacer
191
+ end
192
+ =begin
193
+ flow margin_left: 80 do
194
+ stack width: 70 do
195
+ radio :networking
196
+ para "Offline", stroke: "#BB27FF"
197
+ end
198
+ stack width: 80 do
199
+ radio :networking
200
+ para "Online", stroke: "#BB27FF"
201
+ end
202
+ end
203
+ @connectsettingsb1 = button "Connectivity Settings", margin_left: 100
204
+ @connectsettingsb1.click{}
205
+ stack height: 45 do
206
+ #spacer
207
+ end
208
+ =end
209
+ para "Password Setup", margin_left: 113, stroke: "#BB27FF"
210
+ stack height: 14 do
211
+ #spacer
212
+ end
213
+ flow do
214
+ @check1 = check margin_left: 88; para " Administrator", width: 160, stroke: "#BB27FF"
215
+
216
+ if get_admin_status == 0
217
+ @check1.checked = false
218
+ elsif get_admin_status == 1
219
+ @check1.checked = true
220
+ end
221
+ @editl1 = edit_line width: 6
222
+ #@setb1.click {}
223
+ end
224
+ end
225
+ end
226
+ stack do #lock and seconds with ok and cancel buttons
227
+ stack height: 80 do
228
+ #spacer
229
+ end
230
+ =begin
231
+ flow do
232
+ @lock_check = check margin_left: 160; para "Lock slate automatically after", width: 242, stroke: "#BB27FF"
233
+ if get_lock_state == 0
234
+ @lock_check.checked = false
235
+ else
236
+ @lock_check.checked = true
237
+ end
238
+ @lockmin = edit_line width: 27
239
+ @lockmin.text = "#{get_lock_time}"
240
+ para " minutes", width: 70, stroke: "#BB27FF"
241
+ end
242
+ =end
243
+ flow do
244
+ flow width: 202 do end
245
+ =begin
246
+ para "Update slate every", stroke: "#BB27FF", width: 170
247
+ @pushmin = edit_line width: 27
248
+ @pushmin.text = "#{get_update_time}"
249
+ para " seconds.", stroke: "#BB27FF", width: 280
250
+ =end
251
+ end
252
+ stack height: 58 do
253
+ #spacer
254
+ end
255
+ flow do
256
+ @okb1 = button "OK", height: 32, width: 60, margin_left: 308
257
+ @okb1.click do
258
+ passwd = @editl1.text
259
+ passwdlength = passwd.length
260
+ if @check1.checked? and passwdlength.between?(14,50)
261
+ set_admin_status("1")
262
+ set_admin_password("#{@editl1.text}")
263
+ set_admin("0")
264
+ else
265
+ set_admin_status("0")
266
+ @check1.checked = false
267
+ end
268
+ #set_update_time("#{@pushmin.text}")
269
+ end
270
+ #@cancelb1 = button "Cancel", height: 32, width: 70, margin_left: 250
271
+ #@cancelb1.click{window.close}
272
+ end
273
+ end
274
+
275
+ end
276
+ end
277
+ end
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+
286
+
287
+
288
+
289
+
290
+ def acceptgifts
291
+ window width: 600, height: 700, title: " " do
292
+ background "#0E0E0E"
293
+ stack do
294
+ stack height: 25 do
295
+ #spacer
296
+ end
297
+
298
+ stack do #send gift area
299
+ para "Which gifts do you want to accept?", align: 'center', stroke: "#BB27FF"
300
+ @giftsl1 = [ 'sam', 'wrat', 'sap', 'cor', 'singo', 'conna', 'bronno', 'slimp', 'sand', 'carpnn', 'wtor', 'stora', 'hnap', 'corap', 'slon' ]
301
+ @giftsl1.map! do |gift|
302
+ flow margin_left: 14 do
303
+ @c = check; para gift, width: 200, stroke: "#BB27FF"
304
+ end
305
+ [ @c, gift ]
306
+ end
307
+ stack height: 35 do
308
+ #spacer
309
+ end
310
+ flow do
311
+ @acceptb1 = button "Accept selected gifts", width: 158, height: 38, margin_left: 80
312
+ @acceptb1.click{}
313
+ @rejectb1 = button "Reject selected gifts", width: 150, height: 38, margin_left: 40
314
+ @rejectb1.click{}
315
+ #@cancelb1 = button "Cancel", width: 60, height: 32, margin_left: 70
316
+ #@cancelb1.click{}
317
+ end
318
+ end
319
+ end
320
+ end
321
+ end
322
+
323
+ def accepthosts
324
+ Shoes.app width: 600, height: 700, title: " " do
325
+ background "#0E0E0E"
326
+ stack do
327
+ stack height: 25 do
328
+ #spacer
329
+ end
330
+
331
+ stack do #send gift area
332
+ para "Which hosts do you want to accept?", align: 'center', stroke: "#BB27FF"
333
+ @hostsl1 = [ 'sam', 'wrat', 'sap', 'cor', 'singo', 'conna', 'bronno', 'slimp', 'sand', 'carpnn', 'wtor', 'stora', 'hnap', 'corap', 'slon' ]
334
+ @hostsl1.map! do |host|
335
+ flow margin_left: 14 do
336
+ @c = check; para host, width: 200, stroke: "#BB27FF"
337
+ end
338
+ [ @c, host ]
339
+ end
340
+ stack height: 35 do
341
+ #spacer
342
+ end
343
+ flow do
344
+ @acceptb1 = button "Accept selected hosts", width: 158, height: 38, margin_left: 80
345
+ @acceptb1.click{}
346
+ @rejectb1 = button "Reject selected hosts", width: 155, height: 38, margin_left: 40
347
+ @rejectb1.click{}
348
+ #@cancelb1 = button "Cancel", width: 60, height: 32, margin_left: 70
349
+ #@cancelb1.click{}
350
+ end
351
+ end
352
+ end
353
+ end
354
+ end
355
+
356
+
357
+
358
+
359
+
360
+ def newslate
361
+ Shoes.app title: "New Slate", width: 500, height: 260 do
362
+ background "#0E0E0E"
363
+ stack do
364
+ stack height: 25 do
365
+ #spacer
366
+ end
367
+ flow height: 150 do
368
+ stack width: 350, height: 150 do #name and shortcut section
369
+ flow do
370
+ para "Name", width: 74, margin_left: 80, stroke: "#BB27FF"
371
+ flow width: 60 do end
372
+ @namee2 = edit_line width: 162
373
+ end
374
+ stack height: 17 do
375
+ #spacer
376
+ end
377
+ end
378
+
379
+ =begin
380
+ stack width: 250, height: 150 do
381
+ #background lightgreen #password section
382
+ border yellow, strokewidth: 2
383
+ stack height: 30 do
384
+ #spacer
385
+ end
386
+ flow width: 180 do
387
+ radio :password
388
+ para "No Password", width: 150, stroke: "#BB27FF"
389
+ end
390
+ flow height: 8 do
391
+ #spacer
392
+ end
393
+ flow do
394
+ radio :password
395
+ para "Password", width: 84, stroke: "#BB27FF"
396
+ @passworde1 = edit_line width: 8
397
+ end
398
+ end
399
+
400
+ end
401
+ stack do #send gift area
402
+ para "Send gifts to the following hosts", margin_left: 32, stroke: "#BB27FF"
403
+ @hostslist = [ 'sam', 'wrat', 'sap', 'cor', 'singo', 'conna', 'bronno', 'slimp', 'sand', 'carpnn', 'wtor', 'stora', 'hnap', 'corap', 'slon' ]
404
+ @hostslist.map! do |name|
405
+ flow margin_left: 14 do
406
+ @c = check; para name, width: 200, stroke: "#BB27FF"
407
+ end
408
+ [ @c, name ]
409
+ end
410
+ =end
411
+ flow do
412
+ @okb1 = button "Ok", width: 40, height: 32, margin_left: 220
413
+ @okb1.click do
414
+ if is_arg_cmd?(@namee2.text) == true
415
+ Billboard.alert_cmd_slatename_error
416
+ else
417
+ new_slate(@namee2.text)
418
+ end
419
+ end
420
+ #@cancelb1 = button "Cancel", width: 60, height: 32, margin_left: 80
421
+ #@cancelb1.click{self.close}
422
+ end
423
+ end
424
+ end
425
+ end
426
+ end
427
+
428
+
429
+ def sendgifts
430
+ Shoes.app title: 'Sending Gifts', height: 700, width: 800 do
431
+ background "#0E0E0E"
432
+
433
+ stack height: 100 do
434
+ #spacer
435
+ end
436
+ flow width: 400 do
437
+ para "Hosts", stroke: "#BB27FF", align: 'center'
438
+ stack height: 40 do
439
+ #spacer
440
+ end
441
+ stack do
442
+ @hostsl1 = [ 'princess', 'demon', 'genie', 'angel', 'nymph' ]
443
+ @hostsl1.map! do |host|
444
+ flow { @c1 = check margin_left: 140; para host, margin_left: 7, width: 200, stroke: "#BB27FF" }
445
+ [@c1, host]
446
+ end
447
+ end
448
+ end
449
+ flow width: 400 do
450
+ para "Slates", stroke: "#BB27FF", align: 'center'
451
+ stack height: 40 do
452
+ #spacer
453
+ end
454
+ stack do
455
+ @slatesl1 = [ 'Schedule', 'ideas', 'music', 'programming' ]
456
+ @slatesl1.map! do |slate|
457
+ flow { @c2 = check margin_left: 140; para slate, margin_left: 7, width: 200, stroke: "#BB27FF" }
458
+ [@c2, slate]
459
+ end
460
+ end
461
+ end
462
+ stack height: 44 do
463
+ #spacer
464
+ end
465
+ flow do
466
+ @sendb1 = button "Send Gifts", height: 50, width: 88, margin_left: 300
467
+ @sendb1.click{}
468
+ #@backb1 = button "Back", height: 50, width: 45, margin_left: 30
469
+ #@backb1.click{}
470
+ end
471
+ end
472
+ end
473
+
474
+
475
+ def setpassword
476
+ window title: "password", width: 260, height: 200 do
477
+ background bisque
478
+
479
+ tagline "Set Password", align: "center", margin_top: 20
480
+ flow height: 80 do
481
+ edit_line width: 6, margin_top: 32, margin_left: 128
482
+ end
483
+ flow width: 200 do
484
+ @b_ok = button "ok", width: 30, margin_left: 82
485
+ @b_ok.click do
486
+ #save password
487
+ end
488
+ #@b_cancel = button "cancel", width: 30, margin_left: 20
489
+ #@b_cancel.click{}
490
+ end
491
+ end
492
+ end
493
+
494
+
495
+ def slatesettings(choosen)
496
+ Shoes.app title: "Slate Settings", height: 700, width: 700 do
497
+ background "#0E0E0E"
498
+ @choosenslate = choosen
499
+ @slateid = get_slateid("#{choosen}")
500
+ stack do
501
+ stack height: 57 do
502
+ #spacer
503
+ end
504
+ flow do
505
+ para "Name", width: 74, margin_left: 254, stroke: "#BB27FF"
506
+ @namee1 = edit_line width: 162, margin_left: 246
507
+ @namee1.text = @choosenslate
508
+ end
509
+ stack height: 17 do
510
+ #spacer
511
+ end
512
+ stack height: 68 do
513
+ #spacer
514
+ end
515
+ =begin #does not need password for each slate
516
+ flow width: 550, margin_left: 110 do
517
+ flow width: 230 do
518
+ radio :password
519
+ para "No Password", width: 200, stroke: "#BB27FF"
520
+ end
521
+ flow width: 160 do
522
+ radio :password
523
+ para "Password", width: 110, stroke: "#BB27FF"
524
+ @passworde1 = edit_line width: 11
525
+ end
526
+ end
527
+ =end
528
+ stack height: 66
529
+ #spacer
530
+ end
531
+ stack do #share with hosts area
532
+ para "Select hosts to share with", align: 'center', stroke: "#BB27FF"
533
+ @hostslist = [ 'sam', 'sap', 'cor', 'singo', 'slimp', 'sand', 'carpnn', 'wtor', 'stora', 'hnap', 'corap', 'slon' ]
534
+ @hostslist.map! do |name|
535
+ flow margin_left: 14 do
536
+ @c = check; para name, width: 200, stroke: "#BB27FF"
537
+ end
538
+ [ @c, name ]
539
+ end
540
+ stack height: 20 do
541
+ #spacer
542
+ end
543
+ flow do
544
+ @okb1 = button "Ok", width: 40, height: 32, margin_left: 264
545
+ @okb1.click{set_slatename(@slateid, @namee1.text)}
546
+ #@cancelb1 = button "Cancel", width: 60, height: 32, margin_left: 80
547
+ #@cancelb1.click{}
548
+ end
549
+ end
550
+ end
551
+ end
552
+
553
+
554
+ begin
555
+
556
+ Shoes.app title: 'Slates', width: 450, height: 632 do
557
+ background '#0E0E0E'
558
+
559
+ @seconds_after_keypress = 0
560
+ @needs_updating = 0
561
+ @focusoncommandline = 1
562
+ set_cmd_view("0")
563
+
564
+ every(1) do
565
+ if @seconds_after_keypress >= 3
566
+ @needs_updating = 0
567
+ @seconds_after_keypress = 0
568
+ if using_cmd? == 0
569
+ update_text("#{@slate_text_box.text}")
570
+ end
571
+ end
572
+ if @needs_updating == 1
573
+ @seconds_after_keypress += 1
574
+ end
575
+ end
576
+
577
+ def tab_on_slatetext
578
+ if using_cmd? == 0 && @needs_updating == 1
579
+ update_text("#{@slate_text_box.text}")
580
+ @needs_updating = 0
581
+ @seconds_after_keypress = 0
582
+ end
583
+ @commandline.focus
584
+ @focusoncommandline = 1
585
+ end
586
+
587
+ def tab_on_cmdline
588
+ if using_cmd? == 0 && @needs_updating == 1
589
+ update_text("#{@slate_text_box.text}")
590
+ @needs_updating = 0
591
+ @seconds_after_keypress = 0
592
+ end
593
+ @slate_text_box.focus
594
+ @focusoncommandline = 0
595
+ end
596
+
597
+ def go_to_slate
598
+ #find slate and switch to it
599
+ set_cmd_view("0")
600
+ if viewing?("#{@commandline.text}") == 1
601
+ @slate_text_box.text = "#{set_maintext_viewing}"
602
+ else
603
+ set_viewing("#{@commandline.text}")
604
+ @slate_text_box.text = "#{set_maintext_viewing}"
605
+ @sname_flow.clear{@sname = para "#{get_slatename}", stroke: '#E055FF', size: 'small', margin_left: 4}
606
+ end
607
+ end
608
+
609
+ def next_slate
610
+ if using_cmd? == 0 && @needs_updating == 1
611
+ update_text("#{@slate_text_box.text}")
612
+ @needs_updating = 0
613
+ @seconds_after_keypress = 0
614
+ end
615
+ @slate_text_box.text = "#{switch_maintext_R}"
616
+ @sname_flow.clear{@sname = para "#{get_slatename}", stroke: '#E055FF', size: 'small', margin_left: 4}
617
+ set_cmd_view("0")
618
+ end
619
+
620
+ def previous_slate
621
+ if using_cmd? == 0 && @needs_updating == 1
622
+ update_text("#{@slate_text_box.text}")
623
+ @needs_updating = 0
624
+ @seconds_after_keypress = 0
625
+ end
626
+ @slate_text_box.text = "#{switch_maintext_L}"
627
+ @sname_flow.clear{@sname = para "#{get_slatename}", stroke: '#E055FF', size: 'small', margin_left: 4}
628
+ set_cmd_view("0")
629
+ end
630
+
631
+ def view_slate
632
+ set_cmd_view("0")
633
+ @slate_text_box.text = "#{set_maintext_viewing}"
634
+ end
635
+
636
+ def process_command
637
+ # if using_cmd? == 0 && @needs_updating == 1
638
+ # update_text("#{@slate_text_box.text}")
639
+ # @needs_updating = 0
640
+ # @seconds_after_keypress = 0
641
+ # end
642
+ response = get_command("#{@commandline.text}")
643
+ @slate_text_box.text = "#{response}"
644
+ set_cmd_view("1")
645
+ update_history(@commandline.text)
646
+ @sname_flow.clear{@sname = para "#{get_slatename}", stroke: '#E055FF', size: 'small', margin_left: 4}
647
+ end
648
+
649
+
650
+ @keypresscommand = keypress do |k|
651
+ @seconds_after_keypress = 0
652
+ if k == "\t" and @focusoncommandline == 0
653
+ tab_on_slatetext
654
+ elsif k == "\t" and @focusoncommandline == 1
655
+ tab_on_cmdline
656
+ elsif k == "Down" and @focusoncommandline == 1
657
+ @commandline.focus
658
+ elsif k == "\n" and @focusoncommandline.odd?
659
+ # if @needs_updating == 1
660
+ # if using_cmd? == 0
661
+ # update_text("#{@slate_text_box.text}")
662
+ # @needs_updating = 0
663
+ # end
664
+ # end
665
+ if is_slate?("#{@commandline.text}") == true
666
+ go_to_slate
667
+ elsif @commandline.text =~ /^next\s*$/ || @commandline.text =~ /^n\s*$/
668
+ next_slate
669
+ elsif @commandline.text =~ /^previous\s*$/ || @commandline.text =~ /^p\s*$/
670
+ previous_slate
671
+ elsif @commandline.text =~ /^v\s*$/ || @commandline.text =~ /^viewslate\s*$/
672
+ view_slate
673
+ elsif @commandline.text =~ /^super\s*$/
674
+ if get_admin_status == 1
675
+ unlock_admin
676
+ end
677
+ else
678
+ process_command
679
+ end
680
+ @commandline.text = ""
681
+ elsif k == "Control_R"
682
+ next_slate
683
+ end
684
+
685
+ end
686
+
687
+ stack do
688
+
689
+ @light_section = flow height: 40, width: 200 do
690
+ background '#0E0E0E'
691
+ end
692
+
693
+ @command_section = flow height: 22 do
694
+ #background '#0E0E0E'
695
+
696
+ @sname_flow = flow width: 150 do
697
+ @sname = para "#{get_slatename}", stroke: '#E055FF', size: 'small', margin_left: 4
698
+ end
699
+ @commandline_flow = flow width: 136, height: 22 do
700
+ @commandline = edit_line width: 132, height: 22 do
701
+ @focusoncommandline = 1
702
+ if using_cmd? == 0 && @needs_updating == 1
703
+ update_text("#{@slate_text_box.text}")
704
+ @needs_updating = 0
705
+ @seconds_after_keypress = 0
706
+ end
707
+ end
708
+ end
709
+ @buttons_flow = flow width: 162 do
710
+ flow width: 72 do end
711
+ @arrowb_flow = flow width: 90 do
712
+ @bleft = image "../images/arrowright_imagetwo.png"
713
+ @bleft.click do
714
+ previous_slate
715
+ end
716
+ @bright = image "../images/arrowright_image.png"
717
+ @bright.click do
718
+ next_slate
719
+ end
720
+ end
721
+ =begin
722
+ @triplet_flow = flow width: 72 do
723
+ flow height: 22, width: 24 do
724
+ @glowgiftflow = flow hidden: true do
725
+ @bglowgift = image "../images/gift_glow2.png"
726
+ @bglowgift.click{admin_barrier('acceptgifts_win')}
727
+ end
728
+ @glowgiftflow.show
729
+ end
730
+ @bkey = image "../images/key_glow.png"
731
+ @bpencil = image "../images/pencil_glow_image_red.png"
732
+ end
733
+ =end
734
+ end
735
+ end
736
+
737
+ @slate = flow height: height, width: width do
738
+ @slate_text_box = edit_box height: height, width: width do
739
+ @focusoncommandline = 0
740
+ @needs_updating = 1
741
+ end
742
+ @slate_text_box.text = get_text
743
+ end
744
+
745
+ @new_set = flow height: 20 do
746
+ #background '#0E0E0E'
747
+ @bnewslate_flow = flow width: 450, height: 20 do
748
+ @bnewslate = image "../images/new_slate_icon.png"
749
+ @bnewslate.click{admin_barrier('newslate_win')}
750
+ flow width: 200 do end
751
+ #@bsendgifts = image "../images/gift_nonglow2_bottom.png"
752
+ #@bsendgifts.click{admin_barrier('sendgifts_win')}
753
+ flow width: 210 do end
754
+ @bsettings = image "../images/settings_icon.png"
755
+ @bsettings.click{admin_barrier('generalsettings_win')}
756
+ end
757
+ end
758
+ end
759
+ end
760
+
761
+ #rescue
762
+
763
+ #Shoes.app title: "Critical Error!" do
764
+ # para "A critical error has occured which has caused this program to halt"
765
+ #end
766
+
767
+ #pop up error window in Shoes
768
+ ensure
769
+ #if there is no slate that is being viewed then make the first slate have a 1 for viewing
770
+ end
771
+
772
+
773
+
774
+
775
+ #Developer : Mark Focella (m.focella@gmail.com)
776
+ #Date : February 17, 2014
777
+