From e9d128ac8da88b43fb86f8cfff490b46800ca2f6 Mon Sep 17 00:00:00 2001 From: schaerer Date: Wed, 24 Mar 2010 13:37:34 +0000 Subject: [PATCH] put experimental tools in the experimental menu --- vv/vvMainWindow.cxx | 5 +++-- vv/vvMainWindowBase.h | 4 +++- vv/vvToolBase.h | 5 +++-- vv/vvToolCreatorBase.cxx | 11 +++++++---- vv/vvToolCreatorBase.h | 5 +++-- vv/vvToolImageArithm.cxx | 5 +++-- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 36b7db0..722c923 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvMainWindow.cxx,v $ Language: C++ - Date: $Date: 2010/03/24 10:48:18 $ - Version: $Revision: 1.17 $ + Date: $Date: 2010/03/24 13:37:34 $ + Version: $Revision: 1.18 $ Author : Pierre Seroul (pierre.seroul@gmail.com) Copyright (C) 200COLUMN_IMAGE_NAME @@ -112,6 +112,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() { mInputPathName = ""; mMenuTools = menuTools; + mMenuExperimentalTools = menuExperimental; mMainWidget = this; //Init the contextMenu diff --git a/vv/vvMainWindowBase.h b/vv/vvMainWindowBase.h index 1c10d5e..f1a24e9 100644 --- a/vv/vvMainWindowBase.h +++ b/vv/vvMainWindowBase.h @@ -45,7 +45,8 @@ public: virtual void AddImage(vvImage::Pointer image,std::string filename) = 0; virtual void UpdateCurrentSlicer() = 0; const std::vector & GetSlicerManagers() const { return mSlicerManagers; } - QMenu * GetMenu() const { return mMenuTools; } + QMenu * GetToolMenu() const { return mMenuTools; } + QMenu * GetExperimentalToolMenu() const { return mMenuExperimentalTools; } int GetSlicerManagerCurrentIndex() const { return mSlicerManagerCurrentIndex; } QWidget * GetMainWidget() { return mMainWidget; } @@ -55,6 +56,7 @@ signals: protected: std::vector mSlicerManagers; QMenu * mMenuTools; + QMenu * mMenuExperimentalTools; int mSlicerManagerCurrentIndex; QWidget* mMainWidget; }; diff --git a/vv/vvToolBase.h b/vv/vvToolBase.h index e86b040..4599cef 100644 --- a/vv/vvToolBase.h +++ b/vv/vvToolBase.h @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvToolBase.h,v $ Language: C++ - Date: $Date: 2010/03/01 07:37:25 $ - Version: $Revision: 1.4 $ + Date: $Date: 2010/03/24 13:37:34 $ + Version: $Revision: 1.5 $ Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr) Copyright (C) 2008 @@ -42,6 +42,7 @@ public: static void SetToolMenuName(QString n) { vvToolCreator::mSingleton->mToolMenuName = n; } static void SetToolIconFilename(QString n) { vvToolCreator::mSingleton->mToolIconFilename = n; } static void SetToolTip(QString n) { vvToolCreator::mSingleton->mToolTip = n; } + static void SetToolExperimental(bool exp) { vvToolCreator::mSingleton->mExperimental = exp; } void AddImage(vvImage::Pointer image,std::string filename) { CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename); diff --git a/vv/vvToolCreatorBase.cxx b/vv/vvToolCreatorBase.cxx index 57a1d9f..b2b834c 100644 --- a/vv/vvToolCreatorBase.cxx +++ b/vv/vvToolCreatorBase.cxx @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvToolCreatorBase.cxx,v $ Language: C++ - Date: $Date: 2010/02/24 11:42:42 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/03/24 13:37:34 $ + Version: $Revision: 1.3 $ Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr) Copyright (C) 2008 @@ -31,7 +31,7 @@ #include //------------------------------------------------------------------------------ -vvToolCreatorBase::vvToolCreatorBase(QString name) { +vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false) { mToolName = name; vvToolManager::GetInstance()->AddTool(this); } @@ -50,7 +50,10 @@ void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m) { mAction->setStatusTip(mToolTip); // Connect the action connect(mAction, SIGNAL(triggered()), this, SLOT(MenuToolSlot())); - mMainWindow->GetMenu()->addAction(mAction); + if (mExperimental) + mMainWindow->GetExperimentalToolMenu()->addAction(mAction); + else + mMainWindow->GetToolMenu()->addAction(mAction); } //------------------------------------------------------------------------------ diff --git a/vv/vvToolCreatorBase.h b/vv/vvToolCreatorBase.h index 2143239..24d0e45 100644 --- a/vv/vvToolCreatorBase.h +++ b/vv/vvToolCreatorBase.h @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvToolCreatorBase.h,v $ Language: C++ - Date: $Date: 2010/02/24 11:42:42 $ - Version: $Revision: 1.2 $ + Date: $Date: 2010/03/24 13:37:34 $ + Version: $Revision: 1.3 $ Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr) Copyright (C) 2008 @@ -52,6 +52,7 @@ class vvToolCreatorBase: public QObject { QString mToolIconFilename; QString mToolTip; QAction * mAction; + bool mExperimental; public slots: virtual void MenuToolSlot() { MenuSpecificToolSlot(); } diff --git a/vv/vvToolImageArithm.cxx b/vv/vvToolImageArithm.cxx index 1079730..8a508e4 100644 --- a/vv/vvToolImageArithm.cxx +++ b/vv/vvToolImageArithm.cxx @@ -3,8 +3,8 @@ Program: vv Module: $RCSfile: vvToolImageArithm.cxx,v $ Language: C++ - Date: $Date: 2010/03/24 13:02:59 $ - Version: $Revision: 1.1 $ + Date: $Date: 2010/03/24 13:37:34 $ + Version: $Revision: 1.2 $ Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr) Copyright (C) 2010 @@ -66,6 +66,7 @@ void vvToolImageArithm::Initialize() { SetToolMenuName("ImageArithm"); SetToolIconFilename(":/new/prefix1/icons/cross.png"); SetToolTip("Perform simple arithmetic operations on one or two images."); + SetToolExperimental(true); } //------------------------------------------------------------------------------ -- 2.47.1