summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/printerdrake
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-09-03 16:13:17 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-09-03 16:13:17 +0000
commit491c1fa99a5529e88bf7a2361cf31be787e7cf90 (patch)
tree894172aa789eb968986814472b142c0ea7a11f17 /perl-install/standalone/printerdrake
parent880a8fec0248a4b5f01c7bf0dd00137109910f78 (diff)
downloaddrakx-backup-do-not-use-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar
drakx-backup-do-not-use-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.gz
drakx-backup-do-not-use-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.bz2
drakx-backup-do-not-use-491c1fa99a5529e88bf7a2361cf31be787e7cf90.tar.xz
drakx-backup-do-not-use-491c1fa99a5529e88bf7a2361cf31be787e7cf90.zip
- Used Glib::Timeout->add() function for auto-refreshing remote
printer list.
Diffstat (limited to 'perl-install/standalone/printerdrake')
-rwxr-xr-xperl-install/standalone/printerdrake13
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() {