Hello community,
here is the log from the commit of package yast2-printer
checked in at Fri Sep 12 17:29:48 CEST 2008.
--------
--- yast2-printer/yast2-printer.changes 2008-09-11 16:10:39.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2008-09-12 14:33:59.362883000 +0200
@@ -1,0 +2,13 @@
+Fri Sep 12 13:07:36 CEST 2008 - jsmeix@suse.de
+
+- Adapt the "Modify Printer" dialog to the design on
+ http://en.opensuse.org/YaST/Development/Printer_Enhancement
+ but still a single dialog only with basic functionality
+ (the full featured tabbed dialog is not yet implemented).
+- Show a user information because the Connection Wizard
+ provides currently only minimalist functionality.
+- Fix texts in the dialogs (e.g. avoid the word "queue").
+ The help texts still need to be fixed.
+- 2.17.13
+
+-------------------------------------------------------------------
Old:
----
yast2-printer-2.17.12.tar.bz2
New:
----
yast2-printer-2.17.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.A21789/_old 2008-09-12 17:29:38.000000000 +0200
+++ /var/tmp/diff_new_pack.A21789/_new 2008-09-12 17:29:38.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.17.12)
+# spec file for package yast2-printer (Version 2.17.13)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,12 +20,12 @@
Url: http://en.opensuse.org/YaST/Modules/Printer
Name: yast2-printer
-Version: 2.17.12
+Version: 2.17.13
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.17.12.tar.bz2
+Source0: yast2-printer-2.17.13.tar.bz2
Prefix: /usr
BuildRequires: cups-devel update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite
Recommends: netcat
@@ -64,7 +64,7 @@
Michal Zugec
%prep
-%setup -n yast2-printer-2.17.12
+%setup -n yast2-printer-2.17.13
%build
%{prefix}/bin/y2tool y2autoconf
@@ -119,6 +119,16 @@
%exclude %{prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{prefix}/share/doc/packages/yast2-printer/README
%changelog
+* Fri Sep 12 2008 jsmeix@suse.de
+- Adapt the "Modify Printer" dialog to the design on
+ http://en.opensuse.org/YaST/Development/Printer_Enhancement
+ but still a single dialog only with basic functionality
+ (the full featured tabbed dialog is not yet implemented).
+- Show a user information because the Connection Wizard
+ provides currently only minimalist functionality.
+- Fix texts in the dialogs (e.g. avoid the word "queue").
+ The help texts still need to be fixed.
+- 2.17.13
* Thu Sep 11 2008 jsmeix@suse.de
- Adapt the "Add Printer" dialog to the design on
http://en.opensuse.org/YaST/Development/Printer_Enhancement
++++++ yast2-printer-2.17.12.tar.bz2 -> yast2-printer-2.17.13.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/configure new/yast2-printer-2.17.13/configure
--- old/yast2-printer-2.17.12/configure 2008-09-11 15:47:11.000000000 +0200
+++ new/yast2-printer-2.17.13/configure 2008-09-12 14:31:10.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-printer 2.17.12.
+# Generated by GNU Autoconf 2.61 for yast2-printer 2.17.13.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -574,8 +574,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-printer'
PACKAGE_TARNAME='yast2-printer'
-PACKAGE_VERSION='2.17.12'
-PACKAGE_STRING='yast2-printer 2.17.12'
+PACKAGE_VERSION='2.17.13'
+PACKAGE_STRING='yast2-printer 2.17.13'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1197,7 +1197,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-printer 2.17.12 to adapt to many kinds of systems.
+\`configure' configures yast2-printer 2.17.13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1268,7 +1268,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-printer 2.17.12:";;
+ short | recursive ) echo "Configuration of yast2-printer 2.17.13:";;
esac
cat <<\_ACEOF
@@ -1346,7 +1346,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-printer configure 2.17.12
+yast2-printer configure 2.17.13
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1360,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-printer $as_me 2.17.12, which was
+It was created by yast2-printer $as_me 2.17.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2181,7 +2181,7 @@
# Define the identity of the package.
PACKAGE='yast2-printer'
- VERSION='2.17.12'
+ VERSION='2.17.13'
cat >>confdefs.h <<_ACEOF
@@ -2409,7 +2409,7 @@
-VERSION="2.17.12"
+VERSION="2.17.13"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
@@ -3304,7 +3304,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-printer $as_me 2.17.12, which was
+This file was extended by yast2-printer $as_me 2.17.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -3347,7 +3347,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-printer config.status 2.17.12
+yast2-printer config.status 2.17.13
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/configure.in new/yast2-printer-2.17.13/configure.in
--- old/yast2-printer-2.17.12/configure.in 2008-09-11 15:46:54.000000000 +0200
+++ new/yast2-printer-2.17.13/configure.in 2008-09-12 14:31:06.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.16.7 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.17.12, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.17.13, http://bugs.opensuse.org/, yast2-printer)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.17.12"
+VERSION="2.17.13"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/basicadd.ycp new/yast2-printer-2.17.13/src/basicadd.ycp
--- old/yast2-printer-2.17.12/src/basicadd.ycp 2008-09-11 15:46:50.000000000 +0200
+++ new/yast2-printer-2.17.13/src/basicadd.ycp 2008-09-12 12:05:49.000000000 +0200
@@ -268,9 +268,7 @@
}
// After a local queue was added, enforce to show also local queues
// in particular when no local queues were shown before:
- if( ! Printer::queue_filter_show_local )
- { Printer::queue_filter_show_local = true;
- }
+ Printer::queue_filter_show_local = true;
Wizard::EnableBackButton();
Wizard::EnableAbortButton();
Wizard::EnableNextButton();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/basicmodify.ycp new/yast2-printer-2.17.13/src/basicmodify.ycp
--- old/yast2-printer-2.17.12/src/basicmodify.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/basicmodify.ycp 2008-09-12 13:04:32.000000000 +0200
@@ -50,10 +50,14 @@
string description = Printer::queues[Printer::selected_queues_index,"description"]:"";
string location = Printer::queues[Printer::selected_queues_index,"location"]:"";
string ppd = Printer::queues[Printer::selected_queues_index,"ppd"]:"";
- // After the "Modify the Print Queue" text the actual queue name is appended
- // so that the result is e.g. "Modify the Print Queue funprinter1".
+ boolean is_default = false;
+ if( "yes" == Printer::queues[Printer::selected_queues_index,"default"]:"" )
+ { is_default = true;
+ }
+ // After the "Modify" text the actual queue name is appended
+ // so that the result is e.g. "Modify funprinter1".
// The actual queue name is a system value which cannot be translated.
- string caption = _("Modify the Print Queue") + " " + name;
+ string caption = _("Modify") + " " + name;
string model = "";
list <string> description_words = splitstring( description, " " );
if( size( description_words ) > 2 )
@@ -90,12 +94,12 @@
if( "" != ppd )
{ commandline = "test -r " + ppd;
if( Printerlib::ExecuteBashCommand( commandline ) )
- { driver_options_content = `HBox( `Label( _("All") + " " ),
- `PushButton( `id(`driver_options),
- _("Driver &Options")
- ),
- `Label( " " + _("for the currently used driver") )
- );
+ { driver_options_content = `PushButton( `id(`driver_options),
+ // Label of a PushButton to go to a dialog
+ // to set all available options for the printer driver
+ // which is currently used for a print queue:
+ _("All &Options for the Current Driver")
+ );
}
else
{ ppd = "";
@@ -163,14 +167,16 @@
// Nevertheless we don't rely on correct PPDs (e.g. whatever "third-party" PPDs)
// and test if it really exists in the actually used PPD:
if( "" != default_paper_size )
- { if( a4_default_paper
+ { string default_paper_size_label = _("Default Paper Size of the Current Driver");
+ if( a4_default_paper
|| letter_default_paper
)
{ paper_choice_content = `RadioButtonGroup( `id(`paper_size_radio_buttons),
- `HBox( `Label( _("Default paper size of the currently used driver") ),
+ `HBox( `Label( default_paper_size_label ),
+ `HSpacing( 2 ),
a4_paper_choice_radio_button,
- letter_paper_choice_radio_button,
- `Label( _("(select what is actually loaded in your printer)") )
+ `HSpacing( 1 ),
+ letter_paper_choice_radio_button
)
);
}
@@ -179,17 +185,18 @@
|| letter_paper_choice
)
{ paper_choice_content = `RadioButtonGroup( `id(`paper_size_radio_buttons),
- `HBox( `Label( _("Default paper size of the currently used driver")
+ `HBox( `Label( default_paper_size_label
+ ": " + default_paper_size + " "
),
+ `HSpacing( 2 ),
a4_paper_choice_radio_button,
- letter_paper_choice_radio_button,
- `Label( _("(select what is actually loaded in your printer)") )
+ `HSpacing( 1 ),
+ letter_paper_choice_radio_button
)
);
}
else
- { paper_choice_content = `Label( _("Default paper size of the currently used driver") + ": " + default_paper_size );
+ { paper_choice_content = `Label( default_paper_size_label + ": " + default_paper_size );
}
}
}
@@ -204,7 +211,7 @@
// The current_connection item is preselected because it is the first entry in the
// table of connections via prepend():
term current_connection = `item( `id( -1 ),
- _("Currently used connection") + ": ",
+ _("Current Connection") + ": ",
uri + " ",
description
);
@@ -225,148 +232,145 @@
);
if( "" != nick_name )
{ current_driver = `item( `id( -1 ),
- _("Currently used driver") + ": " + nick_name,
+ _("Current Driver") + ": " + nick_name,
true
);
}
- term contents = `VBox( `VBox( `Left( `Label( // Caption for a Table with a list of printer connections:
- _("Keep or Modify the Connection")
- )
- ),
- `ReplacePoint( `id(`connection_selection_replace_point),
- `Table( `id(`connection_selection),
- // By default there is no UserInput()
- // if only something was selected in the Table
- // (without clicking additionally a button)
- // but the notify and immediate options
- // forces UserInput() in this case:
- `opt(`notify, `immediate),
- // Headers of a Table with a list of printer connections:
- `header( // Header of a Table column with a list of printer connections.
- // Printer model name:
- _("Model"),
- // Header of a Table column with a list of printer connections.
- // Connection of the printer (e.g. via USB or via parallel port):
- _("Connection"),
- // Header of a Table column with a list of printer connections.
- // Additional description of the printer or its particular connection:
- _("Description")
- ),
- prepend( Printer::ConnectionItems( "BasicAddDialog" ),
- current_connection
- )
- )
- ),
- `Right( `HBox( `Label( _("If the connection is not shown, try") + " " ),
- `PushButton( `id(`more_connections),
- _("&More Connections")
- ),
- `Label( " " + _("or use the") + " " ),
- `PushButton( `id(`connection_wizard),
- _("&Connection Wizard")
- )
- )
- )
- ),
- `VStretch(),
- `VBox( `Left( `Label( // Caption for a printer driver selection:
- _("Keep or Exchange the Driver or Change the Option Settings of the Currently Used Driver")
- )
- ),
- `HBox( `PushButton( `id(`apply_driver_filter),
- // This button must be the default
- // (it is activated when the user pressed the Enter key)
- // because when the user has clicked into TextEntry to enter something
- // it is normal to finish entering by pressing the Enter key
- // but if the Enter key was linked to 'Next' or 'Back',
- // the user would get the wrong action.
- `opt(`default),
- // Label of a PushButton to search a list for a search string:
- _("&Show")
- ),
- `Label( " " + _("drivers which match to") + " " ),
- `ReplacePoint( `id(`driver_filter_input_replace_point),
- `TextEntry( `id(`driver_filter_input),
- `opt(`hstretch),
- "",
- driver_filter_input_text
- )
- ),
- `HStretch()
- ),
- `ReplacePoint( `id(`paper_choice_and_driver_options_replace_point),
- `VBox( `Left( paper_choice_content ),
- `Left( driver_options_content )
- )
- ),
- `ReplacePoint( `id(`driver_selection_replace_point),
- `SelectionBox( `id(`driver_selection),
- // By default there is no UserInput()
- // if only something was selected in the SelectionBox
- // (without clicking additionally a button)
- // but the notify option forces UserInput() in this case:
- `opt(`notify),
- "",
- prepend( Printer::DriverItems( driver_filter_string, false ),
- current_driver
- )
- )
- ),
- `Right( `HBox( `Label( _("If no suitable driver is shown, try") + " " ),
- `PushButton( `id(`more_drivers),
- _("More &Drivers")
- ),
- `Label( " " + _("or") + " " ),
- `PushButton( `id(`all_drivers),
- _("&All Drivers")
- ),
- `Label( " " + _("or use the") + " " ),
- `PushButton( `id(`driver_wizard),
- _("Driver &Wizard")
- )
- )
- )
- ),
- `VStretch(),
- `HBox( `TextEntry( `id(`description_input),
- `opt(`hstretch),
- _("Descri&ption"),
- description
- ),
- `TextEntry( `id(`location_input),
- `opt(`hstretch),
- _("&Location"),
- location
- )
- ),
- `VStretch(),
- `VBox( `Left( `Label( _("Special Settings") )
- ),
- `Left( `HBox( `HWeight( 1,
- `PushButton( `id(`queue_state),
- _("Enable/Disable")
- )
- ),
- `HWeight( 1,
- `PushButton( `id(`error_policy),
- _("Error Policy")
- )
- ),
- `HWeight( 1,
- `PushButton( `id(`access_control),
- _("Access Control")
- )
- ),
- `HWeight( 1,
- `PushButton( `id(`other_options),
- _("Other Options")
- )
- ),
- `HStretch()
- )
- )
+ term contents = `VBox
+ ( `VBox
+ ( `Left
+ ( `Label( // Caption for a Table with a list of printer connections:
+ _("Connection")
)
- );
+ ),
+ `ReplacePoint
+ ( `id(`connection_selection_replace_point),
+ `Table
+ ( `id(`connection_selection),
+ // By default there is no UserInput()
+ // if only something was selected in the Table
+ // (without clicking additionally a button)
+ // but the notify and immediate options
+ // forces UserInput() in this case:
+ `opt(`notify, `immediate),
+ // Headers of a Table with a list of printer connections:
+ `header
+ ( // Header of a Table column with a list of printer connections.
+ // Printer model name:
+ _("Model"),
+ // Header of a Table column with a list of printer connections.
+ // Connection of the printer (e.g. via USB or via parallel port):
+ _("Connection"),
+ // Header of a Table column with a list of printer connections.
+ // Additional description of the printer or its particular connection:
+ _("Description")
+ ),
+ prepend( Printer::ConnectionItems( "BasicAddDialog" ), current_connection )
+ )
+ ),
+ `Right
+ ( `HBox
+ ( `PushButton
+ ( `id(`more_connections),
+ // Label of a PushButton to show more available printer connections
+ // in the Table with a list of printer connections:
+ _("&More Connections")
+ ),
+ `PushButton
+ ( `id(`connection_wizard),
+ // Label of a PushButton to go to the "Connection Wizard"
+ // to specify the printer connection individually:
+ _("Connection &Wizard")
+ )
+ )
+ )
+ ),
+ `VStretch(),
+ `VBox
+ ( `Left
+ ( `Label( // Caption for a printer driver selection:
+ _("Driver")
+ )
+ ),
+ `HBox
+ ( `ReplacePoint
+ ( `id(`driver_filter_input_replace_point),
+ `TextEntry
+ ( `id(`driver_filter_input),
+ "",
+ driver_filter_input_text
+ )
+ ),
+ `PushButton
+ ( `id(`apply_driver_filter),
+ // This button must be the default
+ // (it is activated when the user pressed the Enter key)
+ // because when the user has clicked into TextEntry to enter something
+ // it is normal to finish entering by pressing the Enter key
+ // but if the Enter key was linked to 'Next' or 'Back',
+ // the user would get the wrong action.
+ `opt(`default),
+ // Label of a PushButton to search a list for a search string
+ // and then show the search result:
+ _("&Show Matching Drivers")
+ ),
+ `HStretch()
+ ),
+ `ReplacePoint
+ ( `id(`paper_choice_and_driver_options_replace_point),
+ `VBox
+ ( `Left( paper_choice_content ),
+ `Left( driver_options_content )
+ )
+ ),
+ `ReplacePoint
+ ( `id(`driver_selection_replace_point),
+ `SelectionBox
+ ( `id(`driver_selection),
+ // By default there is no UserInput()
+ // if only something was selected in the SelectionBox
+ // (without clicking additionally a button)
+ // but the notify option forces UserInput() in this case:
+ `opt(`notify),
+ "",
+ prepend( Printer::DriverItems( driver_filter_string, false ), current_driver )
+ )
+ ),
+ `Right
+ ( `PushButton
+ ( `id(`add_driver),
+ // Label of a PushButton to go to the "Add Driver" dialog
+ // to install a new driver (and perhaps download it before):
+ _("&Add Driver")
+ )
+ )
+ ),
+ `VStretch(),
+ `HBox
+ ( `TextEntry
+ ( `id(`description_input),
+ `opt(`hstretch),
+ // Label of a TextEntry for a short printer driver description (only one line):
+ _("Descri&ption"),
+ description
+ ),
+ `HSpacing( 2 ),
+ `TextEntry
+ ( `id(`location_input),
+ `opt(`hstretch),
+ // Label of a TextEntry for printer location string:
+ _("&Location"),
+ location
+ ),
+ `HSpacing( 2 ),
+ `CheckBox
+ ( `id(`set_as_default_checkbox),
+ // CheckBox to set a local print queues to be the default queue:
+ _("Set as &Default"),
+ is_default
+ )
+ )
+ );
Wizard::SetContentsButtons( caption,
contents,
HELPS["basic_modify_dialog"]:"",
@@ -429,6 +433,24 @@
{ commandline = commandline + " -L '" + location_input + "'";
something_has_changed = true;
}
+ boolean is_default_input = (boolean)UI::QueryWidget( `id(`set_as_default_checkbox), `Value);
+ if( is_default_input != is_default )
+ { something_has_changed = true;
+ if( is_default_input )
+ { // Acording to "man lpadmin" the "-d queue_name" setting does not work intermixed
+ // with other option settings so that a separate lpadmin command is called:
+ commandline = commandline + " ; /usr/sbin/lpadmin -h localhost -d '" + name + "'";
+ }
+ else
+ { // Currently it is not possible to unset from a queue to be the default queue,
+ // see http://www.cups.org/newsgroups.php?gcups.general+v:31874
+ // All one can do is set up a dummy queue, make it the default, and remove it.
+ // Here I assume blindly that no queue "qqqqqqqqqqqqqqqqqqqq" exists.
+ commandline = commandline + " ; /usr/sbin/lpadmin -h localhost -p qqqqqqqqqqqqqqqqqqqq -v file:/dev/null"
+ + " ; /usr/sbin/lpadmin -h localhost -d qqqqqqqqqqqqqqqqqqqq"
+ + " ; /usr/sbin/lpadmin -h localhost -x qqqqqqqqqqqqqqqqqqqq";
+ }
+ }
if( something_has_changed )
{ Wizard::DisableBackButton();
Wizard::DisableAbortButton();
@@ -438,7 +460,7 @@
// where %1 will be replaced by the queue name.
// Only a simple message because this error does not happen on a normal system
// (i.e. a system which is not totally broken or totally messed up).
- sformat( _("Failed to modify queue %1."), name )
+ sformat( _("Failed to modify %1."), name )
);
}
Wizard::EnableBackButton();
@@ -461,43 +483,11 @@
{ // Exit this dialog and go to the ConnectionWizardDialog via the sequencer in wizards.ycp:
break;
}
- if( ret == `driver_wizard )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when the "Driver Wizard" was selected:
- _("Not yet implemented"),
- // Body of a Popup::AnyMessage when the "Driver Wizard" was selected:
- _("The 'Driver Wizard' is not yet implemented.")
- );
- continue;
- }
- if( ret == `queue_state )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when "Enable/Disable" was selected:
- _("Not yet implemented"),
- // Body of a Popup::AnyMessage when "Enable/Disable" was selected:
- _("'Enable/Disable' is not yet implemented.")
- );
- continue;
- }
- if( ret == `error_policy )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when "Error Policy" was selected:
- _("Not yet implemented"),
- // Body of a Popup::AnyMessage when "Error Policy" was selected:
- _("'Error Policy' is not yet implemented.")
- );
- continue;
- }
- if( ret == `access_control )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when "Access Control" was selected:
+ if( ret == `add_driver )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when "Add Driver" was selected:
_("Not yet implemented"),
- // Body of a Popup::AnyMessage when "Access Control" was selected:
- _("'Access Control' is not yet implemented.")
- );
- continue;
- }
- if( ret == `other_options )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when "Other Options" was selected:
- _("Not yet implemented"),
- // Body of a Popup::AnyMessage when "Other Options" was selected:
- _("'Other Options' are not yet implemented.")
+ // Body of a Popup::AnyMessage when the "Add Driver" was selected:
+ _("The 'Add Driver' dialog is not yet implemented.")
);
continue;
}
@@ -509,7 +499,7 @@
{ Popup::AnyMessage( // Header of a Popup::AnyMessage when "Driver Options" was selected:
_("No driver options available"),
// Body of a Popup::AnyMessage when "Driver Options" was selected:
- _("Possible reasons: No print queue selected or it is a remote queue.")
+ _("Possible reasons: Nothing selected or it is a remote configuration.")
);
continue;
}
@@ -560,165 +550,6 @@
UI::FakeUserInput( `connection_selection );
continue;
}
- if( ret == `all_drivers )
- { y2milestone( "All drivers" );
- UI::ReplaceWidget( `id(`driver_filter_input_replace_point),
- `TextEntry( `id(`driver_filter_input),
- "",
- _("any model")
- )
- );
- UI::ReplaceWidget( `id(`driver_selection_replace_point),
- `SelectionBox( `id(`driver_selection),
- // By default there is no UserInput()
- // if only something was selected in the SelectionBox
- // (without clicking additionally a button)
- // but the notify option forces UserInput() in this case:
- `opt(`notify),
- "",
- prepend( Printer::DriverItems( "", false ),
- current_driver
- )
- )
- );
- continue;
- }
- if( ret == `more_drivers )
- { driver_filter_string = "";
- list driver_items = [];
- // The meaning of "more drivers" is "more based upon the current stage of the modify dialog".
- // Therefore set the model to the current content of the driver_filter_input_text
- // because depending on the history of the modify dialog the driver_filter_input_text
- // could be the NickName of the currenty used PPD
- // or the first (up to three) words of the description of the currenty used connection
- // or the model info of another (autodetected) connection
- // or whatever the user may have entered before:
- model = driver_filter_input_text;
- // Use the existing value of model because for each subsequent run of this more_drivers section
- // the existing value of model is shortened at the end (the last word is removed) to get
- // more and mor derivers for each subsequent run of this more_drivers section.
- y2milestone( "More drivers for '%1'", model );
- if( "" != model
- && "unknown" != tolower( model )
- )
- { // This should be no endless loop because sooner or later driver_filter_string becomes empty
- // because the model string becomes shorter and shorter but to be safe there is a maximum count:
- integer count = 0;
- while( size( driver_items ) < 1
- && count < 5
- )
- { count = count + 1;
- // If the model string does not contain a space,
- // model_words is a singleton list which contains only model.
- list <string> model_words = splitstring( model, " " );
- if( size( model_words ) < 2 )
- { // If there are less than two words (in particular if there is only one word left),
- // the remove below would result an empty model_words list which results
- // an empty driver_filter_string but the fall back to show all drivers is done below.
- break;
- }
- // Remove the last word (i.e. the last element in model_words):
- model_words = remove( model_words, size( model_words ) - 1 );
- // Build a new model and driver_filter_string with the remaining words:
- model = "";
- foreach( string word,
- model_words,
- { if( "" == model )
- { model = word;
- }
- else
- { model = model + " " + word;
- }
- }
- );
- driver_filter_string = filterchars( tolower( model ), Printer::lower_alnum_chars );
- if( "" != driver_filter_string )
- { // If a real search is done, match only at the beginning of the NickName entry in the PPD.
- // When driver_filter_string is empty is must stay empty (i.e. no "^" as driver_filter_string)
- // because Printer::DriverItems() tries to preselect a PPD if driver_filter_string is not empty.
- // When driver_filter_string is empty, the fall back to show all drivers is done below.
- driver_items = Printer::DriverItems( "^" + driver_filter_string, false );
- }
- if( size( driver_items ) < 1
- && size( model_words ) == 1
- )
- { // Nothing found with a driver_filter_string which was derived from only one word.
- // This can happen for example when the autodetected model string does not contain
- // the manufacturer, e.g. "Officejet 7200 series" (a leading "HP" is missing).
- // To make such a one-word-search (e.g. for "Officejet") less strict,
- // match anywhere in the NickName entry in the PPD (i.e. without leading '^'):
- driver_items = Printer::DriverItems( driver_filter_string, false );
- }
- }
- if( "" != driver_filter_string )
- { driver_filter_input_text = model;
- }
- }
- else
- { // Fall back to the manufacturer when the existing value of model cannot be used:
- string model = Printer::connections[Printer::selected_connections_index,"model"]:"";
- if( "" != model
- && "unknown" != tolower( model )
- )
- { // The first word in the driver_filter_string is usually the first word of the manufacturer name.
- // This fuzzy match is intended so that e.g. "Kyocera" and "Kyocera Mita" are the same.
- string manufacturer = splitstring( model, " " )[0]:"";
- if( "" != manufacturer )
- { // Even more fuzzieness for very ambiguous manufacturer names:
- if( "hewlett" == substring( tolower( driver_filter_string ), 0, 7 ) )
- { // Let "Hewlett-Packard", "Hewlett Packard", and "HP be the same:
- manufacturer = "HP";
- }
- if( "oki" == substring( tolower( driver_filter_string ), 0, 3 ) )
- { // Let "Oki", "Okidata", and "Okipage" be the same:
- manufacturer = "Oki";
- }
- driver_filter_string = filterchars( tolower( manufacturer ), Printer::lower_alnum_chars );
- driver_filter_input_text = manufacturer;
- }
- }
- // The driver_filter_string might be empty (e.g. when manufacturer = "unknown"):
- if( "" != driver_filter_string )
- { // Match only at the beginning of the NickName entry in the PPD:
- driver_items = Printer::DriverItems( "^" + driver_filter_string, false );
- if( size( driver_items ) < 1 )
- { // Nothing found with the above driver_filter_string.
- // To make the search less strict,
- // match anywhere in the NickName entry in the PPD (i.e. without leading '^'):
- driver_items = Printer::DriverItems( driver_filter_string, false );
- // Set an unspecific header (and not the specific manufacturer header):
- driver_filter_input_text = driver_filter_string;
- }
- }
- }
- if( size( driver_items ) < 1 )
- { // Nothing was found above.
- // Fall back to show all drivers:
- driver_items = Printer::DriverItems( "", false );
- // Header of a SelectionBox with a list of drivers:
- driver_filter_input_text = _("any model");
- }
- UI::ReplaceWidget( `id(`driver_filter_input_replace_point),
- `TextEntry( `id(`driver_filter_input),
- "",
- driver_filter_input_text
- )
- );
- UI::ReplaceWidget( `id(`driver_selection_replace_point),
- `SelectionBox( `id(`driver_selection),
- // By default there is no UserInput()
- // if only something was selected in the SelectionBox
- // (without clicking additionally a button)
- // but the notify option forces UserInput() in this case:
- `opt(`notify),
- "",
- prepend( driver_items,
- current_driver
- )
- )
- );
- continue;
- }
if( ret == `connection_selection )
{ integer selected_connection_index = (integer)UI::QueryWidget( `id(`connection_selection), `CurrentItem );
if( nil == selected_connection_index )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/connectionwizard.ycp new/yast2-printer-2.17.13/src/connectionwizard.ycp
--- old/yast2-printer-2.17.12/src/connectionwizard.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/connectionwizard.ycp 2008-09-12 14:21:12.000000000 +0200
@@ -82,6 +82,14 @@
// (i.e. the lower right button which results `next as UI::UserInput):
Label::OKButton()
);
+ // Show a user information because the current implementation provides
+ // only very primitive functionality compared to what is should provide
+ // according to http://en.opensuse.org/YaST/Development/Printer_Enhancement
+ Popup::AnyMessage( // Header of a Popup::AnyMessage because of a work-in-progress dialog:
+ _("Under Connstruction"),
+ // Body of a Popup::AnyMessage because of a work-in-progress dialog:
+ _("Currently this is is only a very basic 'placeholder'\nto have some dialog at all for the workflow.\nSee https://bugzilla.novell.com/show_bug.cgi?id=421192")
+ );
any ret = nil;
while(true)
{ ret = UI::UserInput();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/dialogs.ycp new/yast2-printer-2.17.13/src/dialogs.ycp
--- old/yast2-printer-2.17.12/src/dialogs.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/dialogs.ycp 2008-09-12 14:30:08.000000000 +0200
@@ -164,9 +164,9 @@
term widgetAutoconfig = `VBox(
`Left( `Label(_("Specify in which way USB printers are configured automatically")) ),
- `Left( `CheckBox(`id("configurenewprinters"), _("Enable Automatic Configuration of New Printers")) ),
- `Left( `CheckBox(`id("disableprintersonremoval"), _("Disable Printout when Disconnecting USB Printer")) ),
- `Left( `ComboBox(`id("defaultcupspolicy"), _("The name of the CUPS policy to assign to newly configured printers"), [""]) ),
+ `Left( `CheckBox(`id("configurenewprinters"), _("Enable &Automatic Configuration of New Printers")) ),
+ `Left( `CheckBox(`id("disableprintersonremoval"), _("&Disable Printout when Disconnecting USB Printer")) ),
+ `Left( `ComboBox(`id("defaultcupspolicy"), _("The name of the CUPS &policy to assign to newly configured printers"), [""]) ),
`HSpacing()
);
@@ -209,7 +209,7 @@
term widgetOperationPolicy = `VBox(
`Left( `Label(_("Specify the operation policy")) ),
- `Left( `ComboBox(`id("operationpolicy"), _("The operation policy"), [""]) ),
+ `Left( `ComboBox(`id("operationpolicy"), _("The operation &policy"), [""]) ),
`HSpacing()
);
@@ -270,7 +270,8 @@
"SHARING" : $[
"widget" : `custom,
"custom_widget" : widgetSharing,
- "help" : HELPS["sharing_dialog"]:""
+ "help" : HELPS["sharing_dialog"]:"",
+ "handle": handleSharing
],
"OPERATIONPOLICY" : $[
"widget" : `custom,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/overview.ycp new/yast2-printer-2.17.13/src/overview.ycp
--- old/yast2-printer-2.17.12/src/overview.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/overview.ycp 2008-09-12 11:01:38.000000000 +0200
@@ -43,45 +43,78 @@
include "printer/helps.ycp";
-term widgetOverview=
- `VBox(
- `Left(`HBox( `Label( _("Show") ), `HSpacing(),
- `CheckBox( `id(`local_content_checkbox),`opt(`notify), _("local queues")),
- `CheckBox( `id(`remote_content_checkbox),`opt(`notify), _("remote queues")))),
- `VWeight(2,`Table (`id (`overview_table), `opt (`notify, `immediate),
- `header( // Header of a Table column with a list of print queues.
- // Where the queue configuration exists (local or remote):
- _("Configuration"),
- // Header of a Table column with a list of print queues.
- // Print queue name:
- _("Name"),
- // Header of a Table column with a list of print queues.
- // Print queue description (e.g. model or driver):
- _("Description"),
- // Header of a Table column with a list of print queues.
- // Location of the printer (e.g. second floor, room 2.3):
- _("Location"),
- // Header of a Table column with a list of print queues.
- // Whether or not is is the default queue:
- _("Default"),
- // Header of a Table column with a list of print queues.
- // Queue status (accepting/rejecting and enabled/disabled):
- _("Status")
- )
-
- )),
- `HBox (
- `PushButton (`id (`add), Label::AddButton ()),
- `PushButton (`id (`edit), _("Configure")),
- `PushButton (`id (`delete), Label::DeleteButton ()),
- `HStretch (),
- `PushButton (`id (`refresh), _("Refresh list")),
- `PushButton (`id (`test), _("Print test page"))
+term widgetOverview = `VBox
+ ( `Left
+ ( `HBox
+ ( `Label( // Label for CheckBoxes to select local and/or remote print queues to be listed:
+ _("Show")
+ ),
+ `HSpacing(),
+ `CheckBox
+ ( `id(`local_content_checkbox),
+ `opt(`notify),
+ // CheckBox to select local print queues to be listed:
+ _("&Local")
+ ),
+ `CheckBox
+ ( `id(`remote_content_checkbox),
+ `opt(`notify),
+ // CheckBox to select remote print queues to be listed:
+ _("&Remote")
+ )
+ )
+ ),
+ `VWeight
+ ( 2,
+ `Table
+ ( `id(`overview_table),
+ `opt(`notify, `immediate),
+ `header
+ ( // Header of a Table column with a list of print queues.
+ // Where the queue configuration exists (local or remote):
+ _("Configuration"),
+ // Header of a Table column with a list of print queues.
+ // Print queue name:
+ _("Name"),
+ // Header of a Table column with a list of print queues.
+ // Print queue description (e.g. model or driver):
+ _("Description"),
+ // Header of a Table column with a list of print queues.
+ // Location of the printer (e.g. second floor, room 2.3):
+ _("Location"),
+ // Header of a Table column with a list of print queues.
+ // Whether or not is is the default queue:
+ _("Default"),
+ // Header of a Table column with a list of print queues.
+ // Queue status (accepting/rejecting and enabled/disabled):
+ _("Status")
+ )
+ )
+ ),
+ `HBox
+ ( `PushButton( `id(`add),
+ Label::AddButton()
+ ),
+ `PushButton( `id(`edit),
+ // PushButton label to modify an already configured print queue:
+ _("&Configure")),
+ `PushButton( `id(`delete),
+ Label::DeleteButton()
+ ),
+ `HStretch(),
+ `PushButton( `id(`refresh),
+ // PushButton label to refresh the list of print queues:
+ _("Re&fresh List")
+ ),
+ `PushButton( `id(`test),
+ // PushButton label to print a test page:
+ _("Print &Test Page")
+ )
)
- );
+ );
-void initOverview(string key){
- boolean local_content_selected = Printer::queue_filter_show_local;
+void initOverview( string key )
+{ boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
// Determine whether or not it is currently a real client_only config
@@ -98,9 +131,11 @@
{ // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
Printerlib::GetAndSetCupsdStatus( "start" );
}
- UI::ChangeWidget(`local_content_checkbox, `Value, local_content_selected);
- UI::ChangeWidget(`remote_content_checkbox, `Value, remote_content_selected);
- UI::ChangeWidget(`overview_table, `Items, Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote ));
+ UI::ChangeWidget( `local_content_checkbox, `Value, local_content_selected );
+ UI::ChangeWidget( `remote_content_checkbox, `Value, remote_content_selected );
+ UI::ChangeWidget( `overview_table, `Items,
+ Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
+ );
}
/**
@@ -109,220 +144,232 @@
* local and remote checkboxes,
* test button and refresh overview
*/
+symbol handleOverview( string key, map event )
+{ if( ( `remote_content_checkbox == event["ID"]:nil
+ || `local_content_checkbox == event["ID"]:nil
+ ) && "ValueChanged" == event["EventReason"]:""
+ )
+ { y2milestone( "Refreshing overview items" );
+ Printer::queue_filter_show_local = (boolean)UI::QueryWidget( `local_content_checkbox, `Value );
+ Printer::queue_filter_show_remote = (boolean)UI::QueryWidget( `remote_content_checkbox, `Value );
+ UI::ChangeWidget( `overview_table, `Items,
+ Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
+ );
+ }
-symbol handleOverview(string key, map event){
+ if( `refresh == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
+ { // The refresh functionality is useful after switching the Browsing mode.
+ // For example when a client-only config is switched to a "get Browsing info" config
+ // the BrowseInterval in cupsd.conf on remote CUPS servers is by default 30 seconds
+ // so that it takes by default up to 31 seconds before the Overview dialog can show
+ // all remote queues or any time longer depending on the BrowseInterval setting
+ // on the remote CUPS servers which necessitates an explicite [Refresh] button.
+ // Or the other way round when a "Get browsing info" config with a local cupsd
+ // was switched to a "No browsing info" config with a local running cupsd.
+ // The default BrowseTimeout value for the local cupsd is 5 minutes.
+ // Therefore it takes by default 5 minutes until printer information
+ // that was previously received by Browsing is removed (via timeout)
+ // from the local cupsd's list so that such kind of outdated remote queues
+ // are no longer shown in the Overview dialog.
+ UI::ChangeWidget( `overview_table, `Items,
+ Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
+ );
+ }
- if (event["EventReason"]:""=="ValueChanged" && (event["ID"]:nil==`remote_content_checkbox || event["ID"]:nil==`local_content_checkbox)){
- y2milestone("Refreshing overview items");
- Printer::queue_filter_show_local = (boolean)UI::QueryWidget(`local_content_checkbox, `Value);
- Printer::queue_filter_show_remote = (boolean)UI::QueryWidget(`remote_content_checkbox, `Value);
- UI::ChangeWidget(`overview_table, `Items, Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote ));
- }
-
- integer selected_queue_index = (integer)UI::QueryWidget( `id(`overview_table), `CurrentItem );
-
- if( `refresh == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
- { // The refresh functionality is useful after switching the Browsing mode.
- // For example when a client-only config is switched to a "get Browsing info" config
- // the BrowseInterval in cupsd.conf on remote CUPS servers is by default 30 seconds
- // so that it takes by default up to 31 seconds before the Overview dialog can show
- // all remote queues or any time longer depending on the BrowseInterval setting
- // on the remote CUPS servers which necessitates an explicite [Refresh] button.
- // Or the other way round when a "Get browsing info" config with a local cupsd
- // was switched to a "No browsing info" config with a local running cupsd.
- // The default BrowseTimeout value for the local cupsd is 5 minutes.
- // Therefore it takes by default 5 minutes until printer information
- // that was previously received by Browsing is removed (via timeout)
- // from the local cupsd's list so that such kind of outdated remote queues
- // are no longer shown in the Overview dialog.
- UI::ChangeWidget(`overview_table, `Items, Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote ));
- }
-
- if (event["EventReason"]:"" == "Activated" && event["ID"]:nil == `delete){
- string queue_name = Printer::queues[selected_queue_index,"name"]:"";
- if( "" == queue_name )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected:
- _("No Queue Selected"),
- // Body of a Popup::AnyMessage when no queue was selected:
- _("Select a queue.")
- );
- return nil;
- }
- if( "local" != Printer::queues[selected_queue_index,"config"]:"remote" )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when a remote queue was selected to be deleted:
- _("Cannot Delete"),
- // Body of a Popup::AnyMessage when a remote queue was selected to be deleted:
- _("This is a remote queue. Only local queues can be deleted.")
- );
- return nil;
- }
- if (Popup::AnyQuestion( // Header of a confirmation popup before a queue will be deleted:
- _("Confirm Deletion"),
- // Body of a confirmation popup before a queue will be deleted:
- _("The queue would be deleted immediately and cannot be restored."),
- // 'Yes' button label of a confirmation popup before a queue will be deleted:
- sformat( _("Delete queue %1"), queue_name ),
- // 'No' button label of a confirmation popup before a queue will be deleted:
- _("Do not delete it"),
- `focus_no
- ))
- { // To be safe invalidate Printer::selected_queues_index in any case:
- Printer::selected_queues_index = -1;
- y2milestone( "To be deleted:'%1', selected_queue_index = %2", queue_name, selected_queue_index );
- if( ! Printer::DeleteQueue( queue_name ) )
- { Popup::Error( // Message of a Popup::Error
- // where %1 will be replaced by the queue name.
- // Only a simple message because before the function Printer::DeleteQueue
- // was called and this function would have shown more specific messages.
- sformat( _("Failed to delete queue %1."), queue_name )
- );
- }
- // Re-run the OverviewDialog (with a re-created list of queues) via the sequencer:
- return `delete;
- }
+ // After the above changes of the list of queues, determine which queue is currently selected
+ // (because this might change via automated preselection when the table was made anew)
+ // and enable or disable the "Edit", "Delete", and "Test" buttons accordingly.
+ // "Edit" and "Delete" are only possible for local queues, "Test" is also possible for remote queues
+ // (i.e. "Test" is only disabled when there is no queue selected or no queue in the table):
+ integer selected_queue_index = (integer)UI::QueryWidget( `id(`overview_table), `CurrentItem );
+ if( selected_queue_index == nil || selected_queue_index < 0 )
+ { // To be safe invalidate Printer::selected_queues_index when no queue exists:
+ Printer::selected_queues_index = -1;
+ UI::ChangeWidget( `test, `Enabled, false );
+ }
+ else
+ { UI::ChangeWidget( `test, `Enabled, true );
+ // To be safe enable the modify and delete buttons only when it is explicitely verified
+ // that the "config" is "local", otherwise have those buttons disabled by fallback:
+ if( Printer::queues[selected_queue_index,"config"]:"remote" == "local" )
+ { Printer::selected_queues_index = selected_queue_index;
+ }
+ else
+ { // To be safe invalidate Printer::selected_queues_index when a remote queue is selected:
+ Printer::selected_queues_index = -1;
+ // Disable the modify and delete buttons when a remote queue is selected and by fallback:
}
+ }
+ UI::ChangeWidget(`edit, `Enabled, Printer::selected_queues_index >= 0 );
+ UI::ChangeWidget(`delete, `Enabled, Printer::selected_queues_index >= 0 );
- if (event["EventReason"]:"" == "Activated" && event["ID"]:nil == `test){
- y2milestone("printing test page");
- string queue_name = "";
- queue_name = Printer::queues[selected_queue_index,"name"]:"";
- if( "" == queue_name )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected:
- _("No Queue Selected"),
- // Body of a Popup::AnyMessage when no queue was selected:
- _("Select a queue.")
- );
- return nil;
- }
- if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:"no" )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when the queue rejects print jobs:
- _("Rejecting Print Jobs"),
- // Body of a Popup::AnyMessage when the queue rejects print jobs:
- _("The testpage cannot be printed because print jobs are rejected.")
- );
- return nil;
- }
- if( "yes" == Printer::queues[selected_queue_index,"disabled"]:"no" )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when printing is disabled for the queue:
- _("Printout Disabled"),
- // Body of a Popup::AnyMessage when printing is disabled for the queue:
- _("The testpage cannot be printed because printout is disabled.")
- );
- return nil;
- }
- if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
- { Printer::selected_queues_index = selected_queue_index;
- }
- if( ! Printerlib::ExecuteBashCommand( "/usr/bin/lp -d '"
- + queue_name
- + "' -o page-label=\"Testprint:$(hostname)\" /usr/share/cups/data/testprint.ps"
- )
- )
+ if( `delete == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
+ { string queue_name = Printer::queues[selected_queue_index,"name"]:"";
+ if( "" == queue_name )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected from the list:
+ _("Nothing Selected"),
+ // Body of a Popup::AnyMessage when no queue was selected from the list:
+ _("Select an entry.")
+ );
+ return nil;
+ }
+ if( "local" != Printer::queues[selected_queue_index,"config"]:"remote" )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when a remote queue was selected to be deleted:
+ _("Cannot Delete"),
+ // Body of a Popup::AnyMessage when a remote queue was selected to be deleted:
+ _("This is a remote configuration. Only local configurations can be deleted.")
+ );
+ return nil;
+ }
+ if( Popup::AnyQuestion( // Header of a confirmation popup before a queue will be deleted:
+ _("Confirm Deletion"),
+ // Body of a confirmation popup before a queue will be deleted:
+ _("The selected configuration would be deleted immediately and cannot be restored."),
+ // 'Yes' button label of a confirmation popup before a queue will be deleted:
+ sformat( _("Delete configuration %1"), queue_name ),
+ // 'No' button label of a confirmation popup before a queue will be deleted:
+ _("Do not delete it"),
+ `focus_no
+ )
+ )
+ { // To be safe invalidate Printer::selected_queues_index in any case:
+ Printer::selected_queues_index = -1;
+ y2milestone( "To be deleted:'%1', selected_queue_index = %2", queue_name, selected_queue_index );
+ if( ! Printer::DeleteQueue( queue_name ) )
{ Popup::Error( // Message of a Popup::Error
// where %1 will be replaced by the queue name.
- // Only a simple message because this error does not happen on a normal system
- // (i.e. a system which is not totally broken or totally messed up).
- sformat( _("Failed to print testpage for queue %1."), queue_name )
+ // Only a simple message because before the function Printer::DeleteQueue
+ // was called and this function would have shown more specific messages.
+ sformat( _("Failed to delete configuration %1."), queue_name )
);
}
- else
- { Popup::TimedMessage( // Popup message
- // where %1 will be replaced by the queue name.
- sformat( _("Sent testpage to queue %1. Is should start to print soon."), queue_name ),
- 60
- );
- }
- return nil;
- }
+ // Re-run the OverviewDialog (with a re-created list of queues) via the sequencer:
+ return `delete;
+ }
+ }
- if (event["EventReason"]:"" == "Activated" && event["ID"]:nil == `add){
- // Determine whether or not it is a real client_only config
- // (i.e. a ServerName != "localhost/127.0.0.1" in /etc/cups/client.conf).
- // There is no new Printerlib::DetermineClientOnly() here because
- // it was run in initOverview() and the client_only state cannot be
- // changed in YaST while the Overview dialog runs:
- if( Printerlib::client_only )
- { if( ! Popup::YesNoHeadline( // PopupYesNoHeadline headline
- // where %1 will be replaced by the server name:
- sformat( _("Disable remote CUPS server '%1'"), Printerlib::client_conf_server_name ),
- // PopupYesNoHeadline body:
- _("A remote CUPS server setting conflicts with adding a print queue.")
- )
- )
- return nil;
- // Remove the 'ServerName' entry in /etc/cups/client.conf:
- if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
- { Report::Error( // Message of a Report::Error.
- // Only a simple message because this error does not happen on a normal system
- // (i.e. a system which is not totally broken or totally messed up).
- _("Failed to remove the 'ServerName' entry in /etc/cups/client.conf")
+ if( `test == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
+ { y2milestone( "printing test page" );
+ string queue_name = "";
+ queue_name = Printer::queues[selected_queue_index,"name"]:"";
+ if( "" == queue_name )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected from the list:
+ _("Nothing Selected"),
+ // Body of a Popup::AnyMessage when no queue was selected from the list:
+ _("Select an entry.")
+ );
+ return nil;
+ }
+ if( "yes" == Printer::queues[selected_queue_index,"rejecting"]:"no" )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when the queue rejects print jobs:
+ _("Rejecting Print Jobs"),
+ // Body of a Popup::AnyMessage when the queue rejects print jobs:
+ _("The testpage cannot be printed because print jobs are rejected.")
);
- return nil;
- }
- }
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // No local running cupsd is accessible.
- // Do a restart to be safe.
- // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
- if( ! Printerlib::GetAndSetCupsdStatus( "restart" ) )
- { return nil;
- }
- }
- // To be safe autodetect the queues again.
- // When there was a switch from "client only" to a local running cupsd
- // existing local queues are not yet know so that the NewQueueName function
- // may not notice when a queue name proposal for a new (i.e. added) queue
- // already exists as local queue:
- Printer::AutodetectQueues();
- return `add;
- }
-
- if (event["EventReason"]:"" == "Activated" && event["ID"]:nil == `edit){
- string queue_name = Printer::queues[selected_queue_index,"name"]:"";
- if( "" == queue_name )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected:
- _("No Queue Selected"),
- // Body of a Popup::AnyMessage when no queue was selected:
- _("Select a queue.")
- );
return nil;
+ }
+ if( "yes" == Printer::queues[selected_queue_index,"disabled"]:"no" )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when printing is disabled for the queue:
+ _("Printout Disabled"),
+ // Body of a Popup::AnyMessage when printing is disabled for the queue:
+ _("The testpage cannot be printed because printout is disabled.")
+ );
+ return nil;
+ }
+ if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
+ { Printer::selected_queues_index = selected_queue_index;
+ }
+ if( ! Printerlib::ExecuteBashCommand( "/usr/bin/lp -d '"
+ + queue_name
+ + "' -o page-label=\"Testprint:$(hostname)\" /usr/share/cups/data/testprint.ps"
+ )
+ )
+ { Popup::Error( // Message of a Popup::Error
+ // where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system
+ // (i.e. a system which is not totally broken or totally messed up).
+ sformat( _("Failed to print testpage for %1."), queue_name )
+ );
+ return nil;
+ }
+ Popup::TimedMessage( // Popup message
+ // where %1 will be replaced by the queue name.
+ sformat( _("Sent testpage to %1. Is should start to print soon."), queue_name ),
+ 60
+ );
+ return nil;
+ }
+
+ if( `add == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
+ { // Determine whether or not it is a real client_only config
+ // (i.e. a ServerName != "localhost/127.0.0.1" in /etc/cups/client.conf).
+ // There is no new Printerlib::DetermineClientOnly() here because
+ // it was run in initOverview() and the client_only state cannot be
+ // changed in YaST while the Overview dialog runs:
+ if( Printerlib::client_only )
+ { if( ! Popup::YesNoHeadline( // PopupYesNoHeadline headline
+ // where %1 will be replaced by the server name:
+ sformat( _("Disable remote CUPS server '%1'"), Printerlib::client_conf_server_name ),
+ // PopupYesNoHeadline body:
+ _("A remote CUPS server setting conflicts with adding a configuration.")
+ )
+ )
+ { return nil;
}
- if( "local" != Printer::queues[selected_queue_index,"config"]:"remote" )
- { Popup::AnyMessage( // Header of a Popup::AnyMessage when a remote queue was selected to be modified:
- _("Cannot Modify"),
- // Body of a Popup::AnyMessage when a remote queue was selected to be modified:
- _("This is a remote queue. Only local queues can be modified.")
- );
+ // Remove the 'ServerName' entry in /etc/cups/client.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
+ { Report::Error( // Message of a Report::Error.
+ // Only a simple message because this error does not happen on a normal system
+ // (i.e. a system which is not totally broken or totally messed up).
+ _("Failed to remove the 'ServerName' entry in /etc/cups/client.conf")
+ );
return nil;
}
- Printer::selected_queues_index = selected_queue_index;
- y2milestone( "To be modified: '%1', selected_queues_index = %2", queue_name, Printer::selected_queues_index );
- return `modify;
}
+ if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // No local running cupsd is accessible.
+ // Do a restart to be safe.
+ // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
+ if( ! Printerlib::GetAndSetCupsdStatus( "restart" ) )
+ { return nil;
+ }
+ }
+ // To be safe autodetect the queues again.
+ // When there was a switch from "client only" to a local running cupsd
+ // existing local queues are not yet know so that the NewQueueName function
+ // may not notice when a queue name proposal for a new (i.e. added) queue
+ // already exists as local queue:
+ Printer::AutodetectQueues();
+ return `add;
+ }
- if( selected_queue_index == nil || selected_queue_index < 0 )
- { // To be safe invalidate Printer::selected_queues_index when no queue exists:
- Printer::selected_queues_index = -1;
- } else{
- // To be safe enable the modify and delete buttons only when it is explicitely verified
- // that the "config" is "local", otherwise have those buttons disabled by fallback:
- if( Printer::queues[selected_queue_index,"config"]:"remote" == "local" )
- {
- Printer::selected_queues_index = selected_queue_index;
+ if( `edit == event["ID"]:nil && event["EventReason"]:"" == "Activated" )
+ { string queue_name = Printer::queues[selected_queue_index,"name"]:"";
+ if( "" == queue_name )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when no queue was selected from the list:
+ _("Nothing Selected"),
+ // Body of a Popup::AnyMessage when no queue was selected from the list:
+ _("Select an entry.")
+ );
+ return nil;
}
- else
- { // To be safe invalidate Printer::selected_queues_index when a remote queue is selected:
- Printer::selected_queues_index = -1;
- // Disable the modify and delete buttons when a remote queue is selected and by fallback:
+ if( "local" != Printer::queues[selected_queue_index,"config"]:"remote" )
+ { Popup::AnyMessage( // Header of a Popup::AnyMessage when a remote queue was selected to be modified:
+ _("Cannot Modify"),
+ // Body of a Popup::AnyMessage when a remote queue was selected to be modified:
+ _("This is a remote configuration. Only local configurations can be modified.")
+ );
+ return nil;
}
+ Printer::selected_queues_index = selected_queue_index;
+ y2milestone( "To be modified: '%1', selected_queues_index = %2", queue_name, Printer::selected_queues_index );
+ return `modify;
}
- UI::ChangeWidget(`edit, `Enabled, Printer::selected_queues_index>-1);
- UI::ChangeWidget(`delete, `Enabled, Printer::selected_queues_index>-1);
- UI::ChangeWidget(`test, `Enabled, selected_queue_index>-1);
- return nil;
-}
-
+ // Default and fallback return value:
+ return nil;
+}
/* EOF */
}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/Printerlib.ycp new/yast2-printer-2.17.13/src/Printerlib.ycp
--- old/yast2-printer-2.17.12/src/Printerlib.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/Printerlib.ycp 2008-09-12 11:12:05.000000000 +0200
@@ -1,3 +1,32 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/printer/Printerlib.ycp
+ * Package: Configuration of printer
+ * Summary: Common functionality
+ * Authors: Michal Zugec
+ * Johannes Meixner
+ *
+ * $Id: Printerlib.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/printingvianetwork.ycp new/yast2-printer-2.17.13/src/printingvianetwork.ycp
--- old/yast2-printer-2.17.12/src/printingvianetwork.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/printingvianetwork.ycp 2008-09-12 11:20:43.000000000 +0200
@@ -778,6 +778,13 @@
sleep( 1000 );
Popup::ClearFeedback();
}
+ else
+ { // Regardles of the ApplyNetworkPrintingSettings result,
+ // when something was to be changed,
+ // enforce to show also remote queues in the "Overview"
+ // in particular when no local queues were shown before:
+ Printer::queue_filter_show_remote = true;
+ }
y2milestone( "leaving storeNetworkPrinting" );
return nil;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/src/sharing.ycp new/yast2-printer-2.17.13/src/sharing.ycp
--- old/yast2-printer-2.17.12/src/sharing.ycp 2008-09-10 15:34:10.000000000 +0200
+++ new/yast2-printer-2.17.13/src/sharing.ycp 2008-09-12 14:30:08.000000000 +0200
@@ -72,7 +72,7 @@
),
`VSpacing( 1 ),
`Left( `Label( _("Via network interfaces specified below") )),
- `Table( `header( _("Interface"),
+ `Table( `id(`interface_table), `header( _("Interface"),
_("Publish printers by default via this interface")
),
[ `item( `id(0), "eth0", "no" ),
@@ -86,7 +86,7 @@
),
`VSpacing( 1 ),
`Left( `Label( _("For hosts / networks specified below") ) ),
- `Table( `header( _("IP address"),
+ `Table( `id(`ip_table), `header( _("IP address"),
_("Publish printers by default for this address")
),
[ `item( `id(0), "192.168.100.1", "yes" ),
@@ -105,7 +105,21 @@
`VSpacing( 1 )
);
-
+symbol handleSharing(string key, map event){
+ boolean share = (UI::QueryWidget(`deny_or_allow_remote_access, `CurrentButton)==`allow_remote_access_radio_button);
+ UI::ChangeWidget(`allow_local_network_access_check_box, `Enabled, share);
+ UI::ChangeWidget(`publish_to_local_network_check_box, `Enabled, share);
+ UI::ChangeWidget(`interface_table, `Enabled, share);
+ UI::ChangeWidget(`add_interface, `Enabled, share);
+ UI::ChangeWidget(`edit_interface, `Enabled, share);
+ UI::ChangeWidget(`delete_interface, `Enabled, share);
+ UI::ChangeWidget(`ip_table, `Enabled, share);
+ UI::ChangeWidget(`add_ip, `Enabled, share);
+ UI::ChangeWidget(`edit_ip, `Enabled, share);
+ UI::ChangeWidget(`delete_ip, `Enabled, share);
+y2internal("event %1", event);
+ return nil;
+}
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.12/VERSION new/yast2-printer-2.17.13/VERSION
--- old/yast2-printer-2.17.12/VERSION 2008-09-11 15:17:38.000000000 +0200
+++ new/yast2-printer-2.17.13/VERSION 2008-09-12 13:07:32.000000000 +0200
@@ -1 +1 @@
-2.17.12
+2.17.13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org