Author: jsmeix
Date: Wed Nov 12 14:13:37 2008
New Revision: 53199
URL: http://svn.opensuse.org/viewcvs/yast?rev=53199&view=rev
Log:
- Added captions and the printer icon to the dialog header line
(see Novell/Suse Bugzilla bnc#438198).
- Fixed functionality of the "Cancel" button in the non-initial
dialogs of the DialogTree (Printing via Network, Sharing,
Policies, Autoconfig) so that the "Cancel" button goes
now "back" to the Overview according to the new style guide.
Only the "Cancel" button in the initial Overview dialog
exits the whole module.
- 2.17.35
Modified:
trunk/printer/VERSION
trunk/printer/package/yast2-printer.changes
trunk/printer/src/Printer.ycp
trunk/printer/src/autoconfig.ycp
trunk/printer/src/dialogs.ycp
trunk/printer/src/overview.ycp
trunk/printer/src/policies.ycp
trunk/printer/src/printingvianetwork.ycp
trunk/printer/src/sharing.ycp
trunk/printer/src/wizards.ycp
Modified: trunk/printer/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/VERSION?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/VERSION (original)
+++ trunk/printer/VERSION Wed Nov 12 14:13:37 2008
@@ -1 +1 @@
-2.17.34
+2.17.35
Modified: trunk/printer/package/yast2-printer.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/package/yast2-printer.changes?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/package/yast2-printer.changes (original)
+++ trunk/printer/package/yast2-printer.changes Wed Nov 12 14:13:37 2008
@@ -1,4 +1,17 @@
-------------------------------------------------------------------
+Wed Nov 12 12:52:57 CET 2008 - jsmeix@suse.de
+
+- Added captions and the printer icon to the dialog header line
+ (see Novell/Suse Bugzilla bnc#438198).
+- Fixed functionality of the "Cancel" button in the non-initial
+ dialogs of the DialogTree (Printing via Network, Sharing,
+ Policies, Autoconfig) so that the "Cancel" button goes
+ now "back" to the Overview according to the new style guide.
+ Only the "Cancel" button in the initial Overview dialog
+ exits the whole module.
+- 2.17.35
+
+-------------------------------------------------------------------
Thu Nov 6 17:36:12 CET 2008 - jsmeix@suse.de
- Fixed a quoting bug in the Modify queue dialog.
Modified: trunk/printer/src/Printer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/Printer.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/Printer.ycp (original)
+++ trunk/printer/src/Printer.ycp Wed Nov 12 14:13:37 2008
@@ -698,7 +698,7 @@
Progress::New( // Header of a Progress::New:
_("Finishing Printer Configuration"),
" ",
- 0,
+ 1,
[ // 1. progress stage name of a Progress::New:
_("Finish printer configuration")
],
@@ -1625,12 +1625,14 @@
* @return true on success
*/
global boolean AddQueue( string queue_name )
-{ string uri = connections[selected_connections_index,"uri"]:"";
- string ppd = ppds[selected_ppds_index,"ppd"]:"";
- // Delete ' characters because they are used for quoting in the bash commandline below:
+{ // Delete ' characters because they are used for quoting in the bash commandline below:
+ queue_name = deletechars( queue_name, "'" );
+ string uri = deletechars( connections[selected_connections_index,"uri"]:"", "'" );
+ string ppd = deletechars( ppds[selected_ppds_index,"ppd"]:"", "'" );
string model = deletechars( connections[selected_connections_index,"model"]:"", "'" );
string description = deletechars( ppds[selected_ppds_index,"nickname"]:"", "'" );
- if( "" != model
+ if( "" != description
+ && "" != model
&& "unknown" != tolower( model )
&& ! issubstring( filterchars( tolower( description ), lower_alnum_chars ),
filterchars( tolower( model ), lower_alnum_chars )
@@ -1639,12 +1641,21 @@
{ description = model + " with driver " + description;
}
if( "" == uri || "" == ppd || "" == queue_name )
- { return false;
+ { y2milestone( "Cannot set up queue because of empty mandatory parameter: queue_name = '%1', uri = '%2', ppd = '%3'", queue_name, uri, ppd );
+ return false;
}
- // Note the bash quotings of the queue_name and description strings with ' characters:
- string commandline = "/usr/sbin/lpadmin -h localhost -p '" + queue_name + "' -v " + uri + " -m " + ppd + " -D '" + description + "' -E";
+ // Note the bash quotings of the parameters with ' characters:
+ string commandline = "/usr/sbin/lpadmin -h localhost -p '" + queue_name + "' -v '" + uri + "' -m '" + ppd + "' -D '" + description + "' -E";
if( ! Printerlib::ExecuteBashCommand( commandline ) )
- { return false;
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system
+ // (i.e. a system which is not totally broken or totally messed up).
+ _("Failed to set up queue %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
}
return true;
}
@@ -1657,18 +1668,30 @@
{ if( "" == queue_name )
{ queue_name = queues[selected_queues_index,"name"]:"";
if( "local" != queues[selected_queues_index,"config"]:"remote" )
- { return false;
+ { y2milestone( "Cannot delete queue '%1' because it is no local queue", queue_name );
+ return false;
}
}
+ // Delete ' characters because they are used for quoting in the bash commandline below:
+ queue_name = deletechars( queue_name, "'" );
if( "" == queue_name )
- { return false;
+ { y2milestone( "Cannot delete queue because queue_name is the empty string" );
+ return false;
}
// To be safe invalidate selected_queues_index in any case:
selected_queues_index = -1;
// Note the bash quoting of the queue_name string with ' characters:
string commandline = "/usr/sbin/lpadmin -h localhost -x '" + queue_name + "'";
if( ! Printerlib::ExecuteBashCommand( commandline ) )
- { return false;
+ { Popup::ErrorDetails( sformat( // Popup::ErrorDetails message where %1 will be replaced by the queue name.
+ // Only a simple message because this error does not happen on a normal system
+ // (i.e. a system which is not totally broken or totally messed up).
+ _("Failed to delete queue %1."),
+ queue_name
+ ),
+ Printerlib::result["stderr"]:""
+ );
+ return false;
}
return true;
}
Modified: trunk/printer/src/autoconfig.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/autoconfig.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/autoconfig.ycp (original)
+++ trunk/printer/src/autoconfig.ycp Wed Nov 12 14:13:37 2008
@@ -186,7 +186,16 @@
UI::ChangeWidget( `id("cups_autoconfig_operation_policy"), `Enabled, false );
}
y2milestone( "leaving initAutoconfig with\ninitial_cups_autoconfig_ConfigureNewPrinters = '%1'\ninitial_cups_autoconfig_DisablePrintersOnRemoval = '%2'\ninitial_cups_autoconfig_DefaultCUPSPolicy = '%3'", initial_cups_autoconfig_ConfigureNewPrinters, initial_cups_autoconfig_DisablePrintersOnRemoval, initial_cups_autoconfig_DefaultCUPSPolicy );
+}
+symbol handleAutoconfig( string key, map event )
+{ y2milestone( "entering handleAutoconfig with key '%1'\nand event '%2'", key, event );
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `autoconfig_back;
+ }
+ }
+ return nil;
}
void storeAutoconfig( string key, map event )
Modified: trunk/printer/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/dialogs.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/dialogs.ycp (original)
+++ trunk/printer/src/dialogs.ycp Wed Nov 12 14:13:37 2008
@@ -41,105 +41,109 @@
include "printer/policies.ycp";
include "printer/autoconfig.ycp";
-map > wd = $[
- "OVERVIEW" : $[
- "widget" : `custom,
- "custom_widget" : widgetOverview,
- "init" : initOverview,
- "handle" : handleOverview,
- "help" : HELPS["overview"]:""
- ],
- "NETWORKPRINTING" : $[
- "widget" : `custom,
- "custom_widget" : widgetNetworkPrinting,
- "init" : initNetworkPrinting,
- "handle" : handleNetworkPrinting,
- "store" : storeNetworkPrinting,
- "help" : HELPS["printing_via_network_dialog"]:""
- ],
- "SHARING" : $[
- "widget" : `custom,
- "custom_widget" : widgetSharing,
- "init" : initSharing,
- "handle": handleSharing,
- "store" : storeSharing,
- "help" : HELPS["sharing_dialog"]:""
- ],
- "POLICIES" : $[
- "widget" : `custom,
- "custom_widget" : widgetPolicies,
- "init" : initPolicies,
- "store" : storePolicies,
- "help" : HELPS["policies"]:""
- ],
- "AUTOCONFIG" : $[
- "widget" : `custom,
- "custom_widget" : widgetAutoconfig,
- "init" : initAutoconfig,
- "store" : storeAutoconfig,
- "help" : HELPS["autoconfig"]:""
- ]
-];
-
-map tabs_descr = $[
- "overview" : $[
- "header" : _("Printer Configurations"),
- "tree_item_label" : _("Printer Configurations"),
- "contents" : `VBox (
- "OVERVIEW"
- ),
- "widget_names" : ["OVERVIEW"]
- ],
- "network" : $[
- "header" : _("Print via Network"),
- "tree_item_label" : _("Print via Network"),
- "contents" : `VBox (
- "NETWORKPRINTING"
- ),
- "widget_names" : ["NETWORKPRINTING"]
- ],
- "sharing" : $[
- "header" : _("Share Printers"),
- "tree_item_label" : _("Share Printers"),
- "contents" : `VBox (
- "SHARING"
- ),
- "widget_names" : ["SHARING"]
- ],
- "policies" : $[
- "header" : _("Policies"),
- "tree_item_label" : _("Policies"),
- "contents" : `VBox (
- "POLICIES"
- ),
- "widget_names" : ["POLICIES"]
- ],
- "autoconfig" : $[
- "header" : _("Autoconfig Settings"),
- "tree_item_label" : _("Autoconfig Settings"),
- "contents" : `VBox (
- "AUTOCONFIG"
- ),
- "widget_names" : ["AUTOCONFIG"]
- ],
-];
-
-
-symbol runMainDialog(){
- string caption = _("Detected Printers");
-
- symbol ret = DialogTree::ShowAndRun ($[
- "ids_order" : [ "overview", "network", "sharing", "policies", "autoconfig" ],
- "initial_screen" : "overview",
- "screens" : tabs_descr,
- "widget_descr" : wd,
- "back_button" : nil,//Label::BackButton(),
- "abort_button" : Label::CancelButton(),
- "next_button" : Label::OKButton ()
- ]);
- return ret;
+map< string, map< string, any > > widgets_handling =
+ $[ "OVERVIEW" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetOverview,
+ "init" : initOverview,
+ "handle" : handleOverview,
+ "help" : HELPS["overview"]:""
+ ],
+ "NETWORKPRINTING" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetNetworkPrinting,
+ "init" : initNetworkPrinting,
+ "handle" : handleNetworkPrinting,
+ "store" : storeNetworkPrinting,
+ "help" : HELPS["printing_via_network_dialog"]:""
+ ],
+ "SHARING" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetSharing,
+ "init" : initSharing,
+ "handle": handleSharing,
+ "store" : storeSharing,
+ "help" : HELPS["sharing_dialog"]:""
+ ],
+ "POLICIES" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetPolicies,
+ "init" : initPolicies,
+ "handle": handlePolicies,
+ "store" : storePolicies,
+ "help" : HELPS["policies"]:""
+ ],
+ "AUTOCONFIG" :
+ $[ "widget" : `custom,
+ "custom_widget" : widgetAutoconfig,
+ "init" : initAutoconfig,
+ "handle": handleAutoconfig,
+ "store" : storeAutoconfig,
+ "help" : HELPS["autoconfig"]:""
+ ]
+ ];
+
+map< string, map< string, any > > tabs_description =
+ $[ "overview" :
+ $[ "header" : _("Printer Configurations"),
+ "tree_item_label" : _("Printer Configurations"),
+ "caption" : _("Printer Configurations"),
+ "contents" : `VBox( "OVERVIEW" ),
+ "widget_names" : ["OVERVIEW"]
+ ],
+ "network" :
+ $[ "header" : _("Print via Network"),
+ "tree_item_label" : _("Print via Network"),
+ "caption" : _("Print via Network"),
+ "contents" : `VBox( "NETWORKPRINTING" ),
+ "widget_names" : ["NETWORKPRINTING"]
+ ],
+ "sharing" :
+ $[ "header" : _("Share Printers"),
+ "tree_item_label" : _("Share Printers"),
+ "caption" : _("Share Printers"),
+ "contents" : `VBox( "SHARING" ),
+ "widget_names" : ["SHARING"]
+ ],
+ "policies" :
+ $[ "header" : _("Policies"),
+ "tree_item_label" : _("Policies"),
+ "caption" : _("Policies"),
+ "contents" : `VBox( "POLICIES" ),
+ "widget_names" : ["POLICIES"]
+ ],
+ "autoconfig" :
+ $[ "header" : _("Autoconfig Settings"),
+ "tree_item_label" : _("Autoconfig Settings"),
+ "caption" : _("Autoconfig Settings"),
+ "contents" : `VBox( "AUTOCONFIG" ),
+ "widget_names" : ["AUTOCONFIG"]
+ ]
+ ];
+
+symbol runMainDialog()
+{ string caption = _("Detected Printers");
+ symbol ret = DialogTree::ShowAndRun
+ ( $[ "ids_order" : [ "overview", "network", "sharing", "policies", "autoconfig" ],
+ "initial_screen" : "overview",
+ "screens" : tabs_description,
+ "widget_descr" : widgets_handling,
+ // All the dialogs in "ids_order" are single (step) configuration dialogs
+ // and according to the new YaST style guide at
+ // http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEd...
+ // there is no longer a "abort" functionality which exits the whole module.
+ // Instead this button is now named "Cancel" and its functionality is
+ // to go back to the Overview dialog (i.e. what the "back" button would do)
+ // because it reads "Cancel - Closes the window and returns to the overview."
+ // Therefore the button with the "abort" functionality is not shown at all
+ // and the button with the "back" functionality is named "Cancel".
+ "abort_button" : nil,
+ "back_button" : Label::CancelButton(),
+ "next_button" : Label::OKButton()
+ ]
+ );
+ return ret;
}
-
/* EOF */
}
Modified: trunk/printer/src/overview.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/overview.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/overview.ycp (original)
+++ trunk/printer/src/overview.ycp Wed Nov 12 14:13:37 2008
@@ -35,6 +35,7 @@
import "Popup";
import "Printerlib";
import "Printer";
+import "Wizard";
include "printer/helps.ycp";
@@ -149,6 +150,7 @@
If you really must use a non-official port, you cannot use
the YaST printer modue to configure your printers.
");
+ Wizard::SetDesktopIcon("printer");
boolean local_content_selected = Printer::queue_filter_show_local;
boolean remote_content_selected = Printer::queue_filter_show_remote;
boolean local_cupsd_required = true;
Modified: trunk/printer/src/policies.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/policies.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/policies.ycp (original)
+++ trunk/printer/src/policies.ycp Wed Nov 12 14:13:37 2008
@@ -211,6 +211,16 @@
y2milestone( "leaving initPolicies with\ninitial_operation_policy = '%1'\ninitial_error_policy = '%2'", initial_operation_policy, initial_error_policy );
}
+symbol handlePolicies( string key, map event )
+{ y2milestone( "entering handlePolicies with key '%1'\nand event '%2'", key, event );
+ if( "Activated" == event["EventReason"]:"" )
+ { if( `back == event["ID"]:nil )
+ { return `policies_back;
+ }
+ }
+ return nil;
+}
+
void storePolicies( string key, map event)
{ y2milestone( "entering storePolicies with key '%1'\nand event '%2'", key, event );
boolean applied_policies = true;
Modified: trunk/printer/src/printingvianetwork.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/printingvianetwork.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/printingvianetwork.ycp (original)
+++ trunk/printer/src/printingvianetwork.ycp Wed Nov 12 14:13:37 2008
@@ -961,8 +961,11 @@
}
}
if( "Activated" == event["EventReason"]:"" )
- { if( `connection_wizard == event["ID"]:nil )
- { return `connection_wizard;
+ { if( `back == event["ID"]:nil )
+ { return `printing_via_network_back;
+ }
+ if( `connection_wizard == event["ID"]:nil )
+ { return `printing_via_network_connection_wizard;
}
if( `test_client_conf_server == event["ID"]:nil )
{ string current_server_name_input_value = (string)UI::QueryWidget( `id(`client_conf_server_name_input), `Value );
Modified: trunk/printer/src/sharing.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/sharing.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/sharing.ycp (original)
+++ trunk/printer/src/sharing.ycp Wed Nov 12 14:13:37 2008
@@ -927,7 +927,10 @@
}
}
if( "Activated" == event["EventReason"]:"" )
- { switch( event["WidgetID"]:`nil )
+ { if( `back == event["ID"]:nil )
+ { return `sharing_back;
+ }
+ switch( event["WidgetID"]:`nil )
{ integer current_item = -1;
map ret = nil;
map< string, string > interface_map = nil;
Modified: trunk/printer/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/src/wizards.ycp?rev=53199&r1=53198&r2=53199&view=diff
==============================================================================
--- trunk/printer/src/wizards.ycp (original)
+++ trunk/printer/src/wizards.ycp Wed Nov 12 14:13:37 2008
@@ -35,7 +35,6 @@
import "Wizard";
include "printer/readwrite.ycp";
-//include "printer/overview.ycp";
include "printer/basicadd.ycp";
include "printer/basicmodify.ycp";
include "printer/connectionwizard.ycp";
@@ -61,39 +60,52 @@
];
map sequence = $[ "ws_start" : "overview",
"overview": $[ `abort : `abort,
+ `back : `abort,
`next : `next,
`add : "add",
`modify : "modify",
`delete : "overview",
- `connection_wizard : "printing_via_network_connection_wizard"
+ `printing_via_network_back : "overview",
+ `printing_via_network_connection_wizard : "printing_via_network_connection_wizard",
+ `sharing_back : "overview",
+ `policies_back : "overview",
+ `autoconfig_back : "overview"
],
"add" : $[ `abort : `abort,
+ `back : "overview",
`next : "overview",
`connection_wizard : "add_connection_wizard",
`add_driver : "add_driver_add"
],
"add_connection_wizard" : $[ `abort : `abort,
+ `back : "add",
`next : "add"
],
"add_driver_add" : $[ `abort : `abort,
+ `back : "add",
`next : "add"
],
"modify" : $[ `abort : `abort,
+ `back : "overview",
`next : "overview",
`connection_wizard : "modify_connection_wizard",
`add_driver : "modify_driver_add",
`driver_options : "modify_driver_options"
],
"modify_connection_wizard" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"modify_driver_add" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"modify_driver_options" : $[ `abort : `abort,
+ `back : "modify",
`next : "modify"
],
"printing_via_network_connection_wizard" : $[ `abort : `abort,
+ `back : "overview",
`next : "add"
],
];
@@ -121,6 +133,7 @@
]
];
Wizard::CreateDialog();
+ Wizard::SetDesktopIcon("printer");
any ret = Sequencer::Run(aliases, sequence);
UI::CloseDialog();
return ret;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org