Author: aschnell
Date: Thu Aug 7 18:35:27 2008
New Revision: 49837
URL: http://svn.opensuse.org/viewcvs/yast?rev=49837&view=rev
Log:
- some MiniWorkflows need a commit before closing
Modified:
trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
trunk/storage/storage/src/include/ep-lvm-lib.ycp
Modified: trunk/storage/storage/src/include/ep-lvm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-dialogs.ycp?rev=49837&r1=49836&r2=49837&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-dialogs.ycp Thu Aug 7 18:35:27 2008
@@ -421,14 +421,16 @@
}
- boolean DlgResizeVolumeGroup(map &data)
+ boolean DlgResizeVolumeGroup(map &data, symbol() Commit)
{
map aliases = $[
- "TheOne" : ``(MiniWorkflowStepResizeVg(data))
+ "TheOne" : ``(MiniWorkflowStepResizeVg(data)),
+ "Commit" : ``(Commit())
];
map sequence = $[
- "TheOne" : $[ `finish : `finish ]
+ "TheOne" : $[ `finish : "Commit" ],
+ "Commit" : $[ `finish : `finish ]
];
string title = sformat(_("Resize Volume Group %1"), data["device"]:"error");
@@ -490,22 +492,24 @@
}
- boolean DlgCreateLogicalVolume(map &data)
+ boolean DlgCreateLogicalVolume(map &data, symbol() Commit)
{
map aliases = $[
"Name" : ``(MiniWorkflowStepLvName(data)),
"Size" : ``(MiniWorkflowStepLvSize(data)),
"FormatMount" : ``(MiniWorkflowStepFormatMount(data)),
- "Password" : ``(MiniWorkflowStepPassword(data))
+ "Password" : ``(MiniWorkflowStepPassword(data)),
+ "Commit" : ``(Commit())
];
map sequence = $[
"Name" : $[ `next : "Size" ],
"Size" : $[ `next : "FormatMount",
- `finish : `finish ],
+ `finish : "Commit" ],
"FormatMount" : $[ `next : "Password",
- `finish : `finish ],
- "Password" : $[ `finish : `finish ]
+ `finish : "Commit" ],
+ "Password" : $[ `finish : "Commit" ],
+ "Commit" : $[ `finish : `finish ]
];
string title = sformat(_("Add Logical Volume on %1"), "/dev/" + data["vg_name"]:"error");
@@ -542,7 +546,7 @@
void DlgResizeLogicalVolumeNew(map &data)
{
//the empty map is here because data on whole disk need to be passed
- //to resize dialog for partitions (to get available space etc.)
+ //to resize dialog for partitions (to get available space etc.)
//for LVMs we probably don't need it)
DlgResize(data, $[], `lv);
}
Modified: trunk/storage/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-lib.ycp?rev=49837&r1=49836&r2=49837&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-lvm-lib.ycp (original)
+++ trunk/storage/storage/src/include/ep-lvm-lib.ycp Thu Aug 7 18:35:27 2008
@@ -86,7 +86,8 @@
string vgname = data["name"]:"error";
- if (DlgResizeVolumeGroup(data))
+
+ symbol Commit()
{
Debug("resize vg from data", data);
@@ -104,11 +105,21 @@
if (!RemovePvs(vgname, devices_removed))
{
Error(_("Failed to remove some physical devices. TODO"));
- }
- UpdateNavigationTree(nil);
- TreePanel::Create();
+ // TODO: update data
+
+ return `back;
+ }
}
+
+ return `finish;
+ }
+
+
+ if (DlgResizeVolumeGroup(data, Commit))
+ {
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
}
}
@@ -174,15 +185,23 @@
data["pesize"] = target_map[device, "pesize"]:0;
data["max_size_k"] = (target_map[device, "pe_free"]:0 * target_map[device, "pesize"]:0) / 1024;
- if (DlgCreateLogicalVolume(data))
- {
- // ChangeVolumeProperties and thus addLogicalVolume need the device name
+
+ symbol Commit()
+ {
+ // ChangeVolumeProperties and thus addLogicalVolume need the device
data["device"] = device + "/" + data["name"]:"";
Debug("create lv from data", data);
- addLogicalVolume(data, substring(device, 5));
+ if (!addLogicalVolume(data, substring(device, 5)))
+ return `back;
+ return `finish;
+ }
+
+
+ if (DlgCreateLogicalVolume(data, Commit))
+ {
UpdateNavigationTree(nil);
TreePanel::Create();
UpdateTableFocus("/dev/" + data["vg_name"]:"error" + "/" + data["name"]:"error");
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org