Patchwork [bitbake-devel,3/4] hob: clicking on "cancel" should reset table sorting to default

login
register
mail settings
Submitter Cristiana Voicu
Date May 7, 2013, 8:07 a.m.
Message ID <1367914076-4863-4-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/49387/
State New
Headers show

Comments

Cristiana Voicu - May 7, 2013, 8:07 a.m.
Changed the "cancel" callback function for both recipes and packages
list page.

[YOCTO #4333]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    9 +++++++++
 bitbake/lib/bb/ui/crumbs/recipeselectionpage.py  |   10 ++++++++++
 2 files changed, 19 insertions(+)

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 66cb7ff..a4d86bd 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -199,6 +199,7 @@  class PackageSelectionPage (HobPage):
         if self.package_model.filtered_nb == 0:
             if not self.ins.get_nth_page(current_tab).top_bar:
                 self.ins.get_nth_page(current_tab).add_no_result_bar(entry)
+                self.ins.get_nth_page(current_tab).top_bar.set_no_show_all(True)
             self.ins.get_nth_page(current_tab).top_bar.show()
             self.ins.get_nth_page(current_tab).scroll.hide()
         else:
@@ -246,6 +247,13 @@  class PackageSelectionPage (HobPage):
         self.builder.parsing_warnings = []
         self.builder.build_image()
 
+    def refresh_tables(self):
+        self.ins.reset_entry(self.ins.search, 0)
+        for tab in self.tables:
+            index = self.tables.index(tab)
+            filter = self.pages[index]['filter']
+            tab.set_model(self.package_model.tree_model(filter, initial=True))
+
     def back_button_clicked_cb(self, button):
         if self.builder.previous_step ==  self.builder.IMAGE_GENERATED:
             self.builder.restore_initial_selected_packages()
@@ -253,6 +261,7 @@  class PackageSelectionPage (HobPage):
             self.builder.show_image_details()
         else:
             self.builder.show_configuration()
+        self.refresh_tables()
 
     def refresh_selection(self):
         self.builder.configuration.selected_packages = self.package_model.get_selected_packages()
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
index 8573b81..9c138b2 100755
--- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py
@@ -214,6 +214,7 @@  class RecipeSelectionPage (HobPage):
         if self.recipe_model.filtered_nb == 0:
             if not self.ins.get_nth_page(current_tab).top_bar:
                 self.ins.get_nth_page(current_tab).add_no_result_bar(entry)
+                self.ins.get_nth_page(current_tab).top_bar.set_no_show_all(True)
             self.ins.get_nth_page(current_tab).top_bar.show()
             self.ins.get_nth_page(current_tab).scroll.hide()
         else:
@@ -243,13 +244,22 @@  class RecipeSelectionPage (HobPage):
             self.builder.show_recipe_property_dialog(properties)
 
     def build_packages_clicked_cb(self, button):
+        self.refresh_tables()
         self.builder.build_packages()
 
+    def refresh_tables(self):
+        self.ins.reset_entry(self.ins.search, 0)
+        for tab in self.tables:
+            index = self.tables.index(tab)
+            filter = self.pages[index]['filter']
+            tab.set_model(self.recipe_model.tree_model(filter, search_data="", initial=True))
+
     def back_button_clicked_cb(self, button):
         self.builder.recipe_model.set_selected_image(self.builder.configuration.initial_selected_image)
         self.builder.image_configuration_page.update_image_combo(self.builder.recipe_model, self.builder.configuration.initial_selected_image)
         self.builder.image_configuration_page.update_image_desc()
         self.builder.show_configuration()
+        self.refresh_tables()
 
     def refresh_selection(self):
         self.builder.configuration.selected_image = self.recipe_model.get_selected_image()