[yast-commit] r62406 - in /trunk/printer: VERSION package/yast2-printer.changes src/Printer.ycp src/basicadd.ycp src/helps.ycp src/printer_proposal.ycp
Author: jsmeix Date: Wed Aug 18 16:08:36 2010 New Revision: 62406 URL: http://svn.opensuse.org/viewcvs/yast?rev=62406&view=rev Log: - Added a "Use as Default" check-box below the input field for the queue name in the "Add" dialog and enhanced its help text accordingly (see Novell/openSUSE Bugzilla bnc#631263). - 2.20.1 Modified: trunk/printer/VERSION trunk/printer/package/yast2-printer.changes trunk/printer/src/Printer.ycp trunk/printer/src/basicadd.ycp trunk/printer/src/helps.ycp trunk/printer/src/printer_proposal.ycp Modified: trunk/printer/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/VERSION (original) +++ trunk/printer/VERSION Wed Aug 18 16:08:36 2010 @@ -1 +1 @@ -2.20.0 +2.20.1 Modified: trunk/printer/package/yast2-printer.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/package/yast2-printer.changes (original) +++ trunk/printer/package/yast2-printer.changes Wed Aug 18 16:08:36 2010 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Aug 18 12:20:57 CEST 2010 - jsmeix@suse.de + +- Added a "Use as Default" check-box below the input field for + the queue name in the "Add" dialog and enhanced its help text + accordingly (see Novell/openSUSE Bugzilla bnc#631263). +- 2.20.1 + +------------------------------------------------------------------- Tue Aug 10 15:56:38 CEST 2010 - jsmeix@suse.de - Added testprint.2pages.ps and enhanced test page printing Modified: trunk/printer/src/Printer.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printer.ycp?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/src/Printer.ycp (original) +++ trunk/printer/src/Printer.ycp Wed Aug 18 16:08:36 2010 @@ -1950,9 +1950,10 @@ * Add new queue or overwrite existing queue * @return true on success */ -global boolean AddQueue( string queue_name, string default_paper_size ) +global boolean AddQueue( string queue_name, boolean is_default_queue, string default_paper_size ) { // Delete ' characters because they are used for quoting in the bash commandline below: queue_name = deletechars( queue_name, "'" ); + default_paper_size = deletechars( default_paper_size, "'" ); string uri = deletechars( connections[selected_connections_index,"uri"]:"", "'" ); string ppd = deletechars( ppds[selected_ppds_index,"ppd"]:"", "'" ); string model = deletechars( connections[selected_connections_index,"model"]:"", "'" ); @@ -1997,6 +1998,15 @@ current_device_uri = ""; return false; } + // If the new queue was created successfully, make it the default queue if this is requested: + if( is_default_queue ) + { // Acording to "man lpadmin" the "-d queue_name" setting does not work intermixed + // with other option settings so that a separate lpadmin command is called: + commandline = "/usr/sbin/lpadmin -h localhost -d '" + queue_name + "'"; + // Do not care if it fails to make it the default queue (i.e. show no error message to the user) + // because the default queue setting is nice to have but not mandatoty for a working queue: + Printerlib::ExecuteBashCommand( commandline ); + } // Try to set the requested default_paper_size if it is an available choice for this queue. // If no default_paper_size is requested, the CUPS default is used. // For the CUPS 1.3 default see http://www.cups.org/str.php?L2846 Modified: trunk/printer/src/basicadd.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/basicadd.ycp?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/src/basicadd.ycp (original) +++ trunk/printer/src/basicadd.ycp Wed Aug 18 16:08:36 2010 @@ -214,15 +214,29 @@ `VStretch(), `Left ( `HBox - ( `ReplacePoint - ( `id(`queue_name_input_replace_point), - `InputField - ( `id(`queue_name_input), - // Avoid that it becomes squeezed to only a few characters in text mode: - `opt(`hstretch), - // Header of a TextEntry to enter the queue name: - _("Set Arbitrary &Name"), - queue_name_proposal + ( `VBox + ( `Left + ( `ReplacePoint + ( `id(`queue_name_input_replace_point), + `InputField + ( `id(`queue_name_input), + // Avoid that it becomes squeezed to only a few characters in text mode: + `opt(`hstretch), + // Header of a TextEntry to enter the queue name: + _("Set Arbitrary &Name"), + queue_name_proposal + ) + ) + ), + `Left + ( `CheckBox + ( `id(`default_queue_checkbox), + // CheckBox to set a local print queue to be the default queue: + _("&Use as Default"), + // When adding a new queue, do not use it as default queue by default + // because this would override an existing default queue setting: + false + ) ) ), `HStretch(), @@ -230,8 +244,8 @@ ( `Right ( `Label ( // Label text to run HPLIP's printer setup tool 'hp-setup' - // to set up HP printers which runs only in English language: - _("Alternative setup for HP printers (English only):") + // to set up HP printers: + _("Alternative setup for HP printers:") ) ), `Right @@ -241,6 +255,14 @@ // Do not change or translate "hp-setup", it is a program name: _("Run &hp-setup") ) + ), + `Right + ( `Label + ( // Label text to inform the user that HPLIP's + // printer setup tool 'hp-setup' runs in English language. + // Do not change or translate "hp-setup", it is a program name: + _("hp-setup runs in English language") + ) ) ) ) @@ -370,6 +392,7 @@ } queue_name = validated_queue_name; } + boolean is_default_queue = (boolean)UI::QueryWidget( `id(`default_queue_checkbox), `Value ); string default_paper_size = ""; any paper_size = UI::QueryWidget( `id(`paper_size_radio_buttons), `CurrentButton ); if( `a4 == paper_size ) @@ -381,7 +404,7 @@ Wizard::DisableBackButton(); Wizard::DisableNextButton(); // No error messages here because Printer::AddQueue already shows them: - Printer::AddQueue( queue_name, default_paper_size ); + Printer::AddQueue( queue_name, is_default_queue, default_paper_size ); // After a local queue was added, enforce to show also local queues // in particular when no local queues were shown before: Printer::queue_filter_show_local = true; Modified: trunk/printer/src/helps.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/helps.ycp?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/src/helps.ycp (original) +++ trunk/printer/src/helps.ycp Wed Aug 18 16:08:36 2010 @@ -115,7 +115,7 @@ </p>"), "basic_add_dialog" : -// BasicAddDialog help 1/5: +// BasicAddDialog help 1/7: _("<p> <b><big>Set Up a New Queue for a Printer Device</big></b><br> A printer device is not used directly but via a print queue.<br> @@ -127,16 +127,16 @@ For example a second queue with a monochrome-only driver to enforce black-only printout on a color device or a PostScript queue and a queue with a PCL driver for a PostScript+PCL printer -because printing via the PCL driver is usally faster (but with less quality). +because printing via the PCL driver is usually faster (but with less quality). </p>") + -// BasicAddDialog help 2/5: +// BasicAddDialog help 2/7: _("<p> To set up a new queue:<br> Select the connection of the matching printer device,<br> find and assign a suitable printer driver, and<br> set a unique queue name. </p>") + -// BasicAddDialog help 3/5: +// BasicAddDialog help 3/7: _("<p> The <b>connection</b> determines which way data is sent to the printer device.<br> If a wrong connection is selected, no data can be sent to the device @@ -150,7 +150,7 @@ (e.g. device status via 'hp-toolbox', or scanning with a HP all-in-one device) the 'hp:/...' connection must be used. </p>") + -// BasicAddDialog help 4/5: +// BasicAddDialog help 4/7: _("<p> The <b>driver</b> determines that the right data is produced for the specific printer model.<br> @@ -198,12 +198,41 @@ you must first set up the queue and then in a second step you can adjust all driver options in the 'Edit/Modify' dialog. </p>") + -// BasicAddDialog help 5/5: +// BasicAddDialog help 5/7: _("<p> Application programs do not show the actual printer device but its associated <b>queue name</b>.<br> Only letters (a-z and A-Z), numbers (0-9), and the underscore '_' are allowed for the queue name and it must start with a letter. +</p>") + +// BasicAddDialog help 6/7: +_("<p> +One of the print queues may be set to be <b>used by default</b>.<br> +Application programs should use such a system default print queue +if no other print queue was specified by the user. +But there is no such thing as the 'one and only' default queue. +Beside a system default queue any user can maintain his own +default queue setting and furthermore any application program +may implement its own particular way of default queue setting +(e.g. the application may remember the previously used queue).<br> +For details see the openSUSE support database +article 'Print Settings with CUPS' at<br> +http://en.opensuse.org/SDB:Print_Settings_with_CUPS +</p>") + +// BasicAddDialog help 7/7: +_("<p> +An alternative way to set up HP devices is to <b>run hp-setup</b>.<br> +HP's own tool 'hp-setup' provides setup support in particular +for HP printers and HP all-in-one devices which require +a proprietary driver plugin to be downloaded from HP and +installed in the right way on a particular end-user's system. +Furthermore 'hp-setup' can provide better setup support +for HP network printers and HP all-in-one network devices +because HP's own tool can implement special handling +for special HP network devices.<br> +For details see the openSUSE support database +article 'How to set-up a HP printer' at<br> +http://en.opensuse.org/SDB:How_to_set-up_a_HP_printer </p>"), "basic_modify_dialog" : Modified: trunk/printer/src/printer_proposal.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/printer_proposal.ycp?rev=62406&r1=62405&r2=62406&view=diff ============================================================================== --- trunk/printer/src/printer_proposal.ycp (original) +++ trunk/printer/src/printer_proposal.ycp Wed Aug 18 16:08:36 2010 @@ -234,9 +234,12 @@ { y2internal("Selected driver: %1", drivers[0]:nil); // An empty default_paper_size results CUPS's default paper size // (see the Printer::AddQueue function) so that the proposal results the same - // as if the user would have blindly clicked [OK] in the BasicAddDialog: + // as if the user would have blindly clicked [OK] in the BasicAddDialog. + // The BasicAddDialog does by default not set the default queue + // to avoid that a possibly existing default queue gets overwritten. + boolean is_default_queue = false; string default_paper_size = ""; - if( Printer::AddQueue( queue_name, default_paper_size ) ) + if( Printer::AddQueue( queue_name, is_default_queue, default_paper_size ) ) { already_set_up_uris = add( already_set_up_uris, uri ); // Autodetect queues again so that Printer::NewQueueName // can compare with existing queue names but ignore whatever failures -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsmeix@svn.opensuse.org