Author: kmachalkova Date: Wed May 6 11:41:02 2009 New Revision: 57076 URL: http://svn.opensuse.org/viewcvs/yast?rev=57076&view=rev Log: The same in bright pink (context-dependent HandleLvmButtons) 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=57076&r1=57075&r2=57076&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-lvm.ycp (original) +++ trunk/storage/storage/src/include/ep-lvm.ycp Wed May 6 11:41:02 2009 @@ -69,12 +69,22 @@ ); } - void HandleLvmButtons( string device, map event ) + void HandleLvmButtons( any user_data, string device, map event ) { - map dev = Storage::GetDiskPartition( device ); - string vg = (string) dev["disk"]:nil; - // FIXME: is this necessary & sufficient condition? - boolean is_vg = (dev["nr"]:"" == ""); + string vg = ""; + boolean is_vg = false; + + if (user_data == nil) + { + map dev = Storage::GetDiskPartition( device ); + vg = (string) dev["disk"]:nil; + // FIXME: is this necessary & sufficient condition? + is_vg = (dev["nr"]:"" == ""); + } + else + { + vg = (string) user_data; + } switch (Event::IsWidgetActivated(event)) { @@ -166,7 +176,7 @@ { string device = (string) UI::QueryWidget(`id(`table), `CurrentItem); - HandleLvmButtons( device, event ); + HandleLvmButtons( user_data, device, event ); switch (Event::IsWidgetContextMenuActivated(event)) @@ -207,7 +217,7 @@ { string device = (string) user_data; - HandleLvmButtons( device, event ); + HandleLvmButtons( nil, device, event ); UI::SetFocus(`id(`text)); } @@ -256,7 +266,7 @@ string vg_device = (string) user_data; string lv_device = (string) UI::QueryWidget(`id(`table), `CurrentItem); - HandleLvmButtons( lv_device, event ); + HandleLvmButtons( vg_device, lv_device, event ); switch (Event::IsWidgetContextMenuActivated(event)) { @@ -374,7 +384,7 @@ { string device = (string) user_data; - HandleLvmButtons( device, event ); + HandleLvmButtons( nil, device, event ); UI::SetFocus (`id(`text)); } } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org