From 71f0e8976966c8db44a8ef13fbe65b38b228e97f Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Sat, 3 Sep 2005 13:03:41 +0000 Subject: - Auto-refresh the list of remote printers in the main windows every 5 seconds. --- perl-install/standalone/printerdrake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index d8b462148..3ce19773e 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -49,6 +49,8 @@ my $domainname = "mandriva.com"; my $pixdir = '/usr/share/libDrakX/pixmaps/'; +my $refreshinterval = 5; + local $_ = join '', @ARGV; my $printer; @@ -269,6 +271,8 @@ gtkset_mousecursor_normal(); my $isEmbedded = $::isEmbedded; local $::isEmbedded = 0; +local $SIG{ALRM} = sub { Refresh($stringsearch) }; +alarm $refreshinterval; $us->{wnd}->main; ugtk2->exit; @@ -306,7 +310,7 @@ sub RefreshLocalPrintersFull { } foreach my $p (sort { lc($a) cmp lc($b) } @LocalReal) { my $state = ($printer->{SPOOLER} !~ /cups/ ? N("Unknown") : - ((grep { + ((any { ($_->{queuename} eq $p) && ($_->{state} eq "enabled"); } @allprinters) ? N("Enabled") : N("Disabled"))); @@ -365,6 +369,7 @@ sub Refresh { RefreshRemotePrintersFull($strfilt, @printers); GrayDelEdit(); set_selection($selection); + alarm $refreshinterval; } sub AddPrinter() { -- cgit v1.2.1