Author: jdsn Date: Thu Nov 8 19:16:26 2007 New Revision: 41894 URL: http://svn.opensuse.org/viewcvs/yast?rev=41894&view=rev Log: tabs work, basic dialogs Modified: branches/tmp/jdsn/edu-users/src/dialogs.ycp branches/tmp/jdsn/edu-users/src/wizards.ycp Modified: branches/tmp/jdsn/edu-users/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/src/dialogs.ycp?rev=41894&r1=41893&r2=41894&view=diff ============================================================================== --- branches/tmp/jdsn/edu-users/src/dialogs.ycp (original) +++ branches/tmp/jdsn/edu-users/src/dialogs.ycp Thu Nov 8 19:16:26 2007 @@ -34,6 +34,7 @@ import "Label"; import "Wizard"; import "EduUsers"; +import "Autologin"; include "edu-users/helps.ycp"; @@ -41,52 +42,65 @@ * Configure1 dialog * @return dialog result */ -any Configure1Dialog () { +any NewUserDialog() { //Configure1Dialog () { /* EduUsers configure1 dialog caption */ - string caption = _("EduUsers Configuration"); + string caption = _("Add New Edu User"); - /* EduUsers configure1 dialog contents */ - term contents = `Label (_("First part of configuration of edu-users")); + term fields = `VBox( + `VSquash( + `HBox( + // input field for login name + `Bottom(`TextEntry(`id(`username), _("&Username"), "bla")), + ("add_user" != "add_user") + ? `HSpacing (0) + // push button to generate login from first and last name + : `Bottom(`PushButton(`id(`propose), _("&Suggestion")))) + ), + `Password(`id(`pw1), Label::Password(), ""), + `Password(`id(`pw2), Label::ConfirmPassword(), "") + ); + + + term optionbox = `VBox( // checkbox label + `Left( `CheckBox (`id (`autologin),_("A&utomatic Login"), Autologin::used) ) + ); + + if (true) + { // checkbox label + optionbox = add(optionbox, `Left(`CheckBox (`id(`ena), _("D&isable User Login"), !true)) ); + } - Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"", - Label::BackButton(), Label::NextButton()); + optionbox = `HBox( + `HStretch(), + `HVCenter( `HVSquash( optionbox ) ), + `HStretch() + ); - any ret = nil; - while(true) { - ret = UI::UserInput(); - /* abort? */ - if(ret == `abort || ret == `cancel) { - if(ReallyAbort()) break; - else continue; - } - else if(ret == `next || ret == `back) { - break; - } - else { - y2error("unexpected retcode: %1", ret); - continue; - } - } - - return ret; -} - -/** - * Configure2 dialog - * @return dialog result - */ -any Configure2Dialog () { + /* EduUsers configure1 dialog contents */ + term contents = `VBox(`Label (_("First part of configuration of edu-users")), `PushButton(`id(`groups), "bla")); - /* EduUsers configure2 dialog caption */ - string caption = _("EduUsers Configuration"); + contents = `VBox ( + `VSpacing(), + `VBox ( + `VSpacing( 0.5 ), + `HBox ( + `HSpacing (2), + `VBox ( + `HSquash ( fields ), + `VSpacing( 0.5 ), + `VSquash ( `Top( optionbox ) ) + ), + `HSpacing( 2 ) + ), + `VSpacing (0.5) + ) + ); - /* EduUsers configure2 dialog contents */ - term contents = `Label (_("Second part of configuration of edu-users")); - Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"", + Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"", Label::BackButton(), Label::NextButton()); any ret = nil; @@ -111,9 +125,6 @@ return ret; } -any NewUserDialog() { - return `newuserdialog; -} any UsersDialog() { @@ -130,9 +141,18 @@ if(ReallyAbort()) break; else continue; } - else if(ret == `next || ret == `back || ret == `groups || ret == `templates) { + else if (ret == `next || ret == `back || ret == `groups || ret == `templates) { + break; + } + else if (ret == `users) { + continue; + } + else if (ret == `add || ret == `edit ) { break; } + else if (ret == `delete){ + continue; + } else { y2error("unexpected retcode: %1", ret); continue; @@ -163,6 +183,12 @@ else if(ret == `next || ret == `back || ret == `users || ret == `templates) { break; } + else if(ret == `groups) { + continue; + } + else if(ret == `add || ret == `edit || ret == `delete) { + continue; + } else { y2error("unexpected retcode: %1", ret); continue; @@ -174,7 +200,7 @@ any TemplatesDialog() { // fill table with data - Popup::Notify(_("Groups")); + Popup::Notify(_("Templates")); any ret = nil; while(true) { @@ -189,6 +215,12 @@ else if(ret == `next || ret == `back || ret == `users || ret == `groups) { break; } + else if(ret == `templates) { + continue; + } + else if(ret == `add || ret == `edit || ret == `delete) { + continue; + } else { y2error("unexpected retcode: %1", ret); continue; Modified: branches/tmp/jdsn/edu-users/src/wizards.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/edu-users/src/wizards.ycp?rev=41894&r1=41893&r2=41894&view=diff ============================================================================== --- branches/tmp/jdsn/edu-users/src/wizards.ycp (original) +++ branches/tmp/jdsn/edu-users/src/wizards.ycp Thu Nov 8 19:16:26 2007 @@ -44,15 +44,20 @@ any UserAddSequence() { map aliases = $[ - "newuserdialog" : ``(NewUserDialog()) + "newuserdialog" : ``(NewUserDialog()), + "settab" : [ ``( SetTabDialog() ), true], ]; map sequence = $[ - "ws_start" : "config1", + "ws_start" : "newuserdialog", "newuserdialog" : $[ `abort : `abort, - `next : `next + `next : "settab" ], + "settab" : $[ + `abort : `abort, + `next : `next + ] ]; return Sequencer::Run(aliases, sequence); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org