diff options
author | Angelo Naselli <anaselli@linux.it> | 2014-07-20 10:49:25 +0200 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2014-07-20 10:49:25 +0200 |
commit | a10cdecb4a7fb010e73ef04d80027286cb5673a7 (patch) | |
tree | 2991ce415e163e904c06494473c73c1b5ed8d8a5 /lib/AdminPanel/Rpmdragora | |
parent | aec3aa70b297f76cbd003f0c63f43c2b158c2051 (diff) | |
download | manatools-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar manatools-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.gz manatools-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.bz2 manatools-a10cdecb4a7fb010e73ef04d80027286cb5673a7.tar.xz manatools-a10cdecb4a7fb010e73ef04d80027286cb5673a7.zip |
used the same code in a single point
Diffstat (limited to 'lib/AdminPanel/Rpmdragora')
-rw-r--r-- | lib/AdminPanel/Rpmdragora/edit_urpm_sources.pm | 40 |
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 9b9382c1..2518509c 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 |