Mailinglist Archive: yast-devel (126 mails)

< Previous Next >
[yast-devel] How to stay in a tab in DialogTree after clicking Next
  • From: Johannes Meixner <jsmeix@xxxxxxx>
  • Date: Fri, 6 Nov 2009 11:11:25 +0100 (CET)
  • Message-id: <alpine.LNX.2.00.0911061053120.4693@xxxxxxxxxxxxxx>

Hello,

short story:
in yast2-printer I use a DialogTree and in one of its tabs
(which is not its initial tab) I like to stay in the tab
after the user clicked Next when an error happened
while writing the settings to the system so that the user
can change the settings in the tab until it works
or he can click [Cancel] to enforce leaving the dialog.

Details:
in yast2-printer I have in src/dialogs.ycp
--------------------------------------------------------------------------
widgets_handling =
...
"NETWORKPRINTING" : $[ "widget" : `custom,
"custom_widget" : widgetNetworkPrinting,
"init" : initNetworkPrinting,
"handle" : handleNetworkPrinting,
"help" : HELPS["printing_via_network_dialog"]:""
],
.
.
.
tabs_description =
...
"network" : $[ "header" : _("Print via Network"),
"tree_item_label" : _("Print via Network"),
"caption" : _("Print via Network"),
"contents" : `VBox( "NETWORKPRINTING" ),
"widget_names" : ["NETWORKPRINTING"]
],
.
.
.
DialogTree::ShowAndRun
( $[ "ids_order" : [ "overview", "network", ... ],
"initial_screen" : "overview",
--------------------------------------------------------------------------

I like to stay in the "NETWORKPRINTING" tab when writing its
settings fails.

In src/printingvianetwork.ycp I have currently in
the handleNetworkPrinting() function:
----------------------------------------------------------------------------
if( `next == event["ID"]:nil )
{ if( ! ApplyNetworkPrintingSettings() )
{ Popup::Error( // Popup::Error message:
_("Failed to apply the settings to the system.")
);
// In case of an error stay on the "Print via Network" dialog
// so that the user can either change his settings until it works
// or he can use the [Cancel] button to return to the Overview dialog:
return nil;
}
----------------------------------------------------------------------------
but this does not work.

Instead the whole YaST module is exiting with `next regardless
that I explicitely "return nil" and in y2log there is:
------------------------------------------------------------------------------
2009-11-06 11:06:28 <1> nelson(6379) [liby2] Y2ProgramComponent.cc(result):159
Sending result: `result (nil)
2009-11-06 11:06:28 <1> nelson(6379) [liby2] genericfrontend.cc(main):777
Finished YaST2 component 'y2base'
2009-11-06 11:06:28 <1> nelson(6379) [liby2] genericfrontend.cc(main):782
Exiting with client return value '`next'
------------------------------------------------------------------------------


Kind Regards
Johannes Meixner
--
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups