diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake b/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake index 25763e1c3a..06c28a6161 100644 --- a/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake +++ b/Modules/Bundles/org.mitk.gui.qt.ext/files.cmake @@ -1,55 +1,56 @@ SET(SRC_CPP_FILES QmitkCommonWorkbenchWindowAdvisor.cpp - QmitkExtPreferencePage.cpp - QmitkInputDevicesPrefPage.cpp QmitkExtActionBarAdvisor.cpp QmitkExtWorkbenchWindowAdvisor.cpp QmitkExtFileOpenAction.cpp QmitkExtDnDFrameWidget.cpp QmitkExtFileSaveProjectAction.cpp ) SET(INTERNAL_CPP_FILES + QmitkAppInstancesPreferencePage.cpp QmitkCommonExtPlugin.cpp + QmitkInputDevicesPrefPage.cpp QmitkModuleView.cpp ) SET(UI_FILES - + src/internal/QmitkAppInstancesPreferencePage.ui ) SET(MOC_H_FILES - src/internal/QmitkCommonExtPlugin.h - src/internal/QmitkExtWorkbenchWindowAdvisorHack.h - src/internal/QmitkModuleView.h src/QmitkExtFileOpenAction.h src/QmitkExtFileSaveProjectAction.h src/QmitkExtDnDFrameWidget.h - src/QmitkExtPreferencePage.h src/QmitkExtWorkbenchWindowAdvisor.h - src/QmitkInputDevicesPrefPage.h + + src/internal/QmitkAppInstancesPreferencePage.h + src/internal/QmitkCommonExtPlugin.h + src/internal/QmitkExtWorkbenchWindowAdvisorHack.h + src/internal/QmitkInputDevicesPrefPage.h + src/internal/QmitkModuleView.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/Modules/Bundles/org.mitk.gui.qt.ext/plugin.xml b/Modules/Bundles/org.mitk.gui.qt.ext/plugin.xml index 3ae9e69f12..36a65c3634 100644 --- a/Modules/Bundles/org.mitk.gui.qt.ext/plugin.xml +++ b/Modules/Bundles/org.mitk.gui.qt.ext/plugin.xml @@ -1,27 +1,32 @@ + - - + + - - + + - - - + + + + + + diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.cpp b/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.cpp deleted file mode 100644 index 9bae8f9cc1..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-07-07 16:57:15 +0200 (Di, 07 Jul 2009) $ -Version: $Revision: 18019 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#include "QmitkExtPreferencePage.h" - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -QmitkExtPreferencePage::QmitkExtPreferencePage() -: m_MainControl(0) -{ - -} - -QmitkExtPreferencePage::QmitkExtPreferencePage(const QmitkExtPreferencePage& other) -{ - Q_UNUSED(other) - throw std::runtime_error("Copy constructor not implemented"); -} - -void QmitkExtPreferencePage::Init(berry::IWorkbench::Pointer ) -{ -} - -void QmitkExtPreferencePage::CreateQtControl(QWidget* parent) -{ - //empty page - m_MainControl = new QWidget(parent); - QVBoxLayout *layout = new QVBoxLayout; - m_MainControl->setLayout(layout); - this->Update(); -} - -QWidget* QmitkExtPreferencePage::GetQtControl() const -{ - return m_MainControl; -} - -bool QmitkExtPreferencePage::PerformOk() -{ - return true; -} - -void QmitkExtPreferencePage::PerformCancel() -{ - -} - -void QmitkExtPreferencePage::Update() -{ -} diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.h b/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.h deleted file mode 100644 index cbf712a7b4..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtPreferencePage.h +++ /dev/null @@ -1,87 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date: 2009-02-10 14:14:32 +0100 (Di, 10 Feb 2009) $ -Version: $Revision: 16224 $ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - - -#ifndef QMITKExtPreferencePage_H_ -#define QMITKExtPreferencePage_H_ - -#include "berryIQtPreferencePage.h" -#include -#include - -class QWidget; -class QCheckBox; - -class QmitkExtPreferencePage : public QObject, public berry::IQtPreferencePage -{ - Q_OBJECT - Q_INTERFACES(berry::IPreferencePage) - -public: - - /** - * Default constructor - */ - QmitkExtPreferencePage(); - - QmitkExtPreferencePage(const QmitkExtPreferencePage& other); - - /** - * @see berry::IPreferencePage::Init(berry::IWorkbench::Pointer workbench) - */ - void Init(berry::IWorkbench::Pointer workbench); - - - /** - * @see berry::IPreferencePage::CreateQtControl(void* parent) - */ - void CreateQtControl(QWidget* widget); - - /** - * @see berry::IPreferencePage::CreateQtControl() - */ - QWidget* GetQtControl() const; - - /** - * @see berry::IPreferencePage::PerformOk() - */ - virtual bool PerformOk(); - - /** - * @see berry::IPreferencePage::PerformCancel() - */ - virtual void PerformCancel(); - - /** - * @see berry::IPreferencePage::Update() - */ - virtual void Update(); - - /** - * @see berry::IPreferencePage::FlushReferences() - */ - void FlushPreferences(); - -protected: - - QWidget* m_MainControl; - - berry::IPreferences::Pointer m_ExtPreferencesNode; - -}; - -#endif /* QMITKExtPreferencePage_H_ */ diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp new file mode 100644 index 0000000000..9d1c520208 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp @@ -0,0 +1,71 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + +#include "QmitkAppInstancesPreferencePage.h" + +#include +#include + +QmitkAppInstancesPreferencePage::QmitkAppInstancesPreferencePage() +{ + +} + +void QmitkAppInstancesPreferencePage::Init(berry::IWorkbench::Pointer ) +{ + +} + +void QmitkAppInstancesPreferencePage::CreateQtControl(QWidget* parent) +{ + mainWidget = new QWidget(parent); + controls.setupUi(mainWidget); + + berry::IPreferencesService::Pointer prefService + = berry::Platform::GetServiceRegistry() + .GetServiceById(berry::IPreferencesService::ID); + + prefs = prefService->GetSystemPreferences()->Node("/General"); + + Update(); +} + +QWidget* QmitkAppInstancesPreferencePage::GetQtControl() const +{ + return mainWidget; +} + +bool QmitkAppInstancesPreferencePage::PerformOk() +{ + prefs->PutBool("newInstance.always", controls.newInstanceAlways->isChecked()); + prefs->PutBool("newInstance.scene", controls.newInstanceScene->isChecked()); + return true; +} + +void QmitkAppInstancesPreferencePage::PerformCancel() +{ + +} + +void QmitkAppInstancesPreferencePage::Update() +{ + bool always = prefs->GetBool("newInstance.always", false); + bool scene = prefs->GetBool("newInstance.scene", true); + + controls.newInstanceAlways->setChecked(always); + controls.newInstanceScene->setChecked(scene); +} diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h new file mode 100644 index 0000000000..d3937ac996 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h @@ -0,0 +1,57 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#ifndef QMITKAPPINSTANCESPREFERENCEPAGE_H_ +#define QMITKAPPINSTANCESPREFERENCEPAGE_H_ + +#include +#include + +#include + + +class QmitkAppInstancesPreferencePage : public QObject, public berry::IQtPreferencePage +{ + + Q_OBJECT + Q_INTERFACES(berry::IPreferencePage) + +public: + + QmitkAppInstancesPreferencePage(); + QmitkAppInstancesPreferencePage(const QmitkAppInstancesPreferencePage& other); + + void Init(berry::IWorkbench::Pointer workbench); + + void CreateQtControl(QWidget* parent); + QWidget* GetQtControl() const; + + bool PerformOk(); + void PerformCancel(); + void Update(); + +private: + + Ui::QmitkAppInstancesPreferencePage controls; + + berry::IPreferences::Pointer prefs; + + QWidget* mainWidget; +}; + +#endif /* QMITKAPPINSTANCESPREFERENCEPAGE_H_ */ diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.ui b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.ui new file mode 100644 index 0000000000..25aac5d226 --- /dev/null +++ b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.ui @@ -0,0 +1,73 @@ + + + QmitkAppInstancesPreferencePage + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + + Running multiple application instances + + + + + + The options below specify the behavior of repeated invocations of this MITK application. + + + true + + + + + + + Create a new application instance each time the executable is run. + + + New instance for each application invocation + + + + + + + Open each MITK scene file given on the command line in a new application instance. + + + New instance for each MITK scene file (.mitk) + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.cpp b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.cpp index 3057e3f1d7..13c1a82a9d 100644 --- a/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.cpp @@ -1,55 +1,55 @@ /*========================================================================= Program: BlueBerry Platform Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include "QmitkCommonExtPlugin.h" #include -#include "../QmitkExtPreferencePage.h" -#include "../QmitkInputDevicesPrefPage.h" +#include "QmitkAppInstancesPreferencePage.h" +#include "QmitkInputDevicesPrefPage.h" #include "QmitkModuleView.h" #include ctkPluginContext* QmitkCommonExtPlugin::_context = 0; void QmitkCommonExtPlugin::start(ctkPluginContext* context) { this->_context = context; QmitkExtRegisterClasses(); - BERRY_REGISTER_EXTENSION_CLASS(QmitkExtPreferencePage, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkAppInstancesPreferencePage, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkInputDevicesPrefPage, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkModuleView, context) } void QmitkCommonExtPlugin::stop(ctkPluginContext* context) { Q_UNUSED(context) this->_context = 0; } ctkPluginContext* QmitkCommonExtPlugin::getContext() { return _context; } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_ext, QmitkCommonExtPlugin) diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkInputDevicesPrefPage.cpp b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.cpp similarity index 100% rename from Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkInputDevicesPrefPage.cpp rename to Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.cpp diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkInputDevicesPrefPage.h b/Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h similarity index 100% rename from Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkInputDevicesPrefPage.h rename to Modules/Bundles/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h diff --git a/Modules/Bundles/org.mitk.gui.qt.ext/src/mitkQtCommonExtDll.h b/Modules/Bundles/org.mitk.gui.qt.ext/src/mitkQtCommonExtDll.h deleted file mode 100644 index fe101e2965..0000000000 --- a/Modules/Bundles/org.mitk.gui.qt.ext/src/mitkQtCommonExtDll.h +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - -Program: Medical Imaging & Interaction Toolkit -Language: C++ -Date: $Date$ -Version: $Revision$ - -Copyright (c) German Cancer Research Center, Division of Medical and -Biological Informatics. All rights reserved. -See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. - -This software is distributed WITHOUT ANY WARRANTY; without even -the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ - -#ifndef MITKQTCOMMONEXT_EXPORT_DLL_H_ -#define MITKQTCOMMONEXT_EXPORT_DLL_H_ - - -// -// The following block is the standard way of creating macros which make exporting -// from a DLL simpler. All files within this DLL are compiled with the org_mitk_gui_qt_ext_EXPORTS -// symbol defined on the command line. this symbol should not be defined on any project -// that uses this DLL. This way any other project whose source files include this file see -// org_mitk_gui_qt_ext_EXPORTS functions as being imported from a DLL, wheras this DLL sees symbols -// defined with this macro as being exported. -// -#if defined(_WIN32) && !defined(MITK_STATIC) - #if defined(org_mitk_gui_qt_ext_EXPORTS) - #define MITK_QT_COMMON_EXT_EXPORT __declspec(dllexport) - #else - #define MITK_QT_COMMON_EXT_EXPORT __declspec(dllimport) - #endif -#endif - - -#if !defined(MITK_QT_COMMON_EXT_EXPORT) - #define MITK_QT_COMMON_EXT_EXPORT -#endif - -#endif /*MITKQTCOMMONEXT_EXPORT_DLL_H_*/