diff options
author | Cristiana Voicu <cristiana.voicu@intel.com> | 2013-04-01 13:36:25 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-04-02 17:57:07 +0100 |
commit | 0d47a7d8e8b50fbf0ed6ec8f3a8b95a11c067804 (patch) | |
tree | 42e0cc581a98083c1baa0cac699846e93d43bdd9 /bitbake/lib/bb/ui | |
parent | b5b1592dd31fb02dbdf81f96ec559d9b9fafea79 (diff) | |
download | poky-0d47a7d8e8b50fbf0ed6ec8f3a8b95a11c067804.tar.gz |
bitbake: hob: giving focus to the search field loses the table sorting
Giving focus to the search text field should not impact the table
sorting.
[YOCTO #4113]
(Bitbake rev: b5b4b6e4fefa6a164a49b291a0993b1ff63947f4)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 2 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 4 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/packageselectionpage.py | 45 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 45 |
4 files changed, 59 insertions, 37 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index 67d40e09a6..0bd9734f48 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py | |||
@@ -91,7 +91,7 @@ class PackageListModel(gtk.ListStore): | |||
91 | for key in filter.keys(): | 91 | for key in filter.keys(): |
92 | if key == self.COL_NAME: | 92 | if key == self.COL_NAME: |
93 | if filter[key] != 'Search packages by name': | 93 | if filter[key] != 'Search packages by name': |
94 | if filter[key] not in name: | 94 | if name and filter[key] not in name: |
95 | return False | 95 | return False |
96 | else: | 96 | else: |
97 | if model.get_value(it, key) not in filter[key]: | 97 | if model.get_value(it, key) not in filter[key]: |
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 9b4261ab8d..1d1ae1a349 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
@@ -481,6 +481,8 @@ class HobNotebook(gtk.Notebook): | |||
481 | self.pages = [] | 481 | self.pages = [] |
482 | 482 | ||
483 | self.search = None | 483 | self.search = None |
484 | self.search_focus = False | ||
485 | self.page_changed = False | ||
484 | 486 | ||
485 | self.connect("switch-page", self.page_changed_cb) | 487 | self.connect("switch-page", self.page_changed_cb) |
486 | 488 | ||
@@ -494,6 +496,7 @@ class HobNotebook(gtk.Notebook): | |||
494 | lbl.set_active(False) | 496 | lbl.set_active(False) |
495 | 497 | ||
496 | if self.search: | 498 | if self.search: |
499 | self.page_changed = True | ||
497 | self.reset_entry(self.search, page_num) | 500 | self.reset_entry(self.search, page_num) |
498 | 501 | ||
499 | def append_page(self, child, tab_label, tab_tooltip=None): | 502 | def append_page(self, child, tab_label, tab_tooltip=None): |
@@ -537,6 +540,7 @@ class HobNotebook(gtk.Notebook): | |||
537 | child.set_count(0) | 540 | child.set_count(0) |
538 | 541 | ||
539 | def set_search_entry_editable_cb(self, search, event): | 542 | def set_search_entry_editable_cb(self, search, event): |
543 | self.search_focus = True | ||
540 | search.set_editable(True) | 544 | search.set_editable(True) |
541 | text = search.get_text() | 545 | text = search.get_text() |
542 | if text in self.search_names: | 546 | if text in self.search_names: |
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py index 2264116d77..fb9afcb3cf 100755 --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py | |||
@@ -181,24 +181,33 @@ class PackageSelectionPage (HobPage): | |||
181 | 181 | ||
182 | def search_entry_changed(self, entry): | 182 | def search_entry_changed(self, entry): |
183 | text = entry.get_text() | 183 | text = entry.get_text() |
184 | if text not in self.ins.search_names: | 184 | if self.ins.search_focus: |
185 | current_tab = self.ins.get_current_page() | 185 | self.ins.search_focus = False |
186 | filter = self.pages[current_tab]['filter'] | 186 | elif self.ins.page_changed: |
187 | filter[PackageListModel.COL_NAME] = text | 187 | self.ins.page_change = False |
188 | self.tables[current_tab].set_model(self.package_model.tree_model(filter, search_data=text)) | 188 | self.filter_search(entry) |
189 | if self.package_model.filtered_nb == 0: | 189 | elif text not in self.ins.search_names: |
190 | if not self.ins.get_nth_page(current_tab).top_bar: | 190 | self.filter_search(entry) |
191 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) | 191 | |
192 | self.ins.get_nth_page(current_tab).top_bar.show() | 192 | def filter_search(self, entry): |
193 | self.ins.get_nth_page(current_tab).scroll.hide() | 193 | text = entry.get_text() |
194 | else: | 194 | current_tab = self.ins.get_current_page() |
195 | if self.ins.get_nth_page(current_tab).top_bar: | 195 | filter = self.pages[current_tab]['filter'] |
196 | self.ins.get_nth_page(current_tab).top_bar.hide() | 196 | filter[PackageListModel.COL_NAME] = text |
197 | self.ins.get_nth_page(current_tab).scroll.show() | 197 | self.tables[current_tab].set_model(self.package_model.tree_model(filter, search_data=text)) |
198 | if entry.get_text() == '': | 198 | if self.package_model.filtered_nb == 0: |
199 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | 199 | if not self.ins.get_nth_page(current_tab).top_bar: |
200 | else: | 200 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) |
201 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | 201 | self.ins.get_nth_page(current_tab).top_bar.show() |
202 | self.ins.get_nth_page(current_tab).scroll.hide() | ||
203 | else: | ||
204 | if self.ins.get_nth_page(current_tab).top_bar: | ||
205 | self.ins.get_nth_page(current_tab).top_bar.hide() | ||
206 | self.ins.get_nth_page(current_tab).scroll.show() | ||
207 | if entry.get_text() == '': | ||
208 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | ||
209 | else: | ||
210 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | ||
202 | 211 | ||
203 | def button_click_cb(self, widget, event): | 212 | def button_click_cb(self, widget, event): |
204 | path, col = widget.table_tree.get_cursor() | 213 | 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 670b4f92b6..d1e5b69401 100755 --- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | |||
@@ -196,24 +196,33 @@ class RecipeSelectionPage (HobPage): | |||
196 | 196 | ||
197 | def search_entry_changed(self, entry): | 197 | def search_entry_changed(self, entry): |
198 | text = entry.get_text() | 198 | text = entry.get_text() |
199 | if text not in self.ins.search_names: | 199 | if self.ins.search_focus: |
200 | current_tab = self.ins.get_current_page() | 200 | self.ins.search_focus = False |
201 | filter = self.pages[current_tab]['filter'] | 201 | elif self.ins.page_changed: |
202 | filter[RecipeListModel.COL_NAME] = text | 202 | self.ins.page_change = False |
203 | self.tables[current_tab].set_model(self.recipe_model.tree_model(filter, search_data=text)) | 203 | self.filter_search(entry) |
204 | if self.recipe_model.filtered_nb == 0: | 204 | elif text not in self.ins.search_names: |
205 | if not self.ins.get_nth_page(current_tab).top_bar: | 205 | self.filter_search(entry) |
206 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) | 206 | |
207 | self.ins.get_nth_page(current_tab).top_bar.show() | 207 | def filter_search(self, entry): |
208 | self.ins.get_nth_page(current_tab).scroll.hide() | 208 | text = entry.get_text() |
209 | else: | 209 | current_tab = self.ins.get_current_page() |
210 | if self.ins.get_nth_page(current_tab).top_bar: | 210 | filter = self.pages[current_tab]['filter'] |
211 | self.ins.get_nth_page(current_tab).top_bar.hide() | 211 | filter[RecipeListModel.COL_NAME] = text |
212 | self.ins.get_nth_page(current_tab).scroll.show() | 212 | self.tables[current_tab].set_model(self.recipe_model.tree_model(filter, search_data=text)) |
213 | if entry.get_text() == '': | 213 | if self.recipe_model.filtered_nb == 0: |
214 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | 214 | if not self.ins.get_nth_page(current_tab).top_bar: |
215 | else: | 215 | self.ins.get_nth_page(current_tab).add_no_result_bar(entry) |
216 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | 216 | self.ins.get_nth_page(current_tab).top_bar.show() |
217 | self.ins.get_nth_page(current_tab).scroll.hide() | ||
218 | else: | ||
219 | if self.ins.get_nth_page(current_tab).top_bar: | ||
220 | self.ins.get_nth_page(current_tab).top_bar.hide() | ||
221 | self.ins.get_nth_page(current_tab).scroll.show() | ||
222 | if entry.get_text() == '': | ||
223 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False) | ||
224 | else: | ||
225 | entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True) | ||
217 | 226 | ||
218 | def button_click_cb(self, widget, event): | 227 | def button_click_cb(self, widget, event): |
219 | path, col = widget.table_tree.get_cursor() | 228 | path, col = widget.table_tree.get_cursor() |