diff --git a/SCHNApps/Plugins/cameraControl/CMakeLists.txt b/SCHNApps/Plugins/cameraControl/CMakeLists.txt deleted file mode 100644 index 64b8ba521fc6a402acaf2433f21b17fb48c06955..0000000000000000000000000000000000000000 --- a/SCHNApps/Plugins/cameraControl/CMakeLists.txt +++ /dev/null @@ -1,69 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -INCLUDE_DIRECTORIES( - ${SCHNApps_ROOT_DIR}/include - ${SCHNApps_ROOT_DIR}/Plugins/cameraControl - ${CMAKE_CURRENT_BINARY_DIR} -) - -SET( PLUGIN_SRC - ${SCHNApps_ROOT_DIR}/Plugins/cameraControl/cameraControl.cpp -) - -SET( PLUGIN_H - ${SCHNApps_ROOT_DIR}/Plugins/cameraControl/cameraControl.h -) - -IF( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) - - ADD_DEFINITIONS(-DDEBUG) - - IF(WIN32) - link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) - ELSE (WIN32) - link_directories( ${CGoGN_ROOT_DIR}/lib/Debug ${CGoGN_ROOT_DIR}/lib/Release ) - ENDIF (WIN32) - -# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} ) - QT4_WRAP_CPP( PLUGIN_MOC ${PLUGIN_H} ) - - ADD_LIBRARY( CameraControlD SHARED - ${PLUGIN_SRC} - ${PLUGIN_UI} - ${PLUGIN_MOC} - ) - - TARGET_LINK_LIBRARIES( CameraControlD - ${CGoGN_LIBS_D} - ${COMMON_LIBS} - ) - - ADD_DEPENDENCIES( CameraControlD SCHNAppsD ) - - SET_TARGET_PROPERTIES( CameraControlD PROPERTIES COMPILE_DEFINITIONS "DEBUG" ) - -ELSE ( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) - - IF(WIN32) - link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) - ELSE (WIN32) - link_directories( ${CGoGN_ROOT_DIR}/lib/Release ) - ENDIF (WIN32) - -# QT4_WRAP_UI( PLUGIN_UI ${PLUGIN_FORM} ) - QT4_WRAP_CPP( PLUGIN_MOC ${PLUGIN_H} ) - - ADD_LIBRARY( CameraControl SHARED - ${PLUGIN_SRC} - ${PLUGIN_UI} - ${PLUGIN_MOC} - ) - - TARGET_LINK_LIBRARIES( CameraControl - ${CGoGN_LIBS_R} - ${COMMON_LIBS} - ) - - ADD_DEPENDENCIES( CameraControl SCHNApps ) - -ENDIF ( ${CMAKE_BUILD_TYPE} STREQUAL Debug ) diff --git a/SCHNApps/Plugins/cameraControl/cameraControl.cpp b/SCHNApps/Plugins/cameraControl/cameraControl.cpp deleted file mode 100644 index 37296e8db23858c1929acf13b89acb4754f2335a..0000000000000000000000000000000000000000 --- a/SCHNApps/Plugins/cameraControl/cameraControl.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "cameraControl.h" - -#include "mapHandler.h" - -#include "Algo/Import/import.h" - -#include -#include - -bool CameraControlPlugin::enable() -{ - return true; -} - -#ifndef DEBUG -Q_EXPORT_PLUGIN2(CameraControlPlugin, CameraControlPlugin) -#else -Q_EXPORT_PLUGIN2(CameraControlPluginD, CameraControlPlugin) -#endif diff --git a/SCHNApps/Plugins/cameraControl/cameraControl.h b/SCHNApps/Plugins/cameraControl/cameraControl.h deleted file mode 100644 index e35ea69fcc35bd774f4fc2fdd93f75e69da745d9..0000000000000000000000000000000000000000 --- a/SCHNApps/Plugins/cameraControl/cameraControl.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _CAMERACONTROL_PLUGIN_H_ -#define _CAMERACONTROL_PLUGIN_H_ - -#include "plugin.h" - - -using namespace CGoGN; -using namespace SCHNApps; - - -class CameraControlPlugin : public Plugin -{ - Q_OBJECT - Q_INTERFACES(CGoGN::SCHNApps::Plugin) - -public: - CameraControlPlugin() - { - setProvidesRendering(false); - } - - ~CameraControlPlugin() - {} - - virtual bool enable(); - virtual void disable() {} - - virtual void redraw(View *view) {} - - virtual void keyPress(View* view, int key) {} - virtual void keyRelease(View* view, int key) {} - virtual void mousePress(View* view, int button, int x, int y) {} - virtual void mouseRelease(View* view, int button, int x, int y) {} - virtual void mouseMove(View* view, int buttons, int x, int y) {} - virtual void wheelEvent(View* view, int delta, int x, int y) {} - -public slots: - -private: - -}; - -#endif diff --git a/SCHNApps/Plugins/renderExplod/renderExplod.ui b/SCHNApps/Plugins/renderExplod/renderExplod.ui index 66845ce0bcbcfea963ab8cfd5630f754d9321344..0afd82f7bcd8b26209ee77a2ac2e14fa118b62ff 100644 --- a/SCHNApps/Plugins/renderExplod/renderExplod.ui +++ b/SCHNApps/Plugins/renderExplod/renderExplod.ui @@ -22,50 +22,34 @@ QLayout::SetDefaultConstraint - - + + - Position : + Color : - - - - - 0 - 0 - + + + + Position : - - + + - + 0 0 - - Qt::LeftToRight - - - Refresh - - - - - cColor : - - - - - + + - + 0 0 diff --git a/SCHNApps/forms/camerasDialog.ui b/SCHNApps/forms/camerasDialog.ui index 0b2b9794ee0b88d0109fedc94ea24ef89bcd4068..f14cda8c8a5a494cc925ff51bd9feaacfd8cc5af 100644 --- a/SCHNApps/forms/camerasDialog.ui +++ b/SCHNApps/forms/camerasDialog.ui @@ -6,43 +6,56 @@ 0 0 - 198 - 318 + 287 + 332 CamerasDialog - + - + - - - - - Add - - - - - - - Remove - - - - + + + Add + + - - - QAbstractItemView::ExtendedSelection + + + Remove + + + + + Name + + + + + Ortho + + + + + Draw + + + + + Draw path + + + + diff --git a/SCHNApps/include/camera.h b/SCHNApps/include/camera.h index cd2d0c569376d5b8a68ece7e3ebc51131c80cded..48185c228542a34cd831b5223d641ac811348833 100644 --- a/SCHNApps/include/camera.h +++ b/SCHNApps/include/camera.h @@ -20,6 +20,7 @@ public: Camera(const QString& name, Window* window); ~Camera(); +public slots: const QString& getName() const { return m_name; } void setName(const QString& name) { m_name = name; } @@ -29,29 +30,20 @@ public: bool isUsed() const { return !l_views.empty(); } bool isShared() const { return l_views.size() > 1; } + void changeType(qglviewer::Camera::Type type); + /********************************************************* * CAMERA DRAWING *********************************************************/ - virtual void draw(); - bool getDraw() const { return m_draw; } - void setDraw(bool b = true) { m_draw = b; } - - bool getDrawFarPlane() const { return m_drawFarPlane; } - void setDrawFarPlane(bool b) { m_drawFarPlane = b; } - - double getDrawScale() const { return m_drawScale; } - void setDrawScale(double s) { m_drawScale = s; } + void setDraw(bool b); bool getDrawPath() const { return m_drawPath; } - void setDrawPath(bool b) { m_drawPath = b; } + void setDrawPath(bool b); - bool getDrawPathAxis() const { return m_drawPathAxis; } - void setDrawPathAxis(bool b) { m_drawPathAxis = b; } - - double getDrawPathScale() const { return m_drawPathScale; } - void setDrawPathScale(double s) { m_drawPathScale = s;} +public: +// virtual void draw(); /********************************************************* * MANAGE LINKED VIEWS @@ -76,12 +68,7 @@ protected: QList l_views; bool m_draw; - bool m_drawFarPlane; - double m_drawScale; - bool m_drawPath; - bool m_drawPathAxis; - double m_drawPathScale; int m_snapCount; }; diff --git a/SCHNApps/include/dialogs/camerasDialog.h b/SCHNApps/include/dialogs/camerasDialog.h index 5223d21bc6fd839702ab890613163bf0aaafa19d..4b3439729f56454bf5110e84d866ed721e47f60a 100644 --- a/SCHNApps/include/dialogs/camerasDialog.h +++ b/SCHNApps/include/dialogs/camerasDialog.h @@ -2,6 +2,7 @@ #define _CAMERASDIALOG_H_ #include "ui_camerasDialog.h" +#include "view.h" namespace CGoGN { @@ -22,12 +23,18 @@ public: private: Window* m_window; + bool b_refreshingUI; public slots: + void setCameraType(const QString& name, qglviewer::Camera::Type type); + void setDrawCamera(const QString& name, bool b); + void setDrawCameraPath(const QString& name, bool b); + void cb_addCamera(); void cb_removeCameras(); void cb_addCameraToList(Camera* c); void cb_removeCameraFromList(Camera* c); + void cb_itemChanged(QTreeWidgetItem* item, int column); }; } // namespace SCHNApps diff --git a/SCHNApps/include/window.h b/SCHNApps/include/window.h index ef898acb38d41d9840378d765c81820f3ca413c6..b93f978d7369bcc74ee013abbe9febeb0267b1f0 100644 --- a/SCHNApps/include/window.h +++ b/SCHNApps/include/window.h @@ -27,19 +27,14 @@ class Window : public QMainWindow, Ui::Window Q_OBJECT public: - /** - * \fn Window() - * \brief Constructor - */ Window(const QString& appPath, PythonQtObjectPtr& pythonContext, PythonQtScriptingConsole& pythonConsole); - - /** - * \fn ~Window() - * \brief Destructor - */ ~Window(); +public slots: const QString& getAppPath() { return m_appPath; } + CamerasDialog* getCamerasDialog() { return m_camerasDialog; } + PluginsDialog* getPluginsDialog() { return m_pluginsDialog; } + MapsDialog* getMapsDialog() { return m_mapsDialog; } /********************************************************* * MANAGE DOCK @@ -47,24 +42,8 @@ public: QTabWidget* getDockTabWidget() const { return m_dockTabWidget; } - /** - * \fn void addTabInDock(QWidget* tabWidget, const QString& tabText, bool enable) - * \brief Adds the widget as a new tab in the interface's dock - * - * \param tabWidget the created and allocated pointer to the QWidget to add in the dock - * \param tabText The text that will appears in the tab label - * \param enable is the new tab enabled ? - */ +public: void addTabInDock(QWidget* tabWidget, const QString& tabText, bool enable); - - /** - * \fn void removeTabInDock(QWidget* tabWidget) - * \brief removes a given widget from the tab - * - * \param tabWidget the reference to the widget you want to remove - * - * If the widget does belong to the tab, it will be destroyed. - */ void removeTabInDock(QWidget* tabWidget); public slots: @@ -76,55 +55,7 @@ public slots: *********************************************************/ public: - /** - * \fn bool addMenuAction(const QString& menuPath, QAction* action) - * \brief adds an action in the program menu bar - * - * \param menuPath the menu path (see details below) to specify a location for the action in the menu. - * \param action a pointer to the allocated action to add in the menu. All the details on that action (such as - * QObject::connect() calls) are not dealt in this function. - * - * The menu path is a string used to specify the location of the new action in the menu bar. - * In such path every menu step of the path should be separate by ';'. The action is the last substring after - * the last ';', and will be added in the menu with that name. All non-existing menu specified in the path - * shall be created. - * - * Example 1: if you want to add an entry "action" to the existing menu "Plugins" the - * menu path shall be: Plugins;action - * - * Example 2: if you want to add an entry "action" in a new menu "config" that is also a - * submenu of a new menu "Settings", the menu path - * shall be: Settings;config;action - * - * A new action should at least belong to one menu (already existing or not). Otherwise the method will fail. - * - * This method is called by Plugin methods - * - * \return a boolean whether the method succeeded or not. - * - * If the function failed, the error code ( Error::code ) is affected with a value - * depending on the error. This error can be shown with Error::showError - * - * \see deleteMenuAction() - * \see Plugin::addMenuAction() - */ bool addMenuAction(const QString& menuPath, QAction* action); - - /** - * \fn void deleteMenuAction(QAction* action) - * \brief delete an action from the menu bar - * - * \param action pointer to the allocated action to delete. - * - * If this action was the only action remaining in a menu, this menu will also be deleted. - * - * \warning DO NOT use this method with an action that hasn't been added with addMenuAction() - * - * This method is called by Plugin methods - * - * \see addMenuAction() - * \see Plugin::removeMenuAction() - */ void removeMenuAction(QAction* action); /********************************************************* @@ -132,7 +63,6 @@ public: *********************************************************/ bool addToolbarAction(QAction* action); - void removeToolbarAction(QAction* action); /********************************************************* @@ -173,42 +103,9 @@ public: public slots: void registerPluginsDirectory(const QString& path); - /** - * \fn bool loadPlugin(QString pluginPath) - * \brief Loads and references a Plugin - * - * \param pluginPath the absolute path of the Plugin location - * - * The Plugin is loaded and referenced under a name that is the Plugin file name - * where the extension ('.so', '.dylib') and the prefix 'lib' were removed. - * - * Example: /path/libExample.so will be referenced as Example - * - * You have to make sure that a Plugin file with a similar name hasn't been loaded yet, otherwise - * the loading will fail. - * - * This method calls the Plugin::enable() method of the concerned Plugin. That is why - * when Plugin are written, this method is overriden and used as an initialization method. - * - * \return a boolean whether the loading succeeded or not. - */ Plugin* loadPlugin(const QString& pluginFilePath); - - /** - * \fn void unloadPlugin(QString pluginName) - * \brief Unload the Plugin of a given name - * - * \param pluginName the name under which the Plugin is referenced - * - * The Plugin of the given name is dereferenced and deleted, if it exists and was previously - * referenced, if not, the method does nothing. - * - * This method calls the Plugin::disable() method of the concerned Plugin. That is why, - * when Plugin are written, this method is overriden and used as a destruction method. - */ void unloadPlugin(const QString& pluginName); -public: Plugin* getPlugin(const QString& name) const; QList getPluginsList() const { return h_plugins.values(); } const PluginHash& getPluginsHash() const { return h_plugins; } @@ -219,9 +116,14 @@ public: * MANAGE MAPS *********************************************************/ +public: MapHandlerGen* addMap(const QString& name, unsigned int dim); void removeMap(const QString& name); + +public slots: MapHandlerGen* getMap(const QString& name) const; + +public: QList getMapsList() const { return h_maps.values(); } const MapHash& getMapsHash() const { return h_maps; } @@ -288,9 +190,9 @@ public slots: void cb_showHideDock(); void cb_showHidePythonDock(); - void cb_manageCameras(); - void cb_managePlugins(); - void cb_manageMaps(); + void cb_showCamerasDialog(); + void cb_showPluginsDialog(); + void cb_showMapsDialog(); signals: void cameraAdded(Camera* camera); diff --git a/SCHNApps/src/camera.cpp b/SCHNApps/src/camera.cpp index 51f5185fdca7177013544bd2b8ab4fb902f0b44c..55c2d20d44361919c2a34586f22814586d16da02 100644 --- a/SCHNApps/src/camera.cpp +++ b/SCHNApps/src/camera.cpp @@ -1,4 +1,5 @@ #include "camera.h" +#include "dialogs/camerasDialog.h" namespace CGoGN { @@ -11,12 +12,8 @@ unsigned int Camera::cameraCount = 0; Camera::Camera(const QString& name, Window* window) : m_name(name), m_window(window), - m_draw(true), - m_drawFarPlane(true), - m_drawScale(0.1), + m_draw(false), m_drawPath(false), - m_drawPathAxis(false), - m_drawPathScale(1.0), m_snapCount(0) { ++cameraCount; @@ -25,20 +22,31 @@ Camera::Camera(const QString& name, Window* window) : Camera::~Camera() {} -void Camera::draw() +void Camera::changeType(qglviewer::Camera::Type type) { - if(m_draw) - { - qglviewer::Camera::draw(m_drawFarPlane, m_drawScale); - if(m_drawPath) - { - int mask = 1; - if(m_drawPathAxis) - mask = mask | 4; - if(this->keyFrameInterpolator(0)) - this->keyFrameInterpolator(0)->drawPath(mask, 6, m_drawPathScale); - } - } + setType(type); + foreach(View* view, m_window->getViewsList()) + view->updateGL(); + + m_window->getCamerasDialog()->setCameraType(m_name, type); +} + +void Camera::setDraw(bool b) +{ + m_draw = b; + foreach(View* view, m_window->getViewsList()) + view->updateGL(); + + m_window->getCamerasDialog()->setDrawCamera(m_name, b); +} + +void Camera::setDrawPath(bool b) +{ + m_drawPath = b; + foreach(View* view, m_window->getViewsList()) + view->updateGL(); + + m_window->getCamerasDialog()->setDrawCameraPath(m_name, b); } void Camera::linkView(View* view) diff --git a/SCHNApps/src/dialogs/camerasDialog.cpp b/SCHNApps/src/dialogs/camerasDialog.cpp index 52d939f813f4ee4d7e7b561b41478aedef173015..cbe40f35f69737cf6966eec5c326416ddebb2f47 100644 --- a/SCHNApps/src/dialogs/camerasDialog.cpp +++ b/SCHNApps/src/dialogs/camerasDialog.cpp @@ -24,11 +24,59 @@ CamerasDialog::CamerasDialog(Window* window) : connect(m_window, SIGNAL(cameraAdded(Camera*)), this, SLOT(cb_addCameraToList(Camera*))); connect(m_window, SIGNAL(cameraRemoved(Camera*)), this, SLOT(cb_removeCameraFromList(Camera*))); + + connect(cameraList, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(cb_itemChanged(QTreeWidgetItem*,int))); + + cameraList->resizeColumnToContents(1); + cameraList->resizeColumnToContents(2); + cameraList->resizeColumnToContents(3); } CamerasDialog::~CamerasDialog() {} +void CamerasDialog::setCameraType(const QString& name, qglviewer::Camera::Type type) +{ + b_refreshingUI = true; + QList items = cameraList->findItems(name, Qt::MatchExactly); + if(!items.empty()) + { + if(type == qglviewer::Camera::ORTHOGRAPHIC) + items[0]->setCheckState(1, Qt::Checked); + else + items[0]->setCheckState(1, Qt::Unchecked); + } + b_refreshingUI = false; +} + +void CamerasDialog::setDrawCamera(const QString& name, bool b) +{ + b_refreshingUI = true; + QList items = cameraList->findItems(name, Qt::MatchExactly); + if(!items.empty()) + { + if(b) + items[0]->setCheckState(2, Qt::Checked); + else + items[0]->setCheckState(2, Qt::Unchecked); + } + b_refreshingUI = false; +} + +void CamerasDialog::setDrawCameraPath(const QString& name, bool b) +{ + b_refreshingUI = true; + QList items = cameraList->findItems(name, Qt::MatchExactly); + if(!items.empty()) + { + if(b) + items[0]->setCheckState(3, Qt::Checked); + else + items[0]->setCheckState(3, Qt::Unchecked); + } + b_refreshingUI = false; +} + void CamerasDialog::cb_addCamera() { m_window->addCamera(); @@ -36,10 +84,10 @@ void CamerasDialog::cb_addCamera() void CamerasDialog::cb_removeCameras() { - QList currentItems = cameraList->selectedItems(); - foreach(QListWidgetItem* item, currentItems) + QList currentItems = cameraList->selectedItems(); + foreach(QTreeWidgetItem* item, currentItems) { - const QString& cname = item->text(); + const QString& cname = item->text(0); Camera* c = m_window->getCamera(cname); if(!c->isUsed()) m_window->removeCamera(cname); @@ -50,17 +98,46 @@ void CamerasDialog::cb_removeCameras() void CamerasDialog::cb_addCameraToList(Camera* c) { - cameraList->addItem(c->getName()); + QTreeWidgetItem* item = new QTreeWidgetItem(QStringList(c->getName())); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(1, Qt::Unchecked); + item->setCheckState(2, Qt::Unchecked); + item->setCheckState(3, Qt::Unchecked); + cameraList->addTopLevelItem(item); } void CamerasDialog::cb_removeCameraFromList(Camera* c) { - for(int i = 0; i < cameraList->count(); ++i) + QList items = cameraList->findItems(c->getName(), Qt::MatchExactly); + if(!items.empty()) + delete items[0]; +} + +void CamerasDialog::cb_itemChanged(QTreeWidgetItem* item, int column) +{ + if(!b_refreshingUI) { - if(cameraList->item(i)->text() == c->getName()) + Camera *c = m_window->getCamera(item->text(0)); + switch(column) { - delete cameraList->item(i); - return; + case 1 : + if(item->checkState(1) == Qt::Checked) + c->changeType(qglviewer::Camera::ORTHOGRAPHIC); + else + c->changeType(qglviewer::Camera::PERSPECTIVE); + break; + case 2 : + if(item->checkState(2) == Qt::Checked) + c->setDraw(true); + else + c->setDraw(false); + break; + case 3 : + if(item->checkState(3) == Qt::Checked) + c->setDrawPath(true); + else + c->setDrawPath(false); + break; } } } diff --git a/SCHNApps/src/dialogs/mapsDialog.cpp b/SCHNApps/src/dialogs/mapsDialog.cpp index a4427ce165d322c35403413642b77d3849f04939..bc9a35a13e7c57b528c1a8dd3f81f09d4add7612 100644 --- a/SCHNApps/src/dialogs/mapsDialog.cpp +++ b/SCHNApps/src/dialogs/mapsDialog.cpp @@ -146,14 +146,9 @@ void MapsDialog::cb_addMapToList(MapHandlerGen* m) void MapsDialog::cb_removeMapFromList(MapHandlerGen* m) { - for(int i = 0; i < mapList->count(); ++i) - { - if(mapList->item(i)->text() == m->getName()) - { - delete mapList->item(i); - return; - } - } + QList items = mapList->findItems(m->getName(), Qt::MatchExactly); + if(!items.empty()) + delete items[0]; } } // namespace SCHNApps diff --git a/SCHNApps/src/view.cpp b/SCHNApps/src/view.cpp index 65135c20d87223a102b3a6bfa0dc08beb0d2329e..65fecbf0b8e20fce722afc310a860863bbd5379e 100644 --- a/SCHNApps/src/view.cpp +++ b/SCHNApps/src/view.cpp @@ -118,6 +118,16 @@ void View::preDraw() void View::draw() { + QList cameras = m_window->getCamerasList(); + foreach(Camera* camera, cameras) + { + if(camera != m_currentCamera) + { + if(camera->getDraw()) camera->draw(); + if(camera->getDrawPath()) camera->drawAllPaths(); + } + } + foreach(Plugin* plugin, l_plugins) plugin->redraw(this); } @@ -204,6 +214,13 @@ void View::mouseMoveEvent(QMouseEvent* event) foreach(Plugin* plugin, l_plugins) plugin->mouseMove(this, event->button(), event->pos().x(), event->pos().y()); QGLViewer::mouseMoveEvent(event); + + QList views = m_window->getViewsList(); + foreach(View* view, views) + { + if(view != this) + view->updateGL(); + } } void View::wheelEvent(QWheelEvent* event) @@ -211,6 +228,13 @@ void View::wheelEvent(QWheelEvent* event) foreach(Plugin* plugin, l_plugins) plugin->wheelEvent(this, event->delta(), event->pos().x(), event->pos().y()); QGLViewer::wheelEvent(event); + + QList views = m_window->getViewsList(); + foreach(View* view, views) + { + if(view != this) + view->updateGL(); + } } /********************************************************* diff --git a/SCHNApps/src/window.cpp b/SCHNApps/src/window.cpp index 29c9a1d475e2cc341878fb735dc896d2cdd2942e..a3721469212cc2b3bb45c09b25bf0c13f8c63865 100644 --- a/SCHNApps/src/window.cpp +++ b/SCHNApps/src/window.cpp @@ -42,23 +42,25 @@ Window::Window(const QString& appPath, PythonQtObjectPtr& pythonContext, PythonQ this->setupUi(this); - m_dock = new QDockWidget(tr("Plugins' Tabs"), this); + m_dock = new QDockWidget(tr("Plugins"), this); m_dock->setAllowedAreas(Qt::RightDockWidgetArea); m_dock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); - addDockWidget(Qt::RightDockWidgetArea, m_dock); - m_dock->setVisible(false); m_dockTabWidget = new QTabWidget(m_dock); m_dockTabWidget->setObjectName("DockTabWidget"); m_dockTabWidget->setLayoutDirection(Qt::LeftToRight); m_dockTabWidget->setTabPosition(QTabWidget::East); + + addDockWidget(Qt::RightDockWidgetArea, m_dock); + m_dock->setVisible(false); m_dock->setWidget(m_dockTabWidget); connect(actionShowHideDock, SIGNAL(triggered()), this, SLOT(cb_showHideDock())); m_pythonDock = new QDockWidget(tr("Python"), this); m_pythonDock->setAllowedAreas(Qt::BottomDockWidgetArea); - m_dock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); + m_pythonDock->setFeatures(QDockWidget::DockWidgetFloatable | QDockWidget::DockWidgetClosable); + addDockWidget(Qt::BottomDockWidgetArea, m_pythonDock); m_pythonDock->setVisible(false); m_pythonDock->setWidget(&m_pythonConsole); @@ -82,9 +84,9 @@ Window::Window(const QString& appPath, PythonQtObjectPtr& pythonContext, PythonQ connect(actionAboutSCHNApps, SIGNAL(triggered()), this, SLOT(cb_aboutSCHNApps())); connect(actionAboutCGoGN, SIGNAL(triggered()), this, SLOT(cb_aboutCGoGN())); - connect(actionManageCameras, SIGNAL(triggered()), this, SLOT(cb_manageCameras())); - connect(actionManagePlugins, SIGNAL(triggered()), this, SLOT(cb_managePlugins())); - connect(actionManageMaps, SIGNAL(triggered()), this, SLOT(cb_manageMaps())); + connect(actionManageCameras, SIGNAL(triggered()), this, SLOT(cb_showCamerasDialog())); + connect(actionManagePlugins, SIGNAL(triggered()), this, SLOT(cb_showPluginsDialog())); + connect(actionManageMaps, SIGNAL(triggered()), this, SLOT(cb_showMapsDialog())); registerPluginsDirectory(m_appPath + QString("/../lib")); } @@ -743,17 +745,17 @@ void Window::cb_showHidePythonDock() m_pythonDock->setVisible(m_pythonDock->isHidden()); } -void Window::cb_manageCameras() +void Window::cb_showCamerasDialog() { m_camerasDialog->show(); } -void Window::cb_managePlugins() +void Window::cb_showPluginsDialog() { m_pluginsDialog->show(); } -void Window::cb_manageMaps() +void Window::cb_showMapsDialog() { m_mapsDialog->show(); }