diff options
author | Angelo Naselli <anaselli@linux.it> | 2015-01-07 21:04:50 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2015-01-07 21:04:50 +0100 |
commit | 4a289bab3a58b417acec862db0ac68176582b640 (patch) | |
tree | ec0c6e8f37c39edabacb26f6543e5f12eab2ca80 /modules | |
parent | 7ed2c026ec660f95945545fd39a6f78b5a8f96c9 (diff) | |
download | colin-keep-4a289bab3a58b417acec862db0ac68176582b640.tar colin-keep-4a289bab3a58b417acec862db0ac68176582b640.tar.gz colin-keep-4a289bab3a58b417acec862db0ac68176582b640.tar.bz2 colin-keep-4a289bab3a58b417acec862db0ac68176582b640.tar.xz colin-keep-4a289bab3a58b417acec862db0ac68176582b640.zip |
Perform the search after a new filter selection if a string is present
Diffstat (limited to 'modules')
-rwxr-xr-x | modules/rpmdragora/rpmdragora | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/modules/rpmdragora/rpmdragora b/modules/rpmdragora/rpmdragora index 34b9fc8..29077b0 100755 --- a/modules/rpmdragora/rpmdragora +++ b/modules/rpmdragora/rpmdragora @@ -79,7 +79,7 @@ sub _viewbox_callback { # TODO add a check on selection type YItem my $curr_index = $selection->index(); - return if $curr_index == $old_index; + return 0 if $curr_index == $old_index; yui::YUI::app()->busyCursor(); @@ -101,6 +101,8 @@ sub _viewbox_callback { } yui::YUI::app()->normalCursor(); + + return 1; } sub _filterbox_callback { @@ -109,7 +111,7 @@ sub _filterbox_callback { # TODO add a check on selection type YItem my $curr_index = $selection->index(); - return if $curr_index == $old_index; + return 0 if $curr_index == $old_index; yui::YUI::app()->busyCursor(); @@ -123,6 +125,8 @@ sub _filterbox_callback { } yui::YUI::app()->normalCursor(); + + return 1; } sub _searchmenu_callback { @@ -131,7 +135,7 @@ sub _searchmenu_callback { # TODO add a check on selection type YItem my $curr_index = $selection->index(); - return if $curr_index == $old_index; + return 0 if $curr_index == $old_index; yui::YUI::app()->busyCursor(); @@ -145,6 +149,8 @@ sub _searchmenu_callback { } yui::YUI::app()->normalCursor(); + + return 1; } @@ -624,18 +630,6 @@ sub _run_treeview_dialog { $search_menu->addItems($itemColl); $search_menu->setNotify(1); - -# my $i = 0; -# my $previous; -# foreach ($loc->N("in names"), $loc->N("in descriptions"), $loc->N("in summaries"), $loc->N("in file names")) { -# my ($name, $val) = ($_, $i); -# #OLD $search_menu->append(gtksignal_connect(gtkshow( -# # $previous = Gtk2::RadioMenuItem->new_with_label($previous, $name)), -# # activate => sub { $current_search_type = $search_types[$val] })); -# $search_menu->addItem($name); -# $i++; -# } - $find_entry = $factory->createInputField($hbox_top, ""); my $icon_file = File::ShareDir::dist_file(AdminPanel::Shared::distName(), "images/manalog.png"); @@ -1120,6 +1114,7 @@ print "Menu " . $menuLabel . " chosen\n"; # widget selected my $widget = $event->widget(); + my $perform_search = 0; if($widget == $reset_search_button) { $find_entry->setValue(''); @@ -1127,9 +1122,7 @@ print "Menu " . $menuLabel . " chosen\n"; $options->{rebuild_tree}->(); } elsif ($widget == $find_button) { - yui::YUI::app()->busyCursor(); - _do_search($find_entry, $tree, $options, $current_search_type, $urpm, $pkgs); - yui::YUI::app()->normalCursor(); + $perform_search = 1; } elsif ($widget == $select_all_button) { toggle_all($options, 1); @@ -1139,13 +1132,19 @@ print "Menu " . $menuLabel . " chosen\n"; do_action($options, $callback_action, $info); } elsif ($widget == $view_box) { - _viewbox_callback($view_box->selectedItem(), \%$options, \%wanted_categories); + if (_viewbox_callback($view_box->selectedItem(), \%$options, \%wanted_categories)) { + $perform_search = 1 if $find_entry->value(); + } } elsif ($widget == $filter_box) { - _filterbox_callback($filter_box->selectedItem(), \%$options, \@ordered_filters); + if (_filterbox_callback($filter_box->selectedItem(), \%$options, \@ordered_filters)) { + $perform_search = 1 if $find_entry->value(); + } } elsif ($widget == $search_menu) { - _searchmenu_callback($search_menu->selectedItem(), \%$options, \@search_types, \$current_search_type); + if (_searchmenu_callback($search_menu->selectedItem(), \%$options, \@search_types, \$current_search_type)) { + $perform_search = 1 if $find_entry->value(); + } } elsif ($widget == $tree) { _tree_callback($tree->currentItem(),\%$options); @@ -1165,6 +1164,13 @@ print "Menu " . $menuLabel . " chosen\n"; elsif ($widget == $QuitButton) { last if _quit(); } + + if ($perform_search) { + yui::YUI::app()->busyCursor(); + _do_search($find_entry, $tree, $options, $current_search_type, $urpm, $pkgs); + yui::YUI::app()->normalCursor(); + $perform_search = 0; + } } } |