Hello community, here is the log from the commit of package yast2-printer checked in at Sat Jun 3 01:03:29 CEST 2006. -------- --- yast2-printer/yast2-printer.changes 2006-05-11 16:38:36.000000000 +0200 +++ yast2-printer/yast2-printer.changes 2006-06-02 18:54:21.000000000 +0200 @@ -1,0 +2,5 @@ +Fri Jun 2 18:41:25 CEST 2006 - mzugec@suse.cz + +- fixed #169750 - media size not saved properly + +------------------------------------------------------------------- Old: ---- yast2-printer-2.13.16.tar.bz2 New: ---- yast2-printer-2.13.17.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-printer.spec ++++++ --- /var/tmp/diff_new_pack.81AwLc/_old 2006-06-03 01:03:22.000000000 +0200 +++ /var/tmp/diff_new_pack.81AwLc/_new 2006-06-03 01:03:22.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-printer (Version 2.13.16) +# spec file for package yast2-printer (Version 2.13.17) # # 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.13.16 +Version: 2.13.17 Release: 1 License: GPL Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-printer-2.13.16.tar.bz2 +Source0: yast2-printer-2.13.17.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-devtools yast2-testsuite Requires: yast2 netcat zlib blocxx @@ -33,7 +33,7 @@ %prep -%setup -n yast2-printer-2.13.16 +%setup -n yast2-printer-2.13.17 %build %{prefix}/bin/y2tool y2autoconf @@ -100,6 +100,8 @@ %doc %{prefix}/share/doc/packages/yast2-printer %changelog -n yast2-printer +* Fri Jun 02 2006 - mzugec@suse.cz +- fixed #169750 - media size not saved properly * Thu May 11 2006 - mzugec@suse.cz - fixed #172856 - wrong encoding * Thu May 11 2006 - mzugec@suse.cz ++++++ yast2-printer-2.13.16.tar.bz2 -> yast2-printer-2.13.17.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/VERSION new/yast2-printer-2.13.17/VERSION --- old/yast2-printer-2.13.16/VERSION 2006-05-11 16:36:12.000000000 +0200 +++ new/yast2-printer-2.13.17/VERSION 2006-06-02 18:39:35.000000000 +0200 @@ -1 +1 @@ -2.13.16 +2.13.17 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/agents/Makefile.am new/yast2-printer-2.13.17/agents/Makefile.am --- old/yast2-printer-2.13.16/agents/Makefile.am 2006-04-14 09:25:56.000000000 +0200 +++ new/yast2-printer-2.13.17/agents/Makefile.am 2006-06-02 18:48:49.000000000 +0200 @@ -1,10 +1,10 @@ # # Makefile.am for y2c_prnt/agents # -# $Id: Makefile.am 30130 2006-04-14 07:25:44Z mzugec $ +# $Id: Makefile.am 31303 2006-06-02 16:46:50Z mzugec $ # scrconf_DATA = $(wildcard *.scr) -agent_SCRIPTS = ag_smb_queues ag_ppd_file_modify ag_paper_size +agent_SCRIPTS = ag_smb_queues ag_ppd_file_modify EXTRA_DIST = $(scrconf_DATA) $(agent_SCRIPTS) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/agents/Makefile.in new/yast2-printer-2.13.17/agents/Makefile.in --- old/yast2-printer-2.13.16/agents/Makefile.in 2006-05-11 16:21:48.000000000 +0200 +++ new/yast2-printer-2.13.17/agents/Makefile.in 2006-06-02 18:49:12.000000000 +0200 @@ -17,7 +17,7 @@ # # Makefile.am for y2c_prnt/agents # -# $Id: Makefile.am 30130 2006-04-14 07:25:44Z mzugec $ +# $Id: Makefile.am 31303 2006-06-02 16:46:50Z mzugec $ # @@ -220,7 +220,7 @@ yncludedir = @yncludedir@ ystartupdir = @ystartupdir@ scrconf_DATA = $(wildcard *.scr) -agent_SCRIPTS = ag_smb_queues ag_ppd_file_modify ag_paper_size +agent_SCRIPTS = ag_smb_queues ag_ppd_file_modify EXTRA_DIST = $(scrconf_DATA) $(agent_SCRIPTS) all: all-am diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/agents/ag_paper_size new/yast2-printer-2.13.17/agents/ag_paper_size --- old/yast2-printer-2.13.16/agents/ag_paper_size 2006-04-26 18:20:19.000000000 +0200 +++ new/yast2-printer-2.13.17/agents/ag_paper_size 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -#!/bin/bash - -function get_paper () { - ( - . /etc/sysconfig/language &> /dev/null - read h w r < <(LANG=$RC_LANG LC_ALL=$RC_LC_ALL LC_PAPER=$RC_LC_PAPER locale -k LC_PAPER) - case "$h" in - height=297) echo "\$[\"value\":\"A4\"]" ;; - height=279) echo "\$[\"value\":\"Letter\"]" ;; - *) echo "\$[\"value\":\"\"]";; - esac - ) -} - -while true ; do -read COMMAND || exit - # strip leading backquote introduced by NI - COMMAND=${COMMAND#\`} - - case "$COMMAND" in - "result ("*) - exit - ;; - "Read ("*) - get_paper - ;; - *) - echo nil - - esac - done diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/agents/paper_size.scr new/yast2-printer-2.13.17/agents/paper_size.scr --- old/yast2-printer-2.13.16/agents/paper_size.scr 2006-04-13 16:35:55.000000000 +0200 +++ new/yast2-printer-2.13.17/agents/paper_size.scr 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -.ppd.paper_size - -`ag_paper_size () - diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/configure new/yast2-printer-2.13.17/configure --- old/yast2-printer-2.13.16/configure 2006-05-11 16:21:38.000000000 +0200 +++ new/yast2-printer-2.13.17/configure 2006-06-02 18:08:16.000000000 +0200 @@ -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.13.15. +# Generated by GNU Autoconf 2.59 for yast2-printer 2.13.16. # # 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.13.15' -PACKAGE_STRING='yast2-printer 2.13.15' +PACKAGE_VERSION='2.13.16' +PACKAGE_STRING='yast2-printer 2.13.16' 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.13.15 to adapt to many kinds of systems. +\`configure' configures yast2-printer 2.13.16 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.13.15:";; + short | recursive ) echo "Configuration of yast2-printer 2.13.16:";; 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.13.15 +yast2-printer configure 2.13.16 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.13.15, which was +It was created by yast2-printer $as_me 2.13.16, 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.13.15' + VERSION='2.13.16' cat >>confdefs.h <<_ACEOF @@ -2124,7 +2124,7 @@ -VERSION="2.13.15" +VERSION="2.13.16" RPMNAME="yast2-printer" MAINTAINER="Michal Zugec <mzugec@suse.cz>" @@ -21730,7 +21730,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by yast2-printer $as_me 2.13.15, which was +This file was extended by yast2-printer $as_me 2.13.16, 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.13.15 +yast2-printer config.status 2.13.16 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.13.16/configure.in new/yast2-printer-2.13.17/configure.in --- old/yast2-printer-2.13.16/configure.in 2006-05-11 16:21:18.000000000 +0200 +++ new/yast2-printer-2.13.17/configure.in 2006-06-02 18:07:58.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 2.13.18 - DO NOT EDIT! -- dnl (edit configure.in.in instead) -AC_INIT(yast2-printer, 2.13.15, http://bugs.opensuse.org/, yast2-printer) +AC_INIT(yast2-printer, 2.13.16, 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.13.15" +VERSION="2.13.16" RPMNAME="yast2-printer" MAINTAINER="Michal Zugec <mzugec@suse.cz>" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/src/common/dialogs-connection.ycp new/yast2-printer-2.13.17/src/common/dialogs-connection.ycp --- old/yast2-printer-2.13.16/src/common/dialogs-connection.ycp 2006-04-14 09:25:57.000000000 +0200 +++ new/yast2-printer-2.13.17/src/common/dialogs-connection.ycp 2006-06-02 18:48:49.000000000 +0200 @@ -9,7 +9,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: dialogs-connection.ycp 30130 2006-04-14 07:25:44Z mzugec $ + * $Id: dialogs-connection.ycp 31303 2006-06-02 16:46:50Z mzugec $ * */ { @@ -207,36 +207,36 @@ define symbol runGenericConnectionTypeDialog (term items, string caption, string frame, string help, symbol what) ``{ + term contents = `VBox(); - term contents = `VBox ( + if ( size(caption)==0 || size(frame)==0 ) + { + contents = `VBox ( `VSpacing (2), `HBox ( `HSpacing (5), - `Frame ( - frame, `VBox ( `RadioButtonGroup (`id (`connection_type), items), `VSpacing (1) - ) - ), + ), `HSpacing (5) ), `VSpacing (2) ); - - if (caption==nil || frame==nil) - { - contents = `VBox ( + } else contents = `VBox ( `VSpacing (2), `HBox ( `HSpacing (5), + `Frame ( + frame, `VBox ( `RadioButtonGroup (`id (`connection_type), items), `VSpacing (1) - ), + ) + ), `HSpacing (5) ), `VSpacing (2) ); - } + // dialog caption Wizard::SetContentsButtons (caption, contents, @@ -309,7 +309,6 @@ * @return symbol wizard sequencer symbol */ define symbol runNewQueueDialog() ``{ - list<term> printers = []; term contents = `VBox(); if (Spooler::Get () == "cups") @@ -360,7 +359,6 @@ } } - if (is(ret, integer)) { integer from_detect = -1; @@ -456,9 +454,9 @@ )); } // dialog caption - any ret = runGenericConnectionTypeDialog (items, nil, //_("Printer Type"), + any ret = runGenericConnectionTypeDialog (items, "", //_("Printer Type"), // frame label - nil, //_("Printer Type"), + "", //_("Printer Type"), getConnectionTypeHelp (add_queue), `connection_type); if (ret == `lpd) Printer::printer["proposed_raw"] = true; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/src/common/dialogs.ycp new/yast2-printer-2.13.17/src/common/dialogs.ycp --- old/yast2-printer-2.13.16/src/common/dialogs.ycp 2006-04-28 13:16:12.000000000 +0200 +++ new/yast2-printer-2.13.17/src/common/dialogs.ycp 2006-06-02 18:48:49.000000000 +0200 @@ -8,7 +8,7 @@ * Authors: * Petr Blahos <pblahos@suse.cz> * - * $Id: dialogs.ycp 30573 2006-04-28 11:16:06Z mzugec $ + * $Id: dialogs.ycp 31303 2006-06-02 16:46:50Z mzugec $ * Main dialogs. */ { @@ -243,6 +243,20 @@ { ret = `next_propose_queues; } + +map ppd_options = Printer::printer["ppd_options"]:$[]; + + if (ppd_options == $[]) { + string ps = Printer::getPaperSize(); + ppd_options = $["PageSize":ps, + "PageRegion":ps, + "ImageableArea":ps, + "PaperDimension":ps]; + } + Printer::printer["ppd_options"]=ppd_options; + + + } y2milestone ("Returning %1, printer set to %2", ret, Printer::printer); return ret; @@ -1061,6 +1075,22 @@ 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 * be depended options so change of value (lower list) can change content @@ -1100,9 +1130,9 @@ // check locales (for printer size) only for new queue, not modified boolean checkLocales = true; - foreach(map<string, any> row, Printer::printcap, { - if (Printer::printer["name"]:"" == row["name"]:"") checkLocales = false; - }); +// foreach(map<string, any> row, Printer::printcap, { +// if (Printer::printer["name"]:"" == row["name"]:"") checkLocales = false; +// }); list<map> optlist = Printerdb::getPpdFileOptions (filename, checkLocales); // and now add options without their location in PPD file @@ -1323,7 +1353,7 @@ Printer::printer["options"] = selected; Printer::printer["ppd_options"] = ppd_selected; - +/* // 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"]:""; @@ -1334,8 +1364,8 @@ if (size(warning)>0){ Popup::Error(warning); } - - +*/ +//saveOptions(); } return (symbol)ret; @@ -1360,7 +1390,19 @@ boolean know = conf_type || Printer::printer["type"]:"yast2" == "non-yast-now"; boolean raw = Printer::printer["raw"]:false; string model = Printer::printer["detected", "ppd_info", "model"]:""; //["device"]:""; - + map ppd_options = Printer::printer["ppd_options"]:$[]; +/* + if (ppd_options == $[]) { + string ps = Printer::getPaperSize(); + ppd_options = $["PageSize":ps, + "PageRegion":ps, + "ImageableArea":ps, + "PaperDimension":ps]; + } + Printer::printer["ppd_options"]=ppd_options; +y2internal("Printer %1", Printer::printer); +*/ +//saveOptions(); // // texts // @@ -1412,7 +1454,7 @@ if (! raw) { // table entry - items = add (items, `item (`id (`settings), _("Filter settings"), "")); + items = add (items, `item (`id (`settings), _("Filter settings"), ppd_options["PageSize"]:""+" ...")); // table entry items = add (items, `item (`id (`perm), _("Restriction settings"), "")); // table entry @@ -1877,7 +1919,7 @@ // new queue to existing printer if (Printer::runAutoprobedListDialog__current == "-2") { - y2milestone ("Configuring queue for isntalled printer"); + y2milestone ("Configuring queue for installed printer"); return `installed_printer; } // not detected printer @@ -2309,51 +2351,9 @@ { Printer::selectPrinter(-1); ret = `configure_button; -/* - if (new_spooler == "cups") - { - if ( size(Printer::printcap)>0 && true == Popup::AnyQuestion( Label::WarningMsg(), - // message box : configure new queue or add a new printer - "Do want to configure new queue ?", "Yes", "No", `focus_no )) { - 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 (temp_string == 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; - } - - }); - map <string, any> tmp_map = Printer::Detect()[from_detect]:$[]; - Printer::editDetected(tmp_map); - y2milestone("Configuring detected, non-configured printer"); - ret = `edit_button; - } - else - { - Printer::selectPrinter(-1); - ret = `configure_button; - } - } else { - continue; - } -*/ - } - if (ret == `edit) - { + if (ret == `edit) + { if (new_spooler == "cups") { if (Printer::printer == $["type":"yast2"]) @@ -2386,7 +2386,7 @@ 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; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/src/common/misc.ycp new/yast2-printer-2.13.17/src/common/misc.ycp --- old/yast2-printer-2.13.16/src/common/misc.ycp 2006-05-11 16:37:18.000000000 +0200 +++ new/yast2-printer-2.13.17/src/common/misc.ycp 2006-06-02 18:48:49.000000000 +0200 @@ -12,7 +12,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> 2002 * - * $Id: misc.ycp 30871 2006-05-11 14:37:03Z mzugec $ + * $Id: misc.ycp 31303 2006-06-02 16:46:50Z mzugec $ * * Miscelaneous defines. */ @@ -96,7 +96,7 @@ map composite = $[]; if (found) composite = opts[ind]:$[]; - string pagesize = Printerlib::getDefaultPaperSize () == `a4 + string pagesize = Printer::getPaperSize () == "A4" ? "A4" : "Letter"; if (composite != $[]) @@ -177,7 +177,7 @@ map options = p["ppd_options"]:$[]; if (haskey (options, "PageSize")) return p; - string pagesize = Printerlib::getDefaultPaperSize () == `a4 ? "A4" : "Letter"; + string pagesize = Printer::getPaperSize (); options["PageSize"] = pagesize; options["PageRegion"] = pagesize; options["ImageableArea"] = pagesize; @@ -219,7 +219,6 @@ printers = add (printers, p); } }); - return printers; } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/src/common/wizards.ycp new/yast2-printer-2.13.17/src/common/wizards.ycp --- old/yast2-printer-2.13.16/src/common/wizards.ycp 2006-03-21 08:59:06.000000000 +0100 +++ new/yast2-printer-2.13.17/src/common/wizards.ycp 2006-06-02 18:48:49.000000000 +0200 @@ -9,7 +9,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: wizards.ycp 29005 2006-03-15 13:49:42Z mzugec $ + * $Id: wizards.ycp 31303 2006-06-02 16:46:50Z mzugec $ */ { textdomain "printer"; @@ -298,24 +298,6 @@ `queue : "inst_printer", `other : "connection_other", ], -/* - "connection_type" : $[ - `edit_button : "edit_printer_wz", - `parallel : "parallel", - `serial: "serial", - `usb: "usb", - `irda: "irda", - `bluetooth: "bluetooth", - `cups : "connection_cups", - `lpd : "lpd", - `smb : "samba", - `ipx : "novell", - `direct : "connection_direct", - `queue : "inst_printer", - `other : "connection_other", - `abort : `abort, - ], -*/ "edit_printer_wz": $[ `next: `next, `abort : `abort, @@ -340,10 +322,6 @@ `uri : "other", `abort : `abort, ], -// "new_queue" : $[ -// `abort : `abort -// ], - // single connection types "parallel" : $[ `next : "name_auto", `abort : `abort, diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-printer-2.13.16/src/modules/Printer.ycp new/yast2-printer-2.13.17/src/modules/Printer.ycp --- old/yast2-printer-2.13.16/src/modules/Printer.ycp 2006-05-04 13:28:03.000000000 +0200 +++ new/yast2-printer-2.13.17/src/modules/Printer.ycp 2006-06-02 18:48:49.000000000 +0200 @@ -12,7 +12,7 @@ * Petr Blahos <pblahos@suse.cz> * Jiri Srain <jsrain@suse.cz> * - * $Id: Printer.ycp 30684 2006-05-04 11:26:07Z locilka $ + * $Id: Printer.ycp 31303 2006-06-02 16:46:50Z mzugec $ * * Well we all know what modules are for. */ @@ -125,6 +125,27 @@ */ global list<map<string,any> > autodetected = []; + string default_paper_size = nil; + +global string getPaperSize(){ + + if(default_paper_size == nil){ + string p_size="A4"; + map <string, any> output = (map <string, any>) SCR::Execute (.target.bash_output, + ". /etc/sysconfig/language >/dev/null + h=$(locale -k LC_PAPER|grep height) + case $h in + height=297) echo 'A4' ;; + height=279) echo 'Letter' ;; + *) echo 'nil';; + esac", $[]); + if (output["exit"]:0==0) p_size = (splitstring(output["stdout"]:"", "\n"))[0]:""; + default_paper_size = p_size; + } + + return default_paper_size; +} + /** * List of unique keys of the printers read at the beginning. @@ -1215,6 +1236,8 @@ printcap = maplist (map<string,any> e, printcap,``{return assignState (e, false);}); + default_paper_size = getPaperSize(); + y2milestone("Default paper size is %1", default_paper_size); if (!skip_autodetection) { Progress::NextStageStep (16); // step 16-19 - autodetection @@ -2018,7 +2041,6 @@ return; // settings are read and hw is detected list<string> forbidden_names = getForbiddenNames (); - symbol page_size = Printerlib::getDefaultPaperSize (); foreach (map i, autodetected, ``{ if (!alreadyConfigured (i["unique_key"]:"")) { @@ -2048,10 +2070,7 @@ foreach (string paperentry, ["ImageableArea", "PageRegion", "PageSize", "PaperDimension"], ``{ - if (page_size == `letter) - printer["ppd_options", paperentry] = "Letter"; - else - printer["ppd_options", paperentry] = "A4"; + printer["ppd_options", paperentry] = getPaperSize(); }); if (ok) { ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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@suse.de