Fix T41041: 'Delete keyframe' removes markers too

Operators that trigger UI events (but nothing else)
were using 'CANCELLED' making it impossible to tell if an invoke
function failed, or opened a menu.
This commit is contained in:
2014-10-28 17:51:06 +01:00
parent ba76f0c6a2
commit 2f0bdcb306
25 changed files with 72 additions and 58 deletions

View File

@@ -503,8 +503,9 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, const wm
/* return status modifications - for now, make this spacetype dependent as above */ /* return status modifications - for now, make this spacetype dependent as above */
if (sa->spacetype != SPACE_TIME) { if (sa->spacetype != SPACE_TIME) {
/* unless successful, must add "pass-through" to let normal operator's have a chance at tackling this event */ /* unless successful, must add "pass-through" to let normal operator's have a chance at tackling this event */
if (retval != OPERATOR_FINISHED) if ((retval & (OPERATOR_FINISHED | OPERATOR_INTERFACE)) == 0) {
retval |= OPERATOR_PASS_THROUGH; retval |= OPERATOR_PASS_THROUGH;
}
} }
return retval; return retval;

View File

@@ -1407,7 +1407,7 @@ static int insert_key_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UN
uiItemsEnumO(layout, "ANIM_OT_keyframe_insert_menu", "type"); uiItemsEnumO(layout, "ANIM_OT_keyframe_insert_menu", "type");
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
else { else {
/* just call the exec() on the active keyingset */ /* just call the exec() on the active keyingset */

View File

@@ -477,7 +477,7 @@ static int keyingset_active_menu_invoke(bContext *C, wmOperator *op, const wmEve
uiItemsEnumO(layout, "ANIM_OT_keying_set_active_set", "type"); uiItemsEnumO(layout, "ANIM_OT_keying_set_active_set", "type");
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static int keyingset_active_menu_exec(bContext *C, wmOperator *op) static int keyingset_active_menu_exec(bContext *C, wmOperator *op)

View File

@@ -693,7 +693,7 @@ static int armature_parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void ARMATURE_OT_parent_set(wmOperatorType *ot) void ARMATURE_OT_parent_set(wmOperatorType *ot)

View File

@@ -162,7 +162,7 @@ static int pose_groups_menu_invoke(bContext *C, wmOperator *op, const wmEvent *U
/* finish building the menu, and process it (should result in calling self again) */ /* finish building the menu, and process it (should result in calling self again) */
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
else { else {
/* just use the active group index, and call the exec callback for the calling operator */ /* just use the active group index, and call the exec callback for the calling operator */

View File

@@ -423,7 +423,7 @@ static int poselib_add_menu_invoke(bContext *C, wmOperator *op, const wmEvent *U
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
/* this operator is only for a menu, not used further */ /* this operator is only for a menu, not used further */
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }

View File

@@ -5386,7 +5386,7 @@ static int toggle_cyclic_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS
layout = uiPupMenuLayout(pup); layout = uiPupMenuLayout(pup);
uiItemsEnumO(layout, op->type->idname, "direction"); uiItemsEnumO(layout, op->type->idname, "direction");
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
} }
} }

View File

@@ -359,15 +359,15 @@ void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head);
struct uiLayout *uiPupMenuLayout(uiPopupMenu *head); struct uiLayout *uiPupMenuLayout(uiPopupMenu *head);
void uiPupMenuReports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL(); void uiPupMenuReports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL();
bool uiPupMenuInvoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2); int uiPupMenuInvoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2);
/* Pie menus */ /* Pie menus */
typedef struct uiPieMenu uiPieMenu; typedef struct uiPieMenu uiPieMenu;
void uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event); int uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event);
void uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname, int uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname,
const char *propname, const struct wmEvent *event); const char *propname, const struct wmEvent *event);
void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path, const struct wmEvent *event); int uiPieEnumInvoke(struct bContext *C, const char *title, const char *path, const struct wmEvent *event);
struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL(); struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL();
void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie); void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie);

