3 # vim: sw=4 ts=4 expandtab ai
7 class Core_Control(object):
9 from config import Config_Control
10 self.cfg = Config_Control()
12 core_present = Core_Presentation(575, 345, self.chooser)
15 def chooser(self, search_type, show_type):
16 if show_type is 'table_view':
17 from outtable import Out_Table_Control
18 out = Out_Table_Control(self.cfg)
20 if search_type is 'large_file':
21 from searchfile import Search_File_Control
22 elif search_type is 'large_pkg':
23 from pkgsearch import Search_Pkg_Control
24 search = Search_Pkg_Control(self.cfg, out)
29 class Core_Abstraction(object):
33 class Core_Presentation(gtk.Window):
34 """Main window class."""
35 def __init__(self, win_width, win_height, func_chooser):
36 gtk.Window.__init__(self)
37 self.set_default_size(win_width, win_height)
38 self.set_border_width(4)
39 self.connect('delete_event', gtk.main_quit)
40 self.set_wmclass('GtkWindow', 'FindIT')
42 label1 = gtk.Label('Choice search type')
43 srch_butt1 = gtk.RadioButton(None, 'Search Largest File')
44 srch_butt1.connect('toggled', self.srch_type, 'large_file')
45 srch_butt1.set_active(True)
46 srch_butt2 = gtk.RadioButton(srch_butt1, 'Search Largest Package')
47 srch_butt2.connect('toggled', self.srch_type, 'large_pkg')
48 self.search = 'large_file'
49 separator1 = gtk.HSeparator()
51 label2 = gtk.Label('Choice show type')
52 show_butt1 = gtk.RadioButton(None, 'Show in Table view')
53 show_butt1.connect('toggled', self.show_type, 'table_view')
54 show_butt1.set_active(True)
55 show_butt2 = gtk.RadioButton(show_butt1, 'Show in Diagram view')
56 show_butt2.connect('toggled', self.show_type, 'table_view')
57 self.show = 'table_view'
58 separator2 = gtk.HSeparator()
60 self.butt_next = gtk.Button('Next >')
61 self.butt_next.connect('released', self.next_wind, func_chooser)
63 main_vbox = gtk.VBox(False, 4)
64 main_vbox.pack_start(label1, False, False, 10)
65 main_vbox.pack_start(srch_butt1, False, False, 2)
66 main_vbox.pack_start(srch_butt2, False, False, 2)
67 main_vbox.pack_start(separator1, False, False, 2)
68 main_vbox.pack_start(label2, False, False, 10)
69 main_vbox.pack_start(show_butt1, False, False, 2)
70 main_vbox.pack_start(show_butt2, False, False, 2)
71 main_vbox.pack_start(separator2, False, False, 2)
72 main_vbox.pack_start(self.butt_next, False, False, 20)
79 def srch_type(self, widget, data):
82 def show_type(self, widget, data):
85 def next_wind(self, widget, func_chooser):
88 func_chooser(self.search, self.show)
90 if __name__ == '__main__':