X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvToolCreatorBase.cxx;h=075e3352913d6ed59123d7aa866e21cd35b0e5a1;hb=30133023f12212c84e7b4e9318f1055ec3176af1;hp=3b0610c79d7e25ca5bfcddc9fcabdc7a7725ed01;hpb=1e034c70105f0926939acaaa27ddb46e904ae8bf;p=clitk.git diff --git a/vv/vvToolCreatorBase.cxx b/vv/vvToolCreatorBase.cxx index 3b0610c..075e335 100644 --- a/vv/vvToolCreatorBase.cxx +++ b/vv/vvToolCreatorBase.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #include "vvToolCreatorBase.h" #include "vvToolManager.h" @@ -22,10 +22,13 @@ #include //------------------------------------------------------------------------------ -vvToolCreatorBase::vvToolCreatorBase(QString name): mExperimental(false) +vvToolCreatorBase::vvToolCreatorBase(QString name): mAction(NULL), mExperimental(false) { mUseContextMenu = false; mToolName = name; + m_MenuName = "Tools"; + mReadStateFlag = false; + mImageIndex = 0; vvToolManager::GetInstance()->AddTool(this); } //------------------------------------------------------------------------------ @@ -50,16 +53,20 @@ void vvToolCreatorBase::InsertToolInMenu(vvMainWindowBase * m) // Create main action if (mToolIconFilename == "noicon") mAction = new QAction(QString("&").append(mToolMenuName), this); - else + else { mAction = new QAction(QIcon(mToolIconFilename), QString("&").append(mToolMenuName), this); + mAction->setIconVisibleInMenu(true); + } + mAction->setStatusTip(mToolTip); // Connect the action connect(mAction, SIGNAL(triggered()), this, SLOT(MenuToolSlot())); if (mExperimental) mMainWindow->GetExperimentalToolMenu()->addAction(mAction); - else - mMainWindow->GetToolMenu()->addAction(mAction); + else { + mMainWindow->GetMenu(m_MenuName)->addAction(mAction); + } } //------------------------------------------------------------------------------