UI: WM_OT_call_panel option to keep popovers open
authorCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jun 2018 07:24:24 +0000 (09:24 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 6 Jun 2018 07:24:51 +0000 (09:24 +0200)
source/blender/windowmanager/intern/wm_operators.c

index 01bf2d96b06eaa4105ed92064f252f50aec3a07b..97aad67eda28f967f608c5b968362eb19bc8515b 100644 (file)
@@ -2246,8 +2246,9 @@ static int wm_call_panel_exec(bContext *C, wmOperator *op)
        RNA_string_get(op->ptr, "name", idname);
        const int space_type = RNA_enum_get(op->ptr, "space_type");
        const int region_type = RNA_enum_get(op->ptr, "region_type");
+       const bool keep_open = RNA_enum_get(op->ptr, "region_type");
 
-       return UI_popover_panel_invoke(C, space_type, region_type, idname, true, op->reports);
+       return UI_popover_panel_invoke(C, space_type, region_type, idname, keep_open, op->reports);
 }
 
 static void WM_OT_call_panel(wmOperatorType *ot)
@@ -2261,9 +2262,16 @@ static void WM_OT_call_panel(wmOperatorType *ot)
 
        ot->flag = OPTYPE_INTERNAL;
 
-       RNA_def_string(ot->srna, "name", NULL, BKE_ST_MAXNAME, "Name", "Name of the menu");
-       RNA_def_enum(ot->srna, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", "");
-       RNA_def_enum(ot->srna, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
+       PropertyRNA *prop;
+
+       prop = RNA_def_string(ot->srna, "name", NULL, BKE_ST_MAXNAME, "Name", "Name of the menu");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_enum(ot->srna, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", "");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_enum(ot->srna, "region_type", rna_enum_region_type_items, RGN_TYPE_WINDOW, "Region Type", "");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_boolean(ot->srna, "keep_open", true, "Keep Open", "");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************ window / screen operator definitions ************** */