Hello community,
here is the log from the commit of package yast2-printer
checked in at Tue Oct 31 10:19:34 CET 2006.
--------
--- yast2-printer/yast2-printer.changes 2006-10-24 17:34:23.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2006-10-31 09:43:32.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Oct 31 09:41:47 CET 2006 - mzugec@suse.cz
+
+- fate #301214: Adapt yast2-printer for CUPS 1.2
+- 2.14.5
+
+-------------------------------------------------------------------
Old:
----
yast2-printer-2.14.4.tar.bz2
New:
----
yast2-printer-2.14.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-printer.spec ++++++
--- /var/tmp/diff_new_pack.E0TTSC/_old 2006-10-31 10:19:25.000000000 +0100
+++ /var/tmp/diff_new_pack.E0TTSC/_new 2006-10-31 10:19:25.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-printer (Version 2.14.4)
+# spec file for package yast2-printer (Version 2.14.5)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-printer
-Version: 2.14.4
+Version: 2.14.5
Release: 1
License: GNU General Public License (GPL) - all versions
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-printer-2.14.4.tar.bz2
+Source0: yast2-printer-2.14.5.tar.bz2
prefix: /usr
BuildRequires: blocxx-devel cups-devel cups-drivers cups-drivers-stp docbook-xsl-stylesheets doxygen gcc-c++ libxcrypt-devel libxslt openssl-devel perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-testsuite
Requires: yast2 netcat zlib blocxx
@@ -33,7 +33,7 @@
%prep
-%setup -n yast2-printer-2.14.4
+%setup -n yast2-printer-2.14.5
%build
%{prefix}/bin/y2tool y2autoconf
@@ -101,6 +101,9 @@
%doc %{prefix}/share/doc/packages/yast2-printer
%changelog -n yast2-printer
+* Tue Oct 31 2006 - mzugec@suse.cz
+- fate #301214: Adapt yast2-printer for CUPS 1.2
+- 2.14.5
* Tue Oct 24 2006 - mzugec@suse.cz
- #214265 - module crashes when reading old driver database
- 2.14.4
++++++ yast2-printer-2.14.4.tar.bz2 -> yast2-printer-2.14.5.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/VERSION new/yast2-printer-2.14.5/VERSION
--- old/yast2-printer-2.14.4/VERSION 2006-10-24 17:30:58.000000000 +0200
+++ new/yast2-printer-2.14.5/VERSION 2006-10-31 09:40:31.000000000 +0100
@@ -1 +1 @@
-2.14.4
+2.14.5
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/agent-cups/src/CupsCalls.cc new/yast2-printer-2.14.5/agent-cups/src/CupsCalls.cc
--- old/yast2-printer-2.14.4/agent-cups/src/CupsCalls.cc 2006-03-21 08:59:12.000000000 +0100
+++ new/yast2-printer-2.14.5/agent-cups/src/CupsCalls.cc 2006-10-30 18:23:55.000000000 +0100
@@ -38,7 +38,7 @@
// FIXME: return value...?
bool setPrinter(const char*name,const char*info,const char*loc,const char*state,const char*statemsg,
const char*bannerstart,const char*bannerend,const char*deviceuri,
- const set<string>allowusers,const set<string>denyusers,const char*ppd,const char*accepting)
+ const set<string>allowusers,const set<string>denyusers,const char*ppd,const char*accepting, const char*shared)
{
http_t *http; /* Connection to server */
ipp_t *request, /* IPP Request */
@@ -90,6 +90,13 @@
else if(!strcasecmp(accepting,"no"))
ippAddBoolean(request,IPP_TAG_PRINTER,"printer-is-accepting-jobs",0);
}
+ if(NULL!=shared)
+ {
+ if(!strcasecmp(shared,"yes"))
+ ippAddBoolean(request,IPP_TAG_PRINTER,"printer-is-shared",1);
+ else if(!strcasecmp(shared,"no"))
+ ippAddBoolean(request,IPP_TAG_PRINTER,"printer-is-shared",0);
+ }
if(NULL!=info)
ippAddString(request,IPP_TAG_PRINTER,IPP_TAG_TEXT,"printer-info",NULL,info);
if(NULL!=loc)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/agent-cups/src/CupsCalls.h new/yast2-printer-2.14.5/agent-cups/src/CupsCalls.h
--- old/yast2-printer-2.14.4/agent-cups/src/CupsCalls.h 2006-03-21 08:59:12.000000000 +0100
+++ new/yast2-printer-2.14.5/agent-cups/src/CupsCalls.h 2006-10-30 18:23:55.000000000 +0100
@@ -4,7 +4,7 @@
*
* Author: Petr Blahos
*
- * $Id: CupsCalls.h 19894 2004-10-19 15:58:12Z jsrain $
+ * $Id: CupsCalls.h 33813 2006-10-28 12:11:41Z mzugec $
*/
#ifndef _CUPSCALLS_H_
#define _CUPSCALLS_H_
@@ -35,7 +35,7 @@
*/ //FIXME: return value
bool setPrinter(const char*name,const char*info,const char*loc,const char*state,const char*statemsg,
const char*bannerstart,const char*bannerend,const char*deviceuri,
- const set<string>allowusers,const set<string>denyusers,const char*ppd,const char*accepting);
+ const set<string>allowusers,const set<string>denyusers,const char*ppd,const char*accepting, const char*shared);
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/agent-cups/src/PrintersConf.cc new/yast2-printer-2.14.5/agent-cups/src/PrintersConf.cc
--- old/yast2-printer-2.14.4/agent-cups/src/PrintersConf.cc 2006-03-21 08:59:12.000000000 +0100
+++ new/yast2-printer-2.14.5/agent-cups/src/PrintersConf.cc 2006-10-30 18:23:55.000000000 +0100
@@ -4,7 +4,7 @@
*
* Author: Petr Blahos
*
- * $Id: PrintersConf.cc 13245 2004-01-16 17:55:04Z jsrain $
+ * $Id: PrintersConf.cc 33813 2006-10-28 12:11:41Z mzugec $
*/
/*
@@ -73,10 +73,9 @@
/*
* Do the request and get back a response...
*/
-
if ((response = cupsDoRequest(http, request, "/")) != NULL)
{
- Y2_DEBUG("cupsDoRequest to get printers succeded");
+ Y2_DEBUG("cupsDoRequest to get printers succeded %s", response);
if (response->request.status.status_code > IPP_OK_CONFLICT)
{
Y2_DEBUG("lpstat: get-printers failed: %s\n",
@@ -139,6 +138,10 @@
{
newprinter.setAccepting(attr->values[0].boolean);
}
+ else if (strcmp(attr->name, "printer-is-shared") == 0 && attr->value_tag == IPP_TAG_BOOLEAN)
+ {
+ newprinter.setShared(attr->values[0].boolean);
+ }
else if (strcmp(attr->name, "job-sheets-default") == 0 && attr->value_tag == IPP_TAG_NAME)
{
if(attr->num_values>1)
@@ -324,6 +327,7 @@
m->add(YCPString("default"),YCPBoolean(Default));
m->add(YCPString("accepting"),YCPBoolean(Accepting));
+ m->add(YCPString("shared"),YCPBoolean(Shared));
m->add(YCPString("allowusers"),set2YCPList(AllowUsers));
m->add(YCPString("denyusers"),set2YCPList(DenyUsers));
m->add(YCPString("options"),map2YCPMap(options));
@@ -350,7 +354,6 @@
YCPBoolean PrintersConf::Write(const YCPPath &path, const YCPValue& value, const YCPValue& arg)
{
-// Y2_ERROR("Write .cups.printers");
if(2==path->length() && path->component_str(1) == "add")
{
if(value->isVoid())
@@ -418,6 +421,7 @@
const char*xState = NULL;
const char*xStateMsg = NULL;
const char*xAccepting = NULL;
+ const char*xShared = NULL;
const char*xBannerStart = NULL;
const char*xBannerEnd = NULL;
const char*xppd = NULL;
@@ -439,6 +443,7 @@
if(!(v = m->value(YCPString("uri"))).isNull()) if(v->isString()) xUri = v->asString()->value_cstr();
if(!(v = m->value(YCPString("state"))).isNull()) if(v->isString()) xState = v->asString()->value_cstr();
if(!(v = m->value(YCPString("statemessage"))).isNull())if(v->isString()) xStateMsg = v->asString()->value_cstr();
+ if(!(v = m->value(YCPString("shared"))).isNull()) if(v->isBoolean()) xShared = v->asBoolean()->value() ? "Yes" : "No";
if(!(v = m->value(YCPString("accepting"))).isNull()) if(v->isBoolean()) xAccepting = v->asBoolean()->value() ? "Yes" : "No";
if(!(v = m->value(YCPString("bannerstart"))).isNull())if(v->isString()) xBannerStart = v->asString()->value_cstr();
if(!(v = m->value(YCPString("bannerend"))).isNull()) if(v->isString()) xBannerEnd = v->asString()->value_cstr();
@@ -454,9 +459,8 @@
YCPList l = v->asList();
xDenyUsers = YCPList2set(l);
}
-
if(!(v = m->value(YCPString("ppd"))).isNull()) if(v->isString()) xppd = v->asString()->value_cstr();
- ret = ::setPrinter(xPrinter,xInfo,xLoc,xState,xStateMsg,xBannerStart,xBannerEnd,xUri,xAllowUsers,xDenyUsers,xppd,xAccepting);
+ ret = ::setPrinter(xPrinter,xInfo,xLoc,xState,xStateMsg,xBannerStart,xBannerEnd,xUri,xAllowUsers,xDenyUsers,xppd,xAccepting, xShared);
if(!(v = m->value(YCPString("options"))).isNull())
if(v->isMap())
@@ -478,6 +482,7 @@
const char*xStateMsg = NULL;
bool acc = Accepting;
const char*xAccepting = NULL;
+ const char*xShared = NULL;
const char*xBannerStart = NULL;
const char*xBannerEnd = NULL;
set<string>xAllowUsers;
@@ -500,6 +505,7 @@
if(!(v = m->value(YCPString("state"))).isNull()) if(v->isString()) xState = v->asString()->value_cstr();
if(!(v = m->value(YCPString("statemessage"))).isNull())if(v->isString()) xStateMsg = v->asString()->value_cstr();
if(!(v = m->value(YCPString("accepting"))).isNull()) if(v->isBoolean()) xAccepting = (acc = v->asBoolean()->value()) ? "Yes" : "No";
+ if(!(v = m->value(YCPString("shared"))).isNull()) if(v->isBoolean()) xShared = (acc = v->asBoolean()->value()) ? "Yes" : "No";
if(!m->value(YCPString("bannerstart")).isNull() || !m->value(YCPString("bannerstart")).isNull())
{
xBannerStart = m->value(YCPString("bannerstart"))->asString()->value_cstr();
@@ -535,7 +541,7 @@
if(NULL!=xppd && ppd==xppd) xppd = NULL;
if(Accepting==acc) xAccepting = NULL;
- ret = ::setPrinter(xPrinter,xInfo,xLoc,xState,xStateMsg,xBannerStart,xBannerEnd,xUri,xAllowUsers,xDenyUsers,xppd,xAccepting);
+ ret = ::setPrinter(xPrinter,xInfo,xLoc,xState,xStateMsg,xBannerStart,xBannerEnd,xUri,xAllowUsers,xDenyUsers,xppd,xAccepting, xShared);
Y2_DEBUG ("Change printer: %s", ret ? "OK" : "Error");
//
@@ -650,7 +656,6 @@
return false;
}
string name = temp->asString()->value();
-
//
// find this printer in list of printers
//
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/agent-cups/src/PrintersConf.h new/yast2-printer-2.14.5/agent-cups/src/PrintersConf.h
--- old/yast2-printer-2.14.4/agent-cups/src/PrintersConf.h 2006-03-21 08:59:12.000000000 +0100
+++ new/yast2-printer-2.14.5/agent-cups/src/PrintersConf.h 2006-10-30 18:23:55.000000000 +0100
@@ -5,7 +5,7 @@
*
* Author: Petr Blahos
*
- * $Id: PrintersConf.h 19894 2004-10-19 15:58:12Z jsrain $
+ * $Id: PrintersConf.h 33905 2006-10-30 17:22:25Z mzugec $
*/
#ifndef _PrintersConf_h_
#define _PrintersConf_h_
@@ -27,7 +27,7 @@
*
* @short One entry in printers.conf file
* @author Petr Blahos
- * @version $Id: PrintersConf.h 19894 2004-10-19 15:58:12Z jsrain $
+ * @version $Id: PrintersConf.h 33905 2006-10-30 17:22:25Z mzugec $
*
*/
class PrinterEntry
@@ -40,6 +40,7 @@
string Uri;
string State;
string StateMessage;
+ bool Shared;
bool Accepting;
string BannerStart;
string BannerEnd;
@@ -60,7 +61,7 @@
* Default constructor.
*/
PrinterEntry()
- : Name(), Default(false), Info(), Location(), Uri(), State(), StateMessage(),
+ : Name(), Default(false), Info(), Location(), Uri(), State(), StateMessage(), Shared(true),
Accepting(false), BannerStart(), BannerEnd(), AllowUsers(), DenyUsers(), ppd(), options(),
saved(false)
{
@@ -98,6 +99,7 @@
#define CREATE_SET(x,y) void set##x(const y x##_){x = x##_;}
CREATE_SET(Name,string);
CREATE_SET(Default,bool);
+ CREATE_SET(Shared,bool);
CREATE_SET(Info,string);
CREATE_SET(Location,string);
CREATE_SET(Uri,string);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/configure new/yast2-printer-2.14.5/configure
--- old/yast2-printer-2.14.4/configure 2006-10-24 17:02:20.000000000 +0200
+++ new/yast2-printer-2.14.5/configure 2006-10-31 09:37:25.000000000 +0100
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for yast2-printer 2.14.3.
+# Generated by GNU Autoconf 2.59 for yast2-printer 2.14.4.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -423,8 +423,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-printer'
PACKAGE_TARNAME='yast2-printer'
-PACKAGE_VERSION='2.14.3'
-PACKAGE_STRING='yast2-printer 2.14.3'
+PACKAGE_VERSION='2.14.4'
+PACKAGE_STRING='yast2-printer 2.14.4'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -959,7 +959,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.14.3 to adapt to many kinds of systems.
+\`configure' configures yast2-printer 2.14.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1026,7 +1026,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-printer 2.14.3:";;
+ short | recursive ) echo "Configuration of yast2-printer 2.14.4:";;
esac
cat <<\_ACEOF
@@ -1169,7 +1169,7 @@
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-yast2-printer configure 2.14.3
+yast2-printer configure 2.14.4
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1183,7 +1183,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.14.3, which was
+It was created by yast2-printer $as_me 2.14.4, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1913,7 +1913,7 @@
# Define the identity of the package.
PACKAGE='yast2-printer'
- VERSION='2.14.3'
+ VERSION='2.14.4'
cat >>confdefs.h <<_ACEOF
@@ -2124,7 +2124,7 @@
-VERSION="2.14.3"
+VERSION="2.14.4"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
@@ -21730,7 +21730,7 @@
} >&5
cat >&5 <<_CSEOF
-This file was extended by yast2-printer $as_me 2.14.3, which was
+This file was extended by yast2-printer $as_me 2.14.4, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21793,7 +21793,7 @@
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-printer config.status 2.14.3
+yast2-printer config.status 2.14.4
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/configure.in new/yast2-printer-2.14.5/configure.in
--- old/yast2-printer-2.14.4/configure.in 2006-10-24 17:01:44.000000000 +0200
+++ new/yast2-printer-2.14.5/configure.in 2006-10-31 09:37:03.000000000 +0100
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.13.21 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-printer, 2.14.3, http://bugs.opensuse.org/, yast2-printer)
+AC_INIT(yast2-printer, 2.14.4, http://bugs.opensuse.org/, yast2-printer)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.14.3"
+VERSION="2.14.4"
RPMNAME="yast2-printer"
MAINTAINER="Michal Zugec "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/common/dialogs-connection.ycp new/yast2-printer-2.14.5/src/common/dialogs-connection.ycp
--- old/yast2-printer-2.14.4/src/common/dialogs-connection.ycp 2006-09-01 17:39:12.000000000 +0200
+++ new/yast2-printer-2.14.5/src/common/dialogs-connection.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -9,7 +9,7 @@
* Petr Blahos
* Jiri Srain
*
- * $Id: dialogs-connection.ycp 32676 2006-09-01 15:40:46Z mzugec $
+ * $Id: dialogs-connection.ycp 33905 2006-10-30 17:22:25Z mzugec $
*
*/
{
@@ -720,9 +720,9 @@
{
Popup::Message (
// popup CAUTION: "device" here means /dev/usb/lp0, /dev/usb/lp1, ...
-_("No USB devices (/dev/usb/lp?) found. It seems
+_("No USB devices found. It seems
that your USB bus is not properly configured."));
- devices = add (devices, "/dev/usb/lp0");
+// devices = add (devices, "/dev/usb/lp0");
}
else if (type == "serial")
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/common/dialogs.ycp new/yast2-printer-2.14.5/src/common/dialogs.ycp
--- old/yast2-printer-2.14.4/src/common/dialogs.ycp 2006-09-01 17:39:12.000000000 +0200
+++ new/yast2-printer-2.14.5/src/common/dialogs.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -8,7 +8,7 @@
* Authors:
* Petr Blahos
*
- * $Id: dialogs.ycp 32676 2006-09-01 15:40:46Z mzugec $
+ * $Id: dialogs.ycp 33905 2006-10-30 17:22:25Z mzugec $
* Main dialogs.
*/
{
@@ -48,6 +48,7 @@
* @return `abort if aborted and `next otherwise
*/
define symbol WriteDialog() ``{
+// Printer::validateShared();
Wizard::RestoreHelp (getWriteProgressHelp ());
boolean ret = Printer::Write();
return ret ? `next : `abort;
@@ -689,6 +690,7 @@
string uri = Printer::printer["uri"]:"";
string uri_type = Printerlib::getUriType (uri);
boolean raw = (boolean) (Printer::printer["raw"]:nil);
+ boolean shared = (boolean)Printer::printer["shared"]:true;
if (raw == nil)
{
@@ -731,11 +733,6 @@
// check box
_("Print &Form Feed between Jobs"), ff);
-// term aa_insert = allow_auto
-// ? `CheckBox (`id (`auto), `opt (`notify, `hstretch),
-// // check box
-// _("Automatically Propose &Multiple Queues"), auto_propose)
-// : `VSpacing (0);
term contents = `VBox (
`TextEntry (`id (`name), `opt (`hstretch),
@@ -752,6 +749,7 @@
? _("&Class Location")
// text entry
: _("Printer &Location"), loc),
+ `Left(`CheckBox(`id(`shared), _("Share Printer"), shared)),
`VSpacing (0.5),
raw_insert,
ff_insert,
@@ -876,6 +874,7 @@
name = (string)UI::QueryWidget (`id (`name), `Value);
info = (string)UI::QueryWidget (`id (`info), `Value);
loc = (string)UI::QueryWidget (`id (`loc), `Value);
+ shared = (boolean)UI::QueryWidget (`id (`shared), `Value);
// if (allow_auto)
// {
// auto_propose = (boolean) UI::QueryWidget (`id (`auto), `Value);
@@ -900,6 +899,7 @@
Printer::printer["info"] = info;
Printer::printer["location"] = loc;
Printer::printer["auto_propose"] = auto_propose;
+ Printer::printer["shared"] = shared;
if (raw)
{
ret = `raw;
@@ -1400,7 +1400,6 @@
"PaperDimension":ps];
}
Printer::printer["ppd_options"]=ppd_options;
-y2internal("Printer %1", Printer::printer);
*/
//saveOptions();
//
@@ -2173,9 +2172,10 @@
return $[ "ID":Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false),
"MODEL":i["ppd_info", "model"]:"unknown",
"SPOOL":i["name"]:"unknown",
- "DESCR":("<b>" + i["ppd_info", "manufacturer"]:"none" +
+ "DESCR":("<b>" + i["ppd_info", "manufacturer"]:"none" + "<br>" +
" " + i["ppd_info", "model"]:"" +
" / " + i["name"]:"" + "</b><br>" +
+ (((boolean)i["shared"]:false)?_("Shared"):_("Not Shared")) + "<br>" +
_(" Connected As ") + Printerlib::getReplacedString(i["uri"]:"none", false)) + "<br>" +
_(" With Spool ") + i["name"]:"none",
"DEFAULT":def ];
@@ -2306,7 +2306,8 @@
[ `redetect, _("Restart Detection") ],
[ `default_q, _("Set Default") ],
[ `cups_expert , _("CUPS Expert Settings") ],
- [ `change_ipp_listen, _("Change IPP Listen") ]
+ [ `change_ipp_listen, _("Change IPP Listen") ],
+ [ `change_remote_access, _("Change Remote Access Settings") ]
]);
SetHWDialogData ();
@@ -2388,6 +2389,64 @@
}
return ret; // FIXME
}
+
+define symbol runRemoteAccessDialog(){
+ term contents = `HBox (`HStretch (), `VBox (
+ `VStretch (),
+ `RadioButtonGroup (`id (`rb),
+ // frame
+ `Frame (_("Remote Access"),`HBox (
+ `HSpacing (3),
+ `VBox (
+ `VSpacing (3),
+ // radiobutton
+ `Left(`RadioButton( `id(0), _("Enable"))),
+ `Left(`RadioButton( `id(1), _("Disable"))),
+ // radiobutton
+ `VSpacing (3)
+ ),
+ `HSpacing (3)
+ )
+ )),
+ `VStretch ()
+ ), `HStretch ());
+
+ Wizard::SetContentsButtons (_("CUPS Remote Access Settings"), contents, getRemoteAccessHelp(),
+ Label::BackButton (), Label::NextButton () );
+boolean allow=true;
+foreach(string row, CUPS::cups_server_settings["Listen"]:[], {
+ if (row=="localhost:631") allow=false;
+});
+ if (allow) UI::ChangeWidget (`id (`rb), `CurrentButton,0);
+ else UI::ChangeWidget (`id (`rb), `CurrentButton,1);
+
+
+ symbol ret = (symbol)UI::UserInput();
+ if (ret == `next){
+ integer option = tointeger(UI::QueryWidget(`id(`rb), `CurrentButton));
+ switch (option){
+ case 0 :
+ y2milestone("Changing remote access to enable");
+
+ CUPS::cups_server_settings["Listen"]=
+ ["*:631", "/var/run/cups/cups.sock"];
+ CUPS::cups_server_permissions["/"]=$["Allow":["localhost", "127.0.0.2", "@LOCAL"],
+ "Order":["allow,deny"]];
+ break;
+ case 1 :
+ y2milestone("Changing remote access to disable");
+ CUPS::cups_server_settings["Listen"]=
+ ["localhost:631", "127.0.0.2:631", "/var/run/cups/cups.sock"];
+ CUPS::cups_server_permissions["/"]=$["Allow":["localhost", "127.0.0.2"],
+ "Order":["allow,deny"]];
+ break;
+ };
+ }
+
+ return ret;
+}
+
+
/**
* Complex dialog.
* @return symbol for ws
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/common/helps.ycp new/yast2-printer-2.14.5/src/common/helps.ycp
--- old/yast2-printer-2.14.4/src/common/helps.ycp 2006-08-28 11:11:09.000000000 +0200
+++ new/yast2-printer-2.14.5/src/common/helps.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -9,7 +9,7 @@
* Petr Blahos
* Jiri Srain
*
- * $Id: helps.ycp 30684 2006-05-04 11:26:07Z locilka $
+ * $Id: helps.ycp 33905 2006-10-30 17:22:25Z mzugec $
* Help texts.
*/
{
@@ -41,6 +41,14 @@
+ _("<P>Note that some USB printers do not report their serial numbers.</P>");
}
+ define string getRemoteAccessHelp () ``{
+ return _("<P><B><BIG>Remote Access CUPS Settings</BIG></B><br>
+You can allow or disallow (Enable/Disable) remote access to local shared printers.<br> This will overwrite your CUPS server settings.<br>
+For special cases use Overview Dialog: Other -> CUPS Expert Settings ->CUPS Server Settings -> Change Permissions.
+</p>
+");
+
+ }
/**
* Help text
@@ -260,6 +268,10 @@
option to eject the last page of the print job.</p>
");
}
+ // help text 4/7 (feature of >=CUPS1.2) - printer sharing
+ t = t + _("<p><b><big>Share Printer</big></b><br>
+This options allows to share printer via network.
+</p>");
// help text 7/7, only for printer
t = t + _("<P><B><BIG>Testing the Queue</big></b><br>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/common/wizards.ycp new/yast2-printer-2.14.5/src/common/wizards.ycp
--- old/yast2-printer-2.14.4/src/common/wizards.ycp 2006-09-01 17:39:12.000000000 +0200
+++ new/yast2-printer-2.14.5/src/common/wizards.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -9,7 +9,7 @@
* Petr Blahos
* Jiri Srain
*
- * $Id: wizards.ycp 32676 2006-09-01 15:40:46Z mzugec $
+ * $Id: wizards.ycp 33905 2006-10-30 17:22:25Z mzugec $
*/
{
textdomain "printer";
@@ -90,6 +90,7 @@
"listen_ipp_bcast": ``(runListenIPPDialog ()),
"cups_client" : ``(runCupsClientDialog (false)),
"cups_expert" : ``(runCupsExpertDialog ()),
+ "remote_access" : ``(runRemoteAccessDialog()),
// cups only
@@ -458,6 +459,7 @@
`edit_unconf : "edit_printer_unconf",
`change_ipp_listen : "listen_ipp_bcast",
`cups_expert : "cups_expert",
+ `change_remote_access : "remote_access",
// `cupsd : "cupsd",
// `cupsusb : "cups_usb",
`connection_cups : "cups_client"
@@ -489,6 +491,10 @@
`cupsd : "cupsd",
`cupsusb : "cups_usb"
],
+ "remote_access" : $[
+ `abort : `abort,
+ `next : "detected"
+ ],
"cups_usb" : $[
`next : "detected",
`abort : `abort,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/modules/CUPS.ycp new/yast2-printer-2.14.5/src/modules/CUPS.ycp
--- old/yast2-printer-2.14.4/src/modules/CUPS.ycp 2006-08-28 11:13:23.000000000 +0200
+++ new/yast2-printer-2.14.5/src/modules/CUPS.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -11,7 +11,7 @@
* Authors:
* Jiri Srain
*
- * $Id: CUPS.ycp 32589 2006-08-28 09:14:57Z mzugec $
+ * $Id: CUPS.ycp 33905 2006-10-30 17:22:25Z mzugec $
*
* Printer library exported functions. What else?!?
*/
@@ -346,7 +346,6 @@
SCR::Execute (.target.bash, sformat ("test -f %1 && rm %1",
sformat ("/etc/cups/ppd/%1.ppd", entry["name"]:"")));
}
-
boolean res = SCR::Write (.cups.printers.add, entry);
if (! res)
// popup
@@ -413,15 +412,16 @@
cups_usb_devices = maplist (string l, lines, {
string model = regexpsub (l, "[^\"]*\"([^\"]*)\".*", "\\1");
string c_dev = regexpsub (l, "direct usb:([^ ]*) .*", "\\1");
- string u_dev = sformat ("/dev/usb/lp%1", counter);
+/* string u_dev = sformat ("/dev/usb/lp%1", counter);
if (usb_dev_names == `never
|| (usb_dev_names == `serial
&& ! issubstring (c_dev, "serial")))
{
c_dev = u_dev;
}
+*/
counter = counter + 1;
- return [c_dev, model, u_dev];
+ return [c_dev, model];
});
Printerlib::SetCupsUsbDevicesInfo (cups_usb_devices);
return cups_usb_devices;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.14.4/src/modules/Printer.ycp new/yast2-printer-2.14.5/src/modules/Printer.ycp
--- old/yast2-printer-2.14.4/src/modules/Printer.ycp 2006-09-01 17:39:12.000000000 +0200
+++ new/yast2-printer-2.14.5/src/modules/Printer.ycp 2006-10-30 18:23:55.000000000 +0100
@@ -12,7 +12,7 @@
* Petr Blahos
* Jiri Srain
*
- * $Id: Printer.ycp 32676 2006-09-01 15:40:46Z mzugec $
+ * $Id: Printer.ycp 33905 2006-10-30 17:22:25Z mzugec $
*
* Well we all know what modules are for.
*/
@@ -127,6 +127,51 @@
string default_paper_size = nil;
+/*
+global void validateShared(){
+ boolean shared = false;
+ boolean only_localhost = false;
+ foreach(map row, printcap, {
+ if ((boolean)row["shared"]:false==true) shared=true;
+ });
+ foreach(string row, CUPS::cups_server_settings["Listen"]:[], {
+ if (row=="localhost:631") only_localhost = true;
+ });
+ if (only_localhost&&shared) {
+ symbol ret = Popup::AnyQuestion3(Label::WarningMsg(), _("At least one of your printers is configured to be shared.
+But your server is listening only on localhost.
+You can disable sharing of all printers or start listening to all interfaces."),
+_("Disable Sharing"), _("Open Listen"), _("Ignore"), `focus_no);
+ switch (ret){
+ case(`yes):
+ y2milestone("Disable all sharing");
+ list