diff --git a/modules/gui/pymod/export_gosty.cc b/modules/gui/pymod/export_gosty.cc index 6a654ff691a218cf823b6e3f73e52bb9a1617947..039843d1f0ea1a38f175deebab29c259867deb7d 100644 --- a/modules/gui/pymod/export_gosty.cc +++ b/modules/gui/pymod/export_gosty.cc @@ -33,7 +33,6 @@ using namespace boost::python; #include "transfer_ownership.hh" #include "sip_handler.hh" -#include "tool_options_win_proxy.hh" #if OST_IMG_ENABLED #include "data_viewer_proxy.hh" using namespace ost::img::gui; @@ -44,11 +43,6 @@ using namespace ost::gui; namespace { -ToolOptionsWinProxy app_get_tool_options_win(GostyApp* app) -{ - return ToolOptionsWinProxy(app->GetToolOptionsWin()); -} - #if OST_IMG_ENABLED DataViewerProxyPtr app_create_data_viewer1(GostyApp* app, const ost::img::Data& d, const QString& name) { @@ -101,8 +95,10 @@ void export_Gosty() return_value_policy<reference_existing_object>()) .add_property("seq_viewer", make_function(&GostyApp::GetSequenceViewer, return_value_policy<reference_existing_object>())) - .def("GetToolOptionsWin", &app_get_tool_options_win) - .add_property("tool_options_win", &app_get_tool_options_win) + .def("GetToolOptionsWin", &GostyApp::GetToolOptionsWin, + return_value_policy<reference_existing_object>()) + .add_property("tool_options_win", make_function(&GostyApp::GetToolOptionsWin, + return_value_policy<reference_existing_object>())) #if OST_IMG_ENABLED .def("CreateDataViewer", &app_create_data_viewer1) .def("CreateDataViewer", &app_create_data_viewer2) diff --git a/modules/gui/pymod/export_tool.cc b/modules/gui/pymod/export_tool.cc index a0b4090ff05d4dc525fe7ea6276f1047fb570e8a..73067336468023385aaa0cfd10a673be4126a2f1 100644 --- a/modules/gui/pymod/export_tool.cc +++ b/modules/gui/pymod/export_tool.cc @@ -23,14 +23,13 @@ #include <boost/python/register_ptr_to_python.hpp> #include <boost/python/suite/indexing/vector_indexing_suite.hpp> -#include <iostream> -using namespace boost::python; - #include <ost/gui/tools/tool.hh> #include <ost/gui/tools/tool_manager.hh> -#include "tool_options_win_proxy.hh" +#include <ost/gui/tools/tool_options_win.hh> +#include "sip_handler.hh" #include "qptr.hh" +using namespace boost::python; using namespace ost::gui; using namespace ost; @@ -246,9 +245,11 @@ void export_Tool() .def("FindToolByName", &ToolManager::FindToolByName, return_value_policy<reference_existing_object>()) ; - class_<ToolOptionsWinProxy, bases<SipHandlerBase> >("ToolOptionsWin") - .def("Show", &ToolOptionsWinProxy::Show) - .def("Hide", &ToolOptionsWinProxy::Hide) + class_<ToolOptionsWin, boost::noncopyable>("ToolOptionsWin", no_init) + .def("Show", &ToolOptionsWin::show) + .def("Hide", &ToolOptionsWin::hide) + .def("GetQObject",&get_py_qobject<ToolOptionsWin>) + .add_property("qobject", &get_py_qobject<ToolOptionsWin>) ; class_<gfx::NodePtrList>("NodePtrList", init<>()) diff --git a/modules/gui/pymod/scene/inspector_widget.py b/modules/gui/pymod/scene/inspector_widget.py index 68215c66169164a1b4fa5a4cd384fe1bb9edb025..4e7e7f76155f5c51219aaae95daa91967b3e6f03 100644 --- a/modules/gui/pymod/scene/inspector_widget.py +++ b/modules/gui/pymod/scene/inspector_widget.py @@ -39,7 +39,7 @@ class InspectorWidget(ToolBarOptionsWidget): [InspectorWidget.ICONS_PATH+"render_icon.png",RenderOptionsWidget(self),None], [InspectorWidget.ICONS_PATH+"color_icon.png",ColorOptionsWidget(self),None], [InspectorWidget.ICONS_PATH+"preset_icon.png", PresetWidget(self),None], - [InspectorWidget.ICONS_PATH+"tool_icon.png",sip.wrapinstance(app.GetToolOptionsWin().GetSipHandle(),QtGui.QWidget),"Tool Options"] + [InspectorWidget.ICONS_PATH+"tool_icon.png",app.tool_options_win.qobject,"Tool Options"] ] for o in options: ToolBarOptionsWidget.AddWidget(self,o[0], o[1], o[2]) diff --git a/modules/gui/pymod/tool_options_win_proxy.hh b/modules/gui/pymod/tool_options_win_proxy.hh deleted file mode 100644 index e4862944d5e4367292f7c4a7b0e2c0df923ba322..0000000000000000000000000000000000000000 --- a/modules/gui/pymod/tool_options_win_proxy.hh +++ /dev/null @@ -1,46 +0,0 @@ -//------------------------------------------------------------------------------ -// This file is part of the OpenStructure project <www.openstructure.org> -// -// Copyright (C) 2008-2010 by the OpenStructure authors -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License as published by the Free -// Software Foundation; either version 3.0 of the License, or (at your option) -// any later version. -// This library is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more -// details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this library; if not, write to the Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -//------------------------------------------------------------------------------ -#ifndef OST_GUI_TOOL_OPTIONS_WIN_PROXY_HH -#define OST_GUI_TOOL_OPTIONS_WIN_PROXY_HH - -#include <ost/gui/tools/tool_options_win.hh> - -#include "sip_handler.hh" - -namespace ost { namespace gui { - -class ToolOptionsWinProxy : public SipHandler<ToolOptionsWin> { -public: - ToolOptionsWinProxy(ToolOptionsWin* gl_win=NULL): - SipHandler<ToolOptionsWin>(gl_win) - { } - - void Show() - { - return Me()->show(); - } - void Hide() - { - return Me()->hide(); - } -}; - -}} - -#endif