View File

@@ -2794,7 +2794,7 @@ uiLayout *uiPieMenuLayout(uiPieMenu *pie)
return pie->layout; return pie->layout;
} }
void uiPieMenuInvoke(struct bContext *C, const char *idname, const wmEvent *event) int uiPieMenuInvoke(struct bContext *C, const char *idname, const wmEvent *event)
{ {
uiPieMenu *pie; uiPieMenu *pie;
uiLayout *layout; uiLayout *layout;
@@ -2803,11 +2803,11 @@ void uiPieMenuInvoke(struct bContext *C, const char *idname, const wmEvent *even
if (mt == NULL) { if (mt == NULL) {
printf("%s: named menu \"%s\" not found\n", __func__, idname); printf("%s: named menu \"%s\" not found\n", __func__, idname);
return; return OPERATOR_CANCELLED;
} }
if (mt->poll && mt->poll(C, mt) == 0) if (mt->poll && mt->poll(C, mt) == 0)
return; return OPERATOR_CANCELLED;
pie = uiPieMenuBegin(C, IFACE_(mt->label), ICON_NONE, event); pie = uiPieMenuBegin(C, IFACE_(mt->label), ICON_NONE, event);
layout = uiPieMenuLayout(pie); layout = uiPieMenuLayout(pie);
@@ -2822,10 +2822,12 @@ void uiPieMenuInvoke(struct bContext *C, const char *idname, const wmEvent *even
mt->draw(C, &menu); mt->draw(C, &menu);
uiPieMenuEnd(C, pie); uiPieMenuEnd(C, pie);
return OPERATOR_INTERFACE;
} }
void uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname, int uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *opname,
const char *propname, const wmEvent *event) const char *propname, const wmEvent *event)
{ {
uiPieMenu *pie; uiPieMenu *pie;
uiLayout *layout; uiLayout *layout;
@@ -2837,10 +2839,12 @@ void uiPieOperatorEnumInvoke(struct bContext *C, const char *title, const char *
uiItemsEnumO(layout, opname, propname); uiItemsEnumO(layout, opname, propname);
uiPieMenuEnd(C, pie); uiPieMenuEnd(C, pie);
return OPERATOR_INTERFACE;
} }
void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path, int uiPieEnumInvoke(struct bContext *C, const char *title, const char *path,
const wmEvent *event) const wmEvent *event)
{ {
PointerRNA ctx_ptr; PointerRNA ctx_ptr;
PointerRNA r_ptr; PointerRNA r_ptr;
@@ -2851,13 +2855,13 @@ void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path,
RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr); RNA_pointer_create(NULL, &RNA_Context, C, &ctx_ptr);
if (!RNA_path_resolve(&ctx_ptr, path, &r_ptr, &r_prop)) { if (!RNA_path_resolve(&ctx_ptr, path, &r_ptr, &r_prop)) {
return; return OPERATOR_CANCELLED;
} }
/* invalid property, only accept enums */ /* invalid property, only accept enums */
if (RNA_property_type(r_prop) != PROP_ENUM) { if (RNA_property_type(r_prop) != PROP_ENUM) {
BLI_assert(0); BLI_assert(0);
return; return OPERATOR_CANCELLED;
} }
pie = uiPieMenuBegin(C, IFACE_(title), ICON_NONE, event); pie = uiPieMenuBegin(C, IFACE_(title), ICON_NONE, event);
@@ -2868,6 +2872,8 @@ void uiPieEnumInvoke(struct bContext *C, const char *title, const char *path,
uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, NULL, 0); uiItemFullR(layout, &r_ptr, r_prop, RNA_NO_INDEX, 0, UI_ITEM_R_EXPAND, NULL, 0);
uiPieMenuEnd(C, pie); uiPieMenuEnd(C, pie);
return OPERATOR_INTERFACE;
} }
@@ -2922,7 +2928,7 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
} }
} }
bool uiPupMenuInvoke(bContext *C, const char *idname, ReportList *reports) int uiPupMenuInvoke(bContext *C, const char *idname, ReportList *reports)
{ {
uiPopupMenu *pup; uiPopupMenu *pup;
uiLayout *layout; uiLayout *layout;
@@ -2931,11 +2937,11 @@ bool uiPupMenuInvoke(bContext *C, const char *idname, ReportList *reports)
if (mt == NULL) { if (mt == NULL) {
BKE_reportf(reports, RPT_ERROR, "Menu \"%s\" not found", idname); BKE_reportf(reports, RPT_ERROR, "Menu \"%s\" not found", idname);
return false; return OPERATOR_CANCELLED;
} }
if (mt->poll && mt->poll(C, mt) == 0) if (mt->poll && mt->poll(C, mt) == 0)
return false; return OPERATOR_CANCELLED;
pup = uiPupMenuBegin(C, IFACE_(mt->label), ICON_NONE); pup = uiPupMenuBegin(C, IFACE_(mt->label), ICON_NONE);
layout = uiPupMenuLayout(pup); layout = uiPupMenuLayout(pup);
@@ -2951,7 +2957,7 @@ bool uiPupMenuInvoke(bContext *C, const char *idname, ReportList *reports)
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return true; return OPERATOR_INTERFACE;
} }

