aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/rpmdragora.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-11-28 14:37:45 +0100
committerAngelo Naselli <anaselli@linux.it>2014-11-28 14:37:45 +0100
commit407c43f174d0ea123af9d5a032abfbd0b156a2c4 (patch)
tree1471e8655a842e16d6fb94941200c72c29d304ac /lib/AdminPanel/rpmdragora.pm
parent043141ff5038b1bd8d3db61d126f30f2be05c29e (diff)
downloadmanatools-407c43f174d0ea123af9d5a032abfbd0b156a2c4.tar
manatools-407c43f174d0ea123af9d5a032abfbd0b156a2c4.tar.gz
manatools-407c43f174d0ea123af9d5a032abfbd0b156a2c4.tar.bz2
manatools-407c43f174d0ea123af9d5a032abfbd0b156a2c4.tar.xz
manatools-407c43f174d0ea123af9d5a032abfbd0b156a2c4.zip
fixed slow_func (ncurses crash)
Diffstat (limited to 'lib/AdminPanel/rpmdragora.pm')
-rw-r--r--lib/AdminPanel/rpmdragora.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/AdminPanel/rpmdragora.pm b/lib/AdminPanel/rpmdragora.pm
index 5cdf7514..f79b4997 100644
--- a/lib/AdminPanel/rpmdragora.pm
+++ b/lib/AdminPanel/rpmdragora.pm
@@ -410,14 +410,33 @@ sub remove_wait_msg {
sub but { " $_[0] " }
sub but_ { " $_[0] " }
-sub slow_func ($&) {
- my ($param, $func) = @_;
+#=============================================================
+
+=head2 slow_func
+
+=head3 INPUT
+
+ $func: function to be executed with a busy cursor or waiting
+ dialog
+ $msg: message to be shown in ncurses waiting dialog (if any)
+
+=head3 DESCRIPTION
+
+ This function executes a given function with a busy cursor set
+ in graphical environment, or with a waiting dialog if in ncurses
+ text mode
+
+=cut
+
+#=============================================================
+sub slow_func (&) {
+ my ($func, $msg) = @_;
my $retval = 1;
# NOTE busy cursor is not implemented in yui-ncurses
# but we can avoid a waiting dialog in Gtk and QT
if (yui::YUI::app()->isTextMode()) {
- my $w = wait_msg($param);
+ my $w = wait_msg($msg);
$retval = $func->();
remove_wait_msg($w)
}