aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-07-20 10:49:25 +0200
committerAngelo Naselli <anaselli@linux.it>2014-07-20 10:49:25 +0200
commita10cdecb4a7fb010e73ef04d80027286cb5673a7 (patch)
tree2991ce415e163e904c06494473c73c1b5ed8d8a5
parentaec3aa70b297f76cbd003f0c63f43c2b158c2051 (diff)
downloadcolin-keep-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar
colin-keep-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.gz
colin-keep-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.bz2
colin-keep-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.xz
colin-keep-a10cdecb4a7fb010e73ef04d80027286cb5673a7.zip
used the same code in a single point
-rw-r--r--lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm40
1 files changed, 16 insertions, 24 deletions
diff --git a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
index 9b9382c..2518509 100644
--- a/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
+++ b/lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm
@@ -1538,6 +1538,7 @@ sub mainwindow() {
}
elsif ($eventType == $yui::YEvent::MenuEvent) {
### MENU ###
+ my $changed = 0;
my $item = $event->item();
my $menuLabel = $item->label();
if ($menuLabel eq $fileMenu{ quit }->label()) {
@@ -1570,32 +1571,10 @@ sub mainwindow() {
update_callback();
}
elsif ($menuLabel eq $fileMenu{ add_media }->label()) {
- if (easy_add_callback_with_mirror()) {
- yui::YUI::app()->busyCursor();
- $dialog->startMultipleChanges();
-
- $mirrorTbl->deleteAllItems();
- my $itemCollection = readMedia();
- $mirrorTbl->addItems($itemCollection);
-
- $dialog->recalcLayout();
- $dialog->doneMultipleChanges();
- yui::YUI::app()->normalCursor();
- }
+ $changed = easy_add_callback_with_mirror();
}
elsif ($menuLabel eq $fileMenu{ custom }->label()) {
- if (add_callback()) {
- yui::YUI::app()->busyCursor();
- $dialog->startMultipleChanges();
-
- $mirrorTbl->deleteAllItems();
- my $itemCollection = readMedia();
- $mirrorTbl->addItems($itemCollection);
-
- $dialog->recalcLayout();
- $dialog->doneMultipleChanges();
- yui::YUI::app()->normalCursor();
- }
+ $changed = add_callback();
}
elsif ($menuLabel eq $optionsMenu{ proxy }->label()) {
proxy_callback();
@@ -1603,6 +1582,19 @@ sub mainwindow() {
elsif ($menuLabel eq $optionsMenu{ global }->label()) {
options_callback();
}
+ if ($changed) {
+ yui::YUI::app()->busyCursor();
+ $dialog->startMultipleChanges();
+
+ $mirrorTbl->deleteAllItems();
+ my $itemCollection = readMedia();
+ $mirrorTbl->addItems($itemCollection);
+
+ $dialog->recalcLayout();
+ $dialog->doneMultipleChanges();
+ yui::YUI::app()->normalCursor();
+ }
+
}
elsif ($eventType == $yui::YEvent::WidgetEvent) {
# widget selected