Hello community,
here is the log from the commit of package yast2-printer
checked in at Tue Sep 2 18:23:11 CEST 2008.
--------
--- yast2-printer/yast2-printer.changes 2008-08-29 14:50:16.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2008-09-02 16:36:10.369822000 +0200
@@ -1,0 +2,7 @@
+Tue Sep 2 16:31:57 CEST 2008 - jsmeix@suse.de
+
+- The 'Printing via Network'dialog writes the Browsing values
+ to the system (but client-only is not yet implemented).
+- 2.17.8
+
+-------------------------------------------------------------------
Old:
----
yast2-printer-2.17.7.tar.bz2
New:
----
yast2-printer-2.17.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.b23213/_old 2008-09-02 18:23:06.000000000 +0200
+++ /var/tmp/diff_new_pack.b23213/_new 2008-09-02 18:23:06.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.17.7)
+# spec file for package yast2-printer (Version 2.17.8)
#
# 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.7
+Version: 2.17.8
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.17.7.tar.bz2
+Source0: yast2-printer-2.17.8.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.7
+%setup -n yast2-printer-2.17.8
%build
%{prefix}/bin/y2tool y2autoconf
@@ -119,6 +119,10 @@
%exclude %{prefix}/share/doc/packages/yast2-printer/COPYING
%exclude %{prefix}/share/doc/packages/yast2-printer/README
%changelog
+* Tue Sep 02 2008 jsmeix@suse.de
+- The 'Printing via Network'dialog writes the Browsing values
+ to the system (but client-only is not yet implemented).
+- 2.17.8
* Fri Aug 29 2008 jsmeix@suse.de
- Some code cleanup.
- 2.17.7
++++++ yast2-printer-2.17.7.tar.bz2 -> yast2-printer-2.17.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/configure new/yast2-printer-2.17.8/configure
--- old/yast2-printer-2.17.7/configure 2008-08-29 14:46:13.000000000 +0200
+++ new/yast2-printer-2.17.8/configure 2008-09-02 16:33:46.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.7.
+# Generated by GNU Autoconf 2.61 for yast2-printer 2.17.8.
#
# 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.7'
-PACKAGE_STRING='yast2-printer 2.17.7'
+PACKAGE_VERSION='2.17.8'
+PACKAGE_STRING='yast2-printer 2.17.8'
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.7 to adapt to many kinds of systems.
+\`configure' configures yast2-printer 2.17.8 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.7:";;
+ short | recursive ) echo "Configuration of yast2-printer 2.17.8:";;
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.7
+yast2-printer configure 2.17.8
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.7, which was
+It was created by yast2-printer $as_me 2.17.8, 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.7'
+ VERSION='2.17.8'
cat >>confdefs.h <<_ACEOF
@@ -2409,7 +2409,7 @@
-VERSION="2.17.7"
+VERSION="2.17.8"
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.7, which was
+This file was extended by yast2-printer $as_me 2.17.8, 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.7
+yast2-printer config.status 2.17.8
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.7/configure.in new/yast2-printer-2.17.8/configure.in
--- old/yast2-printer-2.17.7/configure.in 2008-08-29 14:46:09.000000000 +0200
+++ new/yast2-printer-2.17.8/configure.in 2008-09-02 16:33:42.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.7, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.17.8, 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.7"
+VERSION="2.17.8"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/src/overview.ycp new/yast2-printer-2.17.8/src/overview.ycp
--- old/yast2-printer-2.17.7/src/overview.ycp 2008-08-29 11:16:45.000000000 +0200
+++ new/yast2-printer-2.17.8/src/overview.ycp 2008-09-02 09:57:44.000000000 +0200
@@ -246,9 +246,7 @@
if (event["EventReason"]:"" == "Activated" && event["ID"]:nil == `add){
// client only
- if( Printerlib::client_only
- && Printerlib::client_conf_server_name != "localhost"
- && Printerlib::client_conf_server_name != "127.0.0.1" )
+ if( Printerlib::client_only )
{ if( ! Popup::YesNoHeadline( "Disable remote CUPS server setting",
"A remote CUPS server setting conflicts with adding a print queue."
)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/src/Printerlib.ycp new/yast2-printer-2.17.8/src/Printerlib.ycp
--- old/yast2-printer-2.17.7/src/Printerlib.ycp 2008-08-29 12:54:14.000000000 +0200
+++ new/yast2-printer-2.17.8/src/Printerlib.ycp 2008-09-02 10:23:50.000000000 +0200
@@ -31,6 +31,8 @@
*/
global boolean ExecuteBashCommand( string bash_commandline )
{ y2milestone( "Executing bash commandline: %1", bash_commandline );
+ // Enforce a hopefully sane environment before running the actual command:
+ bash_commandline = "export PATH='/sbin:/usr/sbin:/usr/bin:/bin' ; export LC_ALL='POSIX' ; export LANG='POSIX' ; umask 022 ; " + bash_commandline;
result = (map)SCR::Execute( .target.bash_output, bash_commandline );
if( result["exit"]:9999 != 0 )
{ y2warning( "'%1' exit code is: %2", bash_commandline, result["exit"]:9999 );
@@ -66,10 +68,11 @@
}
}
else
- { client_conf_server_name = "";
+ { // Use fallback values when the command above failed:
+ client_conf_server_name = "";
client_only = false;
+ return false;
}
- // Ignore when it fails:
return true;
}
@@ -91,7 +94,11 @@
{ browsing_on = true;
}
}
- // Ignore when it fails:
+ else
+ { // Use fallback value when the command above failed:
+ browsing_on = true;
+ return false;
+ }
return true;
}
@@ -114,9 +121,10 @@
cupsd_conf_browse_allow = toset( splitstring( Printerlib::result["stdout"]:"all", " " ) );
}
else
- { cupsd_conf_browse_allow = [ "all" ];
+ { // Use fallback value when the command above failed:
+ cupsd_conf_browse_allow = [ "all" ];
+ return false;
}
- // Ignore when it fails:
return true;
}
@@ -125,12 +133,14 @@
global map cups_autoconfig = $[];
global void Read()
-{ // Determine the 'Browsing [ On | Off ]' value in /etc/cups/cupsd.conf and ignore when it fails:
+{ // Determine the 'Browsing [ On | Off ]' value in /etc/cups/cupsd.conf
+ // and ignore when it fails (i.e. use the fallback value silently):
DetermineBrowsing();
// Determine the 'BrowseAllow [ all | none | @LOCAL | IP-address[/netmask] ]'
- // values in /etc/cups/cupsd.conf and ignore when it fails:
+ // values in /etc/cups/cupsd.conf and ignore when it fails (i.e. use the fallback value silently):
DetermineBrowseAllow();
- // Determine the 'ServerName' value in /etc/cups/client.conf and ignore when it fails:
+ // Determine the 'ServerName' value in /etc/cups/client.conf
+ // and ignore when it fails (i.e. use the fallback value silently):
DetermineClientOnly();
// Read cups-autoconfiguration settings:
cups_autoconfig = (map)SCR::Read(.etc.cups-auto.all);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/src/printingvianetwork.ycp new/yast2-printer-2.17.8/src/printingvianetwork.ycp
--- old/yast2-printer-2.17.7/src/printingvianetwork.ycp 2008-08-29 13:07:20.000000000 +0200
+++ new/yast2-printer-2.17.8/src/printingvianetwork.ycp 2008-09-02 16:29:12.000000000 +0200
@@ -41,39 +41,12 @@
include "printer/helps.ycp";
-boolean something_has_changed = false;
-boolean cupsd_restart_required = false;
-boolean cupsd_start_required = false;
-boolean cupsd_stop_required = false;
-
-boolean ApplyNetworkPrintingSettings()
-{ if( ! something_has_changed )
- { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
- Popup::ShowFeedback( // No title for such a simple feedback message:
- "",
- // Message of a Popup::ShowFeedback when nothing was changed:
- _("Nothing changed.")
- );
- sleep( 1000 );
- Popup::ClearFeedback();
- return true;
- }
- y2milestone( "Writing 'NetworkPrinting' settings to the system." );
- // Nothing implemented yet:
- Popup::AnyMessage( // Header of a Popup::AnyMessage when "ApplyNetworkPrintingSettings" is called:
- _("Not yet implemented"),
- // Body of a Popup::AnyMessage when the "ApplyNetworkPrintingSettings" is called:
- _("Writing the settings to the system is not yet implemented.")
- );
- return false;
-}
-
term widgetNetworkPrinting = `VBox
( `VStretch(),
`Frame
( _("Use CUPS to Print Via Network"),
`RadioButtonGroup
- ( `id(`browsing_or_client_only_check_boxs),
+ ( `id(`browsing_or_client_only_check_boxes),
`VBox
( `Left
( `RadioButton
@@ -101,16 +74,24 @@
`Left
( `ComboBox
( `id(`cupsd_conf_browse_allow_combo_box),
+ `opt(`notify),
_("Usual &General Setting"),
- [ `item( `id(`browse_allow_local), "hosts in the local network" ),
- `item( `id(`browse_allow_all), "all hosts" )
+ [ `item( `id(`browse_allow_all), "all hosts" ),
+ `item( `id(`browse_allow_local), "hosts in the local network" ),
+ `item( `id(`browse_allow_specific), "only specific addresses" ),
]
)
),
`Left
( `TextEntry
( `id(`cupsd_conf_browse_allow_input),
- _("Specific IP Addresses or &Network/Netmask (separated by space)")
+ _("Optional Specific IP Addresses or &Network/Netmask")
+ )
+ ),
+ `Left
+ ( `Label
+ ( `id(`cupsd_conf_browse_allow_input_label),
+ _("(each nnn.nnn.nnn.nnn or nnn.nnn.nnn.nnn/mmm.mmm.mmm.mmm separated by one space)")
)
)
)
@@ -154,6 +135,11 @@
)
)
),
+ `VStretch()
+ );
+
+/*
+ ),
`VStretch(),
`Right
( `PushButton
@@ -162,15 +148,189 @@
)
)
);
+*/
+
+boolean something_has_changed = false;
+boolean cupsd_restart_required = false;
+boolean cupsd_start_required = false;
+boolean cupsd_stop_required = false;
+boolean initial_cupsd_conf_browsing_off_radio_button = false;
+boolean initial_cupsd_conf_browsing_on_radio_button = false;
+any initial_cupsd_conf_browse_allow_combo_box_value = nil;
+boolean initial_cupsd_conf_browse_allow_all = false;
+boolean initial_cupsd_conf_browse_allow_local = false;
+boolean initial_cupsd_conf_browse_allow_specific = false;
+string initial_cupsd_conf_browse_allow_input_value = "";
+boolean initial_client_only_radio_button = false;
+string initial_client_conf_server_name_input_value = "";
+
+boolean ApplyNetworkPrintingSettings()
+{ // Get the actual settings and values from the dialog:
+ any current_radio_button = UI::QueryWidget( `id(`browsing_or_client_only_check_boxes), `CurrentButton );
+ any current_browse_allow = UI::QueryWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value );
+ string current_browse_allow_input_value = (string)UI::QueryWidget( `id(`cupsd_conf_browse_allow_input), `Value );
+ string current_server_name_input_value = (string)UI::QueryWidget( `id(`client_conf_server_name_input), `Value );
+ y2milestone( "ApplyNetworkPrintingSettings with\ncurrent_radio_button = '%1'\ncurrent_browse_allow = '%2'\ncurrent_browse_allow_input_value = '%3'\ncurrent_server_name_input_value = '%4'", current_radio_button, current_browse_allow, current_browse_allow_input_value, current_server_name_input_value );
+ // Browsing Off:
+ if( `cupsd_conf_browsing_off_radio_button == current_radio_button )
+ { if( initial_cupsd_conf_browsing_off_radio_button )
+ { // Nothing has changed:
+ return true;
+ }
+ if( initial_cupsd_conf_browsing_on_radio_button )
+ { // It was initially a "Get browsing info" config,
+ // but now the user has activated the "No browsing info" radio button:
+ something_has_changed = true;
+ // Do not change the global "Browsing On/Off" entry in cupsd.conf
+ // because "Browsing Off" disables also sharing of local printers
+ // which might be needed by the "Share Printers" dialog.
+ // Instead set only "BrowseAllow none" in cupsd.conf:
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf BrowseAllow 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 set 'BrowseAllow none' in /etc/cups/cupsd.conf")
+ );
+ return false;
+ }
+ return true;
+ }
+ if( initial_client_only_radio_button )
+ { // Note that initial_client_only_radio_button is only true for a real client-only config
+ // but not when the server name value for client-only is "localhost" or "127.0.0.1",
+ // see Printerlib::DetermineClientOnly() and the initNetworkPrinting function below.
+ // If it is actually a client-only config,
+ // the user may have only activated the "No browsing info" radio button
+ // but left the server name value for client-only unchanged:
+ if( current_server_name_input_value != initial_client_conf_server_name_input_value )
+ { something_has_changed = true;
+ // The user has changed the server name value for client-only
+ // and afterwards he activated the "No browsing info" radio button.
+ // This should result a client-only setup with the new server name
+ // if the new server name is a non-empty string which is also not 'none':
+ string server_name = deletechars( tolower( current_server_name_input_value ), " " );
+ if( "" != server_name
+ && "none" != server_name
+ )
+ { if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "cups_client_only " + server_name ) )
+ { Report::Error( // Message of a Report::Error
+ // where %1 will be replaced by the server 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 set 'ServerName %1' in /etc/cups/client.conf"), server_name )
+ );
+ return false;
+ }
+ }
+ else
+ { // The client-only server name was changed to the empty string or to 'none'
+ // and afterwards the "No browsing info" radio button was activated.
+ // This should disable the client-only setup but not start the local cupsd:
+ 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 false;
+ }
+ }
+ }
+ }
+ // The above change to the client-only setup was successful or
+ // the user has not changed the server name value for client-only
+ // and afterwards he activated the "No browsing info" radio button.
+ // The latter case should also leave the current client-only setup as is:
+ return true;
+ }
+ // Browsing On:
+ if( `cupsd_conf_browsing_on_radio_button == current_radio_button )
+ { if( initial_cupsd_conf_browsing_off_radio_button )
+ { // It was initially a "No browsing info" config,
+ // but now the user has activated the "Get browsing info" radio button:
+ something_has_changed = true;
+ }
+ if( initial_cupsd_conf_browsing_on_radio_button )
+ { // It was initially a "Get browsing info" config,
+ // but now the user may have changed from which hosts browsing info is accepted:
+ if( current_browse_allow != initial_cupsd_conf_browse_allow_combo_box_value
+ || current_browse_allow_input_value != initial_cupsd_conf_browse_allow_input_value
+ )
+ { something_has_changed = true;
+ }
+ else
+ { // Nothing has changed:
+ return true;
+ }
+ }
+ if( initial_client_only_radio_button )
+ { // It was initially a client-only config,
+ // but now the user has activated the "Get browsing info" radio button:
+ something_has_changed = true;
+ }
+ if( something_has_changed )
+ { string browse_allow_value = current_browse_allow_input_value;
+ if( `browse_allow_all == current_browse_allow )
+ { // If browsing info is accepted from all hosts, it is actually useless
+ // to additionally accept it from specific IPs or networks
+ // but nevertheless the specific addresses are also set in cupsd.conf
+ // because I do not want to ignore what the user has entered.
+ // E.g. the user may like to accept browsing info from some specific addresses
+ // while he plays around with the predefined settings from the combo box:
+ browse_allow_value = browse_allow_value + " all";
+ }
+ if( `browse_allow_local == current_browse_allow )
+ { browse_allow_value = browse_allow_value + " @LOCAL";
+ }
+ if( "" != filterchars( browse_allow_value, " " ) )
+ { if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir + "modify_cupsd_conf Browsing On" ) )
+ { 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 set 'Browsing On' in /etc/cups/cupsd.conf")
+ );
+ return false;
+ }
+ if( ! Printerlib::ExecuteBashCommand( Printerlib::yast_bin_dir
+ + "modify_cupsd_conf BrowseAllow '"
+ + browse_allow_value
+ + "'"
+ )
+ )
+ { Report::Error( // Message of a Report::Error
+ // where %1 will be replaced by the values for BrowseAllow.
+ // 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 set BrowseAllow value(s) '%1' in /etc/cups/cupsd.conf"),
+ browse_allow_value
+ )
+ );
+ return false;
+ }
+ }
+ }
+ // Exit successfully by default and as fallback:
+ return true;
+ }
+ // Client-only:
+ if( `client_only_radio_button == current_radio_button )
+ { // Exit successfully by default and as fallback:
+ return true;
+ }
+ // Exit successfully by default and as fallback:
+ return true;
+}
void initNetworkPrinting( string key )
{ y2milestone( "entering initNetworkPrinting with key '%1'", key );
- // Determine the 'Browsing [ On | Off ]' value in /etc/cups/cupsd.conf and ignore when it fails:
+ // Determine the 'Browsing [ On | Off ]' value in /etc/cups/cupsd.conf
+ // and ignore when it fails (i.e. use the fallback value silently):
Printerlib::DetermineBrowsing();
// Determine the 'BrowseAllow [ all | none | @LOCAL | IP-address[/netmask] ]'
- // values in /etc/cups/cupsd.conf and ignore when it fails:
+ // values in /etc/cups/cupsd.conf and ignore when it fails (i.e. use the fallback value silently):
Printerlib::DetermineBrowseAllow();
- // Determine the 'ServerName' value in /etc/cups/client.conf and ignore when it fails:
+ // Determine the 'ServerName' value in /etc/cups/client.conf
+ // and ignore when it fails (i.e. use the fallback value silently):
Printerlib::DetermineClientOnly();
// Have all widgets disabled initially
// but nevertheless fill in the values of the current settings in the system:
@@ -181,11 +341,18 @@
// When by accident "all" and "@LOCAL" were set as BrowseAllow values,
// the "@LOCAL" entry is preselected in cupsd_conf_browse_allow_combo_box
// because this is the more secure setting:
+ initial_cupsd_conf_browse_allow_specific = true;
+ initial_cupsd_conf_browse_allow_combo_box_value = `browse_allow_specific;
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value, `id(`browse_allow_specific) );
if( contains( Printerlib::cupsd_conf_browse_allow, "all" ) )
- { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value, `id(`browse_allow_all) );
+ { initial_cupsd_conf_browse_allow_all = true;
+ initial_cupsd_conf_browse_allow_combo_box_value = `browse_allow_all;
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value, `id(`browse_allow_all) );
}
if( contains( Printerlib::cupsd_conf_browse_allow, "@LOCAL" ) )
- { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value, `id(`browse_allow_local) );
+ { initial_cupsd_conf_browse_allow_local = true;
+ initial_cupsd_conf_browse_allow_combo_box_value = `browse_allow_local;
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value, `id(`browse_allow_local) );
}
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, false );
// The preset entry in cupsd_conf_browse_allow_input field
@@ -195,7 +362,7 @@
// is implicitely done via cupsd_conf_browsing_off_radio_button:
string cupsd_conf_browse_allow_input_value = mergestring( filter( string value,
Printerlib::cupsd_conf_browse_allow,
- { value = tolower( value ) ;
+ { value = tolower( value );
return( "all" != value
&& "@local" != value
&& "none" != value
@@ -204,9 +371,12 @@
),
" "
);
+ initial_cupsd_conf_browse_allow_input_value = cupsd_conf_browse_allow_input_value;
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Value, cupsd_conf_browse_allow_input_value );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `Enabled, false );
UI::ChangeWidget( `id(`client_only_radio_button), `Value, false );
UI::ChangeWidget( `id(`client_conf_server_name_input), `Enabled, false );
+ initial_client_conf_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 );
@@ -215,7 +385,8 @@
// but there is also an active ServerName (!="localhost") in /etc/cups/client.conf
// have only the client-only widgets avtivated because client-only has topmost priority:
if( Printerlib::client_only )
- { UI::ChangeWidget( `id(`client_only_radio_button), `Value, true );
+ { initial_client_only_radio_button = true;
+ 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 );
}
@@ -225,13 +396,16 @@
if( Printerlib::browsing_on
&& ! contains( Printerlib::cupsd_conf_browse_allow, "none" )
)
- { UI::ChangeWidget( `id(`cupsd_conf_browsing_on_radio_button), `Value, true );
+ { initial_cupsd_conf_browsing_on_radio_button = true;
+ UI::ChangeWidget( `id(`cupsd_conf_browsing_on_radio_button), `Value, true );
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, true );
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, true );
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, true );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `Enabled, true );
}
else
- { UI::ChangeWidget( `id(`cupsd_conf_browsing_off_radio_button), `Value, true );
+ { initial_cupsd_conf_browsing_off_radio_button = true;
+ UI::ChangeWidget( `id(`cupsd_conf_browsing_off_radio_button), `Value, true );
}
}
y2milestone( "leaving initNetworkPrinting" );
@@ -240,26 +414,41 @@
symbol handleNetworkPrinting( string key, map event )
{ y2milestone( "entering handleNetworkPrinting with key '%1'\nand event '%2'", key, event );
if( "ValueChanged" == event["EventReason"]:"" )
- { if( `cupsd_conf_browsing_on_radio_button == event["ID"]:nil )
- { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, true );
- UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, true );
- UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, true );
+ { if( `cupsd_conf_browsing_off_radio_button == event["ID"]:nil )
+ { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, false );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, false );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, false );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `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( `cupsd_conf_browsing_off_radio_button == event["ID"]:nil )
- { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, false );
- UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, false );
- UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, false );
+ if( `cupsd_conf_browsing_on_radio_button == event["ID"]:nil )
+ { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, true );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, true );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, true );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `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( `cupsd_conf_browse_allow_combo_box == event["ID"]:nil )
+ { if( `browse_allow_all == UI::QueryWidget( `id(`cupsd_conf_browse_allow_combo_box), `Value ) )
+ { // If browsing info is accepted from all hosts,
+ // it is useless to additionally accept it from specific IPs or networks:
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, false );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `Enabled, false );
+ }
+ else
+ { UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, true );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `Enabled, true );
+ }
+ }
if( `client_only_radio_button == event["ID"]:nil )
{ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_label), `Enabled, false );
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_combo_box), `Enabled, false );
UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input), `Enabled, false );
+ UI::ChangeWidget( `id(`cupsd_conf_browse_allow_input_label), `Enabled, false );
UI::ChangeWidget( `id(`client_conf_server_name_input), `Enabled, true );
UI::ChangeWidget( `id(`test_client_conf_server), `Enabled, true );
UI::ChangeWidget( `id(`connection_wizard), `Enabled, false );
@@ -293,7 +482,18 @@
_("Failed to apply the settings to the system.")
);
}
+ if( ! something_has_changed )
+ { y2milestone( "Nothing changed in 'Printing via Network' dialog." );
+ Popup::ShowFeedback( // No title for such a simple feedback message:
+ "",
+ // Message of a Popup::ShowFeedback when nothing was changed:
+ _("Nothing changed.")
+ );
+ sleep( 1000 );
+ Popup::ClearFeedback();
+ }
y2milestone( "leaving storeNetworkPrinting" );
+ return nil;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/tools/modify_cupsd_conf new/yast2-printer-2.17.8/tools/modify_cupsd_conf
--- old/yast2-printer-2.17.7/tools/modify_cupsd_conf 2008-08-29 10:41:19.000000000 +0200
+++ new/yast2-printer-2.17.8/tools/modify_cupsd_conf 2008-09-02 15:46:48.000000000 +0200
@@ -21,12 +21,12 @@
echo "E.g.: BrowseAllow '@LOCAL 192.168.100.1 192.168.200.0/255.255.255.0'" 1>&2
echo "There is a strict syntax for keywords and values:" 1>&2
echo "Case matters." 1>&2
- echo "Neither leading nor trailing nor in-between spaces are allowed." 1>&2
- echo "Multiple values for a keyword must be separated by exactly one space." 1>&2
+ echo "Multiple values for a keyword must be separated by space." 1>&2
exit 1
fi
-VALUE="$2"
+# Remove duplicates (ignore case) and remove duplicate, leading and trailing spaces:
+VALUE="$( for V in $2 ; do echo $V ; done | sort -b -f -u | tr -s '[:space:]' ' ' | sed -e 's/ *$//' )"
CUPSDCONF="/etc/cups/cupsd.conf"
if ! test -r $CUPSDCONF -a -w $CUPSDCONF
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.17.7/VERSION new/yast2-printer-2.17.8/VERSION
--- old/yast2-printer-2.17.7/VERSION 2008-08-29 14:45:23.000000000 +0200
+++ new/yast2-printer-2.17.8/VERSION 2008-09-02 16:31:53.000000000 +0200
@@ -1 +1 @@
-2.17.7
+2.17.8
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org