diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2003-01-31 02:54:04 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2003-01-31 02:54:04 +0000 |
commit | 881b151808fdc9ee514940308d9108456ab3f4dd (patch) | |
tree | 5bf6cb4c15e3ba7e47d345d5214979c0dc8e908d /perl-install/printer/printerdrake.pm | |
parent | fccdd76453dcabe23fa4ed389cab7c10a6e980fc (diff) | |
download | drakx-881b151808fdc9ee514940308d9108456ab3f4dd.tar drakx-881b151808fdc9ee514940308d9108456ab3f4dd.tar.gz drakx-881b151808fdc9ee514940308d9108456ab3f4dd.tar.bz2 drakx-881b151808fdc9ee514940308d9108456ab3f4dd.tar.xz drakx-881b151808fdc9ee514940308d9108456ab3f4dd.zip |
- Faster switch between normal and expert mode (no re-read of the print
queues).
- Prepared for working with pre-compiled Foomatic PPDs.
Diffstat (limited to 'perl-install/printer/printerdrake.pm')
-rw-r--r-- | perl-install/printer/printerdrake.pm | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm index 611bd8f5b..56d214eb1 100644 --- a/perl-install/printer/printerdrake.pm +++ b/perl-install/printer/printerdrake.pm @@ -3390,7 +3390,12 @@ sub main { val => N("Change the printing system") } : ()), { clicked_may_quit => - sub { $menuchoice = "\@usermode"; 1 }, + sub { + # Save the cursor position + $cursorpos = $menuchoice; + $menuchoice = "\@usermode"; + 1 + }, val => ($::expert ? N("Normal Mode") : N("Expert Mode")) }, { clicked_may_quit => @@ -3404,16 +3409,23 @@ sub main { printer::main::set_usermode(!$::expert); # Read printer database for the new user mode %printer::main::thedb = (); - #my $_w = $in->wait_message(N("Printerdrake"), - # N("Reading printer database...")); - #printer::main::read_printer_db($printer->{SPOOLER}); - # Re-read printer queues to switch the tree + # Modify menu entries to switch the tree # structure between expert/normal mode. - my $_w = $in->wait_message( - N("Printerdrake"), - N("Reading printer data...")); - printer::main::read_configured_queues($printer); - $cursorpos = "::"; + my $spooler = + $spoolers{$printer->{SPOOLER}}{short_name}; + if ($::expert) { + map { + $printer->{configured}{$_}{queuedata}{menuentry} =~ + s/^/$spooler!/; + } keys(%{$printer->{configured}}); + $cursorpos =~ s/^/$spooler!/; + } else { + map { + $printer->{configured}{$_}{queuedata}{menuentry} =~ + s/^$spooler!//; + } keys(%{$printer->{configured}}); + $cursorpos =~ s/^$spooler!//; + } next; } } else { |