Author: aschnell
Date: Tue Jun 24 14:54:56 2008
New Revision: 48504
URL: http://svn.opensuse.org/viewcvs/yast?rev=48504&view=rev
Log:
- work on editing of partitions, lvm and raid
Added:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-dialogs.ycp Tue Jun 24 14:54:56 2008
@@ -201,6 +201,13 @@
symbol flavour = data["flavour"]:`none;
+
+ boolean do_format = data["format"]:true;
+ boolean crypt_fs = false; // TODO
+ string mount = data["mount"]:"";
+ boolean do_mount = mount != "";
+
+
if (!haskey(data, "format"))
{
string mount_point_proposal = GetMountPointProposal(Storage::GetTargetMap(), []);
@@ -209,9 +216,11 @@
if (mount_point_proposal == Partitions::BootMount())
used_fs = Partitions::DefaultBootFs();
- data["format"] = true;
+ // TODO
+ do_format = true;
data["fsid"] = Partitions::fsid_native;
- data["mount"] = mount_point_proposal;
+ mount = mount_point_proposal;
+ do_mount = mount != "";
data["used_fs"] = used_fs;
data["fs_options"] = FileSystems::DefaultFormatOptions(data);
}
@@ -224,10 +233,6 @@
if (mountpoints == nil)
mountpoints = [ "/", "/usr", Partitions::BootMount(), "/var", "/home", "/opt" ];
- if (!contains(mountpoints, "") && data["enc_type"]:`none==`none)
- mountpoints = add(mountpoints, "");
-
- string mount = data["mount"]:"";
if (!contains(mountpoints, mount))
mountpoints = union([mount], mountpoints);
@@ -273,6 +278,13 @@
MiniWorkflow::SetLastStep(true);
+ UI::ChangeWidget(`id(`format), `Value, do_format ? `do_format : `do_not_format);
+ UI::ChangeWidget(`id(`do_format_attachment), `Enabled, do_format);
+ UI::ChangeWidget(`id(`do_not_format_attachment), `Enabled, !do_format);
+ UI::ChangeWidget(`id(`mount), `Value, do_mount ? `do_mount : `do_not_mount);
+ UI::ChangeWidget(`id(`do_mount_attachment), `Enabled, do_mount);
+ UI::ChangeWidget(`id(`mount_point), `Value, mount);
+
symbol widget = nil;
repeat
@@ -281,6 +293,11 @@
switch (widget)
{
+ case `fs:
+ symbol new_fs = (symbol) UI::QueryWidget(`id(`fs), `Value);
+ // TODO
+ break;
+
case `crypt_fs:
MiniWorkflow::SetLastStep(UI::QueryWidget(`id(`crypt_fs), `Value) != true);
break;
@@ -316,6 +333,10 @@
break;
case `next:
+ do_format = (boolean) UI::QueryWidget(`id(`do_format), `Value);
+ crypt_fs = (boolean) UI::QueryWidget(`id(`crypt_fs), `Value);
+ do_mount = (boolean) UI::QueryWidget(`id(`do_mount), `Value);
+ mount = (string) UI::QueryWidget(`id(`mount_point), `Value);
// TODO: checks
break;
}
@@ -324,20 +345,15 @@
if (widget == `next)
{
- boolean crypt_fs = (boolean) UI::QueryWidget(`id(`crypt_fs), `Value);
-
if (crypt_fs)
data["enc_type"] = data["format"]:false ? `luks : `twofish;
else
data["enc_type"] = `none;
- if (UI::QueryWidget(`id(`do_mount), `Value) == true)
- data["mount"] = (string) UI::QueryWidget(`id(`mount_point), `Value);
- else
- data["mount"] = "";
+ data["format"] = do_format;
+ data["mount"] = do_mount ? mount : "";
- if (UI::QueryWidget(`id(`do_format), `Value) != true ||
- UI::QueryWidget(`id(`crypt_fs), `Value) != true)
+ if (!do_format || !crypt_fs)
widget = `finish;
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-dialogs.ycp Tue Jun 24 14:54:56 2008
@@ -126,10 +126,14 @@
{
map data = $[];
+ map target_map = Storage::GetTargetMap();
+ data = Storage::GetPartition(target_map, device);
+ data["format"] = false;
+
map aliases = $[
"FormatMount" : ``(MiniWorkflowStepFormatMount(data)),
"Password" : ``(MiniWorkflowStepPassword(data))
- ];
+ ];
map sequence = $[
"FormatMount" : $[ `next : "Password",
@@ -137,14 +141,16 @@
"Password" : $[ `finish : `finish ]
];
- symbol widget = MiniWorkflow::Run(_("Edit Partition"), hd_part_icon, aliases, sequence, "FormatMount");
+ string title = sformat(_("Edit Partition %1"), device);
+
+ symbol widget = MiniWorkflow::Run(title, hd_part_icon, aliases, sequence, "FormatMount");
- return false;
+ return widget == `finish;
}
void DlgResizePartition(string device)
{
- DlgResize(`lv);
+ DlgResize(`part);
}
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp Tue Jun 24 14:54:56 2008
@@ -1,9 +1,8 @@
/**
- * File: ep-lib-hd.ycp
+ * File: ep-hd-lib.ycp
* Package: yast2-storage
* Summary: Expert Partitioner
* Authors: Arvin Schnell
- *
*/
{
textdomain "storage";
@@ -82,10 +81,12 @@
}
- boolean EpEditPartition(string device)
+ void EpEditPartition(string device)
{
- DlgEditPartition(device);
-
- return false;
+ if (DlgEditPartition(device))
+ {
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ }
}
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp Tue Jun 24 14:54:56 2008
@@ -197,18 +197,16 @@
"TheOne" : $[ `finish : `finish ]
];
- symbol widget = MiniWorkflow::Run(_("Resize Volume Group"), lvm_icon, aliases, sequence, "TheOne");
+ string title = sformat(_("Resize Volume Group %1"), vgname);
+
+ symbol widget = MiniWorkflow::Run(title, lvm_icon, aliases, sequence, "TheOne");
if (widget == `finish)
{
- if (true) // TODO
- {
- UpdateNavigationTree(nil);
- TreePanel::Create();
- }
+ // TODO
}
- return false;
+ return widget == `finish;
}
@@ -292,6 +290,10 @@
{
map data = $[ "flavour" : `lv ];
+ map target_map = Storage::GetTargetMap();
+ data = Storage::GetPartition(target_map, device);
+ data["format"] = false;
+
map aliases = $[
"FormatMount" : ``(MiniWorkflowStepFormatMount(data)),
"Password" : ``(MiniWorkflowStepPassword(data))
@@ -303,9 +305,11 @@
"Password" : $[ `finish : `finish ]
];
- symbol widget = MiniWorkflow::Run(_("Edit Logical Volume"), lvm_lv_icon, aliases, sequence, "FormatMount");
+ string title = sformat(_("Edit Logical Volume %1"), device);
- return false;
+ symbol widget = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "FormatMount");
+
+ return widget == `finish;
}
Added: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp?rev=48504&view=auto
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp (added)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp Tue Jun 24 14:54:56 2008
@@ -0,0 +1,29 @@
+/**
+ * File: ep-lvm-lib.ycp
+ * Package: yast2-storage
+ * Summary: Expert Partitioner
+ * Authors: Arvin Schnell
+ */
+{
+ textdomain "storage";
+
+
+ void EpResizeVolumeGroup(string device)
+ {
+ if (DlgResizeVolumeGroup(device))
+ {
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ }
+ }
+
+
+ void EpEditLogicalVolume(string device)
+ {
+ if (DlgEditLogicalVolume(device))
+ {
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ }
+ }
+}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm.ycp Tue Jun 24 14:54:56 2008
@@ -9,6 +9,7 @@
include "partitioning/ep-lvm-dialogs.ycp";
+ include "partitioning/ep-lvm-lib.ycp";
void CreateLvmMainPanel(any user_data)
@@ -151,7 +152,7 @@
break;
case `edit:
- DlgEditLogicalVolume(lv_device);
+ EpEditLogicalVolume(lv_device);
break;
case `resize:
@@ -258,7 +259,7 @@
switch (widget)
{
case `edit:
- DlgEditLogicalVolume(device);
+ EpEditLogicalVolume(device);
break;
case `resize:
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp Tue Jun 24 14:54:56 2008
@@ -259,7 +259,9 @@
"TheOne" : $[ `finish : `finish ]
];
- symbol widget = MiniWorkflow::Run(_("Resize RAID"), raid_icon, aliases, sequence, "TheOne");
+ string title = sformat(_("Resize RAID %1"), device);
+
+ symbol widget = MiniWorkflow::Run(title, raid_icon, aliases, sequence, "TheOne");
if (widget == `finish)
{
@@ -270,6 +272,33 @@
}
}
- return false;
+ return widget == `finish;
+ }
+
+
+ boolean DlgEditRaid(string device)
+ {
+ map data = $[ "flavour" : `raid ];
+
+ map target_map = Storage::GetTargetMap();
+ data = Storage::GetPartition(target_map, device);
+ data["format"] = false;
+
+ map aliases = $[
+ "FormatMount" : ``(MiniWorkflowStepFormatMount(data)),
+ "Password" : ``(MiniWorkflowStepPassword(data))
+ ];
+
+ map sequence = $[
+ "FormatMount" : $[ `next : "Password",
+ `finish : `finish ],
+ "Password" : $[ `finish : `finish ]
+ ];
+
+ string title = sformat(_("Edit RAID %1"), device);
+
+ symbol widget = MiniWorkflow::Run(title, raid_icon, aliases, sequence, "FormatMount");
+
+ return widget == `finish;
}
}
Added: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp?rev=48504&view=auto
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp (added)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp Tue Jun 24 14:54:56 2008
@@ -0,0 +1,19 @@
+/**
+ * File: ep-raid-lib.ycp
+ * Package: yast2-storage
+ * Summary: Expert Partitioner
+ * Authors: Arvin Schnell
+ */
+{
+ textdomain "storage";
+
+
+ void EpEditRaid(string device)
+ {
+ if (DlgEditRaid(device))
+ {
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ }
+ }
+}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp?rev=48504&r1=48503&r2=48504&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp Tue Jun 24 14:54:56 2008
@@ -9,6 +9,7 @@
include "partitioning/ep-raid-dialogs.ycp";
+ include "partitioning/ep-raid-lib.ycp";
void CreateRaidMainPanel(any user_data)
@@ -93,6 +94,7 @@
switch (widget)
{
case `edit:
+ EpEditRaid(part_device);
break;
case `resize:
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org