Author: aschnell Date: Wed Aug 26 11:49:19 2009 New Revision: 58436 URL: http://svn.opensuse.org/viewcvs/yast?rev=58436&view=rev Log: - work on context menus Modified: trunk/storage/storage/src/include/ep-dm.ycp trunk/storage/storage/src/include/ep-loop.ycp trunk/storage/storage/src/include/ep-lvm.ycp trunk/storage/storage/src/include/ep-main.ycp trunk/storage/storage/src/include/ep-unused.ycp Modified: trunk/storage/storage/src/include/ep-dm.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dm... ============================================================================== --- trunk/storage/storage/src/include/ep-dm.ycp (original) +++ trunk/storage/storage/src/include/ep-dm.ycp Wed Aug 26 11:49:19 2009 @@ -13,6 +13,19 @@ include "partitioning/ep-dm-lib.ycp"; + void EpContextMenuDm(string device) + { + symbol widget = ContextMenu::Simple([ `item(`id(`edit), _("Edit")) ]); + + switch (widget) + { + case `edit: + EpEditDmDevice(device); + break; + } + } + + void CreateDmMainPanel(any user_data) { symbol Predicate(map disk, map partition) @@ -35,7 +48,7 @@ `HStretch(), // heading `IconAndHeading(_("Device Mapper (DM)"), StorageIcons::dm_icon), - `Table(`id(`table), `opt(`keepSorting, `notify), + `Table(`id(`table), `opt(`keepSorting, `notify, `notifyContextMenu), table_header, table_contents) ) ) @@ -50,6 +63,21 @@ } + void HandleDmMainPanel(any user_data, map event) + { + string device = (string) UI::QueryWidget(`id(`table), `CurrentItem); + + switch (Event::IsWidgetContextMenuActivated(event)) + { + case `table: + EpContextMenuDevice(device); + break; + } + + UI::SetFocus(`id(`table)); + } + + void CreateDmOverviewTab(any user_data) { string dm_device = (string) user_data; Modified: trunk/storage/storage/src/include/ep-loop.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lo... ============================================================================== --- trunk/storage/storage/src/include/ep-loop.ycp (original) +++ trunk/storage/storage/src/include/ep-loop.ycp Wed Aug 26 11:49:19 2009 @@ -30,6 +30,7 @@ } } + term LoopButtonBox() { return `HBox( @@ -40,6 +41,7 @@ ); } + void HandleLoopButtons( string part_device, map event ) { switch (Event::IsWidgetActivated(event)) @@ -58,6 +60,7 @@ } } + void CreateLoopMainPanel(any user_data) { symbol Predicate(map disk, map partition) Modified: trunk/storage/storage/src/include/ep-lvm.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lv... ============================================================================== --- trunk/storage/storage/src/include/ep-lvm.ycp (original) +++ trunk/storage/storage/src/include/ep-lvm.ycp Wed Aug 26 11:49:19 2009 @@ -58,6 +58,7 @@ } } + term LvmButtonBox() { return `HBox( @@ -179,7 +180,6 @@ HandleLvmButtons( user_data, device, event ); - switch (Event::IsWidgetContextMenuActivated(event)) { case `table: Modified: trunk/storage/storage/src/include/ep-main.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-ma... ============================================================================== --- trunk/storage/storage/src/include/ep-main.ycp (original) +++ trunk/storage/storage/src/include/ep-main.ycp Wed Aug 26 11:49:19 2009 @@ -98,7 +98,7 @@ `lvm : $[ `create : CreateLvmMainPanel, `handle : HandleLvmMainPanel ], `md : $[ `create : CreateRaidMainPanel, `handle : HandleRaidMainPanel ], `loop : $[ `create : CreateLoopMainPanel, `handle : HandleLoopMainPanel ], - `dm : $[ `create : CreateDmMainPanel ], + `dm : $[ `create : CreateDmMainPanel, `handle : HandleDmMainPanel ], `nfs : $[ `create : CreateNfsMainPanel, `handle : HandleNfsMainPanel ], `unused : $[ `create : CreateUnusedPanel, `handle : HandleUnusedPanel ], `graph : $[ `create : CreateGraphPanel, `refresh : RefreshGraphPanel, `handle : HandleGraphPanel ], @@ -273,6 +273,11 @@ else EpContextMenuLvmLv(device); break; + + case `CT_DM: + if (part != nil) + EpContextMenuDm(device); + break; } } Modified: trunk/storage/storage/src/include/ep-unused.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-un... ============================================================================== --- trunk/storage/storage/src/include/ep-unused.ycp (original) +++ trunk/storage/storage/src/include/ep-unused.ycp Wed Aug 26 11:49:19 2009 @@ -54,7 +54,7 @@ `VBox( // heading `IconAndHeading(_("Unused Devices"), StorageIcons::unused_icon), - `Table(`id(`table), `opt(`keepSorting, `notify), + `Table(`id(`table), `opt(`keepSorting, `notify, `notifyContextMenu), table_header, table_contents), `HBox( // push button text @@ -75,6 +75,15 @@ void HandleUnusedPanel(any user_data, map event) { + string device = (string) UI::QueryWidget(`id(`table), `CurrentItem); + + switch (Event::IsWidgetContextMenuActivated(event)) + { + case `table: + EpContextMenuDevice(device); + break; + } + switch (Event::IsWidgetActivated(event)) { case `rescan: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org