Ruby GTK3移行後のメインリポジトリ
リビジョン | 04d6ac5467d1cce249a0a13b3a0f6c42ca3775d1 (tree) |
---|---|
日時 | 2015-04-08 22:59:58 |
作者 | Shyouzou Sugitani <shy@user...> |
コミッター | Shyouzou Sugitani |
assorted fixes(6)
@@ -640,9 +640,9 @@ module Menu | ||
640 | 640 | if pixbuf == nil |
641 | 641 | item = Gtk::MenuItem.new(name) |
642 | 642 | else |
643 | - image = Gtk::Image.new() | |
644 | - image.set_from_pixbuf(pixbuf) | |
645 | - image.show() | |
643 | + image = Gtk::Image.new | |
644 | + image.pixbuf = pixbuf | |
645 | + image.show | |
646 | 646 | item = Gtk::ImageMenuItem.new(name) |
647 | 647 | item.set_image(image) |
648 | 648 | item.set_always_show_image(true) # XXX |
@@ -99,7 +99,7 @@ module MetaMagic | ||
99 | 99 | delete_by_myself() |
100 | 100 | return |
101 | 101 | else |
102 | - @instance.new(data) # reset | |
102 | + @instance.new_(*data) # reset | |
103 | 103 | menuitem = create_menuitem(data) |
104 | 104 | if menuitem == nil |
105 | 105 | delete_by_myself() |
@@ -478,11 +478,11 @@ module Prefs | ||
478 | 478 | while listiter != nil |
479 | 479 | value = model.get_value(listiter, 1) |
480 | 480 | if value == directory or directory == nil |
481 | - @balloon_treeview.get_selection().select_iter(listiter) | |
481 | + @balloon_treeview.selection.select_iter(listiter) | |
482 | 482 | selected = true |
483 | 483 | break |
484 | 484 | end |
485 | - listiter = model.iter_next(listiter) | |
485 | + listiter.next! | |
486 | 486 | end |
487 | 487 | if not selected |
488 | 488 | listiter = model.iter_first |
@@ -220,8 +220,8 @@ module Sakura | ||
220 | 220 | return @shell_menu |
221 | 221 | end |
222 | 222 | |
223 | - def new(desc, shiori_dir, use_makoto, surface_set, prefix, | |
224 | - shiori_dll, shiori_name) ## FIXME | |
223 | + def new_(desc, shiori_dir, use_makoto, surface_set, prefix, | |
224 | + shiori_dll, shiori_name) ## FIXME | |
225 | 225 | @shiori = nil |
226 | 226 | @desc = desc |
227 | 227 | @shiori_dir = shiori_dir |
@@ -506,7 +506,7 @@ module Sakura | ||
506 | 506 | db, request_handler] |
507 | 507 | end |
508 | 508 | |
509 | - reset_event = ['OnGhostChanging', 'OnShellChanging', 'OnVanishSelected'] | |
509 | + RESET_EVENT = ['OnGhostChanging', 'OnShellChanging', 'OnVanishSelected'] | |
510 | 510 | |
511 | 511 | def check_event_queue() |
512 | 512 | return (not @event_queue.empty?) |
@@ -516,7 +516,7 @@ module Sakura | ||
516 | 516 | #for key in argdict |
517 | 517 | # assert ['proc'].include?(key) # trap typo, etc. |
518 | 518 | #end |
519 | - if @reset_event.include?(event) | |
519 | + if RESET_EVENT.include?(event) | |
520 | 520 | reset_script(true) |
521 | 521 | end |
522 | 522 | @event_queue << [event, arglist, argdict] |
@@ -1179,13 +1179,13 @@ module Sakura | ||
1179 | 1179 | 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] |
1180 | 1180 | boot_event = ['OnBoot', 'OnFirstBoot', 'OnGhostChanged', 'OnShellChanged', |
1181 | 1181 | 'OnUpdateComplete'] |
1182 | - reset_event = ['OnVanishSelecting', 'OnVanishCancel'] ## FIXME | |
1182 | + RESET_EVENT = ['OnVanishSelecting', 'OnVanishCancel'] ## FIXME | |
1183 | 1183 | |
1184 | 1184 | def notify_event(event, *arglist, **argdict) |
1185 | 1185 | if @time_critical_session and event.startswith('OnMouse') |
1186 | 1186 | return 0 |
1187 | 1187 | end |
1188 | - if @reset_event.include?(event) | |
1188 | + if RESET_EVENT.include?(event) | |
1189 | 1189 | reset_script(true) |
1190 | 1190 | end |
1191 | 1191 | #for key in argdict |
@@ -885,7 +885,7 @@ module Ninix_Main | ||
885 | 885 | def create_ghost(data) |
886 | 886 | ghost = Sakura::Sakura.new |
887 | 887 | ghost.set_responsible(self) |
888 | - ghost.new(*data) | |
888 | + ghost.new_(*data) | |
889 | 889 | return ghost |
890 | 890 | end |
891 | 891 |
@@ -1060,7 +1060,8 @@ module Ninix_Main | ||
1060 | 1060 | |
1061 | 1061 | def create_shell_menuitem(shell_name, shell_key, thumbnail) |
1062 | 1062 | return @__menu.create_meme_menuitem( |
1063 | - shell_name, shell_key, self.select_shell, thumbnail) | |
1063 | + shell_name, shell_key, | |
1064 | + lambda {|key| select_shell(key) }, thumbnail) | |
1064 | 1065 | end |
1065 | 1066 | |
1066 | 1067 | def create_menuitem(key, baseinfo) |
@@ -1081,10 +1082,10 @@ module Ninix_Main | ||
1081 | 1082 | thumbnail_path = nil |
1082 | 1083 | end |
1083 | 1084 | start_menuitem = @__menu.create_ghost_menuitem( |
1084 | - name, icon_path, key, self.start_sakura_cb, # XXX | |
1085 | + name, icon_path, key, lambda {|key| start_sakura_cb(key) }, # XXX | |
1085 | 1086 | thumbnail_path) |
1086 | 1087 | select_menuitem = @__menu.create_ghost_menuitem( |
1087 | - name, icon_path, key, self.select_sakura, | |
1088 | + name, icon_path, key, lambda {|key| select_sakura(key) }, | |
1088 | 1089 | thumbnail_path) |
1089 | 1090 | menuitem = { |
1090 | 1091 | 'Summon' => start_menuitem, |
@@ -1388,7 +1389,10 @@ module Ninix_Main | ||
1388 | 1389 | if sakura.key == key # XXX: needs reloading? |
1389 | 1390 | return |
1390 | 1391 | end |
1391 | - proc = lambda { stop_sakura(sakura, self.start_sakura, key, sakura.key) } | |
1392 | + proc = lambda { stop_sakura( | |
1393 | + sakura, | |
1394 | + lambda {|key, prev| start_sakura(key, prev) }, | |
1395 | + key, sakura.key) } | |
1392 | 1396 | # def proc(self=self, key=key) |
1393 | 1397 | # stop_sakura(sakura, self.start_sakura, key, sakura.key) |
1394 | 1398 | # end |
@@ -1523,7 +1527,7 @@ module Ninix_Main | ||
1523 | 1527 | end |
1524 | 1528 | else |
1525 | 1529 | holon = Ghost.new(ghost_dir) |
1526 | - holon.set_responsible(self.handle_request) | |
1530 | + holon.set_responsible(self) | |
1527 | 1531 | @ghosts[ghost_dir] = holon |
1528 | 1532 | holon.baseinfo = ghost_conf[ghost_dir] |
1529 | 1533 | end |
@@ -1553,7 +1557,7 @@ module Ninix_Main | ||
1553 | 1557 | @balloons[balloon_dir].baseinfo = balloon_conf[balloon_dir] |
1554 | 1558 | else |
1555 | 1559 | meme = BalloonMeme(balloon_dir) |
1556 | - meme.set_responsible(self.handle_request) | |
1560 | + meme.set_responsible(self) | |
1557 | 1561 | @balloons[balloon_dir] = meme |
1558 | 1562 | meme.baseinfo = balloon_conf[balloon_dir] |
1559 | 1563 | end |
@@ -11,7 +11,7 @@ module NinixTest | ||
11 | 11 | @ghosts = Home.search_ghosts(target=nil, check_shiori=false) |
12 | 12 | key = @ghosts.keys.sample |
13 | 13 | @baseinfo = @ghosts[key] |
14 | - @sakura.new(*@baseinfo) | |
14 | + @sakura.new_(*@baseinfo) | |
15 | 15 | end |
16 | 16 | |
17 | 17 | def update |
@@ -31,7 +31,7 @@ module NinixTest | ||
31 | 31 | @index = 0 |
32 | 32 | #INIT#OK#@sakura.initialize |
33 | 33 | #INIT#OK#@sakura.set_responsible(parent) |
34 | - #INIT#OK#@sakura.new(desc, shiori_dir, use_makoto, surface_set, prefix, | |
34 | + #INIT#OK#@sakura.new_(desc, shiori_dir, use_makoto, surface_set, prefix, | |
35 | 35 | ##@sakura.handle_request(event_type, event, *arglist, **argdict) |
36 | 36 | #OK#@sakura.attach_observer(self) |
37 | 37 | #OK#@sakura.notify_observer("OBSERVER TEST", args=nil) |