Author: kmachalkova Date: Thu Apr 23 17:56:34 2009 New Revision: 56948 URL: http://svn.opensuse.org/viewcvs/yast?rev=56948&view=rev Log: Context menu for loops Modified: trunk/storage/storage/src/include/ep-loop.ycp trunk/storage/storage/src/include/ep-main.ycp Modified: trunk/storage/storage/src/include/ep-loop.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-loop.ycp?rev=56948&r1=56947&r2=56948&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-loop.ycp (original) +++ trunk/storage/storage/src/include/ep-loop.ycp Thu Apr 23 17:56:34 2009 @@ -12,6 +12,23 @@ include "partitioning/ep-loop-dialogs.ycp"; include "partitioning/ep-loop-lib.ycp"; + void EpContextMenuLoop(string device) + { + symbol widget = ContextMenu::Simple([ `item(`id(`edit), _("Edit")), + `item(`id(`delete), _("Delete")) ]); + + switch (widget) + { + case `edit: + EpEditLoop(device); + break; + + case `delete: + EpDeleteLoop(device); + break; + } + } + term LoopButtonBox() { return `HBox( @@ -60,7 +77,7 @@ `HStretch(), // heading `IconAndHeading(_("Crypt Files"), StorageIcons::loop_icon), - `Table(`id(`table), `opt(`keepSorting, `notify), + `Table(`id(`table), `opt(`keepSorting, `notify, `notifyContextMenu), table_header, table_contents), `HBox( // push button text @@ -85,6 +102,13 @@ HandleLoopButtons(device, event); + switch (Event::IsWidgetContextMenuActivated(event)) + { + case `table: + EpContextMenuDevice(device); + break; + } + UI::SetFocus(`id(`table)); } Modified: trunk/storage/storage/src/include/ep-main.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-main.ycp?rev=56948&r1=56947&r2=56948&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-main.ycp (original) +++ trunk/storage/storage/src/include/ep-main.ycp Thu Apr 23 17:56:34 2009 @@ -260,6 +260,11 @@ EpContextMenuRaid(device); break; + case `CT_LOOP: + if (part != nil) + EpContextMenuLoop(device); + break; + case `CT_LVM: if (part == nil) EpContextMenuLvmVg(device); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org