diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2005-09-03 16:13:17 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2005-09-03 16:13:17 +0000 |
commit | 491c1fa99a5529e88bf7a2361cf31be787e7cf90 (patch) | |
tree | 894172aa789eb968986814472b142c0ea7a11f17 /perl-install | |
parent | 880a8fec0248a4b5f01c7bf0dd00137109910f78 (diff) | |
download | drakx-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar drakx-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.gz drakx-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.bz2 drakx-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.xz drakx-491c1fa99a5529e88bf7a2361cf31be787e7cf90.zip |
- Used Glib::Timeout->add() function for auto-refreshing remote
printer list.
Diffstat (limited to 'perl-install')
-rwxr-xr-x | perl-install/standalone/printerdrake | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index abe8e7698..7bc4e1387 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -272,8 +272,9 @@ my $isEmbedded = $::isEmbedded; local $::isEmbedded = 0; # Auto refresh -local $SIG{ALRM} = sub { Refresh($stringsearch) }; -alarm $refreshinterval; +my $refreshing = 0; +Glib::Timeout->add($refreshinterval * 1000, + sub { Refresh($stringsearch); 1 }); $us->{wnd}->main; ugtk2->exit; @@ -369,8 +370,9 @@ sub RefreshRemotePrintersFull { } sub Refresh { - # Do not have ourselves recalled if we are not running - alarm 0; + # Do not have ourselves recalled if we are already running + return if $refreshing; + $refreshing = 1; my ($strfilt) = @_; my $selection = get_selection(); printer::services::wait_for_cups(); @@ -380,8 +382,7 @@ sub Refresh { RefreshRemotePrintersFull($strfilt, @printers); GrayDelEdit(); set_selection($selection); - # Recall when refresh intervall has passed - alarm $refreshinterval; + $refreshing = 0; } sub AddPrinter() { |