aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2015-01-07 21:04:50 +0100
committerAngelo Naselli <anaselli@linux.it>2015-01-07 21:04:50 +0100
commit4a289bab3a58b417acec862db0ac68176582b640 (patch)
treeec0c6e8f37c39edabacb26f6543e5f12eab2ca80
parent7ed2c026ec660f95945545fd39a6f78b5a8f96c9 (diff)
downloadcolin-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
-rw-r--r--Changes7
-rw-r--r--lib/AdminPanel/Rpmdragora/gurpm.pm4
-rwxr-xr-xmodules/rpmdragora/rpmdragora48
3 files changed, 37 insertions, 22 deletions
diff --git a/Changes b/Changes
index 825408a..381cd58 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,12 @@
1.0.0-8
+ - rpmdragora: find string if present, after changing the
+ filter
+ - rpmdragora: gurpm module moved to Moose and allowed
+ to be instantiate as a part of an existing
+ dialog
+ - rpmdragora: fixed package searchs
- rpmdragora: used index for YItem
+
1.0.0-7 04/01/2015 23:45
- manaclock: /etc/localtime as link instead of a copy
- rpmdragora: readconf now lets default values if keys
diff --git a/lib/AdminPanel/Rpmdragora/gurpm.pm b/lib/AdminPanel/Rpmdragora/gurpm.pm
index d1a24df..7e9363a 100644
--- a/lib/AdminPanel/Rpmdragora/gurpm.pm
+++ b/lib/AdminPanel/Rpmdragora/gurpm.pm
@@ -117,7 +117,6 @@ sub BUILD {
my $factory = yui::YUI::widgetFactory;
my $vbox;
-$DB::single = 1;
if (! $self->main_dialog) {
if ($self->parent) {
@@ -257,6 +256,9 @@ sub DEMOLISH {
$self->main_dialog->destroy if !$self->parent;
}
+# TODO cancel button cannot be easily managed in libyui polling events
+# removed atm
+#
# sub validate_cancel {
# my ($self, $cancel_msg, $cancel_cb) = @_;
# $self->{main_dialog}->startMultipleChanges();
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;
+ }
}
}