Hello community, here is the log from the commit of package yast2-printer checked in at Tue Nov 6 23:40:26 CET 2007. -------- --- yast2-printer/yast2-printer.changes 2007-10-30 15:57:17.000000000 +0100 +++ /mounts/work_src_done/STABLE/yast2-printer/yast2-printer.changes 2007-11-06 16:50:20.000000000 +0100 @@ -1,0 +2,15 @@ +Tue Nov 6 16:44:36 CET 2007 - mzugec@suse.cz + +- tabbed UI done (without help) +- 2.16.4 + +------------------------------------------------------------------- +Fri Nov 2 12:54:13 CET 2007 - mzugec@suse.cz + +- show network printers - fixed (problem when password contains + space for smb backend)(#332237) +- disable edit for raw queues (#247336) +- split UI into tabs (not done completly) +- 2.16.3 + +------------------------------------------------------------------- Old: ---- yast2-printer-2.16.2.tar.bz2 New: ---- yast2-printer-2.16.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-printer.spec ++++++ --- /var/tmp/diff_new_pack.z13213/_old 2007-11-06 23:32:15.000000000 +0100 +++ /var/tmp/diff_new_pack.z13213/_new 2007-11-06 23:32:15.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package yast2-printer (Version 2.16.2) +# spec file for package yast2-printer (Version 2.16.4) # # Copyright (c) 2007 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.16.2 +Version: 2.16.4 Release: 1 License: GPL v2 or later Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-printer-2.16.2.tar.bz2 +Source0: yast2-printer-2.16.4.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 zlib-devel Requires: yast2 netcat zlib blocxx @@ -29,12 +29,12 @@ Summary: YaST2 - Printer Configuration %package devel-doc -Version: 2.16.2 +Version: 2.16.4 Release: 1 License: GPL v2 or later Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-printer-2.16.2.tar.bz2 +Source0: yast2-printer-2.16.4.tar.bz2 Prefix: /usr BuildRequires: cups-devel yast2-core-devel zlib-devel Summary: YaST2 - Developer documentation for yast2-printer @@ -51,7 +51,7 @@ %prep -%setup -n yast2-printer-2.16.2 +%setup -n yast2-printer-2.16.4 %build %{prefix}/bin/y2tool y2autoconf @@ -130,6 +130,15 @@ %exclude %{prefix}/share/doc/packages/yast2-printer/COPYING %exclude %{prefix}/share/doc/packages/yast2-printer/README %changelog +* Tue Nov 06 2007 - mzugec@suse.cz +- tabbed UI done (without help) +- 2.16.4 +* Fri Nov 02 2007 - mzugec@suse.cz +- show network printers - fixed (problem when password contains + space for smb backend)(#332237) +- disable edit for raw queues (#247336) +- split UI into tabs (not done completly) +- 2.16.3 * Tue Oct 30 2007 - mzugec@suse.cz - let the user accept even non-compliant PPDs - (#310177) - 2.16.2 ++++++ yast2-printer-2.16.2.tar.bz2 -> yast2-printer-2.16.4.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/configure new/yast2-printer-2.16.4/configure --- old/yast2-printer-2.16.2/configure 2007-10-30 15:51:29.000000000 +0100 +++ new/yast2-printer-2.16.4/configure 2007-11-06 16:34:07.000000000 +0100 @@ -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.16.1. +# Generated by GNU Autoconf 2.61 for yast2-printer 2.16.3. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='yast2-printer' PACKAGE_TARNAME='yast2-printer' -PACKAGE_VERSION='2.16.1' -PACKAGE_STRING='yast2-printer 2.16.1' +PACKAGE_VERSION='2.16.3' +PACKAGE_STRING='yast2-printer 2.16.3' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' ac_unique_file="RPMNAME" @@ -1449,7 +1449,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.16.1 to adapt to many kinds of systems. +\`configure' configures yast2-printer 2.16.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1520,7 +1520,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of yast2-printer 2.16.1:";; + short | recursive ) echo "Configuration of yast2-printer 2.16.3:";; esac cat <<\_ACEOF @@ -1626,7 +1626,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -yast2-printer configure 2.16.1 +yast2-printer configure 2.16.3 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1640,7 +1640,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.16.1, which was +It was created by yast2-printer $as_me 2.16.3, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2461,7 +2461,7 @@ # Define the identity of the package. PACKAGE='yast2-printer' - VERSION='2.16.1' + VERSION='2.16.3' cat >>confdefs.h <<_ACEOF @@ -2688,7 +2688,7 @@ -VERSION="2.16.1" +VERSION="2.16.3" RPMNAME="yast2-printer" MAINTAINER="Michal Zugec <mzugec@suse.cz>" @@ -22599,7 +22599,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.16.1, which was +This file was extended by yast2-printer $as_me 2.16.3, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22652,7 +22652,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -yast2-printer config.status 2.16.1 +yast2-printer config.status 2.16.3 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.16.2/configure.in new/yast2-printer-2.16.4/configure.in --- old/yast2-printer-2.16.2/configure.in 2007-10-30 15:51:09.000000000 +0100 +++ new/yast2-printer-2.16.4/configure.in 2007-11-06 16:33:47.000000000 +0100 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.15.9 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-printer, 2.16.1, http://bugs.opensuse.org/, yast2-printer) +AC_INIT(yast2-printer, 2.16.3, 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.16.1" +VERSION="2.16.3" RPMNAME="yast2-printer" MAINTAINER="Michal Zugec <mzugec@suse.cz>" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/common/dialogs-connection.ycp new/yast2-printer-2.16.4/src/common/dialogs-connection.ycp --- old/yast2-printer-2.16.2/src/common/dialogs-connection.ycp 2007-10-29 14:25:37.000000000 +0100 +++ new/yast2-printer-2.16.4/src/common/dialogs-connection.ycp 2007-11-06 16:45:59.000000000 +0100 @@ -9,7 +9,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: dialogs-connection.ycp 36257 2007-02-19 12:23:53Z mzugec $ + * $Id: dialogs-connection.ycp 41826 2007-11-06 15:45:59Z mzugec $ * */ { @@ -440,10 +440,10 @@ if (local == false) { items = add (items, - `Frame(_("Network Printers"), + `Frame(_("Network Printers"), `VBox( // radio button - `Left (`RadioButton (`id (`cups),_("Print via &CUPS Network Server"),selected == `cups)), + `Left (`RadioButton (`id (`ipp),_("Remote &IPP Queue (only for special cases)"),selected == `ipp)), // radio button `Left (`RadioButton (`id (`lpd),_("Print via &LPD-Style Network Server"),selected == `lpd)), // radio button @@ -526,6 +526,7 @@ * Dialog asking about connection type for connection to remote CUPS server * @return symbol wizard sequencer symbol */ +/* define symbol runCupsConnectionDialog () ``{ symbol selected = `cups_client; string uri_type = Printerlib::getUriType (Printer::printer["uri"]:""); @@ -565,6 +566,7 @@ _("Type of Connection to the CUPS Server"), getCupsConnectionsHelp (), `connection_cups); } +*/ /** * Dialog asking about connection type for small print servers diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/common/dialogs.ycp new/yast2-printer-2.16.4/src/common/dialogs.ycp --- old/yast2-printer-2.16.2/src/common/dialogs.ycp 2007-10-29 15:52:14.000000000 +0100 +++ new/yast2-printer-2.16.4/src/common/dialogs.ycp 2007-11-06 16:45:59.000000000 +0100 @@ -8,7 +8,7 @@ * Authors: * Petr Blahos <pblahos@suse.cz> * - * $Id: dialogs.ycp 41620 2007-10-29 15:14:03Z mzugec $ + * $Id: dialogs.ycp 41826 2007-11-06 15:45:59Z mzugec $ * Main dialogs. */ { @@ -28,11 +28,13 @@ import "Stage"; import "Wizard"; import "Wizard_hw"; - import "WizardHW"; + import "CWMTab"; + import "CWM"; include "printer/helps.ycp"; include "printer/misc.ycp"; + string initial_tab = "overview"; /** * Read settings dialog * @return `abort if aborted and `next otherwise @@ -1075,21 +1077,6 @@ return ret; } -/* -void saveOptions(){ - // fixed #164851 - check for conflict choices in PPD - string src_ppd = Printer::printer["ppd"]:""; - string dst_ppd = (string)SCR::Read (.target.tmpdir) + "/patched_ppd_" + Printer::printer["name"]:""; - SCR::Write (.ppd.file.modify,[src_ppd, dst_ppd, Printer::printer["ppd_options"]:$[]]); - string warning = parseWarn( ((map<string, any>)SCR::Execute(.target.bash_output, - "cupstestppd $PPD", $["PPD":dst_ppd]))["stdout"]:""); - SCR::Execute(.target.remove, dst_ppd); - if (size(warning)>0){ - Popup::Error(warning); - } - -} -*/ /** * Configuration of the filter. It is quite complicated because there can @@ -1648,6 +1635,7 @@ * Start dialog with advanced spooler settings * @return symbol for wizzard seq */ +/* define symbol runAdvancedDialog () ``{ string new_spooler = Spooler::Get (); if (new_spooler == "cups" @@ -1843,11 +1831,13 @@ } return ret; } +*/ /** * Dialog for choosing what kind of devices to use * @return wizard sequencer symbol */ +/* define symbol runCupsUsbDeviceTypeDialog () ``{ term contents = `HBox (`HStretch (), `VBox ( `VStretch (), @@ -1896,6 +1886,7 @@ } return ret; } +*/ /** * Decide how to configure autodetected printer @@ -2144,91 +2135,9 @@ return add (items, `item (`id (-1), _("Other (not detected)"), !selected)); } - /** - * Function to set the data to the hardware dialog - * get inspired by summary and getAutoprobedSelectionBox when writing it - */ -void SetHWDialogData () { - string new_spooler = Spooler::Get (); - if (new_spooler == "cups" && CUPS::InstallationType () == `client) new_spooler = "cups-client"; - y2milestone("%1", new_spooler); - list < map<string,any> > printers = []; - if (new_spooler == "cups") - { - list < map<string,any> > items = maplist (map i, Printer::printcap, ``{ - y2milestone("printcap %1", i); - string def = ""; - if (i["name"]:"unknown" == Printer::default_queue) def="Default"; - 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" + "<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 ]; - }); - - items=(list < map<string,any> >) merge((list < map<string,any> >) items, (list < map<string,any> >) maplist (map i, Printer::autodetected, ``{ - if (isPrinterConfigured (i["vendor"]:"", i["device"]:"", i["uri"]:"", i["unique_key"]:"")) - { - y2milestone ("Skipping %1, already configured", i); - return nil; - } - else{ - boolean finded=false; - foreach(map<string, any> row, items, { - if (row["ID"]:nil == Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false)) - { - finded=true; - y2milestone("Printer %1 without ppd file already configured", row["ID"]:nil); - } - }); - if (finded==false) return - $[ "ID":Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false), - "MODEL":i["info"]:"unknown", - "SPOOL":i["name"]:"not configured", - "DESCR": "<b>" + i["info"]:"none" + "</b><br>" - + i["location"]:"" + "<br>" - + _("This printer is not configured") ]; - } - - })); - items = (list < map<string,any> >) filter (any i, items, ``(i != nil)); - integer pos=0; - Printer::conf_unconf_printers = items; - maplist(map<string,any> s, items, { - printers = add(printers, $[ - "id" : tostring(pos), - "rich_descr" : s["DESCR"]:"none", - "table_descr":[ - s["SPOOL"]:"unknown", - s["ID"]:"unknown" , - s["MODEL"]:"unknown", - s["DEFAULT"]:"" ] - ]); - pos = pos + 1; - }); - } else { - printers = [ $[ - "id" : "0", - "rich_descr" : "<b>" + CUPS::server_hostname + "</b><br>" - + ((CUPS::server_default == true) ? _("Default Queue") : (_(" With Spool ") + Printer::default_queue)), - "table_descr":[ - "CUPS", - "", - "", - "" ] - ] ]; - } - WizardHW::SetContents ( printers ); -} - - /** + /** * Restart detection of printers. * @return symbol always `next */ @@ -2241,6 +2150,7 @@ * Run dialog for expert settings * @return symbol ret (`change_ipp_listen, `cupsd, `cupsusb) */ +/* define symbol runCupsExpertDialog() ``{ @@ -2281,106 +2191,587 @@ } return (symbol) ret; } +*/ + +void initServerType (string key) { + CUPS::ReadCupsSettings (); + if (CUPS::InstallationType () == `server){ + UI::ChangeWidget(`id(`server_type), `CurrentButton, `local); + } else { + UI::ChangeWidget(`id(`server_type), `CurrentButton, `remote); + UI::ChangeWidget(`id(`server_name), `Items, [ CUPS::server_hostname ]); + if (CUPS::server_default) UI::ChangeWidget(`use_default, `Value, true); + else UI::ChangeWidget(`queues, `Items, [ Printer::default_queue ]); + } + if ( contains (CUPS::cups_server_settings["Browsing"]:["On"],"On") ) UI::ChangeWidget(`ipp_listen, `Value, true); +} + +list<string> getAddresses(list<string> addr_orig){ + list<string> addresses=addr_orig; + term contents = `Frame (_("Browsing Settings"), `VBox ( + // selectionbox label + `HBox (`HSpacing (3), `SelectionBox (`id (`addr), _("Browse Addre&sses")), `HSpacing (3)), + `HBox ( + `HSpacing (3), + `PushButton (`id (`add), `opt (`key_F3), Label::AddButton ()), + `PushButton (`id (`edit), `opt (`key_F4), Label::EditButton ()), + `PushButton (`id (`del), `opt (`key_F5), Label::DeleteButton ()), + `HStretch (), + // push button +// `PushButton (`id (`propose_server), _("&Propose")), + `PushButton (`id (`ok), Label::OKButton()), + `HSpacing (3) + ) + )); + UI::OpenDialog(contents); + symbol ret = nil; + do { + UI::ChangeWidget(`addr, `Items, addresses); + ret = (symbol) UI::UserInput(); + string curr = (string)UI::QueryWidget(`addr, `CurrentItem); + switch(ret){ + case `add: + curr=""; + case `edit: + UI::OpenDialog(`VBox(`TextEntry(`id(`ip_addr), _("IP Address"), curr), + `HBox(`PushButton(`id(`cancel), Label::CancelButton()), `PushButton(`id(`ok), Label::OKButton())))); + if ((symbol)UI::UserInput()==`ok){ + list<string> tmp_list = []; + foreach(string row, addresses, { + if (row==curr && curr!="") tmp_list = add(tmp_list, (string)UI::QueryWidget(`ip_addr, `Value)); + else tmp_list = add(tmp_list, row); + }); + if (curr=="") tmp_list = add(tmp_list, (string)UI::QueryWidget(`ip_addr, `Value)); + addresses = tmp_list; + } + UI::CloseDialog(); + break; + case `del: + addresses = filter(string item, addresses, {return (item != curr);}); + break; + case `cancel: + addresses = addr_orig; + case `ok: + ret = nil; + break; + } + }while (ret !=nil); + + UI::CloseDialog(); + return addresses; +} + +symbol handleServerType (string key, map event) ``{ + boolean local = (UI::QueryWidget(`id(`server_type), `CurrentButton) == `local); + + UI::ChangeWidget(`ipp_listen, `Enabled, local); + boolean listen = (boolean)UI::QueryWidget(`ipp_listen, `Value); + UI::ChangeWidget(`select_addr, `Enabled, listen && local); + + UI::ChangeWidget(`server_name, `Enabled, !local); + UI::ChangeWidget(`lookup_server, `Enabled, !local); + UI::ChangeWidget(`test_ipp, `Enabled, !local); + UI::ChangeWidget(`use_default, `Enabled, !local); + + boolean use_def=false; + if (!local) use_def=!(boolean) UI::QueryWidget(`use_default, `Value); + UI::ChangeWidget(`queues, `Enabled, use_def); + UI::ChangeWidget(`lookup_queue, `Enabled, use_def); + if (event["EventReason"]:""=="Activated" && event["ID"]:`nil==`select_addr) { + CUPS::cups_server_settings["BrowseAddress"] = getAddresses(CUPS::cups_server_settings["BrowseAddress"]:[]); + } + symbol id = event["ID"]:`nil; + switch(id){ + case `get_hosts_listen: + case `get_hosts_special: + case `get_hosts: + list hosts = []; + if (id == `get_hosts_listen) hosts = CUPS::ListenCupsServers (); + else hosts = getHostnames ( `get_hosts_special == id ? "ipp" : ""); + UI::ChangeWidget(`server_name, `Items, hosts); + break; + case `test_ipp: + string n = (string)UI::QueryWidget (`id(`server_name), `Value); + if (nil == n || "" == n) + // popup + Popup::Message (_("Enter a valid server name.")); + else + Printerlib::testRemote (n, "", "ipp_server", 0); + break; + case `lookup_queue: + list queues = (list)SCR::Read (.cups.remote, UI::QueryWidget (`id (`server_name), `Value)); + queues = toset (queues); + UI::ChangeWidget(`queues, `Items, queues); + break; + } + return nil; +} + +boolean validateServerType(string key, map event){ + if (! (UI::QueryWidget(`id(`server_type), `CurrentButton) == `local)){ + if (size((string)UI::QueryWidget (`id (`server_name), `Value))==0){ + Popup::Warning (_("Enter a valid server name.")); + return false; + } + if (!(boolean)UI::QueryWidget(`use_default, `Value) && size((string)UI::QueryWidget(`queues, `Value))==0){ + Popup::Warning (sformat("%1 \"%2\".", _("Select default queue or check"), _("Use Server's Default Queue"))); + return false; + } + } + return true; +} + +void storeServerType(string key, map event){ + boolean local = (UI::QueryWidget(`id(`server_type), `CurrentButton) == `local); + if (local){ + CUPS::cups_installation=`server; + boolean listen = (boolean)UI::QueryWidget(`ipp_listen, `Value); + CUPS::cups_server_settings["Browsing"] = listen ? ["On"] : ["Off"]; + }else{ + CUPS::cups_installation=`client; + CUPS::server_hostname = (string)UI::QueryWidget(`server_name, `Value); + CUPS::server_default = ((boolean)UI::QueryWidget(`use_default, `Value)); + if (!CUPS::server_default) Printer::default_queue = (string)UI::QueryWidget(`queues, `Value); + } + Printer::dirty = true; +} + + /** + * Function to set the data to the hardware dialog + * get inspired by summary and getAutoprobedSelectionBox when writing it + */ +list<map<string,any> > o_items = nil; + +void initOverview (string key) { + string new_spooler = Spooler::Get (); + if (new_spooler == "cups" && CUPS::InstallationType () == `client) new_spooler = "cups-client"; + y2milestone("%1", new_spooler); + o_items = []; + if (new_spooler == "cups") + { + list < map<string,any> > items = maplist (map i, Printer::printcap, ``{ + y2milestone("printcap %1", i); + string def = ""; + if (i["name"]:"unknown" == Printer::default_queue) def="Default"; + return $[ + "ID":Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false), + "MODEL":i["ppd_info", "model"]:"unknown", + "SPOOL":i["name"]:"unknown", + "DESCR": sformat("<b>%1 %2 / %3</b><br>%4<br>%5 %6<br>%7 %8", + i["ppd_info", "manufacturer"]:"none", i["ppd_info", "model"]:"", i["name"]:"", + (((boolean)i["shared"]:false)?_("Shared"):_("Not Shared")), + _("Connected As"), Printerlib::getReplacedString(i["uri"]:"none", false), + _("With Spool"), i["name"]:"none" + ), + "DEFAULT":def ]; + }); + + items=(list < map<string,any> >) merge((list < map<string,any> >) items, (list < map<string,any> >) maplist (map i, Printer::autodetected, ``{ + if (isPrinterConfigured (i["vendor"]:"", i["device"]:"", i["uri"]:"", i["unique_key"]:"")) + { + y2milestone ("Skipping %1, already configured", i); + return nil; + } + else{ + boolean finded=false; + foreach(map<string, any> row, items, { + if (row["ID"]:nil == Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false)) + { + finded=true; + y2milestone("Printer %1 without ppd file already configured", row["ID"]:nil); + } + }); + if (finded==false) return + $[ "ID":Printerlib::getReplacedString(Printerlib::getUriDevice (i["uri"]:""), false), + "MODEL":i["info"]:"unknown", + "SPOOL":i["name"]:"not configured", + "DESCR": "<b>" + i["info"]:"none" + "</b><br>" + + i["location"]:"" + "<br>" + + _("This printer is not configured") ]; + } + + })); + items = (list < map<string,any> >) filter (any i, items, ``(i != nil)); + Printer::conf_unconf_printers = items; + maplist(map<string,any> s, items, { + o_items = add(o_items, $[ + "id" : tostring(size(o_items)), + "rich_descr" : s["DESCR"]:"none", + "table_descr":[ + s["SPOOL"]:"unknown", + s["ID"]:"unknown" , + s["MODEL"]:"unknown", + s["DEFAULT"]:"" ] + ]); + }); + } + list<term> term_items = maplist (map<string,any> i, o_items, { + term t = `item (`id (i["id"]:"")); + foreach (string l, i["table_descr"]:[], { + t = add (t, l); + }); + return t; + }); + UI::ChangeWidget (`id (`_hw_items), `Items, term_items); + if (size(o_items)>0) UI::ChangeWidget(`_hw_sum, `Value, o_items[0, "rich_descr"]:""); + else UI::ChangeWidget(`_hw_sum, `Value, ""); + boolean local = (CUPS::InstallationType() == `server); + UI::ChangeWidget(`_hw_items, `Enabled, local); + UI::ChangeWidget(`add, `Enabled, local); + UI::ChangeWidget(`edit, `Enabled, local); + UI::ChangeWidget(`delete, `Enabled, local); +} + + /** * Common detected hardware dialog. * @return symbol for ws */ - define symbol runDetectedDialog () ``{ + define symbol handleOverview (string key, map event) ``{ y2milestone ("Starting detected dialog"); // several functions dialog - WizardHW::CreateHWDialog (_("Printer Configuration"), getComplexHelp (), - [_("Queue Name"),_("Device"), _("Model"), _("Default Queue") ], - [ - [ `redetect, _("Restart Detection") ], - [ `default_q, _("Set Default") ], - [ `cups_expert , _("CUPS Expert Settings") ], - [ `change_ipp_listen, _("Change IPP Listen") ], - [ `change_remote_access, _("Change Remote Access Settings") ] - ]); - SetHWDialogData (); - if (Stage::normal()) Wizard::SetNextButton(`next, Label::FinishButton()); else Wizard::SetNextButton(`next, Label::AcceptButton()); - WizardHW::SetSelectedItem (Printer::runAutoprobedListDialog__current); - - - boolean cont = true; symbol ret=nil; string new_spooler = Spooler::Get (); - while (cont) - { - map<string,any> hw_ret = WizardHW::WaitForEvent (); - map event = hw_ret["event"]:$[]; - string selected = hw_ret["selected"]:""; - ret = (symbol) event["ID"]:nil; - if (tointeger(selected) != nil) Printer::selectPrinter(tointeger(selected)); + integer selected = tointeger( UI::QueryWidget(`id(`_hw_items), `CurrentItem)); + if (selected != nil) Printer::selectPrinter(selected); else Printer::selectPrinter(-1); - if (new_spooler == "cups" && CUPS::InstallationType () == `client) - { - new_spooler = "cups-client"; - } - if (ret == `delete) - { - if (new_spooler == "cups-client") {CUPS::cups_installation=`server;new_spooler="cups";} - else if ( (Printer::conf_unconf_printers[tointeger(selected), "SPOOL"]:"" != "not configured") && Popup::YesNo (sformat (_("Really delete printer %1?"), Printer::printer["name"]:""))) Printer::deletePrinter (); - SetHWDialogData(); - continue; - } + if (new_spooler == "cups" && CUPS::InstallationType () == `client) new_spooler = "cups-client"; + + // FIXME : test if this is string or term + if ( (symbol)event["ID"]:nil==nil ) { ret=nil; } + else{ + ret = (symbol) event["ID"]:nil; + switch((symbol) event["ID"]:nil){ + case `delete : + if (new_spooler == "cups-client") {CUPS::cups_installation=`server;new_spooler="cups";} + else if ( (Printer::conf_unconf_printers[selected, "SPOOL"]:"" != "not configured") && Popup::YesNo (sformat (_("Really delete printer %1?"), Printer::printer["name"]:""))) Printer::deletePrinter (); + initOverview(""); + ret=nil; + break; // TODO handle all events here - else - if (ret == `default_q) - { - Printer::setDefaultPrinter (); - ret = `restart_button; - } - if (ret == `add) - { - Printer::selectPrinter(-1); - ret = `configure_button; - } - if (ret == `edit) - { - if (new_spooler == "cups") - { - if (Printer::printer == $["type":"yast2"]) - { - integer from_detect = -1; - integer count = 0; - string prn_id=""; - - foreach(map<string, any> temp_printer, Printer::Detect(), { - string temp_string = splitstring(temp_printer["uri"]:"", ":")[1]:""; - if (tointeger(selected) >= count) - { - if (Printerlib::getReplacedString(temp_string, false) == - Printer::conf_unconf_printers[tointeger(selected), "ID"]:"") - { - from_detect = from_detect + 1; - break; - } - if (temp_string != prn_id) - { - from_detect = from_detect+1; - prn_id = temp_printer["ID"]:""; - } - count=count + 1; - } - }); - Printer::editDetected(Printer::Detect()[from_detect]:$[]); - y2milestone("Configuring detected, non-configured printer %1", Printer::Detect()[from_detect]:$[]); - } - if (Printer::printer["ppd_info", "model"]:nil == nil) ret=`edit_unconf; - else ret = `edit_button; - } else ret=`connection_cups; - } - else if (ret == `redetect) ret = `restart_button; - cont = false; + case `default_q : + Printer::setDefaultPrinter (); + ret = `restart_button; + break; + case `add : + Printer::selectPrinter(-1); + ret = `configure_button; + break; + case `edit : + if (new_spooler == "cups") + { + if (Printer::printer == $["type":"yast2"]) + { + integer from_detect = -1; + integer count = 0; + string prn_id=""; + foreach(map<string, any> temp_printer, Printer::Detect(), { + string temp_string = splitstring(temp_printer["uri"]:"", ":")[1]:""; + if (selected >= count) + { + if (Printerlib::getReplacedString(temp_string, false) == + Printer::conf_unconf_printers[selected, "ID"]:"") + { + from_detect = from_detect + 1; + break; + } + if (temp_string != prn_id) + { + from_detect = from_detect+1; + prn_id = temp_printer["ID"]:""; + } + count=count + 1; + } + }); + Printer::editDetected(Printer::Detect()[from_detect]:$[]); + y2milestone("Configuring detected, non-configured printer %1", Printer::Detect()[from_detect]:$[]); + } + if (Printer::printer["ppd_info", "model"]:nil == nil) ret=`edit_unconf; + else ret = `edit_button; + } else ret=`connection_cups; + break; + case `redetect: + ret = `restart_button; + break; + default: + if (event["EventReason"]:"" == "SelectionChanged") + { + if (size(o_items)>0) + { + UI::ChangeWidget(`_hw_sum, `Value, o_items[selected, "rich_descr"]:""); + // #247336 - don't allow to edit queues without local filtering (raw:true) + UI::ChangeWidget(`id(`edit), `Enabled, !Printer::printer["raw"]:true); + UI::ChangeWidget(`id(`delete), `Enabled, true); + } else + { + UI::ChangeWidget(`_hw_sum, `Value, ""); + UI::ChangeWidget(`id(`edit), `Enabled, false); + UI::ChangeWidget(`id(`delete), `Enabled, false); + } + } else y2warning("Invalid return: %1, %2", ret, event); + ret = nil; } - return ret; // FIXME } + return ret; // FIXME +} + + map<string,any> firewall_widget = + CWMFirewallInterfaces::CreateOpenFirewallWidget ($["services":[ "ipp-tcp" ], "display_details":true]); + list<string> addresses = []; + +void initCupsServer(string key){ + string firewall_help = firewall_widget["help"]:""; + term firewall_layout = firewall_widget["custom_widget"]:`VBox (); + UI::ReplaceWidget(`fw, firewall_layout); + addresses = CUPS::cups_server_settings["BrowseAddress"]:[]; + UI::ChangeWidget (`id (`browsing), `CurrentButton, CUPS::cups_server_settings["Browsing"]:["On"] == ["Off"] ? `off : `on); + // selectionbox + UI::ReplaceWidget (`id (`replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"), addresses)); + CWMFirewallInterfaces::OpenFirewallInit (firewall_widget, ""); + boolean enable = true; + if (CUPS::InstallationType () != `server) enable=false; + UI::ChangeWidget(`f_browsing, `Enabled, enable); + UI::ChangeWidget(`f_address, `Enabled, enable); + +} + +define symbol handleCupsServer (string key, map event) { + CWMFirewallInterfaces::OpenFirewallHandle (firewall_widget, "", event); + symbol id = event["ID"]:`nil; + any ret = nil; + if (id!=`nil) switch(id){ + case `propose_server: + if ((size(addresses)>0 && Popup::ContinueCancel(_("Really replace with the suggested value?"))) + ||(size(addresses)==0)){ + CUPS::ProposeServerSettings (); + addresses = CUPS::cups_server_settings["BrowseAddress"]:[]; + UI::ReplaceWidget (`id (`replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"), addresses)); + } + break; + case `change: + ret = (symbol)UI::QueryWidget (`id (`loc), `CurrentButton); + break; + case `add: + // popup request + UI::OpenDialog (ipAddrPopup (false, _("&IP Address"), "", nil)); + symbol r = nil; + while (nil == r) r = (symbol)UI::UserInput (); + string ad = (string)UI::QueryWidget (`id (`ad), `Value); + UI::CloseDialog (); + if (r != `ok) break; + if (ad != "") addresses = toset (add (addresses, ad)); + // selectionbox label + UI::ReplaceWidget (`id (`replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"), addresses)); + break; + case `del: + addresses = (list<string>)DeleteItem (addresses, UI::QueryWidget (`id (`addr), `CurrentItem)); + // selectionbox label + UI::ReplaceWidget (`id (`replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"), addresses)); + break; + case `edit: + if (UI::QueryWidget (`id (`addr), `CurrentItem) == nil) break; + // popup request + UI::OpenDialog (ipAddrPopup (false, _("&IP Address"), (string)UI::QueryWidget (`id (`addr), `CurrentItem), nil)); + symbol r2 = nil; + while (nil == r2) r2 = (symbol)UI::UserInput (); + string ad2 = (string)UI::QueryWidget (`id (`ad), `Value); + UI::CloseDialog (); + if (r2 != `ok) break; + if (ad2 != "") + { + addresses = (list<string>)DeleteItem (addresses, UI::QueryWidget (`id (`addr), `CurrentItem)); + addresses = (list<string>)toset (add (addresses, ad2)); + } + // selectionbox label + UI::ReplaceWidget (`id (`replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"), addresses)); + break; + } + UI::ChangeWidget(`edit, `Enabled, (size(addresses)>0)); + UI::ChangeWidget(`del, `Enabled, (size(addresses)>0)); + if (ret!=nil)initial_tab = "server"; + else initial_tab = "overview"; + return (symbol)ret; +} + +void storeCupsServer(string key, map event){ + CUPS::cups_server_settings["BrowseAddress"] = addresses; + CUPS::cups_server_settings["Browsing"] = UI::QueryWidget (`id (`browsing), `CurrentButton) == `on ? ["On"] : ["Off"]; + CWMFirewallInterfaces::OpenFirewallStore (firewall_widget, "", event); +} + +map<string, map<string,any> > wd = $[ + "SERVER_TYPE" : $[ + "widget" : `custom, + "custom_widget" : + `MarginBox(1,0, + `VBox( + `Frame(_("Print via"), + `RadioButtonGroup( `id( `server_type ), + `VBox( + `VBox( + `Left( `RadioButton(`id(`local), `opt(`notify), "Local CUPS Server")), + `HBox(`CheckBox(`id(`ipp_listen), `opt(`notify), _("Listen to IPP Broadcast Packets")), + `PushButton(`id(`select_addr), _("Select Addresses")) + ) + ), + `VBox( + `Left(`RadioButton(`id(`remote), `opt(`notify), "Remote CUPS Server" )), + `HBox( + `ComboBox(`id(`server_name), `opt(`editable), _("Server Name")), + // menubutton + `MenuButton (`id(`lookup_server), _("&Look Up"), [ + // menu entry + `item (`id (`get_hosts_special), _("Scan for &IPP Servers")), + // menu item + `item (`id (`get_hosts_listen),_("Listen for IPP &Broadcasts")), + // menu entry + `item (`id (`get_hosts), _("Look Up &All Hosts")), + ]), +// `PushButton(`id(`lookup_server), _("Lookup")), + `PushButton(`id(`test_ipp), _("Test Remote IPP Access")) + ), + `CheckBox(`id(`use_default), `opt(`notify), _("Use Server's Default Queue")), + `HBox( + `ComboBox(`id(`queues), `opt(`editable), _("Queues")), + `PushButton(`id(`lookup_queue), _("Lookup")) + ) + ) + ))), + `VStretch() + )), + "init" : initServerType, + "handle" : handleServerType, + "validate_type" : `function, + "validate_function" : validateServerType, + "store" : storeServerType + ], + "OVERVIEW" : $[ + "widget" : `custom, + "custom_widget" : + `VBox( + `VWeight(2,`Table (`id (`_hw_items), `opt (`notify, `immediate), + `header(_("Queue Name"),_("Device"), _("Model"), _("Default Queue")))), + `VWeight(1,`RichText (`id (`_hw_sum), "")), + `HBox ( + `PushButton (`id (`add), Label::AddButton ()), + `PushButton (`id (`edit), _("Configure")), + `PushButton (`id (`delete), Label::DeleteButton ()), + `HStretch () + ) + ), + "init" : initOverview, + "handle" : handleOverview, +// "store" : storeOverview, +// "help" : help["overview"]:"" + ], + "SERVER" : $[ + "widget" : `custom, + "custom_widget" : + `HBox (`HSpacing (2), `VBox ( + `VSpacing (1), + // frame + `Frame (`id(`f_browsing), _("Browsing Settings"), `VBox ( + `HBox (`HSpacing (3), `RadioButtonGroup (`id (`browsing), `HBox ( + // label + `Label (_("Browsing")), + // radiobutton + `RadioButton (`id (`on), _("On")), + // radiobutton + `RadioButton (`id (`off), _("Off")) + )), + `HSpacing (3)), + // selectionbox label + `HBox (`HSpacing (3), `ReplacePoint (`id( `replace_addr), `SelectionBox (`id (`addr), _("Browse Addre&sses"))), `HSpacing (3)), + `HBox ( + `HSpacing (3), + `PushButton (`id (`add), `opt (`key_F3), Label::AddButton ()), + `PushButton (`id (`edit), `opt (`key_F4), Label::EditButton ()), + `PushButton (`id (`del), `opt (`key_F5), Label::DeleteButton ()), + `HStretch (), + // push button + `PushButton (`id (`propose_server), _("&Propose")), + `HSpacing (3) + ) + )), + // frame + `Frame (`id(`f_address), _("Access Settings"), `VBox ( + `RadioButtonGroup (`id (`loc), `VBox ( + `HBox ( + `RadioButton (`id (`root), `opt (`hstretch), "/ (r&oot)", true), + `RadioButton (`id (`admin), `opt (`hstretch), "/ad&min") + ), + `HBox ( + `RadioButton (`id (`printers), `opt (`hstretch), "/&printers"), + `RadioButton (`id (`classes), `opt (`hstretch), "/&classes") + ) + )), + // pushbutton + `PushButton (`id (`change), _("Change P&ermissions")) + )), +// firewall_layout + `ReplacePoint( `id( `fw ), `Empty() ) + ), `HSpacing (2)), + "init" : initCupsServer, + "handle" : handleCupsServer, + "store" : storeCupsServer + ] + ]; + +map tabs_descr = $[ + "global" : $[ + "header" : _("Global Settings"), + "contents" : `VBox ( + "SERVER_TYPE" + ), + "widget_names" : ["SERVER_TYPE"] + ], + "overview" : $[ + "header" : _("Printers and Queues"), + "contents" : `VBox ( + "OVERVIEW" + ), + "widget_names" : ["OVERVIEW"] + ], + "server" : $[ + "header" : _("CUPS server settings"), + "contents" : `VBox ( + "SERVER" + ), + "widget_names" : ["SERVER"] + ], +]; + + +symbol runMainDialog(){ + string caption = _("Detected Printers"); + map widget_descr = $[ + "tab": CWMTab::CreateWidget($[ + "tab_order": [ "global", "overview", "server" ], + "tabs": tabs_descr, + "widget_descr": wd, + "initial_tab" : initial_tab, + "tab_help" : "", + ]), + ]; + term contents = `VBox( "tab"); + + list<map <string, any> > w = CWM::CreateWidgets (["tab"], (map <string, map <string, any> >)widget_descr); + string help = CWM::MergeHelps(w); + contents = CWM::PrepareDialog(contents, w); + + Wizard::SetContentsButtons(caption, contents, help, Label::BackButton (), Label::AcceptButton ()); + Wizard::DisableBackButton(); + + symbol ret = CWM::Run(w, $[]); + return ret; +} + + define symbol runRemoteAccessDialog(){ term contents = `HBox (`HStretch (), `VBox ( @@ -2443,6 +2834,7 @@ * Complex dialog. * @return symbol for ws */ +/* define symbol runComplexDialog () ``{ Printer::confmode = `adm; string spoolerlabel = ""; @@ -2459,9 +2851,7 @@ Wizard::SetContentsButtons ( // Header of the dialog with all the printers sformat (_("Printer Administration for %1"), spoolerlabel), - Wizard_hw::ConfiguredContent ( - (Spooler::Get () == "cups") - ? + Wizard_hw::ConfiguredContent ( (Spooler::Get () == "cups") ? // table header `header (_("Default"), // table header @@ -2567,13 +2957,13 @@ } return ret; } +*/ /** * Detect installation type * @return symbol `server or `client */ define symbol getInstType () ``{ - if (Spooler::Get () != "cups") - return `server; + if (Spooler::Get () != "cups") return `server; return CUPS::InstallationType (); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/common/wizards.ycp new/yast2-printer-2.16.4/src/common/wizards.ycp --- old/yast2-printer-2.16.2/src/common/wizards.ycp 2007-10-29 14:17:13.000000000 +0100 +++ new/yast2-printer-2.16.4/src/common/wizards.ycp 2007-11-06 16:45:59.000000000 +0100 @@ -9,7 +9,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: wizards.ycp 33905 2006-10-30 17:22:25Z mzugec $ + * $Id: wizards.ycp 41826 2007-11-06 15:45:59Z mzugec $ */ { textdomain "printer"; @@ -53,8 +53,8 @@ // real dialogs "name_auto" : ``(runNameDialog (true)), "name" : ``(runNameDialog (false)), - "detected" : ``(runDetectedDialog ()), - "complex" : ``(runComplexDialog ()), + "main" : ``(runMainDialog ()), +// "complex" : ``(runComplexDialog ()), "model" : ``(runManufModelDialog ()), "model_unknown" : ``(runManufModelDialog ()), "inst_printer" : ``(runInstalledPrinterDialog ()), @@ -63,7 +63,7 @@ // connection selection // "connection_type" : ``(runConnectionTypeDialog ()), "connection_local" :``(runLocalConnectionDialog ()), - "connection_cups" : ``(runCupsConnectionDialog ()), +// "connection_cups" : ``(runCupsConnectionDialog ()), "connection_direct":``(runDirectConnectionDialog ()), "connection_other": ``(runOtherConnectionDialog ()), // by connection type @@ -87,9 +87,9 @@ "pipe" : ``(runPipeDialog ()), "other" : ``(runUriDialog()), // cups-only - "listen_ipp_bcast": ``(runListenIPPDialog ()), - "cups_client" : ``(runCupsClientDialog (false)), - "cups_expert" : ``(runCupsExpertDialog ()), +// "listen_ipp_bcast": ``(runListenIPPDialog ()), +// "cups_client" : ``(runCupsClientDialog (false)), +// "cups_expert" : ``(runCupsExpertDialog ()), "remote_access" : ``(runRemoteAccessDialog()), // cups only @@ -100,14 +100,14 @@ "add_local_printer":``(runConnectionTypeDialog(true)), "add_remote_printer":``(runConnectionTypeDialog(false)), "add_new_queue" : ``(runNewQueueDialog()), - "advanced" : ``(runAdvancedDialog ()), - "cupsd" : ``(runCupsServerDialog ()), +// "advanced" : ``(runAdvancedDialog ()), +// "cupsd" : ``(runCupsServerDialog ("")), "cupsaclroot" : ``(runCupsAclDialog (`root)), "cupsacladmin" : ``(runCupsAclDialog (`admin)), "cupsaclprinters" : ``(runCupsAclDialog (`printers)), "cupsaclclasses" : ``(runCupsAclDialog (`classes)), "cupsaclbcast" : ``(runCupsAclDialog (`bcast)), - "cups_client_main": ``(runCupsClientDialog (true)), +// "cups_client_main": ``(runCupsClientDialog (true)), "useppd" : ``(runSelectPpdFile ()), "downloadppd" : ``(runDownloadPpdFile ()), "ppdselect" : ``(runPpdSelectDialog (false)), @@ -121,7 +121,7 @@ "storeprinter" : [ ``(storePrinter ()) , true ], - "cups_usb" : ``(runCupsUsbDeviceTypeDialog ()), +// "cups_usb" : ``(runCupsUsbDeviceTypeDialog ()), ]; } /** @@ -137,7 +137,7 @@ ]; Printer::default_queue = "lp"; Printer::selectPrinter (3); - list<string> seq = [ "detected", "configdetected", "quick", "complex", "connection_local", "usb", "name", "model", "filter", "featues", "edit", ]; + list<string> seq = [ "main", "configdetected", "quick", "complex", "connection_local", "usb", "name", "model", "filter", "featues", "edit", ]; foreach (string i, seq, ``{ eval (getAliases ()[i]:nil); }); @@ -295,7 +295,7 @@ ], "add_remote_printer" : $[ `abort : `abort, - `cups : "connection_cups", + `ipp : "ipp", `lpd : "lpd", `smb : "samba", `ipx : "novell", @@ -307,13 +307,14 @@ `next: `next, `abort : `abort, ], - +/* "connection_cups" : $[ - `cups_client : "cups_client", - `listen_ipp : "listen_ipp_bcast", +// `cups_client : "cups_client", +// `listen_ipp : "listen_ipp_bcast", `ipp : "ipp", `abort : `abort, ], +*/ "connection_direct" : $[ `socket : "socket", `lpd : "lpd", @@ -350,13 +351,15 @@ "other" : $[ `next : "name_auto", `abort : `abort, ], "ppdetails" : $[ `abort : `abort, `next : "parallel", ], "spdetails" : $[ `abort : `abort, `next : "serial", ], +/* "listen_ipp_bcast" : $[ `abort : `abort, `next : "storeprinter", `perm : "cupsaclbcast", ], - "cupsaclbcast" : $[ `abort : `abort, `next : "listen_ipp_bcast"], - "cups_client" : $[ `abort : `abort, `next : `next ], +*/ +// "cupsaclbcast" : $[ `abort : `abort, `next : "listen_ipp_bcast"], +// "cups_client" : $[ `abort : `abort, `next : `next ], // end of connection types "inst_printer" : $[ `next : `edit, `abort : `abort, ], @@ -444,38 +447,48 @@ define symbol MainSequence() ``{ map<string,any> aliases = getAliases (); map sequence = $[ - "ws_start" : "detected", + "ws_start" : "main", +/* "config_type" : $[ - `server : "detected", - `client : "cups_client_main", + `server : "main", +// `client : "cups_client_main", ], +*/ //old dialogs - "detected" : $[ + "main" : $[ `next : `next, `abort : `abort, `configure_button : "add_printer_wz", - `restart_button : "redetect", +// `restart_button : "redetect", `edit_button : "edit_printer_wz", `edit_unconf : "edit_printer_unconf", - `change_ipp_listen : "listen_ipp_bcast", - `cups_expert : "cups_expert", +// `change_ipp_listen : "listen_ipp_bcast", +// `cups_expert : "cups_expert", `change_remote_access : "remote_access", // `cupsd : "cupsd", // `cupsusb : "cups_usb", - `connection_cups : "cups_client" +// `connection_cups : "cups_client" + `root : "cupsaclroot", + `admin : "cupsacladmin", + `printers : "cupsaclprinters", + `classes : "cupsaclclasses", ], +/* "cups_client" : $[ `next : "detected", `abort : `abort, ], - - "redetect" : $[`next : "detected", ], +*/ + "redetect" : $[`next : "main", ], +/* "listen_ipp_bcast" : $[ `next : "detected", `abort : `abort, `perm : "cupsaclbcast", ], - "cupsaclbcast" : $[ `abort : `abort, `next : "listen_ipp_bcast"], +*/ +// "cupsaclbcast" : $[ `abort : `abort, `next : "listen_ipp_bcast"], +/* "advanced" : $[ `next : "config_type", `this : "advanced", @@ -484,21 +497,27 @@ `switch : `switch, `abort : `abort, ], +*/ +/* "cups_expert" : $[ `abort : `abort, `next : `next, - `change_ipp_listen : "listen_ipp_bcast", - `cupsd : "cupsd", +// `change_ipp_listen : "listen_ipp_bcast", +// `cupsd : "cupsd", `cupsusb : "cups_usb" ], +*/ "remote_access" : $[ `abort : `abort, - `next : "detected" + `next : "main" ], +/* "cups_usb" : $[ - `next : "detected", + `next : "main", `abort : `abort, ], +*/ +/* "cupsd" : $[ `next : "detected", `abort : `abort, @@ -507,40 +526,43 @@ `printers : "cupsaclprinters", `classes : "cupsaclclasses", ], +*/ "cupsaclroot" : $[ - `next : "cupsd", + `next : "main", `abort : `abort, ], "cupsacladmin" : $[ - `next : "cupsd", + `next : "main", `abort : `abort, ], "cupsaclprinters" : $[ - `next : "cupsd", + `next : "main", `abort : `abort, ], "cupsaclclasses" : $[ - `next : "cupsd", + `next : "main", `abort : `abort, ], "add_printer_wz" : $[ - `next: "detected", + `next: "main", `abort : `abort, ], "edit_printer_wz": $[ - `next: "detected", + `next: "main", `abort : `abort, ], "edit_printer_unconf": $[ - `next: "detected", + `next: "main", `abort : `abort, ], +/* "cups_client_main" : $[ `next : `next, `abort : `abort, `advanced : "advanced", `switch : `switch, ], +*/ ]; aliases = (map<string,any>)filter (string k, any v, aliases, ``(haskey (sequence, k))); return Sequencer::Run(aliases, sequence); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/cups/dialogs-cups.ycp new/yast2-printer-2.16.4/src/cups/dialogs-cups.ycp --- old/yast2-printer-2.16.2/src/cups/dialogs-cups.ycp 2007-10-29 15:52:14.000000000 +0100 +++ new/yast2-printer-2.16.4/src/cups/dialogs-cups.ycp 2007-11-06 16:45:59.000000000 +0100 @@ -8,7 +8,7 @@ * Authors: * Petr Blahos <pblahos@suse.cz> * - * $Id: dialogs-cups.ycp 41620 2007-10-29 15:14:03Z mzugec $ + * $Id: dialogs-cups.ycp 41826 2007-11-06 15:45:59Z mzugec $ * * Main dialogs. */ @@ -33,6 +33,7 @@ * Run dialog informing about IPP queue listening * @return symbol for WS */ +/* define symbol runListenIPPDialog () ``{ // this avoids problem with unread CUPS settings in the proposal // see bug #46822 @@ -72,7 +73,6 @@ _("Listen to IPP &Broadcast Packets"), contains ( CUPS::cups_server_settings["Browsing"]:["On"],"On"))), - // push button `PushButton (`id (`perm), _("Select A&ddresses")) ), `HStretch ())), `VSpacing (2), @@ -105,13 +105,14 @@ } return (symbol)ret; } - +*/ /** * Is there only client? * @param main boolean true if this is used as replacement of the * "Complex" dialog * @return symbol for wizard sequencer */ +/* define symbol runCupsClientDialog (boolean main) ``{ // main=true; term advanced = main @@ -126,7 +127,6 @@ `HBox ( // `HSpacing(20), `HStretch(), -// `VWeight( 20, `MinWidth( 20, `ReplacePoint ( `id (`hostent_replace), @@ -288,6 +288,7 @@ } return ret; } +*/ /** * Choose PPD file * @return symbol `next, `abort or `back @@ -966,7 +967,8 @@ * CUPS server settings dialog * @return symbol `next or `back */ - define symbol runCupsServerDialog () ``{ +/* + define void runCupsServerDialog (string key) ``{ map<string,any> firewall_settings = $[ "services" : [ "ipp-tcp" ], @@ -1022,7 +1024,7 @@ ), `HSpacing (2)); // dialog caption - Wizard::SetContentsButtons (_("CUPS Server Settings"), contents, getCupsServerHelp () + firewall_help, Label::BackButton (), Label::NextButton ()); +// Wizard::SetContentsButtons (_("CUPS Server Settings"), contents, getCupsServerHelp () + firewall_help, Label::BackButton (), Label::NextButton ()); list<string> addresses = CUPS::cups_server_settings["BrowseAddress"]:[]; @@ -1038,18 +1040,15 @@ { event = UI::WaitForEvent (); ret = event["ID"]:nil; - if (ret == `cancel) - ret = `abort; - CWMFirewallInterfaces::OpenFirewallHandle (firewall_widget, - "", event); + if (ret == `cancel) ret = `abort; + CWMFirewallInterfaces::OpenFirewallHandle (firewall_widget, "", event); if (`abort == ret) { if (reallyAbort ()) break; } - else if (`back == ret) - break; - else if (`propose_server == ret) +// else if (`back == ret) break; + if (`propose_server == ret) { if ((size(addresses)>0 && Popup::ContinueCancel(_("Really replace with the suggested value?")))||(size(addresses)==0)){ CUPS::ProposeServerSettings (); @@ -1121,6 +1120,7 @@ CWMFirewallInterfaces::OpenFirewallStore (firewall_widget, "", event); } CUPS::cups_server_settings["BrowseAddress"] = addresses; - return (symbol)ret; +// return (symbol)ret; } +*/ } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/modules/CUPS.ycp new/yast2-printer-2.16.4/src/modules/CUPS.ycp --- old/yast2-printer-2.16.2/src/modules/CUPS.ycp 2007-10-29 10:01:58.000000000 +0100 +++ new/yast2-printer-2.16.4/src/modules/CUPS.ycp 2007-11-02 13:06:29.000000000 +0100 @@ -11,7 +11,7 @@ * Authors: * Jiri Srain <jsrain@suse.cz> * - * $Id: CUPS.ycp 39964 2007-08-06 08:01:27Z mzugec $ + * $Id: CUPS.ycp 41734 2007-11-02 12:06:29Z mzugec $ * * Printer library exported functions. What else?!? */ @@ -188,6 +188,9 @@ * @return boolean true on success */ global boolean ReadCupsSettings () { + if (cups_server_settings==nil || cups_server_permissions==nil) + { + list<string> options = (list<string>) SCR::Dir (.etc.cups.cupsd_conf.value); options = toset (options); @@ -222,6 +225,7 @@ y2milestone ("CUPS permissions read: %1", permissions); cups_server_settings = settings; cups_server_permissions = permissions; + } else y2warning("CUPS already readed"); return true; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/modules/Printerlib.ycp new/yast2-printer-2.16.4/src/modules/Printerlib.ycp --- old/yast2-printer-2.16.2/src/modules/Printerlib.ycp 2007-10-29 10:01:58.000000000 +0100 +++ new/yast2-printer-2.16.4/src/modules/Printerlib.ycp 2007-11-02 13:06:29.000000000 +0100 @@ -11,7 +11,7 @@ * Authors: * Petr Blahos <pblahos@suse.cz> * - * $Id: Printerlib.ycp 41035 2007-09-24 07:01:33Z mzugec $ + * $Id: Printerlib.ycp 41734 2007-11-02 12:06:29Z mzugec $ * * Printer library exported functions. What else?!? */ @@ -695,7 +695,7 @@ visible_string = substring(visible_string,0, position) + newString + substring(visible_string, position+3); position = find(visible_string, "%"); } - list pass = regexppos(visible_string, ":[a-zA-Z]+@"); + list pass = regexppos(visible_string, ":[^@]+@"); if (size(pass)==2 && !show_pass){ integer pos = pass[0]:0; integer str_size= pass[1]:0; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/src/modules/Printer.ycp new/yast2-printer-2.16.4/src/modules/Printer.ycp --- old/yast2-printer-2.16.2/src/modules/Printer.ycp 2007-10-29 15:52:14.000000000 +0100 +++ new/yast2-printer-2.16.4/src/modules/Printer.ycp 2007-11-02 13:06:29.000000000 +0100 @@ -12,7 +12,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: Printer.ycp 41620 2007-10-29 15:14:03Z mzugec $ + * $Id: Printer.ycp 41734 2007-11-02 12:06:29Z mzugec $ * * Well we all know what modules are for. */ @@ -824,8 +824,7 @@ // because of CUPS1.1->CUPS1.2 cups provide uri also for printers from broadcast // so YaST now show only printers from /etc/cups/printers.conf // ret = filter (map<string,any> e, ret, ``(e["uri"]:"" != "")); -//string cmd="grep -E '<Printer|<DefaultPrinter' /etc/cups/printers.conf|sed -r s/\"<[a-zA-Z]*Printer\\s+\"//g |sed s/\\s*\\>//g"; - string cmd = "grep -E 'DeviceURI' /etc/cups/printers.conf|cut -d' ' -f2"; + string cmd = "grep -E 'DeviceURI' /etc/cups/printers.conf|cut -d' ' -f2-"; list<string> tmp_prns = splitstring(((map<string,any>)SCR::Execute(.target.bash_output, cmd))["stdout"]:"", "\n"); y2milestone("List of local printers before correcting : %1", tmp_prns); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.16.2/VERSION new/yast2-printer-2.16.4/VERSION --- old/yast2-printer-2.16.2/VERSION 2007-10-30 15:55:15.000000000 +0100 +++ new/yast2-printer-2.16.4/VERSION 2007-11-06 16:44:33.000000000 +0100 @@ -1 +1 @@ -2.16.2 +2.16.4 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de