Author: aschnell
Date: Fri Jul 11 22:48:01 2008
New Revision: 49012
URL: http://svn.opensuse.org/viewcvs/yast?rev=49012&view=rev
Log:
- work on table focus
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp
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=49012&r1=49011&r2=49012&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 Fri Jul 11 22:48:01 2008
@@ -129,10 +129,11 @@
if (DlgCreatePartition(data))
{
Debug("create partition with data", data);
- y2milestone("create partition with %1", data);
- symbol mby = data["mountby"]:Storage::GetMountBy(data["device"]:"");
- Storage::CreatePartition(data["disk_device"]:"", data["device"]:"",
+ string device = data["device"]:"error";
+
+ symbol mby = data["mountby"]:Storage::GetMountBy(device);
+ Storage::CreatePartition(data["disk_device"]:"", device,
data["type"]:`primary,
data["fsid"]:Partitions::fsid_native,
data["region",0]:0, data["region",1]:0, mby);
@@ -140,6 +141,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus(device);
}
}
}
@@ -169,6 +171,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus(device);
}
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp?rev=49012&r1=49011&r2=49012&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-hd.ycp Fri Jul 11 22:48:01 2008
@@ -132,7 +132,8 @@
WFM::call(call);
RescanDisks();
Storage::CreateTargetBackup("expert-partitioner");
- UpdateNavigationTree(`hd);
+ 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=49012&r1=49011&r2=49012&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 Fri Jul 11 22:48:01 2008
@@ -309,17 +309,8 @@
}
- boolean DlgCreateLogicalVolume(string device)
+ boolean DlgCreateLogicalVolume(map &data)
{
- map target_map = Storage::GetTargetMap();
-
- map data = $[ "new" : true,
- "create" : true ];
-
- data["flavour"] = `lv;
- data["vg_name"] = substring(device, 5);
- data["max_size"] = target_map[device, "pe_free"]:0 * target_map[device, "pesize"]:0;
-
map aliases = $[
"Name" : ``(MiniWorkflowStepLvName(data)),
"Size" : ``(MiniWorkflowStepLvSize(data)),
@@ -336,18 +327,11 @@
"Password" : $[ `finish : `finish ]
];
- string title = sformat(_("Add Logical Volume on %1"), device);
-
- symbol ret = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "Name");
+ string title = sformat(_("Add Logical Volume on %1"), "/dev/" + data["vg_name"]:"error");
- if (ret == `finish)
- {
- addLogicalVolume(data, substring(device, 5));
- UpdateNavigationTree(nil);
- TreePanel::Create();
- }
+ symbol widget = MiniWorkflow::Run(title, lvm_lv_icon, aliases, sequence, "Name");
- return false;
+ return widget == `finish;
}
Modified: 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=49012&r1=49011&r2=49012&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-lvm-lib.ycp Fri Jul 11 22:48:01 2008
@@ -62,6 +62,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus("/dev/" + vg_name);
}
}
}
@@ -151,10 +152,24 @@
return;
}
- if (DlgCreateLogicalVolume(device))
+ map target_map = Storage::GetTargetMap();
+
+ map data = $[ "new" : true,
+ "create" : true ];
+
+ data["flavour"] = `lv;
+ data["vg_name"] = substring(device, 5);
+ data["max_size"] = target_map[device, "pe_free"]:0 * target_map[device, "pesize"]:0;
+
+ if (DlgCreateLogicalVolume(data))
{
+ Debug("create lv from data", data);
+
+ addLogicalVolume(data, substring(device, 5));
+
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus("/dev/" + data["vg_name"]:"error" + "/" + data["name"]:"error");
}
}
@@ -176,6 +191,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus(device);
}
}
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp?rev=49012&r1=49011&r2=49012&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-main.ycp Fri Jul 11 22:48:01 2008
@@ -43,6 +43,13 @@
void UpdateNavigationTree(any new_focus);
+ void UpdateTableFocus(string device)
+ {
+ if (UI::WidgetExists(`id(`table)))
+ UI::ChangeWidget(`id(`table), `CurrentItem, device);
+ }
+
+
include "partitioning/icons.ycp";
include "partitioning/ep-lib.ycp";
@@ -244,44 +251,44 @@
TreePanel::Handle(widget);
- if (widget == `back || widget == `abort)
+ switch (widget)
{
- if (!Storage::EqualBackupStates("expert-partitioner", "", true))
- {
- // popup text %1 will be replaces with button text
- string txt = sformat(_("You have changed the partitioning.
+ case `back:
+ case `abort:
+ if (!Storage::EqualBackupStates("expert-partitioner", "", true))
+ {
+ // popup text %1 will be replaces with button text
+ string txt = sformat(_("You have changed the partitioning.
These changes are lost if you exit the main dialog with %1.
Really quit the main dialog?
-"),
- deletechars(back_label, "&")); // TODO
+"), deletechars(back_label, "&")); // TODO
- if (!Popup::YesNo(txt))
- {
- widget = nil;
- continue;
+ if (!Popup::YesNo(txt))
+ {
+ widget = `again;
+ }
}
- }
- }
- else if (widget == `next)
- {
- if (Mode::normal())
- {
- if (DoApply() == `back)
+ break;
+
+ case `next:
+ if (Mode::normal())
{
- // DoApply (inst_prepdisk) replaces the wizard contents
- // TODO: make nicer
- Wizard::SetContentsButtons(_("Expert Partitioner"), contents, "", back_label, next_label);
- UpdateNavigationTree(nil);
- widget = nil;
- continue;
+ if (DoApply() == `back)
+ {
+ // DoApply (inst_prepdisk) replaces the wizard contents
+ // TODO: make nicer
+ Wizard::SetContentsButtons(_("Expert Partitioner"), contents, "", back_label, next_label);
+ UpdateNavigationTree(nil);
+ widget = `again;
+ }
}
- }
- }
- else if (widget == `table)
- {
- any citem = UI::QueryWidget(`id(`table), `CurrentItem);
- TreePanel::SwitchToNew( citem );
- UI::SetFocus(`tree);
+ break;
+
+ case `table:
+ any citem = UI::QueryWidget(`id(`table), `CurrentItem);
+ TreePanel::SwitchToNew(citem);
+ UI::SetFocus(`tree);
+ break;
}
}
until (widget == `back || widget == `abort || widget == `next);
Modified: 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=49012&r1=49011&r2=49012&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-lib.ycp Fri Jul 11 22:48:01 2008
@@ -77,6 +77,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus(data["device"]:"error");
}
}
}
@@ -106,6 +107,7 @@
UpdateNavigationTree(nil);
TreePanel::Create();
+ UpdateTableFocus(device);
}
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org