tools are enabled when a ImageInfosChanged is triggered.
// Adding all new tools (insertion in the menu)
vvToolManager::GetInstance()->InsertToolsInMenu(this);
+ vvToolManager::GetInstance()->EnableToolsInMenu(this, false);
if (!CLITK_EXPERIMENTAL)
menuExperimental->menuAction()->setVisible(false);
timerMemory->start(2000);
}
//------------------------------------------------------------------------------
-
void vvMainWindow::show(){
vvMainWindowBase::show();
PopupRegisterForm(true);
actionNorth_West_Window->setEnabled(1);
actionSouth_East_Window->setEnabled(1);
actionSouth_West_Window->setEnabled(1);
+ vvToolManager::GetInstance()->EnableToolsInMenu(this, true);
inverseButton->setEnabled(1);
goToCursorPushButton->setEnabled(1);
#include "vvToolManager.h"
#include "vvToolCreatorBase.h"
#include "vvMainWindowBase.h"
-
+#include <QAction>
//------------------------------------------------------------------------------
/// Unique static instance
vvToolManager* vvToolManager::mSingleton=0;
}
//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+void vvToolManager::EnableToolsInMenu(vvMainWindowBase * m, bool enable){
+ std::vector<vvToolCreatorBase *>::iterator it;
+ for(it=GetInstance()->mListOfTools.begin(); it!=GetInstance()->mListOfTools.end(); ++it){
+ if((*it)->mAction){
+ (*it)->mAction->setEnabled(enable);
+ }
+ }
+}
/// Called in MainWindow, insert all tools into the menu
static void InsertToolsInMenu(vvMainWindowBase * m);
+ /// Called in MainWindow, make the tools enabled/disabled
+ static void EnableToolsInMenu(vvMainWindowBase * m, bool enable);
+
protected:
/// Singleton object pointer