From 033bf619fa7aa82c8e746ba0c2c5214fc7304052 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 29 Mar 2021 17:05:54 +0200 Subject: [PATCH] Gui: [skip ci] expose Control::showModelView() to Python --- src/Gui/TaskView/TaskDialogPython.cpp | 9 +++++++++ src/Gui/TaskView/TaskDialogPython.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp index 5a9cb4b864..61a0a62def 100644 --- a/src/Gui/TaskView/TaskDialogPython.cpp +++ b/src/Gui/TaskView/TaskDialogPython.cpp @@ -70,6 +70,7 @@ void ControlPy::init_type() add_varargs_method("isAllowedAlterView",&ControlPy::isAllowedAlterView,"isAllowedAlterView()"); add_varargs_method("isAllowedAlterSelection",&ControlPy::isAllowedAlterSelection,"isAllowedAlterSelection()"); add_varargs_method("showTaskView",&ControlPy::showTaskView,"showTaskView()"); + add_varargs_method("showModelView",&ControlPy::showModelView,"showModelView()"); } ControlPy::ControlPy() @@ -178,6 +179,14 @@ Py::Object ControlPy::showTaskView(const Py::Tuple& args) return Py::None(); } +Py::Object ControlPy::showModelView(const Py::Tuple& args) +{ + if (!PyArg_ParseTuple(args.ptr(), "")) + throw Py::Exception(); + Gui::Control().showModelView(); + return Py::None(); +} + // ------------------------------------------------------------------ TaskWatcherPython::TaskWatcherPython(const Py::Object& o) diff --git a/src/Gui/TaskView/TaskDialogPython.h b/src/Gui/TaskView/TaskDialogPython.h index 7222ea0f8f..71e1da1e95 100644 --- a/src/Gui/TaskView/TaskDialogPython.h +++ b/src/Gui/TaskView/TaskDialogPython.h @@ -50,6 +50,7 @@ public: Py::Object isAllowedAlterView(const Py::Tuple&); Py::Object isAllowedAlterSelection(const Py::Tuple&); Py::Object showTaskView(const Py::Tuple&); + Py::Object showModelView(const Py::Tuple&); private: static ControlPy* instance;