Author: kmachalkova Date: Wed Apr 22 13:42:26 2009 New Revision: 56907 URL: http://svn.opensuse.org/viewcvs/yast?rev=56907&view=rev Log: Function buttons for LVMs (pretty dumb so far) Modified: trunk/storage/storage/src/include/ep-lvm.ycp Modified: trunk/storage/storage/src/include/ep-lvm.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm.ycp?rev=56907&r1=56906&r2=56907&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-lvm.ycp (original) +++ trunk/storage/storage/src/include/ep-lvm.ycp Wed Apr 22 13:42:26 2009 @@ -19,7 +19,7 @@ `item(`id(`delete), _("Delete")) ]); switch (widget) - { + { case `add: EpCreateLogicalVolume(device); break; @@ -57,6 +57,17 @@ } } + term LvmButtonBox() + { + return `HBox( + // push button text + `PushButton(`id(`edit),`opt(`key_F4), _("Edit...")), + // push button text + `PushButton(`id(`resize), `opt(`key_F6), _("Resize...")), + // push button text + `PushButton(`id(`delete), `opt(`key_F5), _("Delete...")) + ); + } void CreateLvmMainPanel(any user_data) { @@ -73,6 +84,10 @@ term table_header = StorageFields::TableHeader(fields); list<term> table_contents = StorageFields::TableContents(fields, target_map, Predicate); + list <term> mb_items = [ `item(`id(`group), _("Volume Group")) ]; + + if ( !isempty(table_contents) ) + mb_items = add( mb_items, `item(`id(`volume), _("Logical Volume")) ); UI::ReplaceWidget(`tree_panel, Greasemonkey::Transform( @@ -83,7 +98,8 @@ table_header, table_contents), `HBox( // push button text - `PushButton(`id(`add), `opt(`key_F3), _("Add Volume Group...")), + `MenuButton(`id(`add), `opt(`key_F3), _("Add..."), mb_items), + LvmButtonBox(), `HStretch() ) ) @@ -130,16 +146,8 @@ UI::ReplaceWidget(`tab_panel, `VBox( - `HStretch(), - StorageFields::Overview(fields, target_map, device), - `HBox( - // push button text - `PushButton(`id(`resize), _("Resize...")), - // push button text - `PushButton(`id(`delete), _("Delete...")), - `HStretch() - ) - ) + StorageFields::Overview(fields, target_map, device) + ) ); // helptext @@ -194,12 +202,7 @@ `HBox( // push button text `PushButton(`id(`add), `opt(`key_F3), _("Add...")), - // push button text - `PushButton(`id(`edit), `opt(`key_F4), _("Edit...")), - // push button text - `PushButton(`id(`resize), `opt(`key_F6), _("Resize...")), - // push button text - `PushButton(`id(`delete), `opt(`key_F5), _("Delete...")), + LvmButtonBox(), `HStretch() ) ) @@ -334,12 +337,7 @@ `IconAndHeading(sformat(_("Logical Volume: %1"), device), StorageIcons::lvm_lv_icon), StorageFields::Overview(fields, target_map, device), `HBox( - // push button text - `PushButton(`id(`edit), _("Edit...")), - // push button text - `PushButton(`id(`resize), _("Resize...")), - // push button text - `PushButton(`id(`delete), _("Delete...")), + LvmButtonBox(), `HStretch() ) ) -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org