Author: aschnell
Date: Mon Jul 21 11:29:44 2008
New Revision: 49266
URL: http://svn.opensuse.org/viewcvs/yast?rev=49266&view=rev
Log:
- started work on crypt files
Added:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-lib.ycp
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop.ycp
Added: branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-dialogs.ycp?rev=49266&view=auto
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-dialogs.ycp (added)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-dialogs.ycp Mon Jul 21 11:29:44 2008
@@ -0,0 +1,32 @@
+/**
+ * File: ep-loop-dialogs.ycp
+ * Package: yast2-storage
+ * Summary: Expert Partitioner
+ * Authors: Arvin Schnell
+ */
+{
+ textdomain "storage";
+
+
+ boolean DlgEditLoop(map &data)
+ {
+ string device = data["device"]:"error";
+
+ map aliases = $[
+ "FormatMount" : ``(MiniWorkflowStepFormatMount(data)),
+ "Password" : ``(MiniWorkflowStepPassword(data))
+ ];
+
+ map sequence = $[
+ "FormatMount" : $[ `next : "Password",
+ `finish : `finish ],
+ "Password" : $[ `finish : `finish ]
+ ];
+
+ string title = sformat(_("Edit Crypt File %1"), device);
+
+ symbol widget = MiniWorkflow::Run(title, dm_icon, aliases, sequence, "FormatMount");
+
+ return widget == `finish;
+ }
+}
Added: branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-lib.ycp?rev=49266&view=auto
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-lib.ycp (added)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop-lib.ycp Mon Jul 21 11:29:44 2008
@@ -0,0 +1,55 @@
+/**
+ * File: ep-loop-lib.ycp
+ * Package: yast2-storage
+ * Summary: Expert Partitioner
+ * Authors: Arvin Schnell
+ */
+{
+ textdomain "storage";
+
+
+ void EpCreateLoop()
+ {
+ }
+
+
+ void EpEditLoop(string device)
+ {
+ map target_map = Storage::GetTargetMap();
+ map data = Storage::GetPartition(target_map, device);
+
+ if (data["used_by"]:"" != "")
+ {
+ Error(sformat(_("The Crypt File %1 is in use. It cannot be
+edited. To edit %1, make sure it is not used."), device));
+ return;
+ }
+
+ if (DlgEditLoop(data))
+ {
+ Debug("edit loop from data", data);
+
+ Storage::ChangeVolumeProperties(data);
+
+ UpdateNavigationTree(nil);
+ TreePanel::Create();
+ UpdateTableFocus(device);
+ }
+ }
+
+
+ void EpDeleteLoop(string device)
+ {
+ if (device == nil)
+ {
+ Error(_("No Crypt File selected."));
+ return;
+ }
+
+ if (EpDeleteDevice(device))
+ {
+ UpdateNavigationTree(`loop);
+ TreePanel::Create();
+ }
+ }
+}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop.ycp?rev=49266&r1=49265&r2=49266&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-loop.ycp Mon Jul 21 11:29:44 2008
@@ -9,6 +9,10 @@
textdomain "storage";
+ include "partitioning/ep-loop-dialogs.ycp";
+ include "partitioning/ep-loop-lib.ycp";
+
+
void CreateLoopMainPanel(any user_data)
{
symbol Predicate(map disk, map partition)
@@ -47,6 +51,7 @@
switch (widget)
{
case `add:
+ EpCreateLoop();
break;
}
}
@@ -84,9 +89,11 @@
switch (widget)
{
case `edit:
+ EpEditLoop(part_device);
break;
case `delete:
+ EpDeleteLoop(part_device);
break;
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org