Skip to content

Commit

Permalink
- Simplify config module skeleton
Browse files Browse the repository at this point in the history
- Remove dependency on Wizard_hw


svn path=/trunk/devtools/; revision=65771
  • Loading branch information
Stanislav Višňovský committed Sep 19, 2011
1 parent 386b58e commit 1b0d55e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 77 deletions.
66 changes: 3 additions & 63 deletions devtools/skeletons/config/src/complex.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ textdomain "XXpkgXX";
import "Label";
import "Popup";
import "Wizard";
import "Wizard_hw";
import "UIHelper";
import "Confirm";
import "XXPkgXX";

Expand Down Expand Up @@ -80,66 +80,6 @@ symbol WriteDialog() {
return ret ? `next : `abort;
}

/**
* Summary dialog
* @return dialog result
*/
any SummaryDialog() {

/* XXPkgXX summary dialog caption */
string caption = _("XXPkgXX Configuration");

/* FIXME */
list summary = XXPkgXX::Summary();
list unconfigured = summary[1]:[];
string configured = summary[0]:"";

/* Frame label */
term contents = Wizard_hw::DetectedContent(_("XXPkgXX to Configure"),
unconfigured, false, configured);

Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"",
Label::BackButton(), Label::FinishButton());

any ret = nil;
while(true) {

ret = UI::UserInput();

/* abort? */
if(ret == `abort || ret == `cancel || ret == `back) {
if(ReallyAbort()) break;
else continue;
}
/* overview dialog */
else if(ret == `edit_button) {
ret = `overview;
break;
}
/* configure the selected device */
else if(ret == `configure_button) {
// TODO FIXME: check for change of the configuration
any selected = UI::QueryWidget(`id(`detected_selbox), `CurrentItem);
if(selected == `other) {
ret = `other;
}
else {
ret = `configure;
}
break;
}
else if(ret == `next) {
break;
}
else {
y2error("unexpected retcode: %1", ret);
continue;
}
}

return ret;
}

/**
* Overview dialog
* @return dialog result
Expand All @@ -152,12 +92,12 @@ any OverviewDialog() {
list overview = XXPkgXX::Overview();

/* FIXME table header */
term contents = Wizard_hw::ConfiguredContent(
term contents = UIHelper::EditTable(
/* Table header */
`header(_("Number"), _("XXPkgXX")),
overview, nil, nil, nil, nil );

contents = Wizard_hw::SpacingAround(contents, 1.5, 1.5, 1.0, 1.0);
contents = UIHelper::SpacingAround(contents, 1.5, 1.5, 1.0, 1.0);

Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"",
Label::BackButton(), Label::FinishButton());
Expand Down
15 changes: 1 addition & 14 deletions devtools/skeletons/config/src/wizards.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -73,33 +73,20 @@ any MainSequence() {

/* FIXME: adapt to your needs */
map aliases = $[
"summary" : ``( SummaryDialog() ),
"overview" : ``( OverviewDialog() ),
"configure" : [ ``( AddSequence() ), true ],
"add" : [ ``( AddSequence() ), true ],
"edit" : [ ``( AddSequence() ), true ]
];

/* FIXME: adapt to your needs */
map sequence = $[
"ws_start" : "summary",
"summary" : $[
`abort : `abort,
`next : `next,
`overview : "overview",
`configure : "configure",
`other : "configure",
],
"ws_start" : "overview",
"overview" : $[
`abort : `abort,
`next : `next,
`add : "add",
`edit : "edit",
],
"configure" : $[
`abort : `abort,
`next : "summary",
],
"add" : $[
`abort : `abort,
`next : "overview",
Expand Down
6 changes: 6 additions & 0 deletions package/yast2-devtools.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Sep 19 09:28:33 CEST 2011 - visnov@suse.cz

- Simplify config module skeleton
- Remove dependency on Wizard_hw

-------------------------------------------------------------------
Wed Aug 24 14:53:48 CEST 2011 - ke@suse.de

Expand Down

0 comments on commit 1b0d55e

Please sign in to comment.