diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2003-09-08 01:22:26 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2003-09-08 01:22:26 +0000 |
commit | 46067f935cbb0ac99449fe2eac7d72acec2e2065 (patch) | |
tree | 93302bcf37e6578ce866ccd87356571b59d6bf58 /perl-install/standalone | |
parent | 8b404d3394a1812d7bc01ff6fcec1c39b59d6c97 (diff) | |
download | drakx-backup-do-not-use-46067f935cbb0ac99449fe2eac7d72acec2e2065.tar drakx-backup-do-not-use-46067f935cbb0ac99449fe2eac7d72acec2e2065.tar.gz drakx-backup-do-not-use-46067f935cbb0ac99449fe2eac7d72acec2e2065.tar.bz2 drakx-backup-do-not-use-46067f935cbb0ac99449fe2eac7d72acec2e2065.tar.xz drakx-backup-do-not-use-46067f935cbb0ac99449fe2eac7d72acec2e2065.zip |
- Use a field in the $printer data structure and no a global variable
for the expert mode.
- Fixed bug of database not being re-read when switching between
normal and expert mode with the new GTK2 main window.
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-x | perl-install/standalone/printerdrake | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index c392ba991..81c5d16e9 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -41,8 +41,6 @@ my $pixdir = '/usr/share/libDrakX/pixmaps/'; local $_ = join '', @ARGV; -printer::main::get_usermode(); - my $printer; my $in = 'interactive'->vnew('su', if_(!$::isEmbedded, 'printer-mdk')); @@ -78,14 +76,19 @@ if (0 && !$::isInstall && !$::isEmbedded) { #gtkflush(); # Check whether Foomatic is installed and install it if necessary -printer::printerdrake::install_foomatic($in); +#printer::printerdrake::install_foomatic($in); my $_w = $in->wait_message(N("Printerdrake"), N("Reading data of installed printers...")); # Get what was installed before eval { $printer = printer::main::getinfo('') }; + +# Were we in expert mode last time? +$printer->{expert} = printer::main::get_usermode(); + # Choose the spooler by command line options +$commandline =~ /-expert/ and $printer->{expert} = 1; $commandline =~ /-cups/ and $printer->{SPOOLER} = 'cups' and printer::main::read_configured_queues($printer); $commandline =~ /-lpr/ and @@ -152,12 +155,15 @@ my ($menu, $factory) = create_factory_menu($::isEmbedded ? $::Plug : $us->{wnd}{ [ N("/_Actions") . N("/_Configure CUPS"), undef, \&ConfigCUPS, undef, '<StockItem>', 'gtk-config' ], [ N("/_Options"), undef, undef, undef, '<Branch>' ], [ join('', @{$options{expert}}), undef, sub { - $::expert = $buttorcheck{expert}->get_active; + $printer->{expert} = $buttorcheck{expert}->get_active; # Remember state of expert # mode for next # printerdrake session - printer::main::set_usermode($::expert); - + printer::main::set_usermode($printer->{expert}); + # Read printer database + # for the new user mode + %printer::main::thedb = + (); }, undef, '<CheckItem>' ], [ N("/_Help"), undef, undef, undef, '<Branch>' ], [ N("/_Help").N("/_Help"), undef, \&HelpSystem, undef, '<StockItem>', 'gtk-help' ], @@ -170,7 +176,7 @@ my ($menu, $factory) = create_factory_menu($::isEmbedded ? $::Plug : $us->{wnd}{ }('default', 'edit', 'delete', 'expert'); if (defined $buttorcheck{expert}) { - $buttorcheck{expert}->set_active($::expert); + $buttorcheck{expert}->set_active($printer->{expert}); } else { print STDERR "BUG with LANGUAGE $ENV{LANGUAGE}\n"; } |