3D View: correct menu for moving out of local-view

Also name more clearly
This commit is contained in:
Campbell Barton 2016-02-25 20:36:06 +11:00
parent 3f602fff3c
commit ba98b681e7
2 changed files with 10 additions and 2 deletions

View File

@ -1226,6 +1226,8 @@ class VIEW3D_MT_object(Menu):
def draw(self, context):
layout = self.layout
view = context.space_data
is_local_view = (view.local_view is not None)
layout.operator("ed.undo")
layout.operator("ed.redo")
@ -1277,7 +1279,13 @@ class VIEW3D_MT_object(Menu):
layout.separator()
layout.operator("object.move_to_layer", text="Move to Layer...")
if is_local_view:
layout.operator_context = 'EXEC_REGION_WIN'
layout.operator("object.move_to_layer", text="Move out of Local View")
layout.operator_context = 'INVOKE_REGION_WIN'
else:
layout.operator("object.move_to_layer", text="Move to Layer...")
layout.menu("VIEW3D_MT_object_showhide")
layout.operator_menu_enum("object.convert", "target")

View File

@ -1338,7 +1338,7 @@ static int move_to_layer_invoke(bContext *C, wmOperator *op, const wmEvent *even
{
View3D *v3d = CTX_wm_view3d(C);
if (v3d && v3d->localvd) {
return WM_operator_confirm_message(C, op, "Move from localview");
return WM_operator_confirm_message(C, op, "Move out of Local View");
}
else {
move_to_layer_init(C, op);