summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2005-09-03 13:03:41 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2005-09-03 13:03:41 +0000
commit71f0e8976966c8db44a8ef13fbe65b38b228e97f (patch)
treef0053c8cf7dc8487c5a4cf4c09849f8009f6093f /perl-install
parentee9bf63c02def4c01bc5c034296b03f8bc862b16 (diff)
downloaddrakx-backup-do-not-use-71f0e8976966c8db44a8ef13fbe65b38b228e97f.tar
drakx-backup-do-not-use-71f0e8976966c8db44a8ef13fbe65b38b228e97f.tar.gz
drakx-backup-do-not-use-71f0e8976966c8db44a8ef13fbe65b38b228e97f.tar.bz2
drakx-backup-do-not-use-71f0e8976966c8db44a8ef13fbe65b38b228e97f.tar.xz
drakx-backup-do-not-use-71f0e8976966c8db44a8ef13fbe65b38b228e97f.zip
- Auto-refresh the list of remote printers in the main windows every 5
seconds.
Diffstat (limited to 'perl-install')
-rwxr-xr-xperl-install/standalone/printerdrake7
1 files changed, 6 insertions, 1 deletions
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() {