diff options
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 9 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 35 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 35 |
3 files changed, 43 insertions, 36 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 17d9cee138..51ae78265f 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
@@ -537,14 +537,18 @@ class HobNotebook(gtk.Notebook): | |||
537 | 537 | ||
538 | def set_search_entry_editable_cb(self, search, event): | 538 | def set_search_entry_editable_cb(self, search, event): |
539 | search.set_editable(True) | 539 | search.set_editable(True) |
540 | search.set_text("") | 540 | text = search.get_text() |
541 | if text in self.search_names: | ||
542 | search.set_text("") | ||
541 | style = self.search.get_style() | 543 | style = self.search.get_style() |
542 | style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False) | 544 | style.text[gtk.STATE_NORMAL] = self.get_colormap().alloc_color(HobColors.BLACK, False, False) |
543 | search.set_style(style) | 545 | search.set_style(style) |
544 | 546 | ||
545 | def set_search_entry_reset_cb(self, search, event): | 547 | def set_search_entry_reset_cb(self, search, event): |
546 | page_num = self.get_current_page() | 548 | page_num = self.get_current_page() |
547 | self.reset_entry(search, page_num) | 549 | text = search.get_text() |
550 | if not text: | ||
551 | self.reset_entry(search, page_num) | ||
548 | 552 | ||
549 | def reset_entry(self, entry, page_num): | 553 | def reset_entry(self, entry, page_num): |
550 | style = entry.get_style() | 554 | style = entry.get_style() |
@@ -559,6 +563,7 @@ class HobNotebook(gtk.Notebook): | |||
559 | if search.get_editable() == True: | 563 | if search.get_editable() == True: |
560 | search.set_text("") | 564 | search.set_text("") |
561 | search.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | 565 | search.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) |
566 | search.grab_focus() | ||
562 | 567 | ||
563 | def set_page(self, title): | 568 | def set_page(self, title): |
564 | for child in self.pages: | 569 | for child in self.pages: |
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py index 3b00ff2377..781d579d6c 100755 --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py | |||
@@ -180,24 +180,25 @@ class PackageSelectionPage (HobPage): | |||
180 | self.button_box.pack_end(self.back_button, expand=False, fill=False) | 180 | self.button_box.pack_end(self.back_button, expand=False, fill=False) |
181 | 181 | ||
182 | def search_entry_changed(self, entry): | 182 | def search_entry_changed(self, entry): |
183 | current_tab = self.ins.get_current_page() | ||
184 | filter = self.pages[current_tab]['filter'] | ||
185 | text = entry.get_text() | 183 | text = entry.get_text() |
186 | filter[PackageListModel.COL_NAME] = text | 184 | if text not in self.ins.search_names: |
187 | self.tables[current_tab].set_model(self.package_model.tree_model(filter, search_data=text)) | 185 | current_tab = self.ins.get_current_page() |
188 | if self.package_model.filtered_nb == 0: | 186 | filter = self.pages[current_tab]['filter'] |
189 | if not self.ins.get_nth_page(current_tab).top_bar: | 187 | filter[PackageListModel.COL_NAME] = text |
190 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) | 188 | self.tables[current_tab].set_model(self.package_model.tree_model(filter, search_data=text)) |
191 | self.ins.get_nth_page(current_tab).top_bar.show() | 189 | if self.package_model.filtered_nb == 0: |
192 | self.ins.get_nth_page(current_tab).scroll.hide() | 190 | if not self.ins.get_nth_page(current_tab).top_bar: |
193 | else: | 191 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) |
194 | if self.ins.get_nth_page(current_tab).top_bar: | 192 | self.ins.get_nth_page(current_tab).top_bar.show() |
195 | self.ins.get_nth_page(current_tab).top_bar.hide() | 193 | self.ins.get_nth_page(current_tab).scroll.hide() |
196 | self.ins.get_nth_page(current_tab).scroll.show() | 194 | else: |
197 | if entry.get_text() == '': | 195 | if self.ins.get_nth_page(current_tab).top_bar: |
198 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | 196 | self.ins.get_nth_page(current_tab).top_bar.hide() |
199 | else: | 197 | self.ins.get_nth_page(current_tab).scroll.show() |
200 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | 198 | if entry.get_text() == '': |
199 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | ||
200 | else: | ||
201 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | ||
201 | 202 | ||
202 | def button_click_cb(self, widget, event): | 203 | def button_click_cb(self, widget, event): |
203 | path, col = widget.table_tree.get_cursor() | 204 | path, col = widget.table_tree.get_cursor() |
diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py index aa0cd60c3f..47bb253309 100755 --- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | |||
@@ -195,24 +195,25 @@ class RecipeSelectionPage (HobPage): | |||
195 | button_box.pack_end(self.back_button, expand=False, fill=False) | 195 | button_box.pack_end(self.back_button, expand=False, fill=False) |
196 | 196 | ||
197 | def search_entry_changed(self, entry): | 197 | def search_entry_changed(self, entry): |
198 | current_tab = self.ins.get_current_page() | ||
199 | filter = self.pages[current_tab]['filter'] | ||
200 | text = entry.get_text() | 198 | text = entry.get_text() |
201 | filter[RecipeListModel.COL_NAME] = text | 199 | if text not in self.ins.search_names: |
202 | self.tables[current_tab].set_model(self.recipe_model.tree_model(filter, search_data=text)) | 200 | current_tab = self.ins.get_current_page() |
203 | if self.recipe_model.filtered_nb == 0: | 201 | filter = self.pages[current_tab]['filter'] |
204 | if not self.ins.get_nth_page(current_tab).top_bar: | 202 | filter[RecipeListModel.COL_NAME] = text |
205 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) | 203 | self.tables[current_tab].set_model(self.recipe_model.tree_model(filter, search_data=text)) |
206 | self.ins.get_nth_page(current_tab).top_bar.show() | 204 | if self.recipe_model.filtered_nb == 0: |
207 | self.ins.get_nth_page(current_tab).scroll.hide() | 205 | if not self.ins.get_nth_page(current_tab).top_bar: |
208 | else: | 206 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) |
209 | if self.ins.get_nth_page(current_tab).top_bar: | 207 | self.ins.get_nth_page(current_tab).top_bar.show() |
210 | self.ins.get_nth_page(current_tab).top_bar.hide() | 208 | self.ins.get_nth_page(current_tab).scroll.hide() |
211 | self.ins.get_nth_page(current_tab).scroll.show() | 209 | else: |
212 | if entry.get_text() == '': | 210 | if self.ins.get_nth_page(current_tab).top_bar: |
213 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | 211 | self.ins.get_nth_page(current_tab).top_bar.hide() |
214 | else: | 212 | self.ins.get_nth_page(current_tab).scroll.show() |
215 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | 213 | if entry.get_text() == '': |
214 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | ||
215 | else: | ||
216 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | ||
216 | 217 | ||
217 | def button_click_cb(self, widget, event): | 218 | def button_click_cb(self, widget, event): |
218 | path, col = widget.table_tree.get_cursor() | 219 | path, col = widget.table_tree.get_cursor() |