diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake b/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake index 2a76572546..85da6faaf0 100755 --- a/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/files.cmake @@ -1,52 +1,59 @@ SET(SRC_CPP_FILES QmitkCloseProjectAction.cpp QmitkDnDFrameWidget.cpp QmitkDataNodeSelectionProvider.cpp QmitkFileOpenAction.cpp QmitkFileExitAction.cpp QmitkFunctionality.cpp QmitkFunctionality2.cpp QmitkStatusBar.cpp QmitkStdMultiWidgetEditor.cpp QmitkPreferencesDialog.cpp QmitkFunctionalityCoordinator.cpp - QmitkStdMultiWidgetEditorPreferencePage.cpp ) SET(INTERNAL_CPP_FILES QmitkDataNodeSelection.cpp QmitkCommonActivator.cpp + QmitkEditorsPreferencePage.cpp QmitkFunctionalityUtil.cpp + QmitkGeneralPreferencePage.cpp + QmitkStdMultiWidgetEditorPreferencePage.cpp ) SET(MOC_H_FILES src/QmitkCloseProjectAction.h src/QmitkFileOpenAction.h src/QmitkFileExitAction.h src/QmitkPreferencesDialog.h src/QmitkStdMultiWidgetEditor.h src/QmitkDnDFrameWidget.h src/internal/QmitkCommonActivator.h + src/internal/QmitkEditorsPreferencePage.h + src/internal/QmitkGeneralPreferencePage.h + src/internal/QmitkStdMultiWidgetEditorPreferencePage.h +) + +SET(UI_FILES - src/QmitkStdMultiWidgetEditorPreferencePage.h ) SET(CACHED_RESOURCE_FILES plugin.xml ) # todo: add some qt style sheet resources SET(QRC_FILES resources/resources.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/CoreUI/Bundles/org.mitk.gui.qt.common/plugin.xml b/CoreUI/Bundles/org.mitk.gui.qt.common/plugin.xml index c1b4b2e2f1..db28e35516 100644 --- a/CoreUI/Bundles/org.mitk.gui.qt.common/plugin.xml +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/plugin.xml @@ -1,16 +1,30 @@ + - - - + + + + + + + + + + + + + + + diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.cpp b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.cpp index b41457f871..624fa0d01e 100644 --- a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.cpp +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.cpp @@ -1,57 +1,59 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 18127 $ 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 "QmitkCommonActivator.h" #include "../QmitkStdMultiWidgetEditor.h" -#include "../QmitkStdMultiWidgetEditorPreferencePage.h" +#include "QmitkStdMultiWidgetEditorPreferencePage.h" +#include "QmitkGeneralPreferencePage.h" +#include "QmitkEditorsPreferencePage.h" #include #include -#include - void QmitkCommonActivator::start(ctkPluginContext* context) -{ +{ Q_UNUSED(context) - + BERRY_REGISTER_EXTENSION_CLASS(QmitkStdMultiWidgetEditor, context) BERRY_REGISTER_EXTENSION_CLASS(QmitkStdMultiWidgetEditorPreferencePage, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkGeneralPreferencePage, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkEditorsPreferencePage, context) QFile file(":/org.mitk.gui.qt.common/StateMachine.xml"); if(file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text) ) { QByteArray contents = file.readAll(); QString string(contents); file.close(); mitk::GlobalInteraction::GetInstance()->Initialize("global", string.toStdString()); } else throw std::exception(); QmitkRegisterClasses(); } void QmitkCommonActivator::stop(ctkPluginContext* context) { Q_UNUSED(context) } Q_EXPORT_PLUGIN2(org_mitk_gui_qt_common, QmitkCommonActivator) diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.cpp b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.cpp new file mode 100644 index 0000000000..24a52130b2 --- /dev/null +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.cpp @@ -0,0 +1,58 @@ +/*========================================================================= + +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 "QmitkEditorsPreferencePage.h" + +#include + +QmitkEditorsPreferencePage::QmitkEditorsPreferencePage() +: m_MainControl(0) +{ + +} + +void QmitkEditorsPreferencePage::Init(berry::IWorkbench::Pointer ) +{ +} + +void QmitkEditorsPreferencePage::CreateQtControl(QWidget* parent) +{ + //empty page + m_MainControl = new QWidget(parent); + QVBoxLayout *layout = new QVBoxLayout; + m_MainControl->setLayout(layout); + this->Update(); +} + +QWidget* QmitkEditorsPreferencePage::GetQtControl() const +{ + return m_MainControl; +} + +bool QmitkEditorsPreferencePage::PerformOk() +{ + return true; +} + +void QmitkEditorsPreferencePage::PerformCancel() +{ + +} + +void QmitkEditorsPreferencePage::Update() +{ +} diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.h b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.h new file mode 100644 index 0000000000..f2fb32aea4 --- /dev/null +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkEditorsPreferencePage.h @@ -0,0 +1,75 @@ +/*========================================================================= + +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 QMITKEDITORSPREFERENCEPAGE_H_ +#define QMITKEDITORSPREFERENCEPAGE_H_ + +#include "berryIQtPreferencePage.h" +#include + +class QWidget; + +class QmitkEditorsPreferencePage : public QObject, public berry::IQtPreferencePage +{ + Q_OBJECT + Q_INTERFACES(berry::IPreferencePage) + +public: + + /** + * Default constructor + */ + QmitkEditorsPreferencePage(); + + /** + * @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(); + +protected: + + QWidget* m_MainControl; + +}; + +#endif /* QMITKEDITORSPREFERENCEPAGE_H_ */ diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.cpp b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.cpp new file mode 100644 index 0000000000..6df2a4f89f --- /dev/null +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.cpp @@ -0,0 +1,58 @@ +/*========================================================================= + +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 "QmitkGeneralPreferencePage.h" + +#include + +QmitkGeneralPreferencePage::QmitkGeneralPreferencePage() +: m_MainControl(0) +{ + +} + +void QmitkGeneralPreferencePage::Init(berry::IWorkbench::Pointer ) +{ +} + +void QmitkGeneralPreferencePage::CreateQtControl(QWidget* parent) +{ + //empty page + m_MainControl = new QWidget(parent); + QVBoxLayout *layout = new QVBoxLayout; + m_MainControl->setLayout(layout); + this->Update(); +} + +QWidget* QmitkGeneralPreferencePage::GetQtControl() const +{ + return m_MainControl; +} + +bool QmitkGeneralPreferencePage::PerformOk() +{ + return true; +} + +void QmitkGeneralPreferencePage::PerformCancel() +{ + +} + +void QmitkGeneralPreferencePage::Update() +{ +} diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.h b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.h new file mode 100644 index 0000000000..e4573d58b1 --- /dev/null +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkGeneralPreferencePage.h @@ -0,0 +1,75 @@ +/*========================================================================= + +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 QMITKGENERALPREFERENCEPAGE_H_ +#define QMITKGENERALPREFERENCEPAGE_H_ + +#include "berryIQtPreferencePage.h" +#include + +class QWidget; + +class QmitkGeneralPreferencePage : public QObject, public berry::IQtPreferencePage +{ + Q_OBJECT + Q_INTERFACES(berry::IPreferencePage) + +public: + + /** + * Default constructor + */ + QmitkGeneralPreferencePage(); + + /** + * @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(); + +protected: + + QWidget* m_MainControl; + +}; + +#endif /* QMITKGENERALPREFERENCEPAGE_H_ */ diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditorPreferencePage.cpp b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkStdMultiWidgetEditorPreferencePage.cpp similarity index 100% rename from CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditorPreferencePage.cpp rename to CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkStdMultiWidgetEditorPreferencePage.cpp diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditorPreferencePage.h b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h similarity index 93% rename from CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditorPreferencePage.h rename to CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h index 8694aa0d74..7ddc83d9b9 100644 --- a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditorPreferencePage.h +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h @@ -1,88 +1,87 @@ /*========================================================================= 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 QMITKSTDMULTIWIDGETEDITORPREFERENCEPAGE_H_ #define QMITKSTDMULTIWIDGETEDITORPREFERENCEPAGE_H_ #include "berryIQtPreferencePage.h" -#include #include class QWidget; class QCheckBox; class QPushButton; class QWidgetAction; -struct MITK_QT_COMMON QmitkStdMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage +struct QmitkStdMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkStdMultiWidgetEditorPreferencePage(); QmitkStdMultiWidgetEditorPreferencePage(const QmitkStdMultiWidgetEditorPreferencePage& other); void Init(berry::IWorkbench::Pointer workbench); void CreateQtControl(QWidget* widget); QWidget* GetQtControl() const; /// /// \see IPreferencePage::PerformOk() /// virtual bool PerformOk(); /// /// \see IPreferencePage::PerformCancel() /// virtual void PerformCancel(); /// /// \see IPreferencePage::Update() /// virtual void Update(); public slots: void FirstColorChanged(); void SecondColorChanged(); void UseGradientBackgroundSelected(); void ColorActionChanged(); void ResetColors(); protected: QWidget* m_MainControl; QCheckBox* m_EnableFlexibleZooming; QCheckBox* m_ShowLevelWindowWidget; QCheckBox* m_UseGradientBackground; QCheckBox* m_ChangeBackgroundColors; QCheckBox* m_PACSLikeMouseMode; QPushButton* m_ColorButton1; QPushButton* m_ColorButton2; std::string m_FirstColor; std::string m_SecondColor; QString m_FirstColorStyleSheet; QString m_SecondColorStyleSheet; berry::IPreferences::Pointer m_StdMultiWidgetEditorPreferencesNode; }; #endif /* QMITKDATAMANAGERPREFERENCEPAGE_H_ */