Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-27 01:29:34 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-27 01:34:24 +0300
commitd525c76003b3e7dcda92df09e9009c2f67f5532e (patch)
tree0ea88951ec28b25cdd25d6ba3bb71af4fb21f322 /source/blender/editors/undo
parentd59538228886e5aaba13f04b27d99e5b78b241e8 (diff)
Revert "UI: Edit Menu Operator Polling"
This reverts part of commit b7eba20236ca6499a62a8ee2b0c852086bc46b8e. Polling is causing issues in scripts, and the minor usability improvements are not worth the extra work this may cause at this point in the release cycle. Fixes T65149
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r--source/blender/editors/undo/ed_undo.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 99143cd71f9..ccbe12b4a93 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -392,15 +392,6 @@ static bool ed_undo_redo_poll(bContext *C)
WM_operator_check_ui_enabled(C, last_op->type->name));
}
-static bool ed_undo_poll(bContext *C)
-{
- if (!ed_undo_is_init_and_screenactive_poll(C)) {
- return false;
- }
- UndoStack *undo_stack = CTX_wm_manager(C)->undo_stack;
- return (undo_stack->step_active != NULL) && (undo_stack->step_active->prev != NULL);
-}
-
void ED_OT_undo(wmOperatorType *ot)
{
/* identifiers */
@@ -410,7 +401,7 @@ void ED_OT_undo(wmOperatorType *ot)
/* api callbacks */
ot->exec = ed_undo_exec;
- ot->poll = ed_undo_poll;
+ ot->poll = ed_undo_is_init_and_screenactive_poll;
}
void ED_OT_undo_push(wmOperatorType *ot)
@@ -435,15 +426,6 @@ void ED_OT_undo_push(wmOperatorType *ot)
"");
}
-static bool ed_redo_poll(bContext *C)
-{
- if (!ed_undo_is_init_and_screenactive_poll(C)) {
- return false;
- }
- UndoStack *undo_stack = CTX_wm_manager(C)->undo_stack;
- return (undo_stack->step_active != NULL) && (undo_stack->step_active->next != NULL);
-}
-
void ED_OT_redo(wmOperatorType *ot)
{
/* identifiers */
@@ -453,7 +435,7 @@ void ED_OT_redo(wmOperatorType *ot)
/* api callbacks */
ot->exec = ed_redo_exec;
- ot->poll = ed_redo_poll;
+ ot->poll = ed_undo_is_init_and_screenactive_poll;
}
void ED_OT_undo_redo(wmOperatorType *ot)
@@ -651,16 +633,6 @@ static int undo_history_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
-static bool undo_history_poll(bContext *C)
-{
- if (!ed_undo_is_init_and_screenactive_poll(C)) {
- return false;
- }
- UndoStack *undo_stack = CTX_wm_manager(C)->undo_stack;
- /* more than just original state entry */
- return BLI_listbase_count_at_most(&undo_stack->steps, 2) > 1;
-}
-
void ED_OT_undo_history(wmOperatorType *ot)
{
/* identifiers */
@@ -671,7 +643,7 @@ void ED_OT_undo_history(wmOperatorType *ot)
/* api callbacks */
ot->invoke = undo_history_invoke;
ot->exec = undo_history_exec;
- ot->poll = undo_history_poll;
+ ot->poll = ed_undo_is_init_and_screenactive_poll;
RNA_def_int(ot->srna, "item", 0, 0, INT_MAX, "Item", "", 0, INT_MAX);
}