View File

@@ -1911,7 +1911,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED
/* finish building the menu, and process it (should result in calling self again) */ /* finish building the menu, and process it (should result in calling self again) */
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
/* call constraint_add_exec() to add the IK constraint */ /* call constraint_add_exec() to add the IK constraint */

View File

@@ -309,14 +309,16 @@ static int make_proxy_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* present the menu and be done... */ /* present the menu and be done... */
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
/* this invoke just calls another instance of this operator... */
return OPERATOR_INTERFACE;
} }
else { else {
/* error.. cannot continue */ /* error.. cannot continue */
BKE_report(op->reports, RPT_ERROR, "Can only make proxy for a referenced object or group"); BKE_report(op->reports, RPT_ERROR, "Can only make proxy for a referenced object or group");
return OPERATOR_CANCELLED;
} }
/* this invoke just calls another instance of this operator... */
return OPERATOR_CANCELLED;
} }
static int make_proxy_exec(bContext *C, wmOperator *op) static int make_proxy_exec(bContext *C, wmOperator *op)
@@ -923,7 +925,7 @@ static int parent_set_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static bool parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop) static bool parent_set_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)

View File

@@ -2759,7 +2759,7 @@ static int screen_area_options_invoke(bContext *C, wmOperator *op, const wmEvent
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static void SCREEN_OT_area_options(wmOperatorType *ot) static void SCREEN_OT_area_options(wmOperatorType *ot)
@@ -2866,7 +2866,7 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNU
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static int repeat_history_exec(bContext *C, wmOperator *op) static int repeat_history_exec(bContext *C, wmOperator *op)
@@ -3262,7 +3262,7 @@ static int header_toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEv
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static void SCREEN_OT_header_toolbox(wmOperatorType *ot) static void SCREEN_OT_header_toolbox(wmOperatorType *ot)

View File

@@ -4738,7 +4738,7 @@ static int dyntopo_warning_popup(bContext *C, wmOperatorType *ot, bool vdata, bo
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }

View File

@@ -77,7 +77,7 @@ static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UN
uiItemsEnumR(layout, &ptr, "align"); uiItemsEnumR(layout, &ptr, "align");
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void BUTTONS_OT_toolbox(wmOperatorType *ot) void BUTTONS_OT_toolbox(wmOperatorType *ot)

View File

@@ -2256,7 +2256,7 @@ static int image_pack_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
BKE_image_release_ibuf(ima, ibuf, NULL); BKE_image_release_ibuf(ima, ibuf, NULL);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
BKE_image_release_ibuf(ima, ibuf, NULL); BKE_image_release_ibuf(ima, ibuf, NULL);

View File

@@ -261,7 +261,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void FILE_OT_unpack_all(wmOperatorType *ot) void FILE_OT_unpack_all(wmOperatorType *ot)
@@ -330,7 +330,7 @@ static int unpack_item_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void FILE_OT_unpack_item(wmOperatorType *ot) void FILE_OT_unpack_item(wmOperatorType *ot)

View File

@@ -2194,7 +2194,7 @@ static int nla_fmodifier_add_invoke(bContext *C, wmOperator *UNUSED(op), const w
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static int nla_fmodifier_add_exec(bContext *C, wmOperator *op) static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)

View File

@@ -571,7 +571,7 @@ static int node_group_separate_invoke(bContext *C, wmOperator *UNUSED(op), const
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void NODE_OT_group_separate(wmOperatorType *ot) void NODE_OT_group_separate(wmOperatorType *ot)

View File

@@ -1617,7 +1617,7 @@ static int parent_drop_invoke(bContext *C, wmOperator *op, const wmEvent *event)
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
} }
else { else {

View File

@@ -3173,7 +3173,7 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve
break; break;
} }
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
void TEXT_OT_resolve_conflict(wmOperatorType *ot) void TEXT_OT_resolve_conflict(wmOperatorType *ot)

View File

@@ -176,7 +176,7 @@ static int select_orientation_invoke(bContext *C, wmOperator *UNUSED(op), const
uiItemsEnumO(layout, "TRANSFORM_OT_select_orientation", "orientation"); uiItemsEnumO(layout, "TRANSFORM_OT_select_orientation", "orientation");
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
static void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot) static void TRANSFORM_OT_select_orientation(struct wmOperatorType *ot)

View File

@@ -352,13 +352,22 @@ enum {
OPERATOR_RUNNING_MODAL = (1 << 0), OPERATOR_RUNNING_MODAL = (1 << 0),
OPERATOR_CANCELLED = (1 << 1), OPERATOR_CANCELLED = (1 << 1),
OPERATOR_FINISHED = (1 << 2), OPERATOR_FINISHED = (1 << 2),
/* add this flag if the event should pass through */ /* add this flag if the event should pass through */
OPERATOR_PASS_THROUGH = (1 << 3), OPERATOR_PASS_THROUGH = (1 << 3),
/* in case operator got executed outside WM code... like via fileselect */ /* in case operator got executed outside WM code... like via fileselect */
OPERATOR_HANDLED = (1 << 4), OPERATOR_HANDLED = (1 << 4),
/* used for operators that act indirectly (eg. popup menu)
* note: this isn't great design (using operators to trigger UI) avoid where possible. */
OPERATOR_INTERFACE = (1 << 5),
}; };
#define OPERATOR_FLAGS_ALL (OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | \ #define OPERATOR_FLAGS_ALL ( \
OPERATOR_PASS_THROUGH | OPERATOR_HANDLED) OPERATOR_RUNNING_MODAL | \
OPERATOR_CANCELLED | \
OPERATOR_FINISHED | \
OPERATOR_PASS_THROUGH | \
OPERATOR_HANDLED | \
OPERATOR_INTERFACE | \
0)
/* sanity checks for debug mode only */ /* sanity checks for debug mode only */
#define OPERATOR_RETVAL_CHECK(ret) (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret) #define OPERATOR_RETVAL_CHECK(ret) (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret)

View File

@@ -429,6 +429,7 @@ EnumPropertyItem operator_return_items[] = {
{OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"}, {OPERATOR_FINISHED, "FINISHED", 0, "Finished", "When the operator is complete, operator exits"},
/* used as a flag */ /* used as a flag */
{OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"}, {OPERATOR_PASS_THROUGH, "PASS_THROUGH", 0, "Pass Through", "Do nothing and pass the event on"},
{OPERATOR_INTERFACE, "INTERFACE", 0, "Interface", "Handled but not executed (popup menus)"},
{0, NULL, 0, NULL, NULL} {0, NULL, 0, NULL, NULL}
}; };

View File

@@ -1079,6 +1079,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0); uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_INTERFACE;
} }
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
@@ -1123,7 +1124,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op)
int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{ {
uiPupBlock(C, wm_enum_search_menu, op); uiPupBlock(C, wm_enum_search_menu, op);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
/* Can't be used as an invoke directly, needs message arg (can be NULL) */ /* Can't be used as an invoke directly, needs message arg (can be NULL) */
@@ -1145,7 +1146,7 @@ int WM_operator_confirm_message_ex(bContext *C, wmOperator *op,
uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0); uiItemFullO_ptr(layout, op->type, message, ICON_NONE, properties, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup); uiPupMenuEnd(C, pup);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message) int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message)
@@ -2018,7 +2019,7 @@ static int wm_search_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNU
{ {
uiPupBlock(C, wm_block_search_menu, op); uiPupBlock(C, wm_block_search_menu, op);
return OPERATOR_CANCELLED; return OPERATOR_INTERFACE;
} }
/* op->poll */ /* op->poll */
@@ -2057,9 +2058,7 @@ static int wm_call_menu_exec(bContext *C, wmOperator *op)
char idname[BKE_ST_MAXNAME]; char idname[BKE_ST_MAXNAME];
RNA_string_get(op->ptr, "name", idname); RNA_string_get(op->ptr, "name", idname);
uiPupMenuInvoke(C, idname, op->reports); return uiPupMenuInvoke(C, idname, op->reports);
return OPERATOR_CANCELLED;
} }
static void WM_OT_call_menu(wmOperatorType *ot) static void WM_OT_call_menu(wmOperatorType *ot)
@@ -2081,9 +2080,7 @@ static int wm_call_pie_menu_invoke(bContext *C, wmOperator *op, const wmEvent *e
char idname[BKE_ST_MAXNAME]; char idname[BKE_ST_MAXNAME];
RNA_string_get(op->ptr, "name", idname); RNA_string_get(op->ptr, "name", idname);
uiPieMenuInvoke(C, idname, event); return uiPieMenuInvoke(C, idname, event);
return OPERATOR_CANCELLED;
} }
static int wm_call_pie_menu_exec(bContext *C, wmOperator *op) static int wm_call_pie_menu_exec(bContext *C, wmOperator *op)
@@ -2091,9 +2088,7 @@ static int wm_call_pie_menu_exec(bContext *C, wmOperator *op)
char idname[BKE_ST_MAXNAME]; char idname[BKE_ST_MAXNAME];
RNA_string_get(op->ptr, "name", idname); RNA_string_get(op->ptr, "name", idname);
uiPieMenuInvoke(C, idname, CTX_wm_window(C)->eventstate); return uiPieMenuInvoke(C, idname, CTX_wm_window(C)->eventstate);
return OPERATOR_CANCELLED;
} }
static void WM_OT_call_menu_pie(wmOperatorType *ot) static void WM_OT_call_menu_pie(wmOperatorType *ot)

View File

@@ -626,7 +626,7 @@ struct uiPopupMenu *uiPupMenuBegin(struct bContext *C, const char *title, int ic
void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head) RET_NONE void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head) RET_NONE
struct uiLayout *uiPupMenuLayout(struct uiPopupMenu *head) RET_NULL struct uiLayout *uiPupMenuLayout(struct uiPopupMenu *head) RET_NULL
struct uiLayout *uiPieMenuLayout(struct uiPieMenu *pie) RET_NULL struct uiLayout *uiPieMenuLayout(struct uiPieMenu *pie) RET_NULL
void uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event) RET_NONE int uiPieMenuInvoke(struct bContext *C, const char *idname, const struct wmEvent *event) RET_NONE
struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) RET_NULL struct uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) RET_NULL
void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie) RET_NONE void uiPieMenuEnd(struct bContext *C, uiPieMenu *pie) RET_NONE
struct uiLayout *uiLayoutRadial(struct uiLayout *layout) RET_NULL struct uiLayout *uiLayoutRadial(struct uiLayout *layout) RET_NULL