diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h
index e89610badd..e51cbc1f1f 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/berryIPerspectiveDescriptor.h
@@ -1,113 +1,120 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYIPERSPECTIVEDESCRIPTOR_H_
#define BERRYIPERSPECTIVEDESCRIPTOR_H_
#include
#include
#include
#include "berryImageDescriptor.h"
namespace berry {
/**
* \ingroup org_blueberry_ui
*
* A perspective descriptor describes a perspective in an
* IPerspectiveRegistry
.
*
* A perspective is a template for view visibility, layout, and action visibility
* within a workbench page. There are two types of perspective: a predefined
* perspective and a custom perspective.
*
* - A predefined perspective is defined by an extension to the workbench's
* perspective extension point (
"org.blueberry.ui.perspectives"
).
* The extension defines a id, label, and IPerspectiveFactory
.
* A perspective factory is used to define the initial layout for a page.
*
* - A custom perspective is defined by the user. In this case a predefined
* perspective is modified to suit a particular task and saved as a new
* perspective. The attributes for the perspective are stored in a separate file
* in the workbench's metadata directory.
*
*
*
*
* Within a page the user can open any of the perspectives known
* to the workbench's perspective registry, typically by selecting one from the
* workbench's Open Perspective
menu. When selected, the views
* and actions within the active page rearrange to reflect the perspective.
*
*
* This interface is not intended to be implemented by clients.
*
* @see IPerspectiveRegistry
* @noimplement This interface is not intended to be implemented by clients.
*/
struct BERRY_UI IPerspectiveDescriptor : public Object {
- berryInterfaceMacro(IPerspectiveDescriptor, berry);
+ berryInterfaceMacro(IPerspectiveDescriptor, berry);
- virtual ~IPerspectiveDescriptor();
+ virtual ~IPerspectiveDescriptor();
/**
* Returns the description of this perspective.
* This is the value of its "description"
attribute.
*
* @return the description
* @since 3.0
*/
virtual std::string GetDescription() const = 0;
/**
* Returns this perspective's id. For perspectives declared via an extension,
* this is the value of its "id"
attribute.
*
* @return the perspective id
*/
virtual std::string GetId() const = 0;
/**
* Returns the descriptor of the image to show for this perspective.
* If the extension for this perspective specifies an image, the descriptor
* for it is returned. Otherwise a default image is returned.
*
* @return the descriptor of the image to show for this perspective
*/
virtual ImageDescriptor::Pointer GetImageDescriptor() const = 0;
/**
* Returns this perspective's label. For perspectives declared via an extension,
* this is the value of its "label"
attribute.
*
* @return the label
*/
virtual std::string GetLabel() const = 0;
/**
* Returns true
if this perspective is predefined by an
* extension.
*
* @return boolean whether this perspective is predefined by an extension
*/
virtual bool IsPredefined() const = 0;
+ /**
+ * Return the category path of this descriptor
+ *
+ * @return the category path of this descriptor
+ */
+ virtual std::vector GetCategoryPath() = 0;
+
virtual std::vector< std::string> GetKeywordReferences() const = 0;
};
}
#endif /*BERRYIPERSPECTIVEDESCRIPTOR_H_*/
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.cpp b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.cpp
index 1b4cf54743..9c8e99e01e 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.cpp
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.cpp
@@ -1,324 +1,341 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "berryPerspectiveDescriptor.h"
#include "berryWorkbenchRegistryConstants.h"
#include "berryWorkbenchPlugin.h"
#include "berryWorkbenchConstants.h"
#include "berryPerspectiveRegistry.h"
namespace berry
{
PerspectiveDescriptor::PerspectiveDescriptor(const std::string& id,
const std::string& label, PerspectiveDescriptor::Pointer originalDescriptor)
: singleton(false), fixed(false)
{
this->id = id;
this->label = label;
if (originalDescriptor != 0)
{
this->originalId = originalDescriptor->GetOriginalId();
this->imageDescriptor = originalDescriptor->imageDescriptor;
// This perspective is based on a perspective in some bundle -- if
// that
// bundle goes away then I think it makes sense to treat this
// perspective
// the same as any other -- so store it with the original
// descriptor's
// bundle's list.
//
// It might also make sense the other way...removing the following
// line
// will allow the perspective to stay around when the originating
// bundle
// is unloaded.
//
// This might also have an impact on upgrade cases -- should we
// really be
// destroying all user customized perspectives when the older
// version is
// removed?
//
// I'm leaving this here for now since its a good example, but
// wouldn't be
// surprised if we ultimately decide on the opposite.
//
// The reason this line is important is that this is the value used
// to
// put the object into the UI level registry. When that bundle goes
// away,
// the registry will remove the entire list of objects. So if this
// desc
// has been put into that list -- it will go away.
this->pluginId = originalDescriptor->GetPluginId();
}
}
PerspectiveDescriptor::PerspectiveDescriptor(const std::string& id,
IConfigurationElement::Pointer configElement)
: singleton(false), fixed(false)
{
this->configElement = configElement;
this->id = id;
// Sanity check.
if ((this->GetId() == "") || (this->GetLabel() == "")
|| (this->GetFactoryClassName() == ""))
{
throw CoreException("Invalid extension (missing label, id or class name): "
+ this->GetId());
}
}
IPerspectiveFactory::Pointer PerspectiveDescriptor::CreateFactory()
{
// if there is an originalId, then use that descriptor instead
if (originalId != "")
{
// Get the original descriptor to create the factory. If the
// original is gone then nothing can be done.
IPerspectiveDescriptor::Pointer
target =
dynamic_cast (WorkbenchPlugin::GetDefault()->GetPerspectiveRegistry()) ->FindPerspectiveWithId(
originalId);
return target == 0 ? IPerspectiveFactory::Pointer(0) : target.Cast<
PerspectiveDescriptor> ()->CreateFactory();
}
// otherwise try to create the executable extension
if (configElement != 0)
{
try
{
IPerspectiveFactory::Pointer factory(
configElement ->CreateExecutableExtension (
WorkbenchRegistryConstants::ATT_CLASS));
if (factory.IsNull())
{
// support legacy BlueBerry extensions
factory = configElement ->CreateExecutableExtension (
WorkbenchRegistryConstants::ATT_CLASS, IPerspectiveFactory::GetManifestName());
}
return factory;
} catch (CoreException& /*e*/)
{
// do nothing
}
}
return IPerspectiveFactory::Pointer(0);
}
void PerspectiveDescriptor::DeleteCustomDefinition()
{
dynamic_cast (WorkbenchPlugin::GetDefault() ->GetPerspectiveRegistry())->DeleteCustomDefinition(
PerspectiveDescriptor::Pointer(this));
}
std::string PerspectiveDescriptor::GetDescription() const
{
return configElement == 0 ? description : RegistryReader::GetDescription(
configElement);
}
bool PerspectiveDescriptor::GetFixed() const
{
if (configElement == 0)
return fixed;
bool val = false;
configElement->GetBoolAttribute(WorkbenchRegistryConstants::ATT_FIXED, val);
return val;
}
std::vector< std::string> PerspectiveDescriptor::GetKeywordReferences() const
{
std::vector result;
if (configElement.IsNull())
{
return result;
}
std::string keywordRefId;
std::vector keywordRefs;
berry::IConfigurationElement::vector::iterator keywordRefsIt;
keywordRefs = configElement->GetChildren("keywordReference");
for (keywordRefsIt = keywordRefs.begin()
; keywordRefsIt != keywordRefs.end(); ++keywordRefsIt) // iterate over all refs
{
(*keywordRefsIt)->GetAttribute("id", keywordRefId);
result.push_back(keywordRefId);
}
return result;
}
std::string PerspectiveDescriptor::GetId() const
{
return id;
}
std::string PerspectiveDescriptor::GetPluginId() const
{
return configElement == 0 ? pluginId : configElement->GetContributor();
}
ImageDescriptor::Pointer PerspectiveDescriptor::GetImageDescriptor() const
{
if (imageDescriptor)
return imageDescriptor;
if (configElement)
{
std::string icon;
configElement->GetAttribute(WorkbenchRegistryConstants::ATT_ICON, icon);
if (!icon.empty())
{
imageDescriptor = AbstractUICTKPlugin::ImageDescriptorFromPlugin(
configElement->GetContributor(), icon);
}
}
if (!imageDescriptor)
{
imageDescriptor = ImageDescriptor::GetMissingImageDescriptor();
}
return imageDescriptor;
}
+std::vector PerspectiveDescriptor::GetCategoryPath()
+{
+ std::string category;
+ categoryPath.clear();
+
+ if (configElement.IsNotNull() && configElement->GetAttribute(WorkbenchRegistryConstants::TAG_CATEGORY, category))
+ {
+ Poco::StringTokenizer stok(category, "/", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM);
+ // Parse the path tokens and store them
+ for (Poco::StringTokenizer::Iterator iter = stok.begin(); iter != stok.end(); ++iter)
+ {
+ categoryPath.push_back(*iter);
+ }
+ }
+ return categoryPath;
+}
+
std::string PerspectiveDescriptor::GetLabel() const
{
if (configElement == 0)
return label;
std::string val;
configElement->GetAttribute(WorkbenchRegistryConstants::ATT_NAME, val);
return val;
}
std::string PerspectiveDescriptor::GetOriginalId() const
{
if (originalId == "")
{
return this->GetId();
}
return originalId;
}
bool PerspectiveDescriptor::HasCustomDefinition() const
{
return dynamic_cast (WorkbenchPlugin::GetDefault()->GetPerspectiveRegistry())->HasCustomDefinition(
PerspectiveDescriptor::ConstPointer(this));
}
bool PerspectiveDescriptor::HasDefaultFlag() const
{
if (configElement == 0)
{
return false;
}
bool val = false;
configElement->GetBoolAttribute(WorkbenchRegistryConstants::ATT_DEFAULT, val);
return val;
}
bool PerspectiveDescriptor::IsPredefined() const
{
return this->GetFactoryClassName() != "" && configElement != 0;
}
bool PerspectiveDescriptor::IsSingleton() const
{
if (configElement == 0)
return singleton;
bool val = false;
configElement->GetBoolAttribute(WorkbenchRegistryConstants::ATT_SINGLETON,
val);
return val;
}
bool PerspectiveDescriptor::RestoreState(IMemento::Pointer memento)
{
IMemento::Pointer childMem(memento->GetChild(
WorkbenchConstants::TAG_DESCRIPTOR));
if (childMem)
{
childMem->GetString(WorkbenchConstants::TAG_ID, id);
childMem->GetString(WorkbenchConstants::TAG_DESCRIPTOR, originalId);
childMem->GetString(WorkbenchConstants::TAG_LABEL, label);
childMem->GetString(WorkbenchConstants::TAG_CLASS, className);
int singletonVal;
singleton = childMem->GetInteger(WorkbenchConstants::TAG_SINGLETON,
singletonVal);
// Find a descriptor in the registry.
IPerspectiveDescriptor::Pointer
descriptor =
WorkbenchPlugin::GetDefault() ->GetPerspectiveRegistry()->FindPerspectiveWithId(
this->GetOriginalId());
if (descriptor)
{
// Copy the state from the registred descriptor.
imageDescriptor = descriptor->GetImageDescriptor();
}
}
//return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null); //$NON-NLS-1$
return true;
}
void PerspectiveDescriptor::RevertToPredefined()
{
if (this->IsPredefined())
{
this->DeleteCustomDefinition();
}
}
bool PerspectiveDescriptor::SaveState(IMemento::Pointer memento)
{
IMemento::Pointer childMem(memento->CreateChild(
WorkbenchConstants::TAG_DESCRIPTOR));
childMem->PutString(WorkbenchConstants::TAG_ID, GetId());
if (!originalId.empty())
{
childMem->PutString(WorkbenchConstants::TAG_DESCRIPTOR, originalId);
}
childMem->PutString(WorkbenchConstants::TAG_LABEL, GetLabel());
childMem->PutString(WorkbenchConstants::TAG_CLASS, GetFactoryClassName());
if (singleton)
{
childMem->PutInteger(WorkbenchConstants::TAG_SINGLETON, 1);
}
//return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, 0, "", null);
return true;
}
IConfigurationElement::Pointer PerspectiveDescriptor::GetConfigElement() const
{
return configElement;
}
std::string PerspectiveDescriptor::GetFactoryClassName() const
{
return configElement == 0 ? className : RegistryReader::GetClassValue(
configElement, WorkbenchRegistryConstants::ATT_CLASS);
}
-}
\ No newline at end of file
+}
diff --git a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.h b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.h
index b5151f633c..e8956d298d 100644
--- a/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.h
+++ b/BlueBerry/Bundles/org.blueberry.ui/src/internal/berryPerspectiveDescriptor.h
@@ -1,231 +1,240 @@
/*===================================================================
BlueBerry Platform
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef BERRYPERSPECTIVEDESCRIPTOR_H_
#define BERRYPERSPECTIVEDESCRIPTOR_H_
#include
#include "berryIPerspectiveDescriptor.h"
#include "berryIPerspectiveFactory.h"
#include "berryIMemento.h"
#include
namespace berry {
/**
* \ingroup org_blueberry_ui_internal
*
* PerspectiveDescriptor.
*
* A PerspectiveDesciptor has 3 states:
*
*
* - It
isPredefined()
, in which case it was defined from an
* extension point.
* - It
isPredefined()
and hasCustomFile
, in
* which case the user has customized a predefined perspective.
* - It
hasCustomFile
, in which case the user created a new
* perspective.
*
*
*/
class PerspectiveDescriptor : public IPerspectiveDescriptor {
public:
berryObjectMacro(PerspectiveDescriptor);
private:
std::string id;
std::string pluginId;
std::string originalId;
std::string label;
std::string className;
std::string description;
bool singleton;
bool fixed;
mutable ImageDescriptor::Pointer imageDescriptor;
IConfigurationElement::Pointer configElement;
+ std::vector categoryPath;
+
/**
* Create a new empty descriptor.
*
* @param id
* the id of the new descriptor
* @param label
* the label of the new descriptor
* @param originalDescriptor
* the descriptor that this descriptor is based on
*/
public: PerspectiveDescriptor(const std::string& id, const std::string& label,
PerspectiveDescriptor::Pointer originalDescriptor);
/**
* Create a descriptor from a config element.
*
* @param id
* the id of the element to create
* @param configElement
* the element to base this perspective on
* @throws CoreException
* thrown if there are any missing attributes
*/
public: PerspectiveDescriptor(const std::string& id, IConfigurationElement::Pointer configElement);
/**
* Creates a factory for a predefined perspective. If the perspective is not
* predefined return null
.
*
* @return the IPerspectiveFactory or null
* @throws CoreException
* if the object could not be instantiated.
*/
public: IPerspectiveFactory::Pointer CreateFactory();
/**
* Deletes the custom definition for a perspective..
*/
public: void DeleteCustomDefinition();
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IPerspectiveDescriptor#getDescription()
*/
public: std::string GetDescription() const;
public: void SetDescription(std::string desc) {description = desc; }
std::vector< std::string> GetKeywordReferences() const;
/**
* Returns whether or not this perspective is fixed.
*
* @return whether or not this perspective is fixed
*/
public: bool GetFixed() const;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IPerspectiveDescriptor#getId()
*/
public: std::string GetId() const;
public: std::string GetPluginId() const;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IPerspectiveDescriptor#getImageDescriptor()
*/
public: ImageDescriptor::Pointer GetImageDescriptor() const;
/*
* (non-Javadoc)
*
* @see org.blueberry.ui.IPerspectiveDescriptor#getLabel()
*/
public: std::string GetLabel() const;
/**
* Return the original id of this descriptor.
*
* @return the original id of this descriptor
*/
public: std::string GetOriginalId() const;
/**
* Returns true
if this perspective has a custom definition.
*
* @return whether this perspective has a custom definition
*/
public: bool HasCustomDefinition() const;
/**
* Returns true
if this perspective wants to be default.
*
* @return whether this perspective wants to be default
*/
public: bool HasDefaultFlag() const;
/**
* Returns true
if this perspective is predefined by an
* extension.
*
* @return boolean whether this perspective is predefined by an extension
*/
public: bool IsPredefined() const;
/**
* Returns true
if this perspective is a singleton.
*
* @return whether this perspective is a singleton
*/
public: bool IsSingleton() const;
/**
* Restore the state of a perspective from a memento.
*
* @param memento
* the memento to restore from
* @return the IStatus
of the operation
* @see org.blueberry.ui.IPersistableElement
*/
public: bool RestoreState(IMemento::Pointer memento);
/**
* Revert to the predefined extension template. Does nothing if this
* descriptor is user defined.
*/
public: void RevertToPredefined();
/**
* Save the state of a perspective to a memento.
*
* @param memento
* the memento to restore from
* @return the IStatus
of the operation
* @see org.blueberry.ui.IPersistableElement
*/
public: bool SaveState(IMemento::Pointer memento);
/**
* Return the configuration element used to create this perspective, if one
* was used.
*
* @return the configuration element used to create this perspective
* @since 3.0
*/
public: IConfigurationElement::Pointer GetConfigElement() const;
/**
* Returns the factory class name for this descriptor.
*
* @return the factory class name for this descriptor
* @since 3.1
*/
public: std::string GetFactoryClassName() const;
+
+ /**
+ * Return the category path of this descriptor
+ *
+ * @return the category path of this descriptor
+ */
+ public: std::vector GetCategoryPath();
};
}
#endif /*BERRYPERSPECTIVEDESCRIPTOR_H_*/
diff --git a/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml b/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml
index 7bf77e73d4..b62e7906c4 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.diffusionimaging/plugin.xml
@@ -1,207 +1,188 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ class="QmitkQBallReconstructionView">
+ Q-Ball reconstruction view
+
+
-
-
+ icon="resources/dwiimport.png">
+ Diffusion DICOM data import
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is a short information about this perspective
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ This is a short information about this perspective
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake b/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake
index 05beffb8a1..290dbb4f1f 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/files.cmake
@@ -1,95 +1,103 @@
set(SRC_CPP_FILES
QmitkDiffusionImagingAppApplication.cpp
QmitkDiffusionImagingAppWorkbenchAdvisor.cpp
)
set(INTERNAL_CPP_FILES
QmitkDiffusionApplicationPlugin.cpp
QmitkDiffusionImagingAppIntroPart.cpp
Perspectives/QmitkDiffusionImagingAppPerspective.cpp
Perspectives/QmitkWelcomePerspective.cpp
Perspectives/QmitkDIAppConnectomicsPerspective.cpp
Perspectives/QmitkDIAppDicomImportPerspective.cpp
- Perspectives/QmitkDIAppFiberTractographyPerspective.cpp
Perspectives/QmitkDIAppIVIMPerspective.cpp
Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp
Perspectives/QmitkDIAppQuantificationPerspective.cpp
Perspectives/QmitkDIAppTBSSPerspective.cpp
Perspectives/QmitkDIAppUtilityPerspective.cpp
Perspectives/QmitkDIAppImageProcessingPerspective.cpp
Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp
Perspectives/QmitkDIAppRegistrationPerspective.cpp
Perspectives/QmitkDIAppVisualizationPerspective.cpp
+
+# new perspectives
+ Perspectives/QmitkGibbsTractographyPerspective.cpp
+ Perspectives/QmitkStreamlineTractographyPerspective.cpp
+ Perspectives/QmitkProbabilisticTractographyPerspective.cpp
)
set(UI_FILES
src/internal/QmitkWelcomeScreenViewControls.ui
)
set(MOC_H_FILES
src/internal/QmitkDiffusionImagingAppIntroPart.h
src/internal/QmitkDiffusionApplicationPlugin.h
src/QmitkDiffusionImagingAppApplication.h
src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h
src/internal/Perspectives/QmitkWelcomePerspective.h
src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h
src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h
- src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
src/internal/Perspectives/QmitkDIAppIVIMPerspective.h
src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h
src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h
src/internal/Perspectives/QmitkDIAppTBSSPerspective.h
src/internal/Perspectives/QmitkDIAppUtilityPerspective.h
src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h
src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h
src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h
src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h
+
+# new perspectives
+ src/internal/Perspectives/QmitkGibbsTractographyPerspective.h
+ src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h
+ src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h
)
set(CACHED_RESOURCE_FILES
# list of resource files which can be used by the plug-in
# system without loading the plug-ins shared library,
# for example the icon used in the menu and tabs for the
# plug-in views in the workbench
plugin.xml
resources/icon_dicom.xpm
resources/diffusionimaging.png
resources/preprocessing.png
resources/Measurement_48.png
resources/volvis.png
resources/perspectives/diffusionimaging.png
resources/perspectives/icon_home.png
resources/perspectives/connectomics.png
resources/perspectives/dicomimport.png
resources/perspectives/tractography.png
resources/perspectives/ivim.png
resources/perspectives/preprocessingreconstruction.png
resources/perspectives/quantification.png
resources/perspectives/tbss.png
resources/perspectives/utilities.png
resources/perspectives/imageProcessing.png
resources/perspectives/registration.png
resources/perspectives/phantomData2.png
resources/perspectives/eye.png
resources/perspectives/registration.xpm
resources/perspectives/chart.png
resources/perspectives/preprocessing.png
resources/perspectives/syntheticdata.png
)
set(QRC_FILES
# uncomment the following line if you want to use Qt resources
resources/welcome/QmitkWelcomeScreenView.qrc
resources/org_mitk_gui_qt_diffusionimagingapp.qrc
)
# set(CPP_FILES)
foreach(file ${SRC_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml b/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml
index 61d7c39bad..4c3a284b86 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/plugin.xml
@@ -1,93 +1,109 @@
-
+ icon="resources/perspectives/preprocessing.png">
+ Preprocessing of raw diffusion data and diffusion propagator modeling
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp
index a2d1bdf0ca..75e13e53c0 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/QmitkDiffusionImagingAppWorkbenchAdvisor.cpp
@@ -1,85 +1,86 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDiffusionImagingAppWorkbenchAdvisor.h"
#include "internal/QmitkDiffusionApplicationPlugin.h"
#include
#include
#include
#include
#include
#include
const std::string QmitkDiffusionImagingAppWorkbenchAdvisor::WELCOME_PERSPECTIVE_ID = "org.mitk.diffusionimagingapp.perspectives.welcome";
void
QmitkDiffusionImagingAppWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer)
{
berry::QtWorkbenchAdvisor::Initialize(configurer);
configurer->SetSaveAndRestore(true);
}
berry::WorkbenchWindowAdvisor*
QmitkDiffusionImagingAppWorkbenchAdvisor::CreateWorkbenchWindowAdvisor(
berry::IWorkbenchWindowConfigurer::Pointer configurer)
{
std::vector perspExcludeList;
perspExcludeList.push_back( std::string("org.blueberry.uitest.util.EmptyPerspective") );
perspExcludeList.push_back( std::string("org.blueberry.uitest.util.EmptyPerspective2") );
perspExcludeList.push_back( std::string("org.mitk.coreapp.defaultperspective") );
perspExcludeList.push_back( std::string("org.mitk.extapp.defaultperspective") );
perspExcludeList.push_back( std::string("org.mitk.perspectives.publicdiffusionimaging") );
perspExcludeList.push_back( std::string("org.mitk.perspectives.diffusionimaginginternal") );
// Exclude the help perspective from org.blueberry.ui.qt.help from
// the normal perspective list.
// The perspective gets a dedicated menu entry in the help menu
perspExcludeList.push_back("org.blueberry.perspectives.help");
std::vector viewExcludeList;
viewExcludeList.push_back( std::string("org.mitk.views.controlvisualizationpropertiesview") );
viewExcludeList.push_back( std::string("org.mitk.views.imagenavigator") );
viewExcludeList.push_back( std::string("org.mitk.views.datamanager") );
viewExcludeList.push_back( std::string("org.mitk.views.modules") );
viewExcludeList.push_back( std::string("org.blueberry.ui.internal.introview") );
configurer->SetInitialSize(berry::Point(1000,770));
QmitkExtWorkbenchWindowAdvisor* advisor = new QmitkExtWorkbenchWindowAdvisor(this, configurer);
- advisor->ShowViewMenuItem(false);
- advisor->ShowNewWindowMenuItem(false);
- advisor->ShowClosePerspectiveMenuItem(false);
+ advisor->ShowViewMenuItem(true);
+ advisor->ShowNewWindowMenuItem(true);
+ advisor->ShowClosePerspectiveMenuItem(true);
advisor->SetPerspectiveExcludeList(perspExcludeList);
advisor->SetViewExcludeList(viewExcludeList);
advisor->ShowViewToolbar(false);
- advisor->ShowPerspectiveToolbar(true);
+ advisor->ShowPerspectiveToolbar(false);
advisor->ShowVersionInfo(false);
- advisor->EnableViewBrowser(true);
+ advisor->EnableCandyStore(true);
advisor->ShowMitkVersionInfo(false);
+ advisor->ShowMemoryIndicator(false);
advisor->SetProductName("MITK Diffusion");
advisor->SetWindowIcon(":/org.mitk.gui.qt.diffusionimagingapp/app-icon.png");
return advisor;
}
std::string QmitkDiffusionImagingAppWorkbenchAdvisor::GetInitialWindowPerspectiveId()
{
return WELCOME_PERSPECTIVE_ID;
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp
index 545efe794d..5d453d89be 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.cpp
@@ -1,57 +1,57 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppConnectomicsPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppConnectomicsPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.connectomicsstatistics");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.connectomicsstatistics");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.connectomicsnetworkoperations");
lo = layout->GetViewLayout("org.mitk.views.connectomicsnetworkoperations");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.connectomicsdata");
lo = layout->GetViewLayout("org.mitk.views.connectomicsdata");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
index 5ddd1f377c..6e23a31e1f 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
@@ -1,49 +1,49 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppDicomImportPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppDicomImportPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.diffusiondicomimport");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.cpp
deleted file mode 100644
index c53e45079f..0000000000
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/*===================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center,
-Division of Medical and Biological Informatics.
-All rights reserved.
-
-This software is distributed WITHOUT ANY WARRANTY; without
-even the implied warranty of MERCHANTABILITY or FITNESS FOR
-A PARTICULAR PURPOSE.
-
-See LICENSE.txt or http://www.mitk.org for details.
-
-===================================================================*/
-
-#include "QmitkDIAppFiberTractographyPerspective.h"
-#include "berryIViewLayout.h"
-
-void QmitkDIAppFiberTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
-{
- std::string editorArea = layout->GetEditorArea();
-
- layout->AddStandaloneView("org.mitk.views.datamanager",
- false, berry::IPageLayout::LEFT, 0.3f, editorArea);
-
- layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
- false, berry::IPageLayout::BOTTOM, 0.15f, "org.mitk.views.datamanager");
-
- berry::IFolderLayout::Pointer left =
- layout->CreateFolder("org.mitk.diffusionimaginginternal.leftcontrols2",
- berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
-
- berry::IFolderLayout::Pointer bottomleft =
- layout->CreateFolder("org.mitk.diffusionimaginginternal.leftcontrols",
- berry::IPageLayout::BOTTOM, 0.5f, "org.mitk.diffusionimaginginternal.leftcontrols2");
-
- layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
- berry::IPageLayout::BOTTOM, .6f, "org.mitk.diffusionimaginginternal.leftcontrols", false);
-
- /////////////////////////////////////////////
- // add the views
- /////////////////////////////////////////////
-
- left->AddView("org.mitk.views.gibbstracking");
- berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.gibbstracking");
- lo->SetCloseable(false);
-
- left->AddView("org.mitk.views.stochasticfibertracking");
- lo = layout->GetViewLayout("org.mitk.views.stochasticfibertracking");
- lo->SetCloseable(false);
-
- left->AddView("org.mitk.views.streamlinetracking");
- lo = layout->GetViewLayout("org.mitk.views.streamlinetracking");
- lo->SetCloseable(false);
-
- bottomleft->AddView("org.mitk.views.fiberextraction");
- berry::IViewLayout::Pointer lo2 = layout->GetViewLayout("org.mitk.views.fiberextraction");
- lo2->SetCloseable(false);
-
- bottomleft->AddView("org.mitk.views.fiberprocessing");
- lo2 = layout->GetViewLayout("org.mitk.views.fiberprocessing");
- lo2->SetCloseable(false);
-
- bottomleft->AddView("org.mitk.views.segmentation");
- lo2 = layout->GetViewLayout("org.mitk.views.segmentation");
- lo2->SetCloseable(false);
-}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp
index 2873335651..dfee30f216 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppIVIMPerspective.cpp
@@ -1,52 +1,52 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppIVIMPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppIVIMPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.ivim");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.ivim");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.segmentation");
lo = layout->GetViewLayout("org.mitk.views.segmentation");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp
index 7118b6740e..b56b29b31d 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.cpp
@@ -1,56 +1,56 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppImageProcessingPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppImageProcessingPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, 0.15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.segmentation");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.segmentation");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.segmentationutilities");
lo = layout->GetViewLayout("org.mitk.views.segmentationutilities");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.basicimageprocessing");
lo = layout->GetViewLayout("org.mitk.views.basicimageprocessing");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp
index 61d085dea3..c74d6cba29 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.cpp
@@ -1,76 +1,76 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppPreprocessingReconstructionPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppPreprocessingReconstructionPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mitk.views.leftcontrols2",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
berry::IFolderLayout::Pointer bottomleft =
layout->CreateFolder("org.mitk.views.leftcontrols",
berry::IPageLayout::BOTTOM, 0.5f, "org.mitk.views.leftcontrols2");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .6f, "org.mitk.views.leftcontrols", false);
/////////////////////////////////////////////
// add the views
/////////////////////////////////////////////
left->AddView("org.mitk.views.diffusionpreprocessing");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusionpreprocessing");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.diffusionregistrationview");
lo = layout->GetViewLayout("org.mitk.views.diffusionregistrationview");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.tensorreconstruction");
lo = layout->GetViewLayout("org.mitk.views.tensorreconstruction");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.qballreconstruction");
lo = layout->GetViewLayout("org.mitk.views.qballreconstruction");
- lo->SetCloseable(false);
+
bottomleft->AddView("org.mitk.views.diffusionquantification");
berry::IViewLayout::Pointer lo2 = layout->GetViewLayout("org.mitk.views.diffusionquantification");
lo2->SetCloseable(false);
bottomleft->AddView("org.mitk.views.odfmaximaextraction");
lo2 = layout->GetViewLayout("org.mitk.views.odfmaximaextraction");
lo2->SetCloseable(false);
bottomleft->AddView("org.mitk.views.odfdetails");
lo2 = layout->GetViewLayout("org.mitk.views.odfdetails");
lo2->SetCloseable(false);
bottomleft->AddView("org.mitk.views.denoisingview");
lo2 = layout->GetViewLayout("org.mitk.views.denoisingview");
lo2->SetCloseable(false);
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp
index 8ff05fe48b..19c2f4d3bc 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppQuantificationPerspective.cpp
@@ -1,60 +1,60 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppQuantificationPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppQuantificationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.partialvolumeanalysisview");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.partialvolumeanalysisview");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.tractbasedspatialstatistics");
lo = layout->GetViewLayout("org.mitk.views.tractbasedspatialstatistics");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.imagestatistics");
lo = layout->GetViewLayout("org.mitk.views.imagestatistics");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.measurement");
lo = layout->GetViewLayout("org.mitk.views.measurement");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp
index e4e0cf805d..befc5502f8 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppRegistrationPerspective.cpp
@@ -1,56 +1,56 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppRegistrationPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppRegistrationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.rigidregistration");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.rigidregistration");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.pointbasedregistration");
lo = layout->GetViewLayout("org.mitk.views.pointbasedregistration");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.diffusionregistrationview");
lo = layout->GetViewLayout("org.mitk.views.diffusionregistrationview");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp
index 653aa0b8c7..d8bc4d590c 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.cpp
@@ -1,64 +1,64 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppSyntheticDataGenerationPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppSyntheticDataGenerationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.fiberfoxview");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.fiberfoxview");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.fiberprocessing");
lo = layout->GetViewLayout("org.mitk.views.fiberprocessing");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.fiberextraction");
lo = layout->GetViewLayout("org.mitk.views.fiberextraction");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.fieldmapgenerator");
lo = layout->GetViewLayout("org.mitk.views.fieldmapgenerator");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.segmentation");
lo = layout->GetViewLayout("org.mitk.views.segmentation");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp
index 2313d4ef0d..d6ad86179f 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTBSSPerspective.cpp
@@ -1,49 +1,49 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppTBSSPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppTBSSPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.tractbasedspatialstatistics");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.tractbasedspatialstatistics");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp
index d98a9994fc..184abd2bc0 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppTrackingEvaluationPerspective.cpp
@@ -1,48 +1,48 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppTrackingEvaluationPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppTrackingEvaluationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mitk.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.artificialqballevaluation");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.artificialqballevaluation");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp
index b019aee55e..c553c04c07 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppUtilityPerspective.cpp
@@ -1,52 +1,52 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppUtilityPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppUtilityPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.properties");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.properties");
- lo->SetCloseable(false);
+
left->AddView("org.blueberry.views.logview");
lo = layout->GetViewLayout("org.blueberry.views.logview");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp
index 877800d7fb..7788a6f47f 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppVisualizationPerspective.cpp
@@ -1,56 +1,56 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDIAppVisualizationPerspective.h"
#include "berryIViewLayout.h"
void QmitkDIAppVisualizationPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
left->AddView("org.mitk.views.volumevisualization");
berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.volumevisualization");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.screenshotmaker");
lo = layout->GetViewLayout("org.mitk.views.screenshotmaker");
- lo->SetCloseable(false);
+
left->AddView("org.mitk.views.moviemaker");
lo = layout->GetViewLayout("org.mitk.views.moviemaker");
- lo->SetCloseable(false);
+
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp
similarity index 82%
copy from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
copy to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp
index 5ddd1f377c..de5bb8dd42 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.cpp
@@ -1,49 +1,48 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include "QmitkDIAppDicomImportPerspective.h"
+#include "QmitkGibbsTractographyPerspective.h"
#include "berryIViewLayout.h"
-void QmitkDIAppDicomImportPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
+void QmitkGibbsTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
- left->AddView("org.mitk.views.diffusiondicomimport");
- berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport");
- lo->SetCloseable(false);
-
+ left->AddView("org.mitk.views.tensorreconstruction");
+ left->AddView("org.mitk.views.qballreconstruction");
+ left->AddView("org.mitk.views.gibbstracking");
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h
similarity index 66%
copy from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
copy to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h
index bd4611e7e6..4df9c889c0 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkGibbsTractographyPerspective.h
@@ -1,36 +1,36 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#ifndef QmitkDIAppFiberTractographyPerspective_H_
-#define QmitkDIAppFiberTractographyPerspective_H_
+#ifndef QmitkGibbsTractographyPerspective_H_
+#define QmitkGibbsTractographyPerspective_H_
#include
-class QmitkDIAppFiberTractographyPerspective : public QObject, public berry::IPerspectiveFactory
+class QmitkGibbsTractographyPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
- QmitkDIAppFiberTractographyPerspective() {}
- ~QmitkDIAppFiberTractographyPerspective() {}
+ QmitkGibbsTractographyPerspective() {}
+ ~QmitkGibbsTractographyPerspective() {}
void CreateInitialLayout(berry::IPageLayout::Pointer layout);
};
-#endif /* QmitkDIAppFiberTractographyPerspective_H_ */
+#endif /* QmitkGibbsTractographyPerspective_H_ */
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp
similarity index 82%
copy from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
copy to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp
index 5ddd1f377c..ff6ee899af 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.cpp
@@ -1,49 +1,48 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include "QmitkDIAppDicomImportPerspective.h"
+#include "QmitkProbabilisticTractographyPerspective.h"
#include "berryIViewLayout.h"
-void QmitkDIAppDicomImportPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
+void QmitkProbabilisticTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
- left->AddView("org.mitk.views.diffusiondicomimport");
- berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport");
- lo->SetCloseable(false);
-
+ left->AddView("org.mitk.views.diffusionpreprocessing");
+ left->AddView("org.mitk.views.segmentation");
+ left->AddView("org.mitk.views.stochasticfibertracking");
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h
similarity index 65%
copy from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
copy to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h
index bd4611e7e6..010ca37c6d 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h
@@ -1,36 +1,36 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#ifndef QmitkDIAppFiberTractographyPerspective_H_
-#define QmitkDIAppFiberTractographyPerspective_H_
+#ifndef QmitkProbabilisticTractographyPerspective_H_
+#define QmitkProbabilisticTractographyPerspective_H_
#include
-class QmitkDIAppFiberTractographyPerspective : public QObject, public berry::IPerspectiveFactory
+class QmitkProbabilisticTractographyPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
- QmitkDIAppFiberTractographyPerspective() {}
- ~QmitkDIAppFiberTractographyPerspective() {}
+ QmitkProbabilisticTractographyPerspective() {}
+ ~QmitkProbabilisticTractographyPerspective() {}
void CreateInitialLayout(berry::IPageLayout::Pointer layout);
};
-#endif /* QmitkDIAppFiberTractographyPerspective_H_ */
+#endif /* QmitkProbabilisticTractographyPerspective_H_ */
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp
similarity index 82%
copy from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
copy to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp
index 5ddd1f377c..1223c6f931 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppDicomImportPerspective.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.cpp
@@ -1,49 +1,48 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#include "QmitkDIAppDicomImportPerspective.h"
+#include "QmitkStreamlineTractographyPerspective.h"
#include "berryIViewLayout.h"
-void QmitkDIAppDicomImportPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
+void QmitkStreamlineTractographyPerspective::CreateInitialLayout(berry::IPageLayout::Pointer layout)
{
/////////////////////////////////////////////////////
// all di-app perspectives should have the following:
/////////////////////////////////////////////////////
std::string editorArea = layout->GetEditorArea();
layout->AddStandaloneView("org.mitk.views.datamanager",
false, berry::IPageLayout::LEFT, 0.3f, editorArea);
layout->AddStandaloneView("org.mitk.views.controlvisualizationpropertiesview",
false, berry::IPageLayout::BOTTOM, .15f, "org.mitk.views.datamanager");
berry::IFolderLayout::Pointer left =
layout->CreateFolder("org.mbi.diffusionimaginginternal.leftcontrols",
berry::IPageLayout::BOTTOM, 0.1f, "org.mitk.views.controlvisualizationpropertiesview");
layout->AddStandaloneViewPlaceholder("org.mitk.views.imagenavigator",
berry::IPageLayout::BOTTOM, .4f, "org.mbi.diffusionimaginginternal.leftcontrols", false);
/////////////////////////////////////////////
// here goes the perspective specific stuff
/////////////////////////////////////////////
- left->AddView("org.mitk.views.diffusiondicomimport");
- berry::IViewLayout::Pointer lo = layout->GetViewLayout("org.mitk.views.diffusiondicomimport");
- lo->SetCloseable(false);
-
+ left->AddView("org.mitk.views.tensorreconstruction");
+ left->AddView("org.mitk.views.segmentation");
+ left->AddView("org.mitk.views.streamlinetracking");
}
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h
similarity index 69%
rename from Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
rename to Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h
index bd4611e7e6..ba0347df7c 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h
@@ -1,36 +1,36 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#ifndef QmitkDIAppFiberTractographyPerspective_H_
-#define QmitkDIAppFiberTractographyPerspective_H_
+#ifndef QmitkStreamlineTractographyPerspective_H_
+#define QmitkStreamlineTractographyPerspective_H_
#include
-class QmitkDIAppFiberTractographyPerspective : public QObject, public berry::IPerspectiveFactory
+class QmitkStreamlineTractographyPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
- QmitkDIAppFiberTractographyPerspective() {}
- ~QmitkDIAppFiberTractographyPerspective() {}
+ QmitkStreamlineTractographyPerspective() {}
+ ~QmitkStreamlineTractographyPerspective() {}
void CreateInitialLayout(berry::IPageLayout::Pointer layout);
};
-#endif /* QmitkDIAppFiberTractographyPerspective_H_ */
+#endif /* QmitkStreamlineTractographyPerspective_H_ */
diff --git a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp
index 77cb0da33d..d43779f683 100644
--- a/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp
+++ b/Plugins/org.mitk.gui.qt.diffusionimagingapp/src/internal/QmitkDiffusionApplicationPlugin.cpp
@@ -1,114 +1,121 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkDiffusionApplicationPlugin.h"
#include "src/QmitkDiffusionImagingAppApplication.h"
#include "src/internal/Perspectives/QmitkWelcomePerspective.h"
#include "src/internal/QmitkDiffusionImagingAppIntroPart.h"
#include "src/internal/Perspectives/QmitkDiffusionImagingAppPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppConnectomicsPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppDicomImportPerspective.h"
-#include "src/internal/Perspectives/QmitkDIAppFiberTractographyPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppIVIMPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppImageProcessingPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppPreprocessingReconstructionPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppQuantificationPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppTBSSPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppUtilityPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppSyntheticDataGenerationPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppRegistrationPerspective.h"
#include "src/internal/Perspectives/QmitkDIAppVisualizationPerspective.h"
+#include "src/internal/Perspectives/QmitkGibbsTractographyPerspective.h"
+#include "src/internal/Perspectives/QmitkStreamlineTractographyPerspective.h"
+#include "src/internal/Perspectives/QmitkProbabilisticTractographyPerspective.h"
+
+
#include
#include
#include
#include
#include
#include
#include
QmitkDiffusionApplicationPlugin* QmitkDiffusionApplicationPlugin::inst = 0;
QmitkDiffusionApplicationPlugin::QmitkDiffusionApplicationPlugin()
{
inst = this;
}
QmitkDiffusionApplicationPlugin::~QmitkDiffusionApplicationPlugin()
{
}
QmitkDiffusionApplicationPlugin* QmitkDiffusionApplicationPlugin::GetDefault()
{
return inst;
}
void QmitkDiffusionApplicationPlugin::start(ctkPluginContext* context)
{
berry::AbstractUICTKPlugin::start(context);
this->context = context;
BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppApplication, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppIntroPart, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDiffusionImagingAppPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkWelcomePerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppConnectomicsPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppDicomImportPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppImageProcessingPerspective, context)
- BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppFiberTractographyPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppIVIMPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppPreprocessingReconstructionPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppQuantificationPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppTBSSPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppUtilityPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppSyntheticDataGenerationPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppRegistrationPerspective, context)
BERRY_REGISTER_EXTENSION_CLASS(QmitkDIAppVisualizationPerspective, context)
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkGibbsTractographyPerspective, context)
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkStreamlineTractographyPerspective, context)
+ BERRY_REGISTER_EXTENSION_CLASS(QmitkProbabilisticTractographyPerspective, context)
+
ctkServiceReference cmRef = context->getServiceReference();
ctkConfigurationAdmin* configAdmin = 0;
if (cmRef)
{
configAdmin = context->getService(cmRef);
}
// Use the CTK Configuration Admin service to configure the BlueBerry help system
if (configAdmin)
{
ctkConfigurationPtr conf = configAdmin->getConfiguration("org.blueberry.services.help", QString());
ctkDictionary helpProps;
helpProps.insert("homePage", "qthelp://org.mitk.gui.qt.diffusionimagingapp/bundle/index.html");
conf->update(helpProps);
context->ungetService(cmRef);
}
else
{
MITK_WARN << "Configuration Admin service unavailable, cannot set home page url.";
}
}
ctkPluginContext* QmitkDiffusionApplicationPlugin::GetPluginContext() const
{
return context;
}
Q_EXPORT_PLUGIN2(org_mitk_gui_qt_diffusionimagingapp, QmitkDiffusionApplicationPlugin)
diff --git a/Plugins/org.mitk.gui.qt.ext/files.cmake b/Plugins/org.mitk.gui.qt.ext/files.cmake
index b56eabfd78..f4191da5d4 100644
--- a/Plugins/org.mitk.gui.qt.ext/files.cmake
+++ b/Plugins/org.mitk.gui.qt.ext/files.cmake
@@ -1,67 +1,67 @@
set(SRC_CPP_FILES
QmitkExtActionBarAdvisor.cpp
QmitkExtWorkbenchWindowAdvisor.cpp
QmitkExtFileSaveProjectAction.cpp
QmitkOpenDicomEditorAction.cpp
QmitkOpenXnatEditorAction.cpp
- QmitkViewBrowserWidget.cpp
+ QmitkCandyStoreWidget.cpp
QmitkNewPerspectiveDialog.cpp
)
set(INTERNAL_CPP_FILES
QmitkAppInstancesPreferencePage.cpp
QmitkExternalProgramsPreferencePage.cpp
QmitkCommonExtPlugin.cpp
QmitkInputDevicesPrefPage.cpp
QmitkModuleView.cpp
)
set(UI_FILES
src/internal/QmitkAppInstancesPreferencePage.ui
src/internal/QmitkExternalProgramsPreferencePage.ui
- src/QmitkViewBrowserWidgetControls.ui
+ src/QmitkCandyStoreWidgetControls.ui
)
set(MOC_H_FILES
src/QmitkExtFileSaveProjectAction.h
src/QmitkExtWorkbenchWindowAdvisor.h
src/internal/QmitkAppInstancesPreferencePage.h
src/internal/QmitkExternalProgramsPreferencePage.h
src/internal/QmitkCommonExtPlugin.h
src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
src/internal/QmitkInputDevicesPrefPage.h
src/internal/QmitkModuleView.h
src/QmitkOpenDicomEditorAction.h
src/QmitkOpenXnatEditorAction.h
- src/QmitkViewBrowserWidget.h
+ src/QmitkCandyStoreWidget.h
src/mitkQtPerspectiveItem.h
src/mitkQtViewItem.h
src/QmitkNewPerspectiveDialog.h
)
set(CACHED_RESOURCE_FILES
# list of resource files which can be used by the plug-in
# system without loading the plug-ins shared library,
# for example the icon used in the menu and tabs for the
# plug-in views in the workbench
plugin.xml
resources/ModuleView.png
)
set(QRC_FILES
# uncomment the following line if you want to use Qt resources
resources/org_mitk_gui_qt_ext.qrc
)
set(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.ext/resources/Candy_icon.png b/Plugins/org.mitk.gui.qt.ext/resources/Candy_icon.png
new file mode 100644
index 0000000000..f71e77664c
Binary files /dev/null and b/Plugins/org.mitk.gui.qt.ext/resources/Candy_icon.png differ
diff --git a/Plugins/org.mitk.gui.qt.ext/resources/org_mitk_gui_qt_ext.qrc b/Plugins/org.mitk.gui.qt.ext/resources/org_mitk_gui_qt_ext.qrc
index 7cadabfdac..60cefbb18c 100644
--- a/Plugins/org.mitk.gui.qt.ext/resources/org_mitk_gui_qt_ext.qrc
+++ b/Plugins/org.mitk.gui.qt.ext/resources/org_mitk_gui_qt_ext.qrc
@@ -1,13 +1,14 @@
-
+
Load_48.png
Redo_48.png
Save_48.png
Undo_48.png
Remove_48.png
dcm-icon.png
Slider.png
index.html
xnat-icon.png
+ Candy_icon.png
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.cpp b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp
similarity index 53%
rename from Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.cpp
rename to Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp
index f927b9a06a..61c8384ddd 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.cpp
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.cpp
@@ -1,589 +1,757 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
//Qmitk headers
-#include "QmitkViewBrowserWidget.h"
+#include "QmitkCandyStoreWidget.h"
// Blueberry
#include
#include
#include
#include
#include
#include
// Qt
#include
#include
#include
#include
class KeywordRegistry
{
public:
- KeywordRegistry()
- {
- berry::IExtensionPointService::Pointer extensionPointService = berry::Platform::GetExtensionPointService();
- berry::IConfigurationElement::vector keywordExts(extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.keywords"));
-
- std::string keywordId;
- std::string keywordLabels;
- berry::IConfigurationElement::vector::iterator keywordExtsIt;
- for (keywordExtsIt = keywordExts.begin(); keywordExtsIt != keywordExts.end(); ++keywordExtsIt)
+ KeywordRegistry()
{
- (*keywordExtsIt)->GetAttribute("id", keywordId);
- (*keywordExtsIt)->GetAttribute("label", keywordLabels);
-
- if (m_Keywords.find(keywordId) == m_Keywords.end())
- {
- m_Keywords[keywordId] = std::vector();
- }
- m_Keywords[keywordId].push_back(QString::fromStdString(keywordLabels));
+ berry::IExtensionPointService::Pointer extensionPointService = berry::Platform::GetExtensionPointService();
+ berry::IConfigurationElement::vector keywordExts(extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.keywords"));
+
+ std::string keywordId;
+ std::string keywordLabels;
+ berry::IConfigurationElement::vector::iterator keywordExtsIt;
+ for (keywordExtsIt = keywordExts.begin(); keywordExtsIt != keywordExts.end(); ++keywordExtsIt)
+ {
+ (*keywordExtsIt)->GetAttribute("id", keywordId);
+ (*keywordExtsIt)->GetAttribute("label", keywordLabels);
+
+ if (m_Keywords.find(keywordId) == m_Keywords.end())
+ {
+ m_Keywords[keywordId] = std::vector();
+ }
+ m_Keywords[keywordId].push_back(QString::fromStdString(keywordLabels));
+ }
}
- }
- std::vector GetKeywords(const std::string& id)
- {
- return m_Keywords[id];
- }
+ std::vector GetKeywords(const std::string& id)
+ {
+ return m_Keywords[id];
+ }
- std::vector GetKeywords(const std::vector& ids)
- {
- std::vector result;
- for (int i = 0; i < ids.size(); ++i)
+ std::vector GetKeywords(const std::vector& ids)
{
- std::vector< QString > tmpResult;
- tmpResult = this->GetKeywords(ids[i]);
- result.insert(result.end(), tmpResult.begin(), tmpResult.end());
+ std::vector result;
+ for (unsigned int i = 0; i < ids.size(); ++i)
+ {
+ std::vector< QString > tmpResult;
+ tmpResult = this->GetKeywords(ids[i]);
+ result.insert(result.end(), tmpResult.begin(), tmpResult.end());
+ }
+ return result;
}
- return result;
- }
private:
- std::map > m_Keywords;
+ std::map > m_Keywords;
};
class ClassFilterProxyModel : public QSortFilterProxyModel
{
private :
bool hasToBeDisplayed(const QModelIndex index) const;
bool displayElement(const QModelIndex index) const;
public:
ClassFilterProxyModel(QObject *parent = NULL);
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
};
ClassFilterProxyModel::ClassFilterProxyModel(QObject *parent):
QSortFilterProxyModel(parent)
{
}
bool ClassFilterProxyModel::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
return hasToBeDisplayed(index);
}
bool ClassFilterProxyModel::displayElement(const QModelIndex index) const
{
- bool result = false;
+ bool result = false;
QString type = sourceModel()->data(index, Qt::DisplayRole).toString();
- QStandardItem * item = dynamic_cast(sourceModel())->itemFromIndex(index);
+ QStandardItem * item = dynamic_cast(sourceModel())->itemFromIndex(index);
- if (type.contains(filterRegExp()))
+ if (type.contains(filterRegExp()))
{
- return true;
+ return true;
}
{
- mitk::QtViewItem* viewItem = dynamic_cast(item);
- if (viewItem)
- {
- for (int i = 0; i < viewItem->m_Tags.size(); ++i)
- {
- if (viewItem->m_Tags[i].contains(filterRegExp()))
+ mitk::QtViewItem* viewItem = dynamic_cast(item);
+ if (viewItem)
{
- return true;
+ for (unsigned int i = 0; i < viewItem->m_Tags.size(); ++i)
+ {
+ if (viewItem->m_Tags[i].contains(filterRegExp()))
+ {
+ return true;
+ }
+ }
+ if (viewItem->m_Description.contains(filterRegExp()))
+ {
+ return true;
+ }
}
- }
- if (viewItem->m_Description.contains(filterRegExp()))
- {
- return true;
- }
}
- }
- {
- mitk::QtPerspectiveItem* viewItem = dynamic_cast(item);
- if (viewItem)
{
- for (int i = 0; i < viewItem->m_Tags.size(); ++i)
- {
- if (viewItem->m_Tags[i].contains(filterRegExp()))
+ mitk::QtPerspectiveItem* viewItem = dynamic_cast(item);
+ if (viewItem)
{
- return true;
+ for (unsigned int i = 0; i < viewItem->m_Tags.size(); ++i)
+ {
+ if (viewItem->m_Tags[i].contains(filterRegExp()))
+ {
+ return true;
+ }
+ }
+ if (viewItem->m_Description.contains(filterRegExp()))
+ {
+ return true;
+ }
}
- }
- if (viewItem->m_Description.contains(filterRegExp()))
- {
- return true;
- }
}
- }
- return result;
+
+ return result;
}
bool ClassFilterProxyModel::hasToBeDisplayed(const QModelIndex index) const
{
bool result = false;
- // How many child this element have
if ( sourceModel()->rowCount(index) > 0 )
{
for( int ii = 0; ii < sourceModel()->rowCount(index); ii++)
{
QModelIndex childIndex = sourceModel()->index(ii,0,index);
if ( ! childIndex.isValid() )
break;
result = hasToBeDisplayed(childIndex);
result |= displayElement(index);
if (result)
{
- // there is atless one element to display
break;
}
}
}
else
{
result = displayElement(index);
}
return result;
}
-struct ViewBrowserWindowListener : public berry::IWindowListener
+class CandyStorePerspectiveListener: public berry::IPerspectiveListener
+{
+public:
+
+ CandyStorePerspectiveListener(QmitkCandyStoreWidget* p) :
+ parentWidget(p)
+ {
+ }
+
+ Events::Types GetPerspectiveEventTypes() const
+ {
+ return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED
+ // remove the following line when command framework is finished
+ | Events::CLOSED | Events::OPENED | Events::PART_CHANGED;
+ }
+
+ void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/,
+ berry::IPerspectiveDescriptor::Pointer /*perspective*/)
+ {
+ parentWidget->UpdateTreeList();
+ }
+
+ void PerspectiveSavedAs(berry::IWorkbenchPage::Pointer /*page*/,
+ berry::IPerspectiveDescriptor::Pointer /*oldPerspective*/,
+ berry::IPerspectiveDescriptor::Pointer /*newPerspective*/)
+ {
+
+ }
+
+ void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/,
+ berry::IPerspectiveDescriptor::Pointer /*perspective*/)
+ {
+ parentWidget->UpdateTreeList();
+ }
+
+ void PerspectiveOpened(berry::IWorkbenchPage::Pointer /*page*/,
+ berry::IPerspectiveDescriptor::Pointer /*perspective*/)
+ {
+ parentWidget->UpdateTreeList();
+ }
+
+ void PerspectiveClosed(berry::IWorkbenchPage::Pointer /*page*/,
+ berry::IPerspectiveDescriptor::Pointer /*perspective*/)
+ {
+ parentWidget->UpdateTreeList();
+ }
+
+ void PerspectiveChanged(berry::IWorkbenchPage::Pointer,
+ berry::IPerspectiveDescriptor::Pointer,
+ berry::IWorkbenchPartReference::Pointer partRef, const std::string& changeId)
+ {
+ parentWidget->UpdateTreeList(NULL, partRef.GetPointer(), changeId);
+ }
+
+private:
+ QmitkCandyStoreWidget* parentWidget;
+};
+
+struct CandyStoreWindowListener : public berry::IWindowListener
{
- ViewBrowserWindowListener(QmitkViewBrowserWidget* switcher)
+ CandyStoreWindowListener(QmitkCandyStoreWidget* switcher)
: switcher(switcher),
- m_Running(false)
+ m_Done(false)
{}
- virtual void WindowOpened(berry::IWorkbenchWindow::Pointer /*window*/)
+ virtual void WindowOpened(berry::IWorkbenchWindow::Pointer window)
{
- if (m_Running)
+ if (m_Done)
return;
- m_Running = true;
- switcher->FillTreeList();
- m_Running = false;
+ if ( switcher->FillTreeList() )
+ {
+ m_Done = true;
+ switcher->m_PerspectiveListener = CandyStorePerspectiveListener::Pointer(new CandyStorePerspectiveListener(switcher));
+ window->AddPerspectiveListener(switcher->m_PerspectiveListener);
+ }
}
- virtual void WindowActivated(berry::IWorkbenchWindow::Pointer /*window*/)
+ virtual void WindowActivated(berry::IWorkbenchWindow::Pointer window)
{
- if (m_Running)
+ if (m_Done)
return;
- m_Running = true;
- switcher->FillTreeList();
- m_Running = false;
+ if ( switcher->FillTreeList() )
+ {
+ m_Done = true;
+ switcher->m_PerspectiveListener = CandyStorePerspectiveListener::Pointer(new CandyStorePerspectiveListener(switcher));
+ window->AddPerspectiveListener(switcher->m_PerspectiveListener);
+ }
}
private:
- QmitkViewBrowserWidget* switcher;
- bool m_Running;
+ QmitkCandyStoreWidget* switcher;
+ bool m_Done;
};
bool compareViews(berry::IViewDescriptor::Pointer a, berry::IViewDescriptor::Pointer b)
{
if (a.IsNull() || b.IsNull())
return false;
return a->GetLabel().compare(b->GetLabel()) < 0;
}
+bool comparePerspectives(berry::IPerspectiveDescriptor::Pointer a, berry::IPerspectiveDescriptor::Pointer b)
+{
+ if (a.IsNull() || b.IsNull())
+ return false;
+ return a->GetLabel().compare(b->GetLabel()) < 0;
+}
+
bool compareQStandardItems(QStandardItem* a, QStandardItem* b)
{
if (a==NULL || b==NULL)
return false;
return a->text().compare(b->text()) < 0;
}
-QmitkViewBrowserWidget::QmitkViewBrowserWidget( QWidget * parent, Qt::WindowFlags )
+QmitkCandyStoreWidget::QmitkCandyStoreWidget( QWidget * parent, Qt::WindowFlags )
: QWidget(parent)
{
this->CreateQtPartControl(this);
}
-QmitkViewBrowserWidget::~QmitkViewBrowserWidget()
+QmitkCandyStoreWidget::~QmitkCandyStoreWidget()
{
+
}
-void QmitkViewBrowserWidget::CreateQtPartControl( QWidget *parent )
+void QmitkCandyStoreWidget::CreateQtPartControl( QWidget *parent )
{
// create GUI widgets from the Qt Designer's .ui file
- m_WindowListener = ViewBrowserWindowListener::Pointer(new ViewBrowserWindowListener(this));
+ m_WindowListener = CandyStoreWindowListener::Pointer(new CandyStoreWindowListener(this));
berry::PlatformUI::GetWorkbench()->AddWindowListener(m_WindowListener);
m_Parent = parent;
m_Controls.setupUi( parent );
connect( m_Controls.m_PluginTreeView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(CustomMenuRequested(QPoint)));
connect( m_Controls.m_PluginTreeView, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(ItemClicked(const QModelIndex&)));
connect( m_Controls.lineEdit, SIGNAL(textChanged(QString)), SLOT(FilterChanged()));
m_ContextMenu = new QMenu(m_Controls.m_PluginTreeView);
m_Controls.m_PluginTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
// Create a new TreeModel for the data
m_TreeModel = new QStandardItemModel();
m_FilterProxyModel = new ClassFilterProxyModel(this);
m_FilterProxyModel->setSourceModel(m_TreeModel);
//proxyModel->setFilterFixedString("Diff");
m_Controls.m_PluginTreeView->setModel(m_FilterProxyModel);
FillTreeList();
}
-void QmitkViewBrowserWidget::FillTreeList()
+void QmitkCandyStoreWidget::UpdateTreeList(QStandardItem* root, berry::IWorkbenchPartReference *partRef, const std::string &changeId)
+{
+ berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
+ if (page.IsNull())
+ return;
+
+ if (root==NULL)
+ root = m_TreeModel->invisibleRootItem();
+ for (int i=0; irowCount(); i++)
+ {
+ QStandardItem* item = root->child(i);
+ QFont font;
+ if (dynamic_cast(item))
+ {
+ mitk::QtPerspectiveItem* pItem = dynamic_cast(item);
+ berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective();
+
+ if (currentPersp.IsNotNull() && currentPersp->GetId()==pItem->m_Perspective->GetId())
+ font.setBold(true);
+ pItem->setFont(font);
+ }
+ mitk::QtViewItem* vItem = dynamic_cast(item);
+ if (vItem)
+ {
+ std::vector viewParts(page->GetViews());
+ for (unsigned int i=0; iGetPartName()==vItem->m_View->GetLabel())
+ {
+ font.setBold(true);
+ break;
+ }
+
+ if( partRef!=NULL && partRef->GetId()==vItem->m_View->GetId() && changeId=="viewHide")
+ font.setBold(false);
+
+ vItem->setFont(font);
+ }
+ UpdateTreeList(item, partRef, changeId);
+ }
+}
+
+bool QmitkCandyStoreWidget::FillTreeList()
{
// active workbench window available?
if (berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow().IsNull())
- return;
+ return false;
// active page available?
berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
if (page.IsNull())
- return;
+ return false;
+
// everything is fine and we can remove the window listener
berry::PlatformUI::GetWorkbench()->RemoveWindowListener(m_WindowListener);
// initialize tree model
m_TreeModel->clear();
QStandardItem *treeRootItem = m_TreeModel->invisibleRootItem();
// get all available perspectives
berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
- std::vector perspectives(perspRegistry->GetPerspectives());
+ std::vector perspectiveDescriptors(perspRegistry->GetPerspectives());
+ std::sort(perspectiveDescriptors.begin(), perspectiveDescriptors.end(), comparePerspectives);
// get all Keywords
KeywordRegistry keywordRegistry;
- QModelIndex currentIndex;
berry::IPerspectiveDescriptor::Pointer currentPersp = page->GetPerspective();
std::vector perspectiveExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetPerspectiveExcludeList();
- QStandardItem *perspectiveRootItem = new QStandardItem("Perspectives");
+ std::vector< QStandardItem* > categoryItems;
+ QStandardItem *perspectiveRootItem = new QStandardItem("Workflows");
+ perspectiveRootItem->setEditable(false);
treeRootItem->appendRow(perspectiveRootItem);
- for (unsigned int i=0; iGetId())
{
skipPerspective = true;
break;
}
if (skipPerspective)
continue;
- QIcon* pIcon = static_cast(p->GetImageDescriptor()->CreateImage());
- mitk::QtPerspectiveItem* pItem = new mitk::QtPerspectiveItem(*pIcon, QString::fromStdString(p->GetLabel()));
+ //QIcon* pIcon = static_cast(p->GetImageDescriptor()->CreateImage());
+ mitk::QtPerspectiveItem* pItem = new mitk::QtPerspectiveItem(QString::fromStdString(p->GetLabel()));
pItem->m_Perspective = p;
pItem->m_Description = QString::fromStdString(p->GetDescription());
std::vector keylist = p->GetKeywordReferences();
pItem->m_Tags = keywordRegistry.GetKeywords(keylist);
- perspectiveRootItem->appendRow(pItem);
+ pItem->setEditable(false);
- if (currentPersp)
+ QFont font; font.setBold(true);
+ if (currentPersp.IsNotNull() && currentPersp->GetId()==p->GetId())
+ pItem->setFont(font);
+
+ std::vector catPath = p->GetCategoryPath();
+ if (catPath.empty())
+ {
+ perspectiveRootItem->appendRow(pItem);
+ }
+ else
{
- if (currentPersp->GetId()==p->GetId())
- currentIndex = pItem->index();
+ QStandardItem* categoryItem = NULL;
+
+ for (unsigned int c=0; ctext().toStdString() == catPath.front())
+ {
+ categoryItem = categoryItems.at(c);
+ break;
+ }
+
+ if (categoryItem==NULL)
+ {
+ categoryItem = new QStandardItem(QIcon(),catPath.front().c_str());
+ categoryItems.push_back(categoryItem);
+ }
+ categoryItem->setEditable(false);
+ categoryItem->appendRow(pItem);
}
}
+ std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems);
+ for (unsigned int i=0; iappendRow(categoryItems.at(i));
// get all available views
berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry();
- std::vector views(viewRegistry->GetViews());
- std::sort(views.begin(), views.end(), compareViews);
+ std::vector viewDescriptors(viewRegistry->GetViews());
+ std::vector viewParts(page->GetViews());
+ std::sort(viewDescriptors.begin(), viewDescriptors.end(), compareViews);
std::vector viewExcludeList = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetViewExcludeList();
- QStandardItem* viewRootItem = new QStandardItem(QIcon(),"View categories");
+ QStandardItem* viewRootItem = new QStandardItem(QIcon(),"Candies");
+ viewRootItem->setEditable(false);
treeRootItem->appendRow(viewRootItem);
- std::vector< QStandardItem* > categoryItems;
+ categoryItems.clear();
QStandardItem* noCategoryItem = new QStandardItem(QIcon(),"Miscellaneous");
+ noCategoryItem->setEditable(false);
- for (unsigned int i = 0; i < views.size(); ++i)
+ for (unsigned int i = 0; i < viewDescriptors.size(); ++i)
{
- berry::IViewDescriptor::Pointer v = views[i];
-
+ berry::IViewDescriptor::Pointer v = viewDescriptors[i];
bool skipView = false;
for(unsigned int e=0; eGetId())
{
skipView = true;
break;
}
if (skipView)
continue;
std::vector catPath = v->GetCategoryPath();
QIcon* icon = static_cast(v->GetImageDescriptor()->CreateImage());
mitk::QtViewItem* vItem = new mitk::QtViewItem(*icon, QString::fromStdString(v->GetLabel()));
vItem->m_View = v;
+ vItem->setToolTip(v->GetDescription().c_str());
vItem->m_Description = QString::fromStdString(v->GetDescription());
std::vector keylist = v->GetKeywordReferences();
vItem->m_Tags = keywordRegistry.GetKeywords(keylist);
+ vItem->setEditable(false);
+
+ for (unsigned int i=0; iGetPartName()==v->GetLabel())
+ {
+ QFont font; font.setBold(true);
+ vItem->setFont(font);
+ break;
+ }
if (catPath.empty())
noCategoryItem->appendRow(vItem);
else
{
QStandardItem* categoryItem = NULL;
for (unsigned int c=0; ctext().toStdString() == catPath.front())
{
categoryItem = categoryItems.at(c);
break;
}
if (categoryItem==NULL)
{
categoryItem = new QStandardItem(QIcon(),catPath.front().c_str());
categoryItems.push_back(categoryItem);
}
-
+ categoryItem->setEditable(false);
categoryItem->appendRow(vItem);
}
}
std::sort(categoryItems.begin(), categoryItems.end(), compareQStandardItems);
for (unsigned int i=0; iappendRow(categoryItems.at(i));
if (noCategoryItem->hasChildren())
viewRootItem->appendRow(noCategoryItem);
- QModelIndex correctedIndex = m_FilterProxyModel->mapFromSource(currentIndex);
- m_Controls.m_PluginTreeView->setCurrentIndex(correctedIndex);
+ m_Controls.m_PluginTreeView->expandAll();
+
+ return true;
}
-void QmitkViewBrowserWidget::FilterChanged()
+void QmitkCandyStoreWidget::FilterChanged()
{
QString filterString = m_Controls.lineEdit->text();
if (filterString.size() > 0 )
m_Controls.m_PluginTreeView->expandAll();
else
m_Controls.m_PluginTreeView->collapseAll();
- QRegExp::PatternSyntax syntax = QRegExp::RegExp;
+ // QRegExp::PatternSyntax syntax = QRegExp::RegExp;
Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive;
QString strPattern = "^*" + filterString;
QRegExp regExp(strPattern, caseSensitivity);
m_FilterProxyModel->setFilterRegExp(regExp);
}
-void QmitkViewBrowserWidget::ItemClicked(const QModelIndex &index)
+void QmitkCandyStoreWidget::ItemClicked(const QModelIndex &index)
{
QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index));
if ( dynamic_cast< mitk::QtPerspectiveItem* >(item) )
{
try
{
mitk::QtPerspectiveItem* pItem = dynamic_cast< mitk::QtPerspectiveItem* >(item);
berry::PlatformUI::GetWorkbench()->ShowPerspective( pItem->m_Perspective->GetId(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
}
catch (...)
{
QMessageBox::critical(0, "Opening Perspective Failed", QString("The requested perspective could not be opened.\nSee the log for details."));
}
}
else if ( dynamic_cast< mitk::QtViewItem* >(item) )
{
berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
if (page.IsNotNull())
{
try
{
mitk::QtViewItem* vItem = dynamic_cast< mitk::QtViewItem* >(item);
page->ShowView(vItem->m_View->GetId());
}
catch (berry::PartInitException e)
{
BERRY_ERROR << "Error: " << e.displayText() << std::endl;
}
}
}
}
-void QmitkViewBrowserWidget::AddPerspective()
+void QmitkCandyStoreWidget::AddPerspective()
{
QmitkNewPerspectiveDialog* dialog = new QmitkNewPerspectiveDialog( m_Parent );
int dialogReturnValue = dialog->exec();
if ( dialogReturnValue == QDialog::Rejected )
return;
berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
try
{
berry::IPerspectiveDescriptor::Pointer perspDesc;
perspDesc = perspRegistry->CreatePerspective(dialog->GetPerspectiveName().toStdString(), perspRegistry->FindPerspectiveWithId(perspRegistry->GetDefaultPerspective()));
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(perspDesc);
}
catch(...)
{
QMessageBox::warning(m_Parent, "Error", "Duplication of selected perspective failed. Please make sure the specified perspective name is not already in use!");
}
FillTreeList();
}
-void QmitkViewBrowserWidget::ClonePerspective()
+void QmitkCandyStoreWidget::ClonePerspective()
{
if (m_RegisteredPerspective.IsNotNull())
{
QmitkNewPerspectiveDialog* dialog = new QmitkNewPerspectiveDialog( m_Parent );
QString defaultName(m_RegisteredPerspective->GetLabel().c_str());
defaultName.append(" Copy");
dialog->SetPerspectiveName(defaultName);
int dialogReturnValue = dialog->exec();
if ( dialogReturnValue == QDialog::Rejected )
return;
berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
try
{
berry::IPerspectiveDescriptor::Pointer perspDesc = perspRegistry->ClonePerspective(dialog->GetPerspectiveName().toStdString(), dialog->GetPerspectiveName().toStdString(), m_RegisteredPerspective);
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(perspDesc);
}
catch(...)
{
QMessageBox::warning(m_Parent, "Error", "Duplication of selected perspective failed. Please make sure the specified perspective name is not already in use!");
}
FillTreeList();
}
}
-void QmitkViewBrowserWidget::ResetPerspective()
+void QmitkCandyStoreWidget::ResetPerspective()
{
if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to reset the curent perspective?", QMessageBox::Yes|QMessageBox::No).exec())
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
}
-void QmitkViewBrowserWidget::DeletePerspective()
+void QmitkCandyStoreWidget::DeletePerspective()
{
if (m_RegisteredPerspective.IsNotNull())
{
QString question = "Do you really want to remove the perspective '";
question.append(m_RegisteredPerspective->GetLabel().c_str());
question.append("'?");
if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", question, QMessageBox::Yes|QMessageBox::No).exec())
{
berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
perspRegistry->DeletePerspective(m_RegisteredPerspective);
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->RemovePerspective(m_RegisteredPerspective);
FillTreeList();
if (! berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->GetPerspective())
{
- berry::IPerspectiveDescriptor::Pointer persp = perspRegistry->FindPerspectiveWithId(perspRegistry->GetDefaultPerspective());
- berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(persp);
+ berry::IPerspectiveDescriptor::Pointer persp = perspRegistry->FindPerspectiveWithId(perspRegistry->GetDefaultPerspective());
+ berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->SetPerspective(persp);
}
}
}
}
-void QmitkViewBrowserWidget::ClosePerspective()
+void QmitkCandyStoreWidget::ClosePerspective()
{
if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close the curent perspective?", QMessageBox::Yes|QMessageBox::No).exec())
{
berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
page->CloseCurrentPerspective(true, true);
- if ( page->GetPerspective().IsNull() )
- {
- berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
- berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
- }
+ // if ( page->GetPerspective().IsNull() )
+ // {
+ // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
+ // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
+ // }
}
}
-void QmitkViewBrowserWidget::ClosePerspectives()
+void QmitkCandyStoreWidget::CloseAllPerspectives()
{
if (QMessageBox::Yes == QMessageBox(QMessageBox::Question, "Please confirm", "Do you really want to close all perspectives?", QMessageBox::Yes|QMessageBox::No).exec())
{
berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
page->CloseAllPerspectives(true, true);
- berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
- berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
+ // berry::IPerspectiveRegistry* perspRegistry = berry::PlatformUI::GetWorkbench()->GetPerspectiveRegistry();
+ // berry::PlatformUI::GetWorkbench()->ShowPerspective( perspRegistry->GetDefaultPerspective(), berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow() );
}
}
-void QmitkViewBrowserWidget::CustomMenuRequested(QPoint pos)
+void QmitkCandyStoreWidget::ExpandAll()
+{
+ m_Controls.m_PluginTreeView->expandAll();
+}
+
+void QmitkCandyStoreWidget::CollapseAll()
+{
+ m_Controls.m_PluginTreeView->collapseAll();
+}
+
+void QmitkCandyStoreWidget::CustomMenuRequested(QPoint pos)
{
QModelIndex index = m_Controls.m_PluginTreeView->indexAt(pos);
QStandardItem* item = m_TreeModel->itemFromIndex(m_FilterProxyModel->mapToSource(index));
- if (m_ContextMenu==NULL || item==NULL)
+ if (m_ContextMenu==NULL)
return;
m_ContextMenu->clear();
m_RegisteredPerspective = NULL;
- bool showMenu = false;
- if (item->text()=="Perspectives")
- {
- QAction* resetAction = new QAction("Reset current perspective", this);
- m_ContextMenu->addAction(resetAction);
- connect(resetAction, SIGNAL(triggered()), SLOT(ResetPerspective()));
-
- QAction* closeAction = new QAction("Close current perspective", this);
- m_ContextMenu->addAction(closeAction);
- connect(closeAction, SIGNAL(triggered()), SLOT(ClosePerspective()));
+ QAction* expandAction = new QAction("Expand tree", this);
+ m_ContextMenu->addAction(expandAction);
+ connect(expandAction, SIGNAL(triggered()), SLOT(ExpandAll()));
- m_ContextMenu->addSeparator();
+ QAction* collapseAction = new QAction("Collapse tree", this);
+ m_ContextMenu->addAction(collapseAction);
+ connect(collapseAction, SIGNAL(triggered()), SLOT(CollapseAll()));
- QAction* closeAllAction = new QAction("Close all perspectives", this);
- m_ContextMenu->addAction(closeAllAction);
- connect(closeAllAction, SIGNAL(triggered()), SLOT(ClosePerspectives()));
+ m_ContextMenu->addSeparator();
- showMenu = true;
- }
- if (dynamic_cast< mitk::QtPerspectiveItem* >(item) )
+ if ( item!=NULL && dynamic_cast< mitk::QtPerspectiveItem* >(item) )
{
m_RegisteredPerspective = dynamic_cast< mitk::QtPerspectiveItem* >(item)->m_Perspective;
//m_ContextMenu->addSeparator();
QAction* cloneAction = new QAction("Duplicate perspective", this);
m_ContextMenu->addAction(cloneAction);
connect(cloneAction, SIGNAL(triggered()), SLOT(ClonePerspective()));
if (!m_RegisteredPerspective->IsPredefined())
{
QAction* deleteAction = new QAction("Remove perspective", this);
m_ContextMenu->addAction(deleteAction);
connect(deleteAction, SIGNAL(triggered()), SLOT(DeletePerspective()));
}
- showMenu = true;
+ m_ContextMenu->addSeparator();
}
- if (showMenu)
- m_ContextMenu->popup(m_Controls.m_PluginTreeView->viewport()->mapToGlobal(pos));
-}
\ No newline at end of file
+ QAction* resetAction = new QAction("Reset current perspective", this);
+ m_ContextMenu->addAction(resetAction);
+ connect(resetAction, SIGNAL(triggered()), SLOT(ResetPerspective()));
+
+ QAction* closeAction = new QAction("Close current perspective", this);
+ m_ContextMenu->addAction(closeAction);
+ connect(closeAction, SIGNAL(triggered()), SLOT(ClosePerspective()));
+
+ m_ContextMenu->addSeparator();
+
+ QAction* closeAllAction = new QAction("Close all perspectives", this);
+ m_ContextMenu->addAction(closeAllAction);
+ connect(closeAllAction, SIGNAL(triggered()), SLOT(CloseAllPerspectives()));
+
+ m_ContextMenu->popup(m_Controls.m_PluginTreeView->viewport()->mapToGlobal(pos));
+}
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h
similarity index 73%
rename from Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.h
rename to Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h
index a7cc5cf78a..995ea9ca94 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidget.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidget.h
@@ -1,83 +1,88 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
-#ifndef _QMITKViewBrowserWidget_H_INCLUDED
-#define _QMITKViewBrowserWidget_H_INCLUDED
+#ifndef _QMITKCandyStoreWidget_H_INCLUDED
+#define _QMITKCandyStoreWidget_H_INCLUDED
//QT headers
#include
#include
-#include "ui_QmitkViewBrowserWidgetControls.h"
+#include "ui_QmitkCandyStoreWidgetControls.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
class ClassFilterProxyModel;
/** @brief
*/
-class QmitkViewBrowserWidget : public QWidget
+class QmitkCandyStoreWidget : public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
- QmitkViewBrowserWidget (QWidget* parent = 0, Qt::WindowFlags f = 0);
- virtual ~QmitkViewBrowserWidget();
+ QmitkCandyStoreWidget (QWidget* parent = 0, Qt::WindowFlags f = 0);
+ virtual ~QmitkCandyStoreWidget();
virtual void CreateQtPartControl(QWidget *parent);
- void FillTreeList();
+ bool FillTreeList();
+ void UpdateTreeList(QStandardItem* item = NULL, berry::IWorkbenchPartReference* partRef=NULL, const std::string& changeId="");
+
+ berry::IPerspectiveListener::Pointer m_PerspectiveListener;
public slots:
void CustomMenuRequested(QPoint pos);
void ItemClicked(const QModelIndex &index);
void AddPerspective();
void ClonePerspective();
void ResetPerspective();
void DeletePerspective();
- void ClosePerspectives();
+ void CloseAllPerspectives();
void ClosePerspective();
+ void ExpandAll();
+ void CollapseAll();
void FilterChanged();
protected:
// member variables
- Ui::QmitkViewBrowserWidgetControls m_Controls;
+ Ui::QmitkCandyStoreWidgetControls m_Controls;
QWidget* m_Parent;
QStandardItemModel* m_TreeModel;
ClassFilterProxyModel* m_FilterProxyModel;
QMenu* m_ContextMenu;
berry::IPerspectiveDescriptor::Pointer m_RegisteredPerspective;
berry::IWindowListener::Pointer m_WindowListener;
- friend struct ViewBrowserViewListener;
+
private:
};
-#endif // _QMITKViewBrowserWidget_H_INCLUDED
+#endif // _QMITKCandyStoreWidget_H_INCLUDED
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidgetControls.ui b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidgetControls.ui
similarity index 91%
rename from Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidgetControls.ui
rename to Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidgetControls.ui
index 63d449195c..2f8a961032 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkViewBrowserWidgetControls.ui
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkCandyStoreWidgetControls.ui
@@ -1,52 +1,52 @@
- QmitkViewBrowserWidgetControls
-
+ QmitkCandyStoreWidgetControls
+
0
0
752
974
0
0
QmitkTemplate
-
Filter...
-
true
false
ctkSearchBox
QLineEdit
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
index 9396e649c3..1945d37a05 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
@@ -1,1269 +1,1264 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkExtWorkbenchWindowAdvisor.h"
#include "QmitkExtActionBarAdvisor.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
// UGLYYY
#include "internal/QmitkExtWorkbenchWindowAdvisorHack.h"
#include "internal/QmitkCommonExtPlugin.h"
#include "mitkUndoController.h"
#include "mitkVerboseLimitedLinearUndo.h"
#include
#include
#include
#include
QmitkExtWorkbenchWindowAdvisorHack
* QmitkExtWorkbenchWindowAdvisorHack::undohack =
new QmitkExtWorkbenchWindowAdvisorHack();
QString QmitkExtWorkbenchWindowAdvisor::QT_SETTINGS_FILENAME = "QtSettings.ini";
class PartListenerForTitle: public berry::IPartListener
{
public:
PartListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) :
windowAdvisor(wa)
{
}
Events::Types GetPartEventTypes() const
{
return Events::ACTIVATED | Events::BROUGHT_TO_TOP | Events::CLOSED
| Events::HIDDEN | Events::VISIBLE;
}
void PartActivated(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref.Cast ())
{
windowAdvisor->UpdateTitle(false);
}
}
void PartBroughtToTop(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref.Cast ())
{
windowAdvisor->UpdateTitle(false);
}
}
void PartClosed(berry::IWorkbenchPartReference::Pointer /*ref*/)
{
windowAdvisor->UpdateTitle(false);
}
void PartHidden(berry::IWorkbenchPartReference::Pointer ref)
{
if (!windowAdvisor->lastActiveEditor.Expired() &&
ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock())
{
windowAdvisor->UpdateTitle(true);
}
}
void PartVisible(berry::IWorkbenchPartReference::Pointer ref)
{
if (!windowAdvisor->lastActiveEditor.Expired() &&
ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock())
{
windowAdvisor->UpdateTitle(false);
}
}
private:
QmitkExtWorkbenchWindowAdvisor* windowAdvisor;
};
class PartListenerForImageNavigator: public berry::IPartListener
{
public:
PartListenerForImageNavigator(QAction* act) :
imageNavigatorAction(act)
{
}
Events::Types GetPartEventTypes() const
{
return Events::OPENED | Events::CLOSED | Events::HIDDEN |
Events::VISIBLE;
}
void PartOpened(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref->GetId()=="org.mitk.views.imagenavigator")
{
imageNavigatorAction->setChecked(true);
}
}
void PartClosed(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref->GetId()=="org.mitk.views.imagenavigator")
{
imageNavigatorAction->setChecked(false);
}
}
void PartVisible(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref->GetId()=="org.mitk.views.imagenavigator")
{
imageNavigatorAction->setChecked(true);
}
}
void PartHidden(berry::IWorkbenchPartReference::Pointer ref)
{
if (ref->GetId()=="org.mitk.views.imagenavigator")
{
imageNavigatorAction->setChecked(false);
}
}
private:
QAction* imageNavigatorAction;
};
class PerspectiveListenerForTitle: public berry::IPerspectiveListener
{
public:
PerspectiveListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) :
windowAdvisor(wa), perspectivesClosed(false)
{
}
Events::Types GetPerspectiveEventTypes() const
{
return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED
// remove the following line when command framework is finished
| Events::CLOSED | Events::OPENED;
}
void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer /*perspective*/)
{
windowAdvisor->UpdateTitle(false);
}
void PerspectiveSavedAs(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer /*oldPerspective*/,
berry::IPerspectiveDescriptor::Pointer /*newPerspective*/)
{
windowAdvisor->UpdateTitle(false);
}
void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer /*perspective*/)
{
windowAdvisor->UpdateTitle(false);
}
void PerspectiveOpened(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer /*perspective*/)
{
if (perspectivesClosed)
{
QListIterator i(windowAdvisor->viewActions);
while (i.hasNext())
{
i.next()->setEnabled(true);
}
//GetViewRegistry()->Find("org.mitk.views.imagenavigator");
if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
{
windowAdvisor->openDicomEditorAction->setEnabled(true);
}
if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser"))
{
windowAdvisor->openXnatEditorAction->setEnabled(true);
}
windowAdvisor->fileSaveProjectAction->setEnabled(true);
windowAdvisor->closeProjectAction->setEnabled(true);
windowAdvisor->undoAction->setEnabled(true);
windowAdvisor->redoAction->setEnabled(true);
windowAdvisor->imageNavigatorAction->setEnabled(true);
windowAdvisor->resetPerspAction->setEnabled(true);
if( windowAdvisor->GetShowClosePerspectiveMenuItem() )
{
windowAdvisor->closePerspAction->setEnabled(true);
}
}
perspectivesClosed = false;
}
void PerspectiveClosed(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer /*perspective*/)
{
berry::IWorkbenchWindow::Pointer wnd = windowAdvisor->GetWindowConfigurer()->GetWindow();
bool allClosed = true;
if (wnd->GetActivePage())
{
std::vector perspectives(wnd->GetActivePage()->GetOpenPerspectives());
allClosed = perspectives.empty();
}
if (allClosed)
{
perspectivesClosed = true;
QListIterator i(windowAdvisor->viewActions);
while (i.hasNext())
{
i.next()->setEnabled(false);
}
if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
{
windowAdvisor->openDicomEditorAction->setEnabled(false);
}
if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser"))
{
windowAdvisor->openXnatEditorAction->setEnabled(false);
}
windowAdvisor->fileSaveProjectAction->setEnabled(false);
windowAdvisor->closeProjectAction->setEnabled(false);
windowAdvisor->undoAction->setEnabled(false);
windowAdvisor->redoAction->setEnabled(false);
windowAdvisor->imageNavigatorAction->setEnabled(false);
windowAdvisor->resetPerspAction->setEnabled(false);
if( windowAdvisor->GetShowClosePerspectiveMenuItem() )
{
windowAdvisor->closePerspAction->setEnabled(false);
}
}
}
private:
QmitkExtWorkbenchWindowAdvisor* windowAdvisor;
bool perspectivesClosed;
};
class PerspectiveListenerForMenu: public berry::IPerspectiveListener
{
public:
PerspectiveListenerForMenu(QmitkExtWorkbenchWindowAdvisor* wa) :
windowAdvisor(wa)
{
}
Events::Types GetPerspectiveEventTypes() const
{
return Events::ACTIVATED | Events::DEACTIVATED;
}
void PerspectiveActivated(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer perspective)
{
QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()];
if (action)
{
action->setChecked(true);
}
}
void PerspectiveDeactivated(berry::IWorkbenchPage::Pointer /*page*/,
berry::IPerspectiveDescriptor::Pointer perspective)
{
QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()];
if (action)
{
action->setChecked(false);
}
}
private:
QmitkExtWorkbenchWindowAdvisor* windowAdvisor;
};
QmitkExtWorkbenchWindowAdvisor::QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor,
berry::IWorkbenchWindowConfigurer::Pointer configurer) :
berry::WorkbenchWindowAdvisor(configurer),
lastInput(0),
wbAdvisor(wbAdvisor),
showViewToolbar(true),
showPerspectiveToolbar(false),
showVersionInfo(true),
showMitkVersionInfo(true),
showViewMenuItem(true),
showNewWindowMenuItem(false),
showClosePerspectiveMenuItem(true),
- enableViewBrowser(true),
+ enableCandyStore(true),
+ showMemoryIndicator(true),
dropTargetListener(new QmitkDefaultDropTargetListener)
{
productName = QCoreApplication::applicationName().toStdString();
}
berry::ActionBarAdvisor::Pointer QmitkExtWorkbenchWindowAdvisor::CreateActionBarAdvisor(
berry::IActionBarConfigurer::Pointer configurer)
{
berry::ActionBarAdvisor::Pointer actionBarAdvisor(
new QmitkExtActionBarAdvisor(configurer));
return actionBarAdvisor;
}
void* QmitkExtWorkbenchWindowAdvisor::CreateEmptyWindowContents(void* parent)
{
QWidget* parentWidget = static_cast(parent);
QLabel* label = new QLabel(parentWidget);
label->setText("No perspectives are open. Open a perspective in the Window->Open Perspective menu.");
label->setContentsMargins(10,10,10,10);
label->setAlignment(Qt::AlignTop);
label->setEnabled(false);
parentWidget->layout()->addWidget(label);
return label;
}
void QmitkExtWorkbenchWindowAdvisor::ShowClosePerspectiveMenuItem(bool show)
{
showClosePerspectiveMenuItem = show;
}
bool QmitkExtWorkbenchWindowAdvisor::GetShowClosePerspectiveMenuItem()
{
return showClosePerspectiveMenuItem;
}
+void QmitkExtWorkbenchWindowAdvisor::ShowMemoryIndicator(bool show)
+{
+ showMemoryIndicator = show;
+}
+
+bool QmitkExtWorkbenchWindowAdvisor::GetShowMemoryIndicator()
+{
+ return showMemoryIndicator;
+}
-void QmitkExtWorkbenchWindowAdvisor::EnableViewBrowser(bool enable)
+void QmitkExtWorkbenchWindowAdvisor::EnableCandyStore(bool enable)
{
- enableViewBrowser = enable;
+ enableCandyStore = enable;
}
-bool QmitkExtWorkbenchWindowAdvisor::GetEnableViewBrowser()
+bool QmitkExtWorkbenchWindowAdvisor::GetEnableCandyStore()
{
- return enableViewBrowser;
+ return enableCandyStore;
}
void QmitkExtWorkbenchWindowAdvisor::ShowNewWindowMenuItem(bool show)
{
showNewWindowMenuItem = show;
}
void QmitkExtWorkbenchWindowAdvisor::ShowViewToolbar(bool show)
{
showViewToolbar = show;
}
void QmitkExtWorkbenchWindowAdvisor::ShowViewMenuItem(bool show)
{
showViewMenuItem = show;
}
void QmitkExtWorkbenchWindowAdvisor::ShowPerspectiveToolbar(bool show)
{
showPerspectiveToolbar = show;
}
void QmitkExtWorkbenchWindowAdvisor::ShowVersionInfo(bool show)
{
showVersionInfo = show;
}
void QmitkExtWorkbenchWindowAdvisor::ShowMitkVersionInfo(bool show)
{
showMitkVersionInfo = show;
}
void QmitkExtWorkbenchWindowAdvisor::SetProductName(const std::string& product)
{
productName = product;
}
void QmitkExtWorkbenchWindowAdvisor::SetWindowIcon(const std::string& wndIcon)
{
windowIcon = wndIcon;
}
-void QmitkExtWorkbenchWindowAdvisor::onViewBrowser()
+void QmitkExtWorkbenchWindowAdvisor::onCandyStore()
{
- viewBrowser->setVisible(viewBrowserAction->isChecked());
+ candyStore->setVisible(candyStoreAction->isChecked());
}
void QmitkExtWorkbenchWindowAdvisor::PostWindowCreate()
{
// very bad hack...
berry::IWorkbenchWindow::Pointer window =
this->GetWindowConfigurer()->GetWindow();
QMainWindow* mainWindow =
static_cast (window->GetShell()->GetControl());
window->SetPerspectiveExcludeList(perspectiveExcludeList);
window->SetViewExcludeList(viewExcludeList);
if (!windowIcon.empty())
{
mainWindow->setWindowIcon(QIcon(QString::fromStdString(windowIcon)));
}
mainWindow->setContextMenuPolicy(Qt::PreventContextMenu);
/*mainWindow->setStyleSheet("color: white;"
"background-color: #808080;"
"selection-color: #659EC7;"
"selection-background-color: #808080;"
" QMenuBar {"
"background-color: #808080; }");*/
// ==== Application menu ============================
QMenuBar* menuBar = mainWindow->menuBar();
menuBar->setContextMenuPolicy(Qt::PreventContextMenu);
QMenu* fileMenu = menuBar->addMenu("&File");
fileMenu->setObjectName("FileMenu");
QAction* fileOpenAction = new QmitkFileOpenAction(QIcon(":/org.mitk.gui.qt.ext/Load_48.png"), window);
fileMenu->addAction(fileOpenAction);
fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window);
fileSaveProjectAction->setIcon(QIcon(":/org.mitk.gui.qt.ext/Save_48.png"));
fileMenu->addAction(fileSaveProjectAction);
closeProjectAction = new QmitkCloseProjectAction(window);
closeProjectAction->setIcon(QIcon(":/org.mitk.gui.qt.ext/Remove_48.png"));
fileMenu->addAction(closeProjectAction);
fileMenu->addSeparator();
QAction* fileExitAction = new QmitkFileExitAction(window);
fileExitAction->setObjectName("QmitkFileExitAction");
fileMenu->addAction(fileExitAction);
if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
{
openDicomEditorAction = new QmitkOpenDicomEditorAction(QIcon(":/org.mitk.gui.qt.ext/dcm-icon.png"),window);
}
if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser"))
{
openXnatEditorAction = new QmitkOpenXnatEditorAction(QIcon(":/org.mitk.gui.qt.ext/xnat-icon.png"),window);
}
berry::IViewRegistry* viewRegistry =
berry::PlatformUI::GetWorkbench()->GetViewRegistry();
const std::vector& viewDescriptors =
viewRegistry->GetViews();
// another bad hack to get an edit/undo menu...
QMenu* editMenu = menuBar->addMenu("&Edit");
undoAction = editMenu->addAction(QIcon(":/org.mitk.gui.qt.ext/Undo_48.png"),
"&Undo",
QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()),
QKeySequence("CTRL+Z"));
undoAction->setToolTip("Undo the last action (not supported by all modules)");
redoAction = editMenu->addAction(QIcon(":/org.mitk.gui.qt.ext/Redo_48.png")
, "&Redo",
QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()),
QKeySequence("CTRL+Y"));
redoAction->setToolTip("execute the last action that was undone again (not supported by all modules)");
imageNavigatorAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Slider.png"), "&Image Navigator", NULL);
bool imageNavigatorViewFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.imagenavigator");
if (imageNavigatorViewFound)
{
QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator()));
imageNavigatorAction->setCheckable(true);
// add part listener for image navigator
imageNavigatorPartListener = new PartListenerForImageNavigator(imageNavigatorAction);
window->GetPartService()->AddPartListener(imageNavigatorPartListener);
berry::IViewPart::Pointer imageNavigatorView =
window->GetActivePage()->FindView("org.mitk.views.imagenavigator");
imageNavigatorAction->setChecked(false);
if (imageNavigatorView)
{
bool isImageNavigatorVisible = window->GetActivePage()->IsPartVisible(imageNavigatorView);
if (isImageNavigatorVisible)
imageNavigatorAction->setChecked(true);
}
imageNavigatorAction->setToolTip("Toggle image navigator for navigating through image");
}
- // add view browser
- viewBrowserAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Slider.png"), "&View Browser", NULL);
- if (enableViewBrowser)
- {
- QObject::connect(viewBrowserAction, SIGNAL(triggered(bool)), SLOT(onViewBrowser()));
- viewBrowserAction->setCheckable(true);
- viewBrowserAction->setChecked(false);
- viewBrowserAction->setToolTip("Toggle view browser");
- }
-
// toolbar for showing file open, undo, redo and other main actions
QToolBar* mainActionsToolBar = new QToolBar;
mainActionsToolBar->setObjectName("mainActionsToolBar");
mainActionsToolBar->setContextMenuPolicy(Qt::PreventContextMenu);
#ifdef __APPLE__
mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextUnderIcon );
#else
mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon );
#endif
mainActionsToolBar->addAction(fileOpenAction);
mainActionsToolBar->addAction(fileSaveProjectAction);
mainActionsToolBar->addAction(closeProjectAction);
mainActionsToolBar->addAction(undoAction);
mainActionsToolBar->addAction(redoAction);
if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor"))
{
mainActionsToolBar->addAction(openDicomEditorAction);
}
if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.xnat.browser"))
{
mainActionsToolBar->addAction(openXnatEditorAction);
}
if (imageNavigatorViewFound)
{
mainActionsToolBar->addAction(imageNavigatorAction);
}
- if (enableViewBrowser)
+
+ if (enableCandyStore)
{
- mainActionsToolBar->addAction(viewBrowserAction);
+ candyStoreAction = new QAction(QIcon(":/org.mitk.gui.qt.ext/Candy_icon.png"), "&Candy Store", NULL);
+ QObject::connect(candyStoreAction, SIGNAL(triggered(bool)), SLOT(onCandyStore()));
+ candyStoreAction->setCheckable(true);
+ candyStoreAction->setChecked(false);
+ candyStoreAction->setToolTip("Toggle Candy Store");
+ mainActionsToolBar->addAction(candyStoreAction);
}
mainWindow->addToolBar(mainActionsToolBar);
#ifdef __APPLE__
mainWindow->setUnifiedTitleAndToolBarOnMac(true);
#endif
// ==== Window Menu ==========================
QMenu* windowMenu = menuBar->addMenu("Window");
if (showNewWindowMenuItem)
{
windowMenu->addAction("&New Window", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onNewWindow()));
windowMenu->addSeparator();
}
QMenu* perspMenu = windowMenu->addMenu("&Open Perspective");
QMenu* viewMenu;
if (showViewMenuItem)
{
viewMenu = windowMenu->addMenu("Show &View");
viewMenu->setObjectName("Show View");
}
windowMenu->addSeparator();
resetPerspAction = windowMenu->addAction("&Reset Perspective",
QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective()));
if(showClosePerspectiveMenuItem)
closePerspAction = windowMenu->addAction("&Close Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onClosePerspective()));
windowMenu->addSeparator();
windowMenu->addAction("&Preferences...",
QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()),
QKeySequence("CTRL+P"));
// fill perspective menu
berry::IPerspectiveRegistry* perspRegistry =
window->GetWorkbench()->GetPerspectiveRegistry();
QActionGroup* perspGroup = new QActionGroup(menuBar);
std::vector perspectives(
perspRegistry->GetPerspectives());
bool skip = false;
for (std::vector::iterator perspIt =
perspectives.begin(); perspIt != perspectives.end(); ++perspIt)
{
// if perspectiveExcludeList is set, it contains the id-strings of perspectives, which
// should not appear as an menu-entry in the perspective menu
if (perspectiveExcludeList.size() > 0)
{
for (unsigned int i=0; iGetId())
{
skip = true;
break;
}
}
if (skip)
{
skip = false;
continue;
}
}
QAction* perspAction = new berry::QtOpenPerspectiveAction(window,
*perspIt, perspGroup);
mapPerspIdToAction.insert(std::make_pair((*perspIt)->GetId(), perspAction));
}
perspMenu->addActions(perspGroup->actions());
// sort elements (converting vector to map...)
std::vector::const_iterator iter;
std::map VDMap;
skip = false;
for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter)
{
// if viewExcludeList is set, it contains the id-strings of view, which
// should not appear as an menu-entry in the menu
if (viewExcludeList.size() > 0)
{
for (unsigned int i=0; iGetId())
{
skip = true;
break;
}
}
if (skip)
{
skip = false;
continue;
}
}
if ((*iter)->GetId() == "org.blueberry.ui.internal.introview")
continue;
if ((*iter)->GetId() == "org.mitk.views.imagenavigator")
continue;
std::pair p(
(*iter)->GetLabel(), (*iter));
VDMap.insert(p);
}
// ==================================================
// ==== Perspective Toolbar ==================================
QToolBar* qPerspectiveToolbar = new QToolBar;
qPerspectiveToolbar->setObjectName("perspectiveToolBar");
if (showPerspectiveToolbar)
{
qPerspectiveToolbar->addActions(perspGroup->actions());
mainWindow->addToolBar(qPerspectiveToolbar);
}
else
delete qPerspectiveToolbar;
// ==== View Toolbar ==================================
QToolBar* qToolbar = new QToolBar;
qToolbar->setObjectName("viewToolBar");
std::map::const_iterator
MapIter;
for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter)
{
berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window,
(*MapIter).second);
viewActions.push_back(viewAction);
if(showViewMenuItem)
viewMenu->addAction(viewAction);
if (showViewToolbar)
{
qToolbar->addAction(viewAction);
}
}
if (showViewToolbar)
{
mainWindow->addToolBar(qToolbar);
}
else
delete qToolbar;
QSettings settings(GetQSettingsFile(), QSettings::IniFormat);
mainWindow->restoreState(settings.value("ToolbarPosition").toByteArray());
// ====================================================
// ===== Help menu ====================================
QMenu* helpMenu = menuBar->addMenu("&Help");
helpMenu->addAction("&Welcome",this, SLOT(onIntro()));
helpMenu->addAction("&Open Help Perspective", this, SLOT(onHelpOpenHelpPerspective()));
helpMenu->addAction("&Context Help",this, SLOT(onHelp()), QKeySequence("F1"));
helpMenu->addAction("&About",this, SLOT(onAbout()));
// =====================================================
QStatusBar* qStatusBar = new QStatusBar();
//creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar
QmitkStatusBar *statusBar = new QmitkStatusBar(qStatusBar);
//disabling the SizeGrip in the lower right corner
statusBar->SetSizeGripEnabled(false);
QmitkProgressBar *progBar = new QmitkProgressBar();
qStatusBar->addPermanentWidget(progBar, 0);
progBar->hide();
// progBar->AddStepsToDo(2);
// progBar->Progress(1);
mainWindow->setStatusBar(qStatusBar);
- viewBrowser = new QDockWidget("View Browser");
- viewBrowser->setWidget(new QmitkViewBrowserWidget());
- viewBrowser->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
- viewBrowser->setVisible(false);
- mainWindow->addDockWidget(Qt::LeftDockWidgetArea, viewBrowser);
+// QLabel* label = new QLabel();
+// label->setText(" Candy Store");
+ candyStore = new QDockWidget("Candy Store");
+ candyStore->setWidget(new QmitkCandyStoreWidget());
+ candyStore->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
+ candyStore->setVisible(false);
+ candyStore->setObjectName("Candy Store");
+// candyStore->setTitleBarWidget(label);
+ mainWindow->addDockWidget(Qt::LeftDockWidgetArea, candyStore);
- QmitkMemoryUsageIndicatorView* memoryIndicator =
- new QmitkMemoryUsageIndicatorView();
- qStatusBar->addPermanentWidget(memoryIndicator, 0);
+ if (showMemoryIndicator)
+ {
+ QmitkMemoryUsageIndicatorView* memoryIndicator = new QmitkMemoryUsageIndicatorView();
+ qStatusBar->addPermanentWidget(memoryIndicator, 0);
+ }
}
void QmitkExtWorkbenchWindowAdvisor::PreWindowOpen()
{
berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer();
// show the shortcut bar and progress indicator, which are hidden by
// default
//configurer->SetShowPerspectiveBar(true);
//configurer->SetShowFastViewBars(true);
//configurer->SetShowProgressIndicator(true);
// // add the drag and drop support for the editor area
// configurer.addEditorAreaTransfer(EditorInputTransfer.getInstance());
// configurer.addEditorAreaTransfer(ResourceTransfer.getInstance());
// configurer.addEditorAreaTransfer(FileTransfer.getInstance());
// configurer.addEditorAreaTransfer(MarkerTransfer.getInstance());
// configurer.configureEditorAreaDropListener(new EditorAreaDropAdapter(
// configurer.getWindow()));
this->HookTitleUpdateListeners(configurer);
menuPerspectiveListener = new PerspectiveListenerForMenu(this);
configurer->GetWindow()->AddPerspectiveListener(menuPerspectiveListener);
configurer->AddEditorAreaTransfer(QStringList("text/uri-list"));
configurer->ConfigureEditorAreaDropListener(dropTargetListener);
}
void QmitkExtWorkbenchWindowAdvisor::PostWindowOpen()
{
// Force Rendering Window Creation on startup.
berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer();
ctkPluginContext* context = QmitkCommonExtPlugin::getContext();
ctkServiceReference serviceRef = context->getServiceReference();
if (serviceRef)
{
mitk::IDataStorageService *dsService = context->getService(serviceRef);
if (dsService)
{
mitk::IDataStorageReference::Pointer dsRef = dsService->GetDataStorage();
mitk::DataStorageEditorInput::Pointer dsInput(new mitk::DataStorageEditorInput(dsRef));
mitk::WorkbenchUtil::OpenEditor(configurer->GetWindow()->GetActivePage(),dsInput);
}
}
}
void QmitkExtWorkbenchWindowAdvisor::onIntro()
{
QmitkExtWorkbenchWindowAdvisorHack::undohack->onIntro();
}
void QmitkExtWorkbenchWindowAdvisor::onHelp()
{
QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelp();
}
void QmitkExtWorkbenchWindowAdvisor::onHelpOpenHelpPerspective()
{
QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelpOpenHelpPerspective();
}
void QmitkExtWorkbenchWindowAdvisor::onAbout()
{
QmitkExtWorkbenchWindowAdvisorHack::undohack->onAbout();
}
//--------------------------------------------------------------------------------
// Ugly hack from here on. Feel free to delete when command framework
// and undo buttons are done.
//--------------------------------------------------------------------------------
QmitkExtWorkbenchWindowAdvisorHack::QmitkExtWorkbenchWindowAdvisorHack() : QObject()
{
}
QmitkExtWorkbenchWindowAdvisorHack::~QmitkExtWorkbenchWindowAdvisorHack()
{
}
void QmitkExtWorkbenchWindowAdvisorHack::onUndo()
{
mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel();
if (model)
{
if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model ))
{
mitk::VerboseLimitedLinearUndo::StackDescription descriptions =
verboseundo->GetUndoDescriptions();
if (descriptions.size() >= 1)
{
MITK_INFO << "Undo " << descriptions.front().second;
}
}
model->Undo();
}
else
{
MITK_ERROR << "No undo model instantiated";
}
}
void QmitkExtWorkbenchWindowAdvisorHack::onRedo()
{
mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel();
if (model)
{
if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model ))
{
mitk::VerboseLimitedLinearUndo::StackDescription descriptions =
verboseundo->GetRedoDescriptions();
if (descriptions.size() >= 1)
{
MITK_INFO << "Redo " << descriptions.front().second;
}
}
model->Redo();
}
else
{
MITK_ERROR << "No undo model instantiated";
}
}
void QmitkExtWorkbenchWindowAdvisorHack::onImageNavigator()
{
// get ImageNavigatorView
berry::IViewPart::Pointer imageNavigatorView =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.imagenavigator");
if (imageNavigatorView)
{
bool isImageNavigatorVisible = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->IsPartVisible(imageNavigatorView);
if (isImageNavigatorVisible)
{
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->HideView(imageNavigatorView);
return;
}
}
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.imagenavigator");
//berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
}
-void QmitkExtWorkbenchWindowAdvisorHack::onViewBrowser()
-{
- // get view browser
- berry::IViewPart::Pointer viewBrowser =
- berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.viewbrowser");
- if (viewBrowser)
- {
- bool isVisible = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->IsPartVisible(viewBrowser);
- if (isVisible)
- {
- berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->HideView(viewBrowser);
- return;
- }
- }
- berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.viewbrowser");
-}
-
void QmitkExtWorkbenchWindowAdvisorHack::onEditPreferences()
{
QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow());
_PreferencesDialog.exec();
}
void QmitkExtWorkbenchWindowAdvisorHack::onQuit()
{
berry::PlatformUI::GetWorkbench()->Close();
}
void QmitkExtWorkbenchWindowAdvisorHack::onResetPerspective()
{
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
}
void QmitkExtWorkbenchWindowAdvisorHack::onClosePerspective()
{
berry::IWorkbenchPage::Pointer
page =
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage();
page->ClosePerspective(page->GetPerspective(), true, true);
}
void QmitkExtWorkbenchWindowAdvisorHack::onNewWindow()
{
berry::PlatformUI::GetWorkbench()->OpenWorkbenchWindow(0);
}
void QmitkExtWorkbenchWindowAdvisorHack::onIntro()
{
bool hasIntro =
berry::PlatformUI::GetWorkbench()->GetIntroManager()->HasIntro();
if (!hasIntro)
{
QRegExp reg("(.*)(\\n)*");
QRegExp reg2("(\\n)*(.*)");
QFile file(":/org.mitk.gui.qt.ext/index.html");
file.open(QIODevice::ReadOnly | QIODevice::Text); //text file only for reading
QString text = QString(file.readAll());
file.close();
QString title = text;
title.replace(reg, "");
title.replace(reg2, "");
std::cout << title.toStdString() << std::endl;
QMessageBox::information(NULL, title,
text, "Close");
}
else
{
berry::PlatformUI::GetWorkbench()->GetIntroManager()->ShowIntro(
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(), false);
}
}
void QmitkExtWorkbenchWindowAdvisorHack::onHelp()
{
ctkPluginContext* context = QmitkCommonExtPlugin::getContext();
if (context == 0)
{
MITK_WARN << "Plugin context not set, unable to open context help";
return;
}
// Check if the org.blueberry.ui.qt.help plug-in is installed and started
QList > plugins = context->getPlugins();
foreach(QSharedPointer p, plugins)
{
if (p->getSymbolicName() == "org.blueberry.ui.qt.help")
{
if (p->getState() != ctkPlugin::ACTIVE)
{
// try to activate the plug-in explicitly
try
{
p->start(ctkPlugin::START_TRANSIENT);
}
catch (const ctkPluginException& pe)
{
MITK_ERROR << "Activating org.blueberry.ui.qt.help failed: " << pe.what();
return;
}
}
}
}
ctkServiceReference eventAdminRef = context->getServiceReference();
ctkEventAdmin* eventAdmin = 0;
if (eventAdminRef)
{
eventAdmin = context->getService(eventAdminRef);
}
if (eventAdmin == 0)
{
MITK_WARN << "ctkEventAdmin service not found. Unable to open context help";
}
else
{
ctkEvent ev("org/blueberry/ui/help/CONTEXTHELP_REQUESTED");
eventAdmin->postEvent(ev);
}
}
void QmitkExtWorkbenchWindowAdvisorHack::onHelpOpenHelpPerspective()
{
berry::PlatformUI::GetWorkbench()->ShowPerspective("org.blueberry.perspectives.help",
berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow());
}
void QmitkExtWorkbenchWindowAdvisorHack::onAbout()
{
QmitkAboutDialog* aboutDialog = new QmitkAboutDialog(QApplication::activeWindow(),NULL);
aboutDialog->open();
}
void QmitkExtWorkbenchWindowAdvisor::HookTitleUpdateListeners(
berry::IWorkbenchWindowConfigurer::Pointer configurer)
{
// hook up the listeners to update the window title
titlePartListener = new PartListenerForTitle(this);
titlePerspectiveListener = new PerspectiveListenerForTitle(this);
editorPropertyListener = new berry::PropertyChangeIntAdapter<
QmitkExtWorkbenchWindowAdvisor>(this,
&QmitkExtWorkbenchWindowAdvisor::PropertyChange);
// configurer.getWindow().addPageListener(new IPageListener() {
// public void pageActivated(IWorkbenchPage page) {
// updateTitle(false);
// }
//
// public void pageClosed(IWorkbenchPage page) {
// updateTitle(false);
// }
//
// public void pageOpened(IWorkbenchPage page) {
// // do nothing
// }
// });
configurer->GetWindow()->AddPerspectiveListener(titlePerspectiveListener);
configurer->GetWindow()->GetPartService()->AddPartListener(titlePartListener);
}
std::string QmitkExtWorkbenchWindowAdvisor::ComputeTitle()
{
berry::IWorkbenchWindowConfigurer::Pointer configurer =
GetWindowConfigurer();
berry::IWorkbenchPage::Pointer currentPage =
configurer->GetWindow()->GetActivePage();
berry::IEditorPart::Pointer activeEditor;
if (currentPage)
{
activeEditor = lastActiveEditor.Lock();
}
std::string title;
//TODO Product
// IProduct product = Platform.getProduct();
// if (product != null) {
// title = product.getName();
// }
// instead of the product name, we use a custom variable for now
title = productName;
if(showMitkVersionInfo)
{
title += std::string(" ") + MITK_VERSION_STRING;
}
if (showVersionInfo)
{
// add version informatioin
QString versions = QString(" (ITK %1.%2.%3 VTK %4.%5.%6 Qt %7 MITK %8)")
.arg(ITK_VERSION_MAJOR).arg(ITK_VERSION_MINOR).arg(ITK_VERSION_PATCH)
.arg(VTK_MAJOR_VERSION).arg(VTK_MINOR_VERSION).arg(VTK_BUILD_VERSION)
.arg(QT_VERSION_STR)
.arg(MITK_VERSION_STRING);
title += versions.toStdString();
}
if (currentPage)
{
if (activeEditor)
{
lastEditorTitle = activeEditor->GetTitleToolTip();
if (!lastEditorTitle.empty())
title = lastEditorTitle + " - " + title;
}
berry::IPerspectiveDescriptor::Pointer persp =
currentPage->GetPerspective();
std::string label = "";
if (persp)
{
label = persp->GetLabel();
}
berry::IAdaptable* input = currentPage->GetInput();
if (input && input != wbAdvisor->GetDefaultPageInput())
{
label = currentPage->GetLabel();
}
if (!label.empty())
{
title = label + " - " + title;
}
}
title += " (Not for use in diagnosis or treatment of patients)";
return title;
}
void QmitkExtWorkbenchWindowAdvisor::RecomputeTitle()
{
berry::IWorkbenchWindowConfigurer::Pointer configurer =
GetWindowConfigurer();
std::string oldTitle = configurer->GetTitle();
std::string newTitle = ComputeTitle();
if (newTitle != oldTitle)
{
configurer->SetTitle(newTitle);
}
}
void QmitkExtWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden)
{
berry::IWorkbenchWindowConfigurer::Pointer configurer =
GetWindowConfigurer();
berry::IWorkbenchWindow::Pointer window = configurer->GetWindow();
berry::IEditorPart::Pointer activeEditor;
berry::IWorkbenchPage::Pointer currentPage = window->GetActivePage();
berry::IPerspectiveDescriptor::Pointer persp;
berry::IAdaptable* input = 0;
if (currentPage)
{
activeEditor = currentPage->GetActiveEditor();
persp = currentPage->GetPerspective();
input = currentPage->GetInput();
}
if (editorHidden)
{
activeEditor = 0;
}
// Nothing to do if the editor hasn't changed
if (activeEditor == lastActiveEditor.Lock() && currentPage == lastActivePage.Lock()
&& persp == lastPerspective.Lock() && input == lastInput)
{
return;
}
if (!lastActiveEditor.Expired())
{
lastActiveEditor.Lock()->RemovePropertyListener(editorPropertyListener);
}
lastActiveEditor = activeEditor;
lastActivePage = currentPage;
lastPerspective = persp;
lastInput = input;
if (activeEditor)
{
activeEditor->AddPropertyListener(editorPropertyListener);
}
RecomputeTitle();
}
void QmitkExtWorkbenchWindowAdvisor::PropertyChange(berry::Object::Pointer /*source*/, int propId)
{
if (propId == berry::IWorkbenchPartConstants::PROP_TITLE)
{
if (!lastActiveEditor.Expired())
{
std::string newTitle = lastActiveEditor.Lock()->GetPartName();
if (lastEditorTitle != newTitle)
{
RecomputeTitle();
}
}
}
}
void QmitkExtWorkbenchWindowAdvisor::SetPerspectiveExcludeList(std::vector v)
{
this->perspectiveExcludeList = v;
}
std::vector QmitkExtWorkbenchWindowAdvisor::GetPerspectiveExcludeList()
{
return this->perspectiveExcludeList;
}
void QmitkExtWorkbenchWindowAdvisor::SetViewExcludeList(std::vector v)
{
this->viewExcludeList = v;
}
std::vector QmitkExtWorkbenchWindowAdvisor::GetViewExcludeList()
{
return this->viewExcludeList;
}
void QmitkExtWorkbenchWindowAdvisor::PostWindowClose()
{
berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow();
QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl());
QSettings settings(GetQSettingsFile(), QSettings::IniFormat);
settings.setValue("ToolbarPosition", mainWindow->saveState());
}
QString QmitkExtWorkbenchWindowAdvisor::GetQSettingsFile() const
{
QFileInfo settingsInfo = QmitkCommonExtPlugin::getContext()->getDataFile(QT_SETTINGS_FILENAME);
return settingsInfo.canonicalFilePath();
}
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
index 56a3e48229..f79da801a3 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
@@ -1,180 +1,185 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#ifndef QMITKEXTWORKBENCHWINDOWADVISOR_H_
#define QMITKEXTWORKBENCHWINDOWADVISOR_H_
#include
#include
#include
#include
#include
#include
#include
#include
#include
-#include
+#include
class QAction;
class QMenu;
class MITK_QT_COMMON_EXT_EXPORT QmitkExtWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor
{
Q_OBJECT
public:
QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor,
berry::IWorkbenchWindowConfigurer::Pointer configurer);
berry::ActionBarAdvisor::Pointer CreateActionBarAdvisor(
berry::IActionBarConfigurer::Pointer configurer);
void* CreateEmptyWindowContents(void* parent);
void PostWindowCreate();
void PreWindowOpen();
void PostWindowOpen();
void PostWindowClose();
void ShowViewToolbar(bool show);
void ShowPerspectiveToolbar(bool show);
void ShowVersionInfo(bool show);
void ShowMitkVersionInfo(bool show);
void ShowViewMenuItem(bool show);
void ShowNewWindowMenuItem(bool show);
void ShowClosePerspectiveMenuItem(bool show);
bool GetShowClosePerspectiveMenuItem();
- void EnableViewBrowser(bool enable);
+ void EnableCandyStore(bool enable);
- bool GetEnableViewBrowser();
+ bool GetEnableCandyStore();
+
+ void ShowMemoryIndicator(bool show);
+
+ bool GetShowMemoryIndicator();
//TODO should be removed when product support is here
void SetProductName(const std::string& product);
void SetWindowIcon(const std::string& wndIcon);
void SetPerspectiveExcludeList(std::vector v);
std::vector GetPerspectiveExcludeList();
void SetViewExcludeList(std::vector v);
std::vector GetViewExcludeList();
protected slots:
virtual void onIntro();
virtual void onHelp();
virtual void onHelpOpenHelpPerspective();
virtual void onAbout();
- void onViewBrowser();
+ void onCandyStore();
private:
/**
* Hooks the listeners needed on the window
*
* @param configurer
*/
void HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer);
std::string ComputeTitle();
void RecomputeTitle();
QString GetQSettingsFile() const;
/**
* Updates the window title. Format will be: [pageInput -]
* [currentPerspective -] [editorInput -] [workspaceLocation -] productName
* @param editorHidden TODO
*/
void UpdateTitle(bool editorHidden);
void PropertyChange(berry::Object::Pointer /*source*/, int propId);
static QString QT_SETTINGS_FILENAME;
berry::IPartListener::Pointer titlePartListener;
berry::IPerspectiveListener::Pointer titlePerspectiveListener;
berry::IPerspectiveListener::Pointer menuPerspectiveListener;
berry::IPartListener::Pointer imageNavigatorPartListener;
- berry::IPartListener::Pointer viewBrowserPartListener;
+ berry::IPartListener::Pointer CandyStorePartListener;
berry::IPropertyChangeListener::Pointer editorPropertyListener;
friend struct berry::PropertyChangeIntAdapter;
friend class PartListenerForTitle;
friend class PerspectiveListenerForTitle;
friend class PerspectiveListenerForMenu;
friend class PartListenerForImageNavigator;
berry::IEditorPart::WeakPtr lastActiveEditor;
berry::IPerspectiveDescriptor::WeakPtr lastPerspective;
berry::IWorkbenchPage::WeakPtr lastActivePage;
std::string lastEditorTitle;
berry::IAdaptable* lastInput;
berry::WorkbenchAdvisor* wbAdvisor;
bool showViewToolbar;
bool showPerspectiveToolbar;
bool showVersionInfo;
bool showMitkVersionInfo;
bool showViewMenuItem;
bool showNewWindowMenuItem;
bool showClosePerspectiveMenuItem;
- bool enableViewBrowser;
+ bool enableCandyStore;
+ bool showMemoryIndicator;
std::string productName;
std::string windowIcon;
// enables DnD on the editor area
berry::IDropTargetListener::Pointer dropTargetListener;
// stringlist for excluding perspectives from the perspective menu entry (e.g. Welcome Perspective)
std::vector perspectiveExcludeList;
// stringlist for excluding views from the menu entry
std::vector viewExcludeList;
// maps perspective ids to QAction objects
std::map mapPerspIdToAction;
// actions which will be enabled/disabled depending on the application state
QList viewActions;
QAction* fileSaveProjectAction;
QAction* closeProjectAction;
QAction* undoAction;
QAction* redoAction;
QAction* imageNavigatorAction;
- QAction* viewBrowserAction;
+ QAction* candyStoreAction;
QAction* resetPerspAction;
QAction* closePerspAction;
QAction* openDicomEditorAction;
QAction* openXnatEditorAction;
- QDockWidget* viewBrowser;
+ QDockWidget* candyStore;
};
#endif /*QMITKEXTWORKBENCHWINDOWADVISOR_H_*/
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
index d644b2cf58..96f8edb1d1 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
@@ -1,59 +1,58 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include
class ctkPluginContext;
class QmitkPreferencesDialog;
class QmitkExtWorkbenchWindowAdvisorHack : public QObject
{
Q_OBJECT
public slots:
void onUndo();
void onRedo();
void onImageNavigator();
- void onViewBrowser();
void onEditPreferences();
void onQuit();
void onResetPerspective();
void onClosePerspective();
void onNewWindow();
void onIntro();
/**
* @brief This slot is called if the user klicks the menu item "help->context help" or presses F1.
* The help page is shown in a workbench editor.
*/
void onHelp();
void onHelpOpenHelpPerspective();
/**
* @brief This slot is called if the user clicks in help menu the about button
*/
void onAbout();
public:
QmitkExtWorkbenchWindowAdvisorHack();
~QmitkExtWorkbenchWindowAdvisorHack();
static QmitkExtWorkbenchWindowAdvisorHack* undohack;
};
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.cpp b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.cpp
index 084c10b639..12889eb454 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.cpp
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.cpp
@@ -1,60 +1,61 @@
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "QmitkExtAppWorkbenchAdvisor.h"
#include "internal/QmitkExtApplicationPlugin.h"
#include
const std::string QmitkExtAppWorkbenchAdvisor::DEFAULT_PERSPECTIVE_ID =
"org.mitk.extapp.defaultperspective";
void
QmitkExtAppWorkbenchAdvisor::Initialize(berry::IWorkbenchConfigurer::Pointer configurer)
{
berry::QtWorkbenchAdvisor::Initialize(configurer);
configurer->SetSaveAndRestore(true);
}
berry::WorkbenchWindowAdvisor*
QmitkExtAppWorkbenchAdvisor::CreateWorkbenchWindowAdvisor(
berry::IWorkbenchWindowConfigurer::Pointer configurer)
{
QmitkExtWorkbenchWindowAdvisor* advisor = new
QmitkExtWorkbenchWindowAdvisor(this, configurer);
// Exclude the help perspective from org.blueberry.ui.qt.help from
// the normal perspective list.
// The perspective gets a dedicated menu entry in the help menu
std::vector excludePerspectives;
excludePerspectives.push_back("org.blueberry.perspectives.help");
advisor->SetPerspectiveExcludeList(excludePerspectives);
// Exclude some views from the normal view list
std::vector excludeViews;
excludeViews.push_back("org.mitk.views.modules");
+ excludeViews.push_back( "org.blueberry.ui.internal.introview" );
advisor->SetViewExcludeList(excludeViews);
advisor->SetWindowIcon(":/org.mitk.gui.qt.extapplication/icon.png");
return advisor;
//return new QmitkExtWorkbenchWindowAdvisor(this, configurer);
}
std::string QmitkExtAppWorkbenchAdvisor::GetInitialWindowPerspectiveId()
{
return DEFAULT_PERSPECTIVE_ID;
}
diff --git a/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml b/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml
index 7aee1a8968..32c792be7d 100644
--- a/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml
+++ b/Plugins/org.mitk.gui.qt.moviemaker/plugin.xml
@@ -1,27 +1,35 @@
+ icon="resources/icon.xpm" >
+ Take movies of your data
+
+
- This is a short information about this perspective
+ Take screenshots of your data
-
-
-
+
+
+
+
+
+
+
+
+
+
+