fixed problem with show main window - finish
authorAlexandr Popov <popov2al@gmail.com>
Sat, 28 Mar 2009 22:43:19 +0000 (01:43 +0300)
committerAlexandr Popov <popov2al@gmail.com>
Sat, 28 Mar 2009 22:43:19 +0000 (01:43 +0300)
src/core.py

index 96ee2b3..80f50a4 100644 (file)
@@ -7,38 +7,32 @@ import gobject
 
 class Core_Control(object):
     def __init__(self):
-        from config.py import Config_Control
-        config = Config_Control()
+        from config import Config_Control
+        cfg = Config_Control()
+
+        from vvod import Gtk_Inp_Control
+        vvod = Gtk_Inp_Control(cfg.get('default_start_dir'), cfg.get('default_count'))
+
+        from output import Output_Control
+        out = Output_Control()
         
         from searchfile import Search_File_Control
-        search = Search_File_Control()
+        start_dir, count = vvod.get_data()
+        search = Search_File_Control(start_dir, count, cfg.get('ignore_dir_list'), out.show)
         
         elem_list = []
         elem_list.append(vvod.get_ui())
-        elem_list.append(output.get_ui())
         elem_list.append(search.get_ui())
+        elem_list.append(out.get_ui())
         core_present = Core_Presentation(575, 345, elem_list)
-        main = Core_Abstraction(config, core_present, 
-
+        core_present.show_mw()
                 
 class Core_Abstraction(object):
-    def __init__(self, config, ui, vvod, search, output):
-        self.config = config
-        self.ui = ui
-        self.vvod = vvod
-        self.search = search
-        self.output = output
-        self.ui.run()
-
-    def start_search(self):
-        data = self.vvod.get_data()
-        query = self.search.run(self.config, data)
-        self.output.show(query)
+    pass
+
 
-        
 class Core_Presentation(gtk.Window):
-        """Main window class."""
-### Window initialization ##################################################
+    """Main window class."""
     def __init__(self, win_width, win_height, elem_list):
         gtk.Window.__init__(self)
         self.set_default_size(win_width, win_height)
@@ -57,3 +51,5 @@ class Core_Presentation(gtk.Window):
         self.show_all()
         gtk.main()
 
+if __name__ == '__main__':
+    Core_Control()