Hello community,
here is the log from the commit of package yast2-printer
checked in at Tue Nov 18 14:18:38 CET 2008.
--------
--- yast2-printer/yast2-printer.changes 2008-11-06 17:43:47.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2008-11-18 00:13:28.800251000 +0100
@@ -1,0 +2,67 @@
+Fri Nov 14 15:55:55 CET 2008 - mzugec@suse.cz
+
+- autoconfigure local printers during installation (bnc#437735)
+- 2.17.41
+
+-------------------------------------------------------------------
+Fri Nov 14 11:27:48 CET 2008 - jsmeix@suse.de
+
+- Fixed "client-only" handling in the dialogs of the DialogTree
+ (Printing via Network, Sharing, Policies, Autoconfig).
+- Fixed testpage printing commands (added "-h localhost").
+- 2.17.40
+
+-------------------------------------------------------------------
+Thu Nov 13 18:21:42 CET 2008 - jsmeix@suse.de
+
+- Fixed testpage printing, made it more fail safe.
+- 2.17.39
+
+-------------------------------------------------------------------
+Thu Nov 13 14:27:52 CET 2008 - jsmeix@suse.de
+
+- Fixed removal of the "Cancel" button from the Overview dialog
+ so that also in ncurses mode the other dialogs in the DialogTree
+ get the button with the "cancel" functionality re-enabled.
+- Avoid unexpected side-effects of Package::Remove.
+- Fixed "Trigger Automatic Configuration" in Autoconfig dialog
+ by enabling the automatic configuration if the trigger is "on".
+- 2.17.38
+
+-------------------------------------------------------------------
+Thu Nov 13 11:27:13 CET 2008 - jsmeix@suse.de
+
+- In Sharing dialog fixed removing all BrowseAddress values
+ and made it more user-friendly to change from
+ "deny any remote access" to "allow remote access".
+- Added "Trigger Automatic Configuration" to Autoconfig dialog.
+- Removed the "Cancel" button from the Overview dialog
+ because there is nothing to cancel here.
+- Implemented the fixed functionality of the "Cancel" button
+ in the non-initial dialogs of the DialogTree correctly
+ (see below Wed Nov 12 12:52:57 CET 2008).
+- 2.17.37
+
+-------------------------------------------------------------------
+Wed Nov 12 14:55:36 CET 2008 - jsmeix@suse.de
+
+- Remove the queue if it was only partially added and removed
+ duplicate error messages when adding or deleting a queue.
+- Enforced a consistent meaning of the "OK" button
+ (see Novell/Suse Bugzilla bnc#443676).
+- 2.17.36
+
+-------------------------------------------------------------------
+Wed Nov 12 12:52:57 CET 2008 - jsmeix@suse.de
+
+- Added captions and the printer icon to the dialog header line
+ (see Novell/Suse Bugzilla bnc#438198).
+- Fixed functionality of the "Cancel" button in the non-initial
+ dialogs of the DialogTree (Printing via Network, Sharing,
+ Policies, Autoconfig) so that the "Cancel" button goes
+ now "back" to the Overview according to the new style guide.
+ Only the "Cancel" button in the initial Overview dialog
+ exits the whole module.
+- 2.17.35
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-printer-2.17.34.tar.bz2
New:
----
yast2-printer-2.17.41.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.Ti4198/_old 2008-11-18 14:18:13.000000000 +0100
+++ /var/tmp/diff_new_pack.Ti4198/_new 2008-11-18 14:18:13.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.17.34)
+# spec file for package yast2-printer (Version 2.17.41)
#
# 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.34
+Version: 2.17.41
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.17.34.tar.bz2
+Source0: yast2-printer-2.17.41.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.34
+%setup -n yast2-printer-2.17.41
%build
%{prefix}/bin/y2tool y2autoconf
@@ -117,7 +117,54 @@
%doc %{prefix}/share/doc/packages/yast2-printer
%exclude %{prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{prefix}/share/doc/packages/yast2-printer/README
+
%changelog
+* Fri Nov 14 2008 mzugec@suse.cz
+- autoconfigure local printers during installation (bnc#437735)
+- 2.17.41
+* Fri Nov 14 2008 jsmeix@suse.de
+- Fixed "client-only" handling in the dialogs of the DialogTree
+ (Printing via Network, Sharing, Policies, Autoconfig).
+- Fixed testpage printing commands (added "-h localhost").
+- 2.17.40
+* Thu Nov 13 2008 jsmeix@suse.de
+- Fixed testpage printing, made it more fail safe.
+- 2.17.39
+* Thu Nov 13 2008 jsmeix@suse.de
+- Fixed removal of the "Cancel" button from the Overview dialog
+ so that also in ncurses mode the other dialogs in the DialogTree
+ get the button with the "cancel" functionality re-enabled.
+- Avoid unexpected side-effects of Package::Remove.
+- Fixed "Trigger Automatic Configuration" in Autoconfig dialog
+ by enabling the automatic configuration if the trigger is "on".
+- 2.17.38
+* Thu Nov 13 2008 jsmeix@suse.de
+- In Sharing dialog fixed removing all BrowseAddress values
+ and made it more user-friendly to change from
+ "deny any remote access" to "allow remote access".
+- Added "Trigger Automatic Configuration" to Autoconfig dialog.
+- Removed the "Cancel" button from the Overview dialog
+ because there is nothing to cancel here.
+- Implemented the fixed functionality of the "Cancel" button
+ in the non-initial dialogs of the DialogTree correctly
+ (see below Wed Nov 12 12:52:57 CET 2008).
+- 2.17.37
+* Wed Nov 12 2008 jsmeix@suse.de
+- Remove the queue if it was only partially added and removed
+ duplicate error messages when adding or deleting a queue.
+- Enforced a consistent meaning of the "OK" button
+ (see Novell/Suse Bugzilla bnc#443676).
+- 2.17.36
+* Wed Nov 12 2008 jsmeix@suse.de
+- Added captions and the printer icon to the dialog header line
+ (see Novell/Suse Bugzilla bnc#438198).
+- Fixed functionality of the "Cancel" button in the non-initial
+ dialogs of the DialogTree (Printing via Network, Sharing,
+ Policies, Autoconfig) so that the "Cancel" button goes
+ now "back" to the Overview according to the new style guide.
+ Only the "Cancel" button in the initial Overview dialog
+ exits the whole module.
+- 2.17.35
* Thu Nov 06 2008 jsmeix@suse.de
- Fixed a quoting bug in the Modify queue dialog.
- Renamed buttons according to the new style guide
++++++ yast2-printer-2.17.34.tar.bz2 -> yast2-printer-2.17.41.tar.bz2 ++++++
++++ 6747 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/configure.in new/yast2-printer-2.17.41/configure.in
--- old/yast2-printer-2.17.34/configure.in 2008-11-06 17:41:27.000000000 +0100
+++ new/yast2-printer-2.17.41/configure.in 2008-11-14 15:46:26.000000000 +0100
@@ -1,9 +1,9 @@
dnl configure.in for yast2-printer
dnl
-dnl -- This file is generated by y2autoconf 2.16.7 - DO NOT EDIT! --
+dnl -- This file is generated by y2autoconf 2.17.0 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.17.34, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.17.36, 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.34"
+VERSION="2.17.36"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/autoconfig.ycp new/yast2-printer-2.17.41/src/autoconfig.ycp
--- old/yast2-printer-2.17.34/src/autoconfig.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/autoconfig.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -66,6 +66,7 @@
// because initAutoconfig checks if cups-autoconfig is installed
// and if not it tries to install it.
`id("cups_autoconfig_remove"),
+ `opt(`notify),
// CheckBox to have no automatic configuration of USB printers at all
// by removing the cups-autoconfig RPM package.
// Do not change or translate "cups-autoconfig", it is a RPM package name.
@@ -77,7 +78,8 @@
`VSpacing( 1 ),
`Left
( `CheckBox
- ( `id("cups_autoconfig_configure_new_attachend"),
+ ( `id("cups_autoconfig_configure_new_attached"),
+ `opt(`notify),
// CheckBox to enable that a print queue is automatically created
// when a USB printer is connected for the first time to the USB:
_("Enable &Automatic Configuration of New Attachend USB Printers")
@@ -100,6 +102,17 @@
_("Operation &Policy for Automatically Configured USB Printers"),
[""]
)
+ ),
+ // Have space between the settings for automatic configuration
+ // and the choice to "Trigger Automatic Configuration":
+ `VSpacing( 1 ),
+ `Left
+ ( `CheckBox
+ ( `id("cups_autoconfig_trigger"),
+ `opt(`notify),
+ // CheckBox to trigger that print queues are automatically created right now:
+ _("&Trigger Automatic Configuration")
+ )
)
)
)
@@ -107,17 +120,65 @@
void initAutoconfig( string key )
{ y2milestone( "entering initAutoconfig with key '%1'", key );
- // The whole Autoconfig Settings dialog is useless without having cups-autoconfig installed.
+ boolean autoconfig_settings_dialog_is_useless = false;
+ // The whole Autoconfig Settings dialog is useless if it is a "client-only" config.
+ // Determine whether or not it is currently a real client-only config
+ // (i.e. a ServerName != "localhost/127.0.0.1" in /etc/cups/client.conf)
+ // and ignore when it fails (i.e. use the fallback value silently):
+ Printerlib::DetermineClientOnly();
+ if( Printerlib::client_only )
+ { if( ! Popup::YesNoHeadline( sformat( // PopupYesNoHeadline headline
+ // where %1 will be replaced by the server name:
+ _("Disable remote CUPS server '%1'"),
+ Printerlib::client_conf_server_name
+ ),
+ // PopupYesNoHeadline body:
+ _("A remote CUPS server setting conflicts with automatic configuration of printers for the local system.")
+ )
+ )
+ { autoconfig_settings_dialog_is_useless = true;
+ y2milestone( "autoconfig_settings_dialog_is_useless because user decided not to disable client-only CUPS server '%1'",
+ Printerlib::client_conf_server_name
+ );
+ }
+ else
+ { // Remove the 'ServerName' entry in /etc/cups/client.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message:
+ _("Failed to remove the 'ServerName' entry in /etc/cups/client.conf"),
+ Printerlib::result["stderr"]:"" + "\n" + Printerlib::result["stdout"]:""
+ );
+ autoconfig_settings_dialog_is_useless = true;
+ y2milestone( "putoconfig_settings_dialog_is_useless because it failed to disable client-only CUPS server '%1'",
+ Printerlib::client_conf_server_name
+ );
+ }
+ }
+ }
+ // When it is no "client-only" config,
+ // determine whether or not a local cupsd is accessible:
+ if( ! autoconfig_settings_dialog_is_useless )
+ { if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
+ if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
+ { autoconfig_settings_dialog_is_useless = true;
+ y2milestone( "autoconfig_settings_dialog_is_useless because 'rccups start' failed." );
+ }
+ }
+ }
+ // When it is no "client-only" config and when a local cupsd is accessible,
+ // the whole dialog is still useless without having cups-autoconfig installed.
// Therefore check if cups-autoconfig is installed and if not try to install it.
// It is perfectly o.k. when the user rejects cups-autoconfig to be installed
// (perhaps he selected it to be removed before in this dialog
// and re-launched this dialog by accident or to check the current setting).
// Therefore there is no additional message shown here when the dialog is useless
// because there was a Popup request that cups-autoconfig must be installed.
- boolean autoconfig_settings_dialog_is_useless = false;
- if( ! Printerlib::TestAndInstallPackage( "cups-autoconfig", "installed" ) )
- { if( ! Printerlib::TestAndInstallPackage( "cups-autoconfig", "install" ) )
- { autoconfig_settings_dialog_is_useless = true;
+ if( ! autoconfig_settings_dialog_is_useless )
+ { if( ! Printerlib::TestAndInstallPackage( "cups-autoconfig", "installed" ) )
+ { if( ! Printerlib::TestAndInstallPackage( "cups-autoconfig", "install" ) )
+ { autoconfig_settings_dialog_is_useless = true;
+ }
}
}
UI::ChangeWidget( `id("cups_autoconfig_remove"), `Value, autoconfig_settings_dialog_is_useless );
@@ -126,18 +187,18 @@
// fallback values in particular when the cups-autoconfig RPM is not installed.
// By default the ConfigureNewPrinters value in /etc/cups-autoconfig.conf is set to "yes":
initial_cups_autoconfig_ConfigureNewPrinters = true;
- Printerlib::ExecuteBashCommand( "grep -i '^ConfigureNewPrinters' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
+ Printerlib::ExecuteBashCommand( "grep -i '^[[:space:]]*ConfigureNewPrinters' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
if( "no" == tolower( Printerlib::result["stdout"]:"yes" ) )
{ initial_cups_autoconfig_ConfigureNewPrinters = false;
}
// By default the DisablePrintersOnRemoval value in /etc/cups-autoconfig.conf is set to "no":
initial_cups_autoconfig_DisablePrintersOnRemoval = false;
- Printerlib::ExecuteBashCommand( "grep -i '^DisablePrintersOnRemoval' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
+ Printerlib::ExecuteBashCommand( "grep -i '^[[:space:]]*DisablePrintersOnRemoval' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
if( "yes" == tolower( Printerlib::result["stdout"]:"no" ) )
{ initial_cups_autoconfig_DisablePrintersOnRemoval = true;
}
// By default the DefaultCUPSPolicy value in /etc/cups-autoconfig.conf is set to the empty string:
- Printerlib::ExecuteBashCommand( "grep -i '^DefaultCUPSPolicy' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
+ Printerlib::ExecuteBashCommand( "grep -i '^[[:space:]]*DefaultCUPSPolicy' /etc/cups-autoconfig.conf | cut -s -d '=' -f2 | tr -d -c '[:alnum:]'" );
initial_cups_autoconfig_DefaultCUPSPolicy = tolower( Printerlib::result["stdout"]:"" );
// By default the DefaultCUPSPolicy value in /etc/cups-autoconfig.conf is set to the empty string.
// Therefore an empty policy name could be added as additional possible value
@@ -151,7 +212,7 @@
}
// Set the different values for the different widgets in the dialog
// and use the default values as fallback values:
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"), `Value, initial_cups_autoconfig_ConfigureNewPrinters );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Value, initial_cups_autoconfig_ConfigureNewPrinters );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Value, initial_cups_autoconfig_DisablePrintersOnRemoval );
// Determine the existing policy names in '<Policy policy-name>' sections in /etc/cups/cupsd.conf:
list< string > operation_policy_names = [ "" ];
@@ -178,20 +239,22 @@
else
{ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Value, "not set" );
}
+ // The CheckBox to trigger automatic configuration is initially always off:
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ // Disable all widgets if autoconfig_settings_dialog_is_useless:
if( autoconfig_settings_dialog_is_useless )
{ UI::ChangeWidget( `id("cups_autoconfig_remove"), `Enabled, false );
UI::ChangeWidget( `id("cups_autoconfig_label"), `Enabled, false );
- UI::ChangeWidget( `id("cups_autoconfig_configure_new_attachend"), `Enabled, false );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Enabled, false );
UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled, false );
UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled, false );
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled, false );
}
y2milestone( "leaving initAutoconfig with\ninitial_cups_autoconfig_ConfigureNewPrinters = '%1'\ninitial_cups_autoconfig_DisablePrintersOnRemoval = '%2'\ninitial_cups_autoconfig_DefaultCUPSPolicy = '%3'", initial_cups_autoconfig_ConfigureNewPrinters, initial_cups_autoconfig_DisablePrintersOnRemoval, initial_cups_autoconfig_DefaultCUPSPolicy );
-
}
-void storeAutoconfig( string key, map event )
-{ y2milestone( "entering storeAutoconfig with key '%1'\nand event '%2'", key, event );
- // If the cups-autoconfig RPM should be removed and when it is currently installed,
+boolean ApplyAutoconfigSettings()
+{ // If the cups-autoconfig RPM should be removed and when it is currently installed,
// try to remove it and return because nothing else matters in this case.
// Return even when the user decided to reject the removal because
// it would lead to unexpected results when cups-autoconfig settings
@@ -207,22 +270,25 @@
{ if( Printerlib::TestAndInstallPackage( "cups-autoconfig", "installed" ) )
{ Printerlib::TestAndInstallPackage( "cups-autoconfig", "remove" );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ //return `autoconfig_next;
+ return true;
}
}
boolean applied_autoconfig_settings = true;
// Get the actual settings and values from the dialog:
- boolean current_cups_autoconfig_ConfigureNewPrinters = (boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attachend"), `Value );
+ boolean current_cups_autoconfig_ConfigureNewPrinters = (boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attached"), `Value );
boolean current_cups_autoconfig_DisablePrintersOnRemoval = (boolean)UI::QueryWidget( `id("cups_autoconfig_disable_on_removal"), `Value );
string current_cups_autoconfig_DefaultCUPSPolicy = (string)UI::QueryWidget( `id("cups_autoconfig_operation_policy"), `Value );
y2milestone( "current_cups_autoconfig_ConfigureNewPrinters = '%1'\ncurrent_cups_autoconfig_DisablePrintersOnRemoval = '%2'\ncurrent_cups_autoconfig_DefaultCUPSPolicy = '%3'", current_cups_autoconfig_ConfigureNewPrinters, current_cups_autoconfig_DisablePrintersOnRemoval, current_cups_autoconfig_DefaultCUPSPolicy );
+ boolean cups_autoconfig_triggered = (boolean)UI::QueryWidget( `id("cups_autoconfig_trigger"), `Value );
if( current_cups_autoconfig_ConfigureNewPrinters == initial_cups_autoconfig_ConfigureNewPrinters
&& current_cups_autoconfig_DisablePrintersOnRemoval == initial_cups_autoconfig_DisablePrintersOnRemoval
&& current_cups_autoconfig_DefaultCUPSPolicy == initial_cups_autoconfig_DefaultCUPSPolicy
+ && ! cups_autoconfig_triggered
)
{ y2milestone( "Nothing changed in 'Autoconfig Settings' dialog." );
y2milestone( "leaving storeAutoconfig" );
- return nil;
+ return true;
}
if( current_cups_autoconfig_ConfigureNewPrinters != initial_cups_autoconfig_ConfigureNewPrinters )
{ if( current_cups_autoconfig_ConfigureNewPrinters )
@@ -287,12 +353,65 @@
applied_autoconfig_settings = false;
}
}
- if( ! applied_autoconfig_settings )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
+ if( applied_autoconfig_settings )
+ { // After the autoconfig settings have been successfully applied,
+ // check if cups-autoconfig should run now:
+ if( cups_autoconfig_triggered )
+ { if( ! Printerlib::ExecuteBashCommand( "/usr/lib/cups-autoconfig/cups-autoconfig --add" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ _("Automatic configuration failed."),
+ Printerlib::result["stderr"]:""
+ );
+ applied_autoconfig_settings = false;
+ }
+ }
}
y2milestone( "leaving storeAutoconfig" );
+ return applied_autoconfig_settings;
+}
+
+symbol handleAutoconfig( string key, map event )
+{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key, event );
+ if( "ValueChanged" == event["EventReason"]:"" )
+ { if( "cups_autoconfig_remove" == event["WidgetID"]:"" )
+ { // Enable or disable the other widgets depending on whether or not
+ // the cups-autoconfig RPM should be removed:
+ boolean have_cups_autoconfig = ! (boolean)UI::QueryWidget( `id("cups_autoconfig_remove"), `Value );
+ UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Enabled, have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_disable_on_removal"), `Enabled, have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled, have_cups_autoconfig );
+ UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Enabled, have_cups_autoconfig );
+ }
+ if( "cups_autoconfig_configure_new_attached" == event["WidgetID"]:"" )
+ { // Set the CheckBox to trigger automatic configuration to "off"
+ // when cups-autoconfig should not do an automatic configuration
+ // but do not automatically set the trigger to "on" in the opposite case:
+ if( ! (boolean)UI::QueryWidget( `id("cups_autoconfig_configure_new_attached"), `Value ) )
+ { UI::ChangeWidget( `id("cups_autoconfig_trigger"), `Value, false );
+ }
+ }
+ if( "cups_autoconfig_trigger" == event["WidgetID"]:"" )
+ { // Set the CheckBox to do an automatic configuration to "on"
+ // when the CheckBox to trigger automatic configuration is set to "on"
+ // but do not automatically disable automatic configuration in the opposite case:
+ if( (boolean)UI::QueryWidget( `id("cups_autoconfig_trigger"), `Value ) )
+ { UI::ChangeWidget( `id("cups_autoconfig_configure_new_attached"), `Value, true );
+ }
+ }
+ }
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `autoconfig_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyAutoconfigSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `autoconfig_next;
+ }
+ }
return nil;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/basicadd.ycp new/yast2-printer-2.17.41/src/basicadd.ycp
--- old/yast2-printer-2.17.34/src/basicadd.ycp 2008-11-06 15:24:50.000000000 +0100
+++ new/yast2-printer-2.17.41/src/basicadd.ycp 2008-11-14 14:09:46.000000000 +0100
@@ -256,14 +256,8 @@
}
Wizard::DisableBackButton();
Wizard::DisableNextButton();
- if( ! Printer::AddQueue( 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::AddQueue
- // was called and this function would have shown more specific messages.
- sformat( _("Failed to add queue %1."), queue_name )
- );
- }
+ // No error messages here because Printer::AddQueue already shows them:
+ Printer::AddQueue( queue_name );
// After a local queue was added, enforce to show also local queues
// in particular when no local queues were shown before:
Printer::queue_filter_show_local = true;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/dialogs.ycp new/yast2-printer-2.17.41/src/dialogs.ycp
--- old/yast2-printer-2.17.34/src/dialogs.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/dialogs.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -41,105 +41,105 @@
include "printer/policies.ycp";
include "printer/autoconfig.ycp";
-map > wd = $[
- "OVERVIEW" : $[
- "widget" : `custom,
- "custom_widget" : widgetOverview,
- "init" : initOverview,
- "handle" : handleOverview,
- "help" : HELPS["overview"]:""
- ],
- "NETWORKPRINTING" : $[
- "widget" : `custom,
- "custom_widget" : widgetNetworkPrinting,
- "init" : initNetworkPrinting,
- "handle" : handleNetworkPrinting,
- "store" : storeNetworkPrinting,
- "help" : HELPS["printing_via_network_dialog"]:""
- ],
- "SHARING" : $[
- "widget" : `custom,
- "custom_widget" : widgetSharing,
- "init" : initSharing,
- "handle": handleSharing,
- "store" : storeSharing,
- "help" : HELPS["sharing_dialog"]:""
- ],
- "POLICIES" : $[
- "widget" : `custom,
- "custom_widget" : widgetPolicies,
- "init" : initPolicies,
- "store" : storePolicies,
- "help" : HELPS["policies"]:""
- ],
- "AUTOCONFIG" : $[
- "widget" : `custom,
- "custom_widget" : widgetAutoconfig,
- "init" : initAutoconfig,
- "store" : storeAutoconfig,
- "help" : HELPS["autoconfig"]:""
- ]
-];
-
-map tabs_descr = $[
- "overview" : $[
- "header" : _("Printer Configurations"),
- "tree_item_label" : _("Printer Configurations"),
- "contents" : `VBox (
- "OVERVIEW"
- ),
- "widget_names" : ["OVERVIEW"]
- ],
- "network" : $[
- "header" : _("Print via Network"),
- "tree_item_label" : _("Print via Network"),
- "contents" : `VBox (
- "NETWORKPRINTING"
- ),
- "widget_names" : ["NETWORKPRINTING"]
- ],
- "sharing" : $[
- "header" : _("Share Printers"),
- "tree_item_label" : _("Share Printers"),
- "contents" : `VBox (
- "SHARING"
- ),
- "widget_names" : ["SHARING"]
- ],
- "policies" : $[
- "header" : _("Policies"),
- "tree_item_label" : _("Policies"),
- "contents" : `VBox (
- "POLICIES"
- ),
- "widget_names" : ["POLICIES"]
- ],
- "autoconfig" : $[
- "header" : _("Autoconfig Settings"),
- "tree_item_label" : _("Autoconfig Settings"),
- "contents" : `VBox (
- "AUTOCONFIG"
- ),
- "widget_names" : ["AUTOCONFIG"]
- ],
-];
-
-
-symbol runMainDialog(){
- string caption = _("Detected Printers");
-
- symbol ret = DialogTree::ShowAndRun ($[
- "ids_order" : [ "overview", "network", "sharing", "policies", "autoconfig" ],
- "initial_screen" : "overview",
- "screens" : tabs_descr,
- "widget_descr" : wd,
- "back_button" : nil,//Label::BackButton(),
- "abort_button" : Label::CancelButton(),
- "next_button" : Label::OKButton ()
- ]);
- return ret;
+map< string, map< string, any > > widgets_handling =
+ $[ "OVERVIEW" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetOverview,
+ "init" : initOverview,
+ "handle" : handleOverview,
+ "help" : HELPS["overview"]:""
+ ],
+ "NETWORKPRINTING" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetNetworkPrinting,
+ "init" : initNetworkPrinting,
+ "handle" : handleNetworkPrinting,
+ "help" : HELPS["printing_via_network_dialog"]:""
+ ],
+ "SHARING" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetSharing,
+ "init" : initSharing,
+ "handle": handleSharing,
+ "help" : HELPS["sharing_dialog"]:""
+ ],
+ "POLICIES" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetPolicies,
+ "init" : initPolicies,
+ "handle": handlePolicies,
+ "help" : HELPS["policies"]:""
+ ],
+ "AUTOCONFIG" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetAutoconfig,
+ "init" : initAutoconfig,
+ "handle": handleAutoconfig,
+ "help" : HELPS["autoconfig"]:""
+ ]
+ ];
+
+map< string, map< string, any > > tabs_description =
+ $[ "overview" :
+ $[ "header" : _("Printer Configurations"),
+ "tree_item_label" : _("Printer Configurations"),
+ "caption" : _("Printer Configurations"),
+ "contents" : `VBox( "OVERVIEW" ),
+ "widget_names" : ["OVERVIEW"]
+ ],
+ "network" :
+ $[ "header" : _("Print via Network"),
+ "tree_item_label" : _("Print via Network"),
+ "caption" : _("Print via Network"),
+ "contents" : `VBox( "NETWORKPRINTING" ),
+ "widget_names" : ["NETWORKPRINTING"]
+ ],
+ "sharing" :
+ $[ "header" : _("Share Printers"),
+ "tree_item_label" : _("Share Printers"),
+ "caption" : _("Share Printers"),
+ "contents" : `VBox( "SHARING" ),
+ "widget_names" : ["SHARING"]
+ ],
+ "policies" :
+ $[ "header" : _("Policies"),
+ "tree_item_label" : _("Policies"),
+ "caption" : _("Policies"),
+ "contents" : `VBox( "POLICIES" ),
+ "widget_names" : ["POLICIES"]
+ ],
+ "autoconfig" :
+ $[ "header" : _("Autoconfig Settings"),
+ "tree_item_label" : _("Autoconfig Settings"),
+ "caption" : _("Autoconfig Settings"),
+ "contents" : `VBox( "AUTOCONFIG" ),
+ "widget_names" : ["AUTOCONFIG"]
+ ]
+ ];
+
+symbol runMainDialog()
+{ string caption = _("Detected Printers");
+ symbol ret = DialogTree::ShowAndRun
+ ( $[ "ids_order" : [ "overview", "network", "sharing", "policies", "autoconfig" ],
+ "initial_screen" : "overview",
+ "screens" : tabs_description,
+ "widget_descr" : widgets_handling,
+ // All the dialogs in "ids_order" are single (step) configuration dialogs
+ // and according to the new YaST style guide at
+ // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd...
+ // there is no longer a "abort" functionality which exits the whole module.
+ // Instead this button is now named "Cancel" and its functionality is
+ // to go back to the Overview dialog (i.e. what the "back" button would do)
+ // because it reads "Cancel - Closes the window and returns to the overview."
+ // Therefore the button with the "abort" functionality is not shown at all
+ // and the button with the "back" functionality is named "Cancel".
+ "abort_button" : nil,
+ "back_button" : Label::CancelButton(),
+ "next_button" : Label::OKButton()
+ ]
+ );
+ return ret;
}
-
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/driveradd.ycp new/yast2-printer-2.17.41/src/driveradd.ycp
--- old/yast2-printer-2.17.34/src/driveradd.ycp 2008-11-06 15:24:37.000000000 +0100
+++ new/yast2-printer-2.17.41/src/driveradd.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -275,7 +275,7 @@
// when hpijs-standalone is removed by the package management system
// and because we do want to get rid of it, it is removed by plain rpm:
if( Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) )
- { Printerlib::ExecuteBashCommand( "rpm -e --nodeps hpijs-standalone" );
+ { Printerlib::TestAndInstallPackage( "hpijs-standalone", "remove" );
}
if( ! Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) )
{ if( Printerlib::TestAndInstallPackage( "hplip", "install" ) )
@@ -319,7 +319,7 @@
{ // It can lead to an almost endless sequence of further problems
// when hpijs-standalone is removed by the package management system
// and because we do want to get rid of it, it is removed by plain rpm:
- Printerlib::ExecuteBashCommand( "rpm -e --nodeps hpijs-standalone" );
+ Printerlib::TestAndInstallPackage( "hpijs-standalone", "remove" );
if( ! Printerlib::TestAndInstallPackage( "hpijs-standalone", "installed" ) )
{ // Try again to install hplip only if hpijs-standalone was actually removed.
if( Printerlib::TestAndInstallPackage( "hplip", "install" ) )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/overview.ycp new/yast2-printer-2.17.41/src/overview.ycp
--- old/yast2-printer-2.17.34/src/overview.ycp 2008-11-06 16:38:30.000000000 +0100
+++ new/yast2-printer-2.17.41/src/overview.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -35,6 +35,7 @@
import "Popup";
import "Printerlib";
import "Printer";
+import "Wizard";
include "printer/helps.ycp";
@@ -121,7 +122,8 @@
);
void initOverview( string key )
-{ // First of all the multi-line string because such strings cannot be indented:
+{ y2milestone( "entering initOverview with key '%1'", key );
+ // First of all the multi-line string because such strings cannot be indented:
string required_cupsd_not_accessible =
// Message of a Popup::ErrorDetails
// when a local cupsd is required but it is not accessible.
@@ -149,6 +151,12 @@
If you really must use a non-official port, you cannot use
the YaST printer modue to configure your printers.
");
+ Wizard::SetDesktopIcon("printer");
+ // The button with "back/cancel" functionality is removed here
+ // only because here it happens faster than only in the handleOverview function
+ // to avoid that the button is visible for some time until it is actually removed.
+ // See the handleOverview function for details why this button is removed.
+ Wizard::HideBackButton();
boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
@@ -219,6 +227,7 @@
UI::ChangeWidget( `overview_table, `Items,
Printer::QueueItems( Printer::queue_filter_show_local, Printer::queue_filter_show_remote )
);
+ y2milestone( "leaving initOverview" );
}
/**
@@ -228,7 +237,58 @@
* test button and refresh overview
*/
symbol handleOverview( string key, map event )
-{ if( ( `remote_content_checkbox == event["ID"]:nil
+{ y2milestone( "entering handleOverview with key '%1'\nand event '%2'", key, event );
+ // In the Overview dialog it does not make sense to have a button with "back" functionality
+ // which is named "Cancel" according to the new YaST style guide at
+ // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd...
+ // because there is nothing to "cancel" in the Overview dialog because it
+ // only shows information about the current state of the configuration
+ // but the Overview dialog itself does not do any change of the configuration.
+ // The Overview dialog has actually the same meaning for the user
+ // as a plain notification popup which has only a "OK" button.
+ // If the user does not agree to what is shown in the Overview dialog
+ // he must launch a configuration sub-dialog to change the configuration.
+ // If the user accepted in such a configuration sub-dialog what he changed
+ // via the "OK" button there, the change is applied and the Overview dialog
+ // shows the new current state of the configuration, see
+ // http://en.opensuse.org/YaST/Development/Printer_Enhancement#Basic_Implementa...:
+ // so that it is not possible to "cancel" the change in the Overview dialog.
+ // Any change of the configuration is done in sub-dialogs which are called
+ // from the Overview dialog (even the "Confirm Deletion" popup is such a sub-dialog)
+ // and in all those sub-dialogs there is a button with "cancel" functionality.
+ // Note that all the different dialogs in the DialogTree (see dialogs.ycp) are
+ // for the Wizard only different tabs of one same dialog (see "overview" in wizards.ycp)
+ // so that the button with "back/cancel" functionality must be carefully re-enabled
+ // whenever the Overview dialog is replaced by another dialog tab in the DialogTree
+ // so that the other dialogs in the DialogTree have a button with "cancel" functionality.
+ // In graphical mode:
+ // When the Overview dialog is to be replaced by another dialog tab in the DialogTree
+ // the event has the form e.g.: $["EventSerialNo":2, "EventType":"MenuEvent", "ID":"network"]
+ // i.e. the EventType is "MenuEvent" so that testing only this general condition
+ // (without a specific match if "ID" is one of "network","sharing","policies","autoconfig")
+ // should be sufficiently safe to get the button with "back/cancel" functionality restored.
+ // In ncurses mode:
+ // When the Overview dialog is to be replaced by another dialog tab in the DialogTree
+ // the event has the form e.g.: $["EventReason":"Activated", "EventSerialNo":0, "EventType":"WidgetEvent",
+ // "ID":`wizardTree, "WidgetClass":`Tree, "WidgetID":`wizardTree]
+ // The EventType "WidgetEvent" cannot be used here because it is too unspecific
+ // because "WidgetEvent" type events are all kind of clicked buttons so that
+ // for ncurses mode the ID is used as test if the Overview dialog is to be
+ // replaced by another dialog tab in the DialogTree.
+ // This strange testing method works at least for openSUSE 11.0 and openSUSE 11.1.
+ Wizard::HideBackButton();
+ if( "MenuEvent" == event["EventType"]:""
+ || `wizardTree == event["ID"]:nil
+ )
+ { Wizard::RestoreBackButton();
+ // The above RestoreBackButton restores also its label to the default "Back"
+ // but according to the new YaST style guide at
+ // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd...
+ // this button is now named "Cancel":
+ Wizard::SetBackButton( `back, Label::CancelButton() );
+ }
+
+ if( ( `remote_content_checkbox == event["ID"]:nil
|| `local_content_checkbox == event["ID"]:nil
) && "ValueChanged" == event["EventReason"]:""
)
@@ -312,31 +372,26 @@
);
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
- )
+ 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 before the function Printer::DeleteQueue
- // was called and this function would have shown more specific messages.
- sformat( _("Failed to delete configuration %1."), queue_name )
- );
- }
- // Re-run the OverviewDialog (with a re-created list of queues) via the sequencer:
- return `delete;
+ { return nil;
}
+ // 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 );
+ // No error messages here because Printer::DeleteQueue already shows them:
+ Printer::DeleteQueue( queue_name );
+ // Re-run the OverviewDialog (with a re-created list of queues) via the sequencer:
+ return `delete;
}
if( `test == event["ID"]:nil && "Activated" == event["EventReason"]:"" )
@@ -357,7 +412,7 @@
// Body of a Popup::AnyMessage when the queue rejects print jobs:
_("The testpage cannot be printed because print jobs are rejected.")
);
- return nil;
+ 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:
@@ -368,26 +423,128 @@
return nil;
}
if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
- { Printer::selected_queues_index = selected_queue_index;
+ { // When it is a local queue, remember it as the currently selected queue
+ // so that the user can just click the button with "modify" functionality
+ // if he likes to change the configuration when the testprint is not o.k.
+ Printer::selected_queues_index = selected_queue_index;
+ // Test whether there are already pending jobs in a local queue.
+ // If yes, the queue is usually currently actively printing because
+ // the test above makes sure that the queue has printing enabled.
+ // When this command fails for whatever reason, it is a safe fallback
+ // to assume that there are no pending jobs in the queue:
+ if( Printerlib::ExecuteBashCommand( "/usr/bin/lpstat -h localhost -o '"
+ + queue_name
+ + "' | egrep -q '^"
+ + queue_name
+ + "-[0-9]+'"
+ )
+ )
+ { if( Popup::AnyQuestion( // Header of a confirmation popup before all pending jobs in a queue will be deleted:
+ _("Delete Pending Print Jobs"),
+ // Body of a confirmation popup before a queue will be deleted:
+ _("There are pending print jobs which might be deleted before the testpage is printed."),
+ // 'Yes' button label of a confirmation popup
+ // before all pending jobs in a queue will be deleted:
+ sformat( _("Delete all pending jobs for %1"), queue_name ),
+ // 'No' button label of a confirmation popup
+ // before all pending jobs in a queue will be deleted:
+ _("Print the testpage after the other jobs"),
+ `focus_no
+ )
+ )
+ { if( ! Printerlib::ExecuteBashCommand( "/usr/bin/cancel -a -h localhost '" + queue_name + "'" ) )
+ { Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
+ // where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system.
+ _("Failed to delete all pending jobs for %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ }
+ }
+ }
}
+ // Do not enforce to talk to the cupsd on localhost when submiting the testpage
+ // because testpage printing must also work for a "client-only" config:
if( ! Printerlib::ExecuteBashCommand( "/usr/bin/lp -d '"
+ queue_name
- + "' -o page-label=\"Testprint:$(hostname)\" /usr/share/cups/data/testprint.ps"
+ + "' -o page-label=\"Testprint_from_$(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 )
- );
+ { Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
+ // where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system.
+ _("Failed to print testpage for %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
return nil;
}
- Popup::TimedMessage( // Popup message
- // where %1 will be replaced by the queue name.
- sformat( _("Sent testpage to %1. It should start to print soon."), queue_name ),
- 60
- );
+ Popup::TimedAnyQuestion( // Popup::TimedAnyQuestion header:
+ _("Wait Until Testprint Finished"),
+ // Popup::TimedAnyQuestion message
+ // where %1 will be replaced by the queue name.
+ sformat( _("Sent testpage to %1. It should start to print soon."), queue_name ),
+ // Popup::TimedAnyQuestion 'Yes' button label:
+ Label::StopButton(),
+ // Popup::TimedAnyQuestion 'No' button label:
+ Label::OKButton(),
+ `focus_yes,
+ 120
+ );
+ if( "local" == Printer::queues[selected_queue_index,"config"]:"remote" )
+ { // When it is a local queue and there are still pending jobs in the queue,
+ // it seems something went wrong with the testpage printing
+ // so that the user can delete all pending jobs now.
+ // Via the "cancel" command the cupsd sends termination signals
+ // to running filter processes for the queue so that the filters
+ // (in particular the printer driver) could do whatever is needed
+ // to switch an actively printing printer device into a clean state
+ // (e.g. exit its graphics printing mode and switch back to normal mode).
+ // The backend process terminates when the filters have finished.
+ // This helps in usual cases (in particular when a good driver is used)
+ // if something had messed up for an actively printing job but
+ // unfortunately there is no option for the "cancel" command
+ // which lets the cupsd immediatelly kill the backend process
+ // as emergency brake when e.g. a wrong driver lets the printer
+ // spit out zillions of sheets with nonsense characters.
+ // When this command fails for whatever reason, it is a safe fallback
+ // to assume that there are no pending jobs in the queue:
+ if( Printerlib::ExecuteBashCommand( "/usr/bin/lpstat -h localhost -o '"
+ + queue_name
+ + "' | egrep -q '^"
+ + queue_name
+ + "-[0-9]+'"
+ )
+ )
+ { if( Popup::AnyQuestion( // Header of a confirmation popup before all pending jobs in a queue will be deleted:
+ _("Delete Pending Print Jobs"),
+ // Body of a confirmation popup before a queue will be deleted:
+ _("There are pending print jobs which might be deleted now."),
+ // 'Yes' button label of a confirmation popup
+ // before all pending jobs in a queue will be deleted:
+ sformat( _("Delete all pending jobs for %1"), queue_name ),
+ // 'No' button label of a confirmation popup
+ // before all pending jobs in a queue will be deleted:
+ _("Do not delete them"),
+ `focus_no
+ )
+ )
+ { if( ! Printerlib::ExecuteBashCommand( "/usr/bin/cancel -a -h localhost '" + queue_name + "'" ) )
+ { Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
+ // where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system.
+ _("Failed to delete all pending jobs for %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ }
+ }
+ }
+ }
return nil;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/policies.ycp new/yast2-printer-2.17.41/src/policies.ycp
--- old/yast2-printer-2.17.34/src/policies.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/policies.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -146,12 +146,15 @@
}
}
}
- // Determine whether or not a local cupsd is accessible:
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
- if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
- { policies_dialog_is_useless = true;
- y2milestone( "policies_dialog_is_useless because 'rccups start' failed." );
+ // When it is no "client-only" config,
+ // determine whether or not a local cupsd is accessible:
+ if( ! policies_dialog_is_useless )
+ {if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
+ if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
+ { policies_dialog_is_useless = true;
+ y2milestone( "policies_dialog_is_useless because 'rccups start' failed." );
+ }
}
}
// Determine the existing policy names in '<Policy policy-name>' sections in /etc/cups/cupsd.conf:
@@ -211,9 +214,8 @@
y2milestone( "leaving initPolicies with\ninitial_operation_policy = '%1'\ninitial_error_policy = '%2'", initial_operation_policy, initial_error_policy );
}
-void storePolicies( string key, map event)
-{ y2milestone( "entering storePolicies with key '%1'\nand event '%2'", key, event );
- boolean applied_policies = true;
+boolean ApplyPoliciesSettings()
+{ boolean applied_policies = true;
// Get the actual settings and values from the dialog:
string current_operation_policy = (string)UI::QueryWidget( `id("operation_policy"), `Value );
boolean apply_operation_policy = (boolean)UI::QueryWidget( `id("apply_operation_policy"), `Value );
@@ -228,7 +230,7 @@
)
{ y2milestone( "Nothing changed in 'Policies' dialog." );
y2milestone( "leaving storePolicies" );
- return nil;
+ return true;
}
if( apply_operation_policy
|| apply_error_policy
@@ -305,12 +307,25 @@
}
}
}
- if( ! applied_policies )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
y2milestone( "leaving storePolicies" );
+ return applied_policies;
+}
+
+symbol handlePolicies( string key, map event )
+{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key, event );
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `policies_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyPoliciesSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ return `policies_next;
+ }
+ }
return nil;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/Printerlib.ycp new/yast2-printer-2.17.41/src/Printerlib.ycp
--- old/yast2-printer-2.17.34/src/Printerlib.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/Printerlib.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -126,6 +126,16 @@
);
return false;
}
+ // Package::Install(package_name) has unexpected side-effects
+ // because it does additionally remove whatever other packages
+ // for example to "automatically solve" existing package conflicts
+ // without any dialog where the user could accept or reject additional removals
+ // (the user may have intentionally accepted whatever package conflict).
+ // I am only interested to install exactly the one package which was specified
+ // and all what this one package requires but I am not interested to get whatever
+ // other packages removed but I do not know a function which does this.
+ // Therefore I use Package::Install(package_name) because it is most important
+ // to get all installed what is required by the package which was specified.
if( ! Package::Install( package_name ) )
{ y2milestone( "TestAndInstallPackage: Failed to install required package %1.", package_name );
Popup::Error( // Message of a Popup::Error where %1 will be replaced by the package name.
@@ -145,17 +155,72 @@
{ y2milestone( "TestAndInstallPackage: skip remove because %1", result["stdout"]:"package is not installed" );
return true;
}
- if( ! Package::Remove( package_name ) )
+ else
+ { if( ! Popup::ContinueCancel( sformat( // Body of a Popup::ContinueCancel
+ // where %1 will be replaced by the package name
+ // when removing package %1 would break dependencies.
+ _("Remove package %1?"),
+ package_name
+ )
+ )
+ )
+ { // The user has decided not to continue.
+ // Therefore we exit here but with "false" because
+ // the request to remove the package was not done.
+ return false;
+ }
+ }
+ // Intentionally Package::Remove(package_name) is not used here
+ // because it does additionally remove whatever other packages
+ // for example to "automatically solve" existing package conflicts
+ // without any dialog where the user could accept or reject additional removals
+ // (the user may have intentionally accepted whatever package conflict).
+ // Furthermore Package::Remove(package_name) does additionally install
+ // whatever other packages for example to "automatically solve" whatever
+ // kind of RPM soft requirements (Recommends) for other packages.
+ // I am only interested to remove exactly the one package which was specified
+ // and I am not interested to get whatever replacement package installed.
+ // Usually (i.e. in a openSUSE standard system) the packages which are removed here
+ // do not have dependencies or the calling function removes dependant packages
+ // in the right order (e.g. first hplip and then hplip-hpijs, see driveradd.ycp)
+ // but the user might have installed whatever third-party packages
+ // which could have dependencies to the package which should be removed here.
+ if( ! ExecuteBashCommand( "rpm -e --test '" + package_name + "'" ) )
+ { // There is no Popup::ContinueCancelHeadlineDetails available.
+ // Therefore the exact RPM message is shown via a separated Popup::ErrorDetails.
+ Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
+ // where %1 will be replaced by the package name.
+ _("Removing package %1 would break dependencies."),
+ package_name
+ ),
+ result["stderr"]:""
+ );
+ if( ! Popup::ContinueCancelHeadline( sformat( // Header of a Popup::ContinueCancelHeadline
+ // where %1 will be replaced by the package name
+ // when removing package %1 would break dependencies.
+ _("Remove %1 regardless of breaking dependencies?"),
+ package_name
+ ),
+ // Body of a Popup::ContinueCancelHeadline
+ // when removing package %1 would break dependencies.
+ _("Breaking dependencies leads to arbitrary failures elsewhere.")
+ )
+ )
+ { // The user has decided not to continue which is the right decission.
+ // Therefore we exit here but with "false" because removing the package failed.
+ return false;
+ }
+ }
+ if( ! ExecuteBashCommand( "rpm -e --nodeps '" + package_name + "'" ) )
{ y2milestone( "TestAndInstallPackage: Failed to remove package %1.", package_name );
- Popup::Error( // Message of a Popup::Error where %1 will be replaced by the package name.
- // Only a simple message because:
- // Either the user has explicitely rejected to remove the package,
- // or 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 remove package %1."),
- package_name
- )
- );
+ Popup::ErrorDetails( sformat( // Message of a Popup::ErrorDetails
+ // where %1 will be replaced by the package name.
+ // Only a simple message because this error does not happen on a normal system.
+ _("Failed to remove package %1."),
+ package_name
+ ),
+ result["stderr"]:""
+ );
return false;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/printer_proposal.ycp new/yast2-printer-2.17.41/src/printer_proposal.ycp
--- old/yast2-printer-2.17.34/src/printer_proposal.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/printer_proposal.ycp 2008-11-14 15:41:38.000000000 +0100
@@ -36,6 +36,7 @@
import "Printer";
import "Progress";
+import "String";
/* The main () */
y2milestone("----------------------------------------");
@@ -59,10 +60,39 @@
Progress::set (progress_orig);
}
+// Propose configuration for each local printer
+// TODO: replace by cups-autoconfig
+
+ list<term> detected_printers = filter(term row, (list<term>)Printer::ConnectionItems( "BasicAddDialog" ), { return (!issubstring(String::CutBlanks(row[1]:""), "Unknown")); });
+ y2milestone("Detected local printers : %1", detected_printers);
+ if (size(detected_printers)>0){
+ y2milestone("Local printers detected, will configure");
+ foreach(term printer, detected_printers, {
+ y2internal("Configure queue for backend %1", printer[2]:"");
+ string queue_name = Printer::NewQueueName( tolower( printer[1]:"" ));
+ y2milestone("Proposed queue name : %1", queue_name);
+ list drivers = Printer::DriverItems( filterchars( tolower( String::CutBlanks(printer[1]:"") ), Printer::lower_alnum_chars ), true );
+ if (size(drivers)>0){
+ y2internal("Available drivers : %1", drivers);
+ y2internal("Selected driver : %1", drivers[0]:nil);
+ Printer::selected_ppds_index=drivers[0,0,0]:-1;
+ Printer::selected_connections_index=printer[0,0]:-1;
+ Printer::AddQueue(queue_name);
+ } else y2error("No available drivers for printer %1", printer);
+ });
+ } else {
+ y2milestone("No local printers detected");
+ }
+
+ foreach( term queue, (list<term>) Printer::QueueItems(true, false), {
+ proposal = add(proposal, queue[3]:"");
+ });
+/*
proposal = maplist ( map< string, string > queue, Printer::queues, {
string description = queue["description"]:"";
return description;
});
+*/
proposal = filter (string p, proposal, { return p != ""; });
if (size (proposal) == 0)
proposal = [ _("No printer queue configured.") ];
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/Printer.ycp new/yast2-printer-2.17.41/src/Printer.ycp
--- old/yast2-printer-2.17.34/src/Printer.ycp 2008-11-06 16:51:39.000000000 +0100
+++ new/yast2-printer-2.17.41/src/Printer.ycp 2008-11-14 15:42:19.000000000 +0100
@@ -698,7 +698,7 @@
Progress::New( // Header of a Progress::New:
_("Finishing Printer Configuration"),
" ",
- 0,
+ 1,
[ // 1. progress stage name of a Progress::New:
_("Finish printer configuration")
],
@@ -1625,12 +1625,14 @@
* @return true on success
*/
global boolean AddQueue( string queue_name )
-{ string uri = connections[selected_connections_index,"uri"]:"";
- string ppd = ppds[selected_ppds_index,"ppd"]:"";
- // Delete ' characters because they are used for quoting in the bash commandline below:
+{ // Delete ' characters because they are used for quoting in the bash commandline below:
+ queue_name = deletechars( queue_name, "'" );
+ string uri = deletechars( connections[selected_connections_index,"uri"]:"", "'" );
+ string ppd = deletechars( ppds[selected_ppds_index,"ppd"]:"", "'" );
string model = deletechars( connections[selected_connections_index,"model"]:"", "'" );
string description = deletechars( ppds[selected_ppds_index,"nickname"]:"", "'" );
- if( "" != model
+ if( "" != description
+ && "" != model
&& "unknown" != tolower( model )
&& ! issubstring( filterchars( tolower( description ), lower_alnum_chars ),
filterchars( tolower( model ), lower_alnum_chars )
@@ -1639,12 +1641,31 @@
{ description = model + " with driver " + description;
}
if( "" == uri || "" == ppd || "" == queue_name )
- { return false;
+ { y2milestone( "Cannot set up queue because of empty mandatory parameter: queue_name = '%1', uri = '%2', ppd = '%3'", queue_name, uri, ppd );
+ return false;
}
- // Note the bash quotings of the queue_name and description strings with ' characters:
- string commandline = "/usr/sbin/lpadmin -h localhost -p '" + queue_name + "' -v " + uri + " -m " + ppd + " -D '" + description + "' -E";
+ // Note the bash quotings of the parameters with ' characters:
+ string commandline = "/usr/sbin/lpadmin -h localhost -p '" + queue_name + "' -v '" + uri + "' -m '" + ppd + "' -D '" + description + "' -E";
if( ! Printerlib::ExecuteBashCommand( commandline ) )
- { return false;
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message 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).
+ _("Failed to add queue %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ // When the PPD file is totally broken, it will not be accepted by the cupsd.
+ // In this case lpadmin shows an error message and exits with non-zero exit code
+ // but nevertherless the queue is created without a PPD file, i.e. as a raw queue.
+ // It seems that first of all lpadmin creates the queue and then
+ // in a second step it is modified to assign the PPD file,
+ // see http://www.cups.org/newsgroups.php?gcups.bugs+T+Q"STR+%232949"
+ // Because this AddQueue function is only used to add a not-yet-existing queue,
+ // it is safe to try to remove the queue in any case if the setup had failed
+ // but ignore any possible errors here (e.g. when the queue does not exist).
+ Printerlib::ExecuteBashCommand( "/usr/sbin/lpadmin -h localhost -x '" + queue_name + "'" );
+ return false;
}
return true;
}
@@ -1657,18 +1678,30 @@
{ if( "" == queue_name )
{ queue_name = queues[selected_queues_index,"name"]:"";
if( "local" != queues[selected_queues_index,"config"]:"remote" )
- { return false;
+ { y2milestone( "Cannot delete queue '%1' because it is no local queue", queue_name );
+ return false;
}
}
+ // Delete ' characters because they are used for quoting in the bash commandline below:
+ queue_name = deletechars( queue_name, "'" );
if( "" == queue_name )
- { return false;
+ { y2milestone( "Cannot delete queue because queue_name is the empty string" );
+ return false;
}
// To be safe invalidate selected_queues_index in any case:
selected_queues_index = -1;
// Note the bash quoting of the queue_name string with ' characters:
string commandline = "/usr/sbin/lpadmin -h localhost -x '" + queue_name + "'";
if( ! Printerlib::ExecuteBashCommand( commandline ) )
- { return false;
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message 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).
+ _("Failed to delete configuration %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
}
return true;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/printingvianetwork.ycp new/yast2-printer-2.17.41/src/printingvianetwork.ycp
--- old/yast2-printer-2.17.34/src/printingvianetwork.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/printingvianetwork.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -519,11 +519,11 @@
// if the browse_allow_value string is effectively empty or it contains "none"
// so that the client-only config is to be disabled in any case:
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 receiving printer information.")
- )
+ // 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 receiving printer information.")
+ )
)
{ return false;
}
@@ -791,7 +791,9 @@
initial_server_name_input_value = Printerlib::client_conf_server_name;
UI::ChangeWidget( `id(`client_conf_server_name_input), `Value, Printerlib::client_conf_server_name );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, false );
- UI::ChangeWidget( `id(`connection_wizard), `Enabled, false );
+ // The "Connection Wizard" button is enabled by default
+ // and disabled in case of "client_only", see below:
+ UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
// Enable those widgets which match to the current settings in the system:
// If there is 'Browsing On' in /etc/cups/cupsd.conf
// but there is also an active ServerName (!="localhost") in /etc/cups/client.conf
@@ -801,11 +803,20 @@
UI::ChangeWidget( `id(`client_only_radio_button), `Value, true );
UI::ChangeWidget( `id(`client_conf_server_name_input), `Enabled, true );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, true );
+ // The "Connection Wizard" button is disabled in case of "client_only".
+ // In this case it is never again enabled as long as the dialog runs
+ // because the user can select one of the radio buttons
+ // to receive or not receive printer information via CUPS Browsing
+ // which would switch from "client_only" to a local running cupsd
+ // but only when finishing the dialog via ApplyNetworkPrintingSettings().
+ // Therefore in case of "client_only" to use a network printer directly
+ // the user must first switch from "client_only" to a local running cupsd
+ // (e.g. by changing the client-only server to the empty string or to 'none')
+ // and close the dialog to apply this change and re-launch the dialog afterwards.
+ UI::ChangeWidget( `id(`connection_wizard), `Enabled, false );
}
else
- { // The "Connection Wizard" button is only disabled in casae of "client_only":
- UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
- // If "none" is present as a BrowseAllow value, no 'Browsing On' widget is enabled
+ { // If "none" is present as a BrowseAllow value, no 'Browsing On' widget is enabled
// but the 'Browsing Off' widget is enabled instead:
if( Printerlib::cupsd_conf_browsing_on
&& ! contains( Printerlib::cupsd_conf_browse_allow, "none" )
@@ -931,7 +942,12 @@
UI::ChangeWidget( `id(`browse_allow_input), `Enabled, false );
UI::ChangeWidget( `id(`client_conf_server_name_input), `Enabled, false );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, false );
- UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
+ if( ! Printerlib::client_only )
+ { // The "Connection Wizard" button is enabled by default
+ // and disabled if currently a "client_only" config is active.
+ // In this case it is never again enabled as long as the dialog runs, see above:
+ UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
+ }
}
if( `browsing_on_radio_button == event["ID"]:nil )
{ UI::ChangeWidget( `id(`browse_allow_label), `Enabled, true );
@@ -939,7 +955,12 @@
UI::ChangeWidget( `id(`browse_allow_input), `Enabled, true );
UI::ChangeWidget( `id(`client_conf_server_name_input), `Enabled, false );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, false );
- UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
+ if( ! Printerlib::client_only )
+ { // The "Connection Wizard" button is enabled by default
+ // and disabled if currently a "client_only" config is active.
+ // In this case it is never again enabled as long as the dialog runs, see above:
+ UI::ChangeWidget( `id(`connection_wizard), `Enabled, true );
+ }
}
if( `browse_allow_combo_box == event["ID"]:nil )
{ if( `browse_allow_all == UI::QueryWidget( `id(`browse_allow_combo_box), `Value ) )
@@ -961,8 +982,29 @@
}
}
if( "Activated" == event["EventReason"]:"" )
- { if( `connection_wizard == event["ID"]:nil )
- { return `connection_wizard;
+ { if( `back == event["ID"]:nil )
+ { return `printing_via_network_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplyNetworkPrintingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! printing_via_network_has_changed )
+ { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
+ }
+ 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;
+ }
+ return `printing_via_network_next;
+ }
+ if( `connection_wizard == event["ID"]:nil )
+ { return `printing_via_network_connection_wizard;
}
if( `test_client_conf_server == event["ID"]:nil )
{ string current_server_name_input_value = (string)UI::QueryWidget( `id(`client_conf_server_name_input), `Value );
@@ -973,27 +1015,6 @@
return nil;
}
-void storeNetworkPrinting( string key, map event )
-{ y2milestone( "entering storeNetworkPrinting with key '%1'\nand event '%2'", key, event );
- if( ! ApplyNetworkPrintingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! printing_via_network_has_changed )
- { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
- }
- 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;
-}
-
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/sharing.ycp new/yast2-printer-2.17.41/src/sharing.ycp
--- old/yast2-printer-2.17.34/src/sharing.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/sharing.ycp 2008-11-14 15:51:28.000000000 +0100
@@ -59,7 +59,7 @@
( `Left
( `RadioButton
( `id(`deny_remote_access_radio_button),
- `opt(`notify, `immediate),
+ `opt(`notify),
// A RadioButton label to deny remote access to local print queues:
_("&Deny remote access"),
initial_deny_remote_access
@@ -68,7 +68,7 @@
`Left
( `RadioButton
( `id(`allow_remote_access_radio_button),
- `opt(`notify, `immediate),
+ `opt(`notify),
// A RadioButton label to allow remote access to local print queues:
_("&Allow remote access"),
initial_allow_remote_access
@@ -499,6 +499,22 @@
return false;
}
}
+ else
+ { // When there are no browse_address_values,
+ // do not change the global "Browsing On/Off" entry in cupsd.conf
+ // because "Browsing Off" disables also receiving
+ // of remote queue information from remote CUPS servers
+ // which might be needed by the "Print Via Network" dialog.
+ // Instead remove only the "BrowseAddress" entries in cupsd.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf BrowseAddress none" ) )
+ { Popup::ErrorDetails( // Popup::ErrorDetails message.
+ // Do not change or translate "BrowseAddress", it is a system settings name.
+ _("Failed to remove 'BrowseAddress' entries from /etc/cups/cupsd.conf"),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
+ }
+ }
// Only if all the above was successfully set, Listen is set too:
// Currently 'Listen *:631' is simply set for any kind of remote access
// because the Listen directive supports only network addresses as value.
@@ -561,12 +577,15 @@
}
}
}
- // Determine whether or not a local cupsd is accessible:
- if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
- { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
- if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
- { share_printers_dialog_is_useless = true;
- y2milestone( "share_printers_dialog_is_useless because 'rccups start' failed." );
+ // When it is no "client-only" config,
+ // determine whether or not a local cupsd is accessible:
+ if( ! share_printers_dialog_is_useless )
+ { if( ! Printerlib::GetAndSetCupsdStatus( "" ) )
+ { // Printerlib::GetAndSetCupsdStatus already shows a confirmation popup:
+ if( ! Printerlib::GetAndSetCupsdStatus( "start" ) )
+ { share_printers_dialog_is_useless = true;
+ y2milestone( "share_printers_dialog_is_useless because 'rccups start' failed." );
+ }
}
}
// Note that the "Share Printers" dialog is not useless when there is no local queue.
@@ -927,7 +946,21 @@
}
}
if( "Activated" == event["EventReason"]:"" )
- { switch( event["WidgetID"]:`nil )
+ { if( `back == event["ID"]:nil )
+ { return `sharing_back;
+ }
+ if( `next == event["ID"]:nil )
+ { if( ! ApplySharingSettings() )
+ { Popup::Error( // Popup::Error message:
+ _("Failed to apply the settings to the system.")
+ );
+ }
+ if( ! sharing_has_changed )
+ { y2milestone( "Nothing changed in 'Share Printers' dialog." );
+ }
+ return `sharing_next;
+ }
+ switch( event["WidgetID"]:`nil )
{ integer current_item = -1;
map ret = nil;
map< string, string > interface_map = nil;
@@ -1066,19 +1099,5 @@
return nil;
}
-void storeSharing( string key, map event )
-{ y2milestone( "entering storeSharing with key '%1'\nand event '%2'", key, event );
- if( ! ApplySharingSettings() )
- { Popup::Error( // Popup::Error message:
- _("Failed to apply the settings to the system.")
- );
- }
- if( ! sharing_has_changed )
- { y2milestone( "Nothing changed in 'Share Printers' dialog." );
- }
- y2milestone( "leaving storeSharing" );
- return nil;
-}
-
/* EOF */
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/src/wizards.ycp new/yast2-printer-2.17.41/src/wizards.ycp
--- old/yast2-printer-2.17.34/src/wizards.ycp 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/src/wizards.ycp 2008-11-13 10:11:39.000000000 +0100
@@ -35,7 +35,6 @@
import "Wizard";
include "printer/readwrite.ycp";
-//include "printer/overview.ycp";
include "printer/basicadd.ycp";
include "printer/basicmodify.ycp";
include "printer/connectionwizard.ycp";
@@ -61,39 +60,56 @@
];
map sequence = $[ "ws_start" : "overview",
"overview": $[ `abort : `abort,
+ `back : `abort,
`next : `next,
`add : "add",
`modify : "modify",
`delete : "overview",
- `connection_wizard : "printing_via_network_connection_wizard"
+ `printing_via_network_back : "overview",
+ `printing_via_network_next : "overview",
+ `printing_via_network_connection_wizard : "printing_via_network_connection_wizard",
+ `sharing_back : "overview",
+ `sharing_next : "overview",
+ `policies_back : "overview",
+ `policies_next : "overview",
+ `autoconfig_back : "overview",
+ `autoconfig_next : "overview"
],
"add" : $[ `abort : `abort,
+ `back : "overview",
`next : "overview",
`connection_wizard : "add_connection_wizard",
`add_driver : "add_driver_add"
],
"add_connection_wizard" : $[ `abort : `abort,
+ `back : "add",
`next : "add"
],
"add_driver_add" : $[ `abort : `abort,
+ `back : "add",
`next : "add"
],
"modify" : $[ `abort : `abort,
+ `back : "overview",
`next : "overview",
`connection_wizard : "modify_connection_wizard",
`add_driver : "modify_driver_add",
`driver_options : "modify_driver_options"
],
"modify_connection_wizard" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"modify_driver_add" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"modify_driver_options" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"printing_via_network_connection_wizard" : $[ `abort : `abort,
+ `back : "overview",
`next : "add"
],
];
@@ -121,6 +137,7 @@
]
];
Wizard::CreateDialog();
+ Wizard::SetDesktopIcon("printer");
any ret = Sequencer::Run(aliases, sequence);
UI::CloseDialog();
return ret;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/tools/modify_cupsd_conf new/yast2-printer-2.17.41/tools/modify_cupsd_conf
--- old/yast2-printer-2.17.34/tools/modify_cupsd_conf 2008-11-06 12:44:45.000000000 +0100
+++ new/yast2-printer-2.17.41/tools/modify_cupsd_conf 2008-11-14 15:51:12.000000000 +0100
@@ -270,8 +270,14 @@
do test -n "$V" && sed -i -e "${ROOT_LOCATION_LINE_NUMBER}a$KEY $V" $CUPSDCONF
done
else # The 'Order allow,deny' line denies packets by default
- # to be 100% on the safe side have explicite 'Allow none' and 'Deny all' lines too:
- sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all\nAllow none" $CUPSDCONF
+ # to be on the safe side have en explicite 'Deny all' line
+ # but do not have an additional 'Allow none' line too
+ # because an explicite 'Allow none' line results in YaST
+ # a "none" entry for the experts settings in the Shareing dialog
+ # and such a "none" expert setting overrules any other setting
+ # so that all user would have to remove this expert setting
+ # manually to allow any kind of remote access.
+ sed -i -e "${ROOT_LOCATION_LINE_NUMBER}aDeny all" $CUPSDCONF
fi
fi
# Report the resulting setting in any case:
@@ -286,9 +292,15 @@
# or an error message because of a failed test below) on a new line:
echo 1>&2
# Test if the result is the expected one if a value was specified:
- if test -n "$VALUE" -a "$RESULT" != "$VALUE"
- then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
- exit 5
+ if test -n "$VALUE"
+ then if test "none" = "$VALUE"
+ then EXPECTED_RESULT=""
+ else EXPECTED_RESULT="$VALUE"
+ fi
+ if test "$RESULT" != "$EXPECTED_RESULT"
+ then echo "Failed to set '$KEY $VALUE' in $CUPSDCONF." 1>&2
+ exit 5
+ fi
fi
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-printer-2.17.34/VERSION new/yast2-printer-2.17.41/VERSION
--- old/yast2-printer-2.17.34/VERSION 2008-11-06 17:36:08.000000000 +0100
+++ new/yast2-printer-2.17.41/VERSION 2008-11-14 15:52:02.000000000 +0100
@@ -1 +1 @@
-2.17.34
+2.17.41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org