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:
authorJulian Eisel <eiseljulian@gmail.com>2018-05-13 17:49:05 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-05-13 17:49:05 +0300
commita23995f42a662533f24764f9051a70b224aa77d7 (patch)
treeb80ab94a7a7ee032fc74dbe930e3d46ee35fa5e4 /source/blender/editors/screen/workspace_edit.c
parent5717612f7c9a94a11420b3aa06c9674d3574043e (diff)
Fix/workaround crash when appending workspace in edit mode
Linking/appending in edit mode currently isn't supported. For workspaces it should probably be, but we can look into supporting this later. For now gray out buttons in "Add Workspace" menu while in edit mode.
Diffstat (limited to 'source/blender/editors/screen/workspace_edit.c')
-rw-r--r--source/blender/editors/screen/workspace_edit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index c8aa4560dc4..bd4381f4099 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -331,6 +331,12 @@ static void WORKSPACE_OT_workspace_delete(wmOperatorType *ot)
ot->exec = workspace_delete_exec;
}
+static int workspace_append_activate_poll(bContext *C)
+{
+ wmOperatorType *ot = WM_operatortype_find("WM_OT_append", false);
+ return WM_operator_poll(C, ot);
+}
+
static int workspace_append(bContext *C, const char *directory, const char *idname)
{
wmOperatorType *ot = WM_operatortype_find("WM_OT_append", false);
@@ -384,6 +390,7 @@ static void WORKSPACE_OT_append_activate(wmOperatorType *ot)
/* api callbacks */
ot->exec = workspace_append_activate_exec;
+ ot->poll = workspace_append_activate_poll;
RNA_def_string(ot->srna, "idname", NULL, MAX_ID_NAME - 2, "Identifier",
"Name of the workspace to append and activate");