Objects updates again
[findit] / src / files / search.py
index 4c7a54c..e554f4e 100755 (executable)
@@ -17,6 +17,7 @@ class Control(object):
         start_path = '.'
         count = 7
 
+        print ui
         if ui == 'cli':
             self.present = Cli_Presentation(start_path, count, self.start_search)
         elif ui == 'gtk':
@@ -35,7 +36,6 @@ class Control(object):
     def run(self):
         return self.present.toplevel
 
-
 #==============================================================================
 
 class Abstraction(object):
@@ -59,8 +59,7 @@ class Abstraction(object):
 
             for fname in fnames:
                 flpath = abspath(join(dirpath, fname))
-                #self.presentation.show_current_status(flpath)
-                self.presentation.update_window(flpath)
+                self.presentation.show_current_status(flpath)
 
                 # Останавливаем цикл по нажатию кнопки стоп
                 stopit = get_stopit()
@@ -75,7 +74,6 @@ class Abstraction(object):
                 except OSError:
                     continue
 
-
 #==============================================================================
 
 class Cli_Presentation(object):
@@ -88,7 +86,6 @@ class Cli_Presentation(object):
     def show_current_status(self, current_path):
         print current_path
 
-
 #==============================================================================
 
 class Gtk_Presentation(object):
@@ -148,12 +145,12 @@ class Gtk_Presentation(object):
         def show_current_status(current_path):
             self.statusbar.push(self.context_id, current_path)
             gtk.main_iteration()
-        self.update_window = show_current_status
+        self.show_current_status = show_current_status
 
 #        self.show_out_toplevel(None, 'outtable', [(11, 22, 33)])
 
     #=== Functions ============================================================
-    def start_btn_released(self, widget, start_func):
+    def start_btn_released(self, btn, start_func):
         self.stopit = False
         self.stop_btn.set_sensitive(True)
         self.start_btn.set_sensitive(False)
@@ -176,8 +173,12 @@ class Gtk_Presentation(object):
     def show_out_toplevel(self, btn, outtype, results):
         print 'Entering <' + outtype + '> output mode...'
         out_submodule = __import__('files.' + outtype, None, None, outtype)
-        out_toplevel = out_submodule.Gtk_Presentation(results)
+        out_toplevel = out_submodule.Gtk_Presentation(results).toplevel
 
-###        self.vbox.remove(self.vbox.get_children()[2])
+        try:
+            self.vbox.remove(self.vbox.get_children()[2])
+        except:
+            pass
         self.vbox.add(out_toplevel)
+        out_toplevel.show_all()
 #        out_submodule.Gtk_Presentation().show_results(results)