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/QmitkPreferencesDialog.cpp b/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkPreferencesDialog.cpp
index 7934fdb5ec..b94fdfeeaf 100644
--- a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkPreferencesDialog.cpp
+++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkPreferencesDialog.cpp
@@ -1,520 +1,523 @@
/*=========================================================================
Program: BlueBerry Platform
Language: C++
Date: $Date: 2009-07-08 13:02:46 +0200 (Mi, 08 Jul 2009) $
Version: $Revision: 18037 $
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 "QmitkPreferencesDialog.h"
#include "berryPlatform.h"
#include "berryIPreferencePage.h"
#include "berryIConfigurationElement.h"
#include "berryIExtensionPointService.h"
#include "berryIExtension.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
QmitkPreferencesDialog::QmitkPreferencesDialog(QWidget * parent, Qt::WindowFlags f)
: QDialog(parent, f), m_CurrentPage(0)
{
// m_PreferencesService
m_PreferencesService =
berry::Platform::GetServiceRegistry().GetServiceById(berry::IPreferencesService::ID);
// m_PrefPages
berry::IExtensionPointService::Pointer extensionPointService = berry::Platform::GetExtensionPointService();
berry::IConfigurationElement::vector prefPages(extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.preferencePages"));
berry::IConfigurationElement::vector keywordExts(extensionPointService->GetConfigurationElementsFor("org.blueberry.ui.keywords"));
berry::IConfigurationElement::vector::iterator prefPagesIt;
std::string id;
std::string name;
std::string category;
std::string className;
std::vector keywords;
vector keywordRefs;
berry::IConfigurationElement::vector::iterator keywordRefsIt;
berry::IConfigurationElement::vector::iterator keywordExtsIt;
string keywordRefId;
string keywordId;
string keywordLabels;
for (prefPagesIt = prefPages.begin(); prefPagesIt != prefPages.end(); ++prefPagesIt)
{
keywords.clear();
id.clear();
name.clear();
className.clear();
category.clear();
keywordRefId.clear();
keywordId.clear();
keywordLabels.clear();
if((*prefPagesIt)->GetAttribute("id", id)
&& (*prefPagesIt)->GetAttribute("name", name)
&& (*prefPagesIt)->GetAttribute("class", className))
{
(*prefPagesIt)->GetAttribute("category", category);
//# collect keywords
keywordRefs = (*prefPagesIt)->GetChildren("keywordreference"); // get all keyword references
for (keywordRefsIt = keywordRefs.begin()
; keywordRefsIt != keywordRefs.end(); ++keywordRefsIt) // iterate over all refs
{
(*keywordRefsIt)->GetAttribute("id", keywordRefId); // get referenced id
for (keywordExtsIt = keywordExts.begin(); keywordExtsIt != keywordExts.end(); ++keywordExtsIt) // iterate over all keywords
{
(*keywordExtsIt)->GetAttribute("id", keywordId); // get keyword id
if(keywordId == keywordRefId) // if referenced id is equals the current keyword id
{
//# collect all keywords from label attribute with a tokenizer
- (*keywordExtsIt)->GetAttribute("label", keywordLabels);
+ std::string currLabel;
+ (*keywordExtsIt)->GetAttribute("label", currLabel);
+ std::transform(currLabel.begin(), currLabel.end(), currLabel.begin(), ::tolower);
+ if (!currLabel.empty()) keywordLabels += std::string(" ") + currLabel;
- break; // break here; possibly search for other referenced keywords
+ //break; // break here; possibly search for other referenced keywords
}
}
}
// add information as PrefPage
m_PrefPages.push_back(PrefPage(id, name, category, className, keywordLabels, berry::IConfigurationElement::Pointer(*prefPagesIt)));
}
}
//#QWidget
//# m_Keyword
m_Keyword = new QLineEdit("");
//m_Keyword->installEventFilter(this);
QObject::connect(m_Keyword, SIGNAL(editingFinished()), this, SLOT(OnKeywordEditingFinished()));
QObject::connect(m_Keyword, SIGNAL(textChanged ( const QString & )), this, SLOT(OnKeywordTextChanged(const QString &)));
//# m_PreferencesTree
m_PreferencesTree = new QTreeWidget;
m_PreferencesTree->setHeaderHidden(true);
QObject::connect(m_PreferencesTree, SIGNAL(itemSelectionChanged()), this, SLOT(OnPreferencesTreeItemSelectionChanged()));
//# m_LeftLayout
m_LeftLayout = new QGridLayout;
m_LeftLayout->setContentsMargins(0,0,0,0);
m_LeftLayout->setSpacing(0);
m_LeftLayout->addWidget(m_Keyword, 0, 0);
m_LeftLayout->addWidget(m_PreferencesTree, 1, 0);
//# m_LeftPanel
m_LeftPanel = new QWidget;
m_LeftPanel->setLayout(m_LeftLayout);
//# m_Headline
m_Headline = new QLabel("");
m_Headline->setStyleSheet("background-color: silver; "
"border-style: solid; border-width: 1px;"
"border-color: white; font: bold 13px; color: white;");
//# m_PreferencesPanel
m_PreferencesPanel = new QStackedWidget;
//# m_RightLayout
m_RightLayout = new QGridLayout;
m_RightLayout->setRowStretch(0, 1);
m_RightLayout->setRowStretch(1, 20);
m_RightLayout->setContentsMargins(0,0,0,0);
m_RightLayout->setSpacing(0);
m_RightLayout->addWidget(m_Headline, 0, 0);
m_RightLayout->addWidget(m_PreferencesPanel, 1, 0);
//# m_RightPanel
m_RightPanel = new QWidget;
m_RightPanel->setLayout(m_RightLayout);
//# m_Splitter
m_Splitter = new QSplitter(Qt::Horizontal);
m_Splitter->setContentsMargins(0,0,0,0);
//m_Splitter->setFrameStyle(QFrame::Plain | QFrame::Sunken);
m_Splitter->setLineWidth(2);
m_Splitter->addWidget(m_LeftPanel);
m_Splitter->addWidget(m_RightPanel);
//QList sizes; sizes.push_back(this->width()*(1/3)); sizes.push_back(this->width()*(2/3));
//m_Splitter->setSizes(sizes);
m_Splitter->setStretchFactor(0,0);
m_Splitter->setStretchFactor(1,2);
//# m_ImportButton
m_ImportButton = new QPushButton(QString(tr("Import ...")));
QObject::connect(m_ImportButton, SIGNAL(clicked(bool)), this, SLOT(OnImportButtonClicked(bool)));
m_ImportButton->setIcon(QIcon(":/org.mitk.gui.qt.common/edit-redo.png"));
m_ImportButton->setFlat(true);
m_ImportButton->setDefault(false);
//# m_ExportButton
m_ExportButton = new QPushButton(QString(tr("Export ...")), this);
QObject::connect(m_ExportButton, SIGNAL(clicked(bool)), this, SLOT(OnExportButtonClicked(bool)));
m_ExportButton->setIcon(QIcon(":/org.mitk.gui.qt.common/edit-undo.png"));
m_ExportButton->setFlat(true);
m_ExportButton->setDefault(false);
//# m_ApplyButton
m_ApplyButton = new QPushButton(QString(tr("OK")), this);
QObject::connect(m_ApplyButton, SIGNAL(clicked(bool)), this, SLOT(OnApplyButtonClicked(bool)));
m_ApplyButton->setIcon(QIcon(":/org.mitk.gui.qt.common/document-save.png"));
m_ApplyButton->setFlat(true);
m_ApplyButton->setDefault(false);
//# m_CloseButton
m_CloseButton = new QPushButton(QString(tr("Close")), this);
QObject::connect(m_CloseButton, SIGNAL(clicked(bool)), this, SLOT(OnCloseButtonClicked(bool)));
m_CloseButton->setIcon(QIcon(":/org.mitk.gui.qt.common/system-log-out.png"));
m_CloseButton->setFlat(true);
m_CloseButton->setDefault(true);
m_CloseButton->setFocus();
//# m_Layout
m_Layout = new QGridLayout;
//m_Layout->setContentsMargins(0,0,0,0);
//m_Layout->setSpacing(2);
//m_Layout->setRowStretch(0, 20);
//m_Layout->setRowStretch(1, 1);
m_Layout->addWidget(m_Splitter, 0, 0, 1, 4);
m_Layout->addWidget(m_ImportButton, 2, 0);
m_Layout->addWidget(m_ExportButton, 2, 1);
m_Layout->addWidget(m_ApplyButton, 2, 2);
m_Layout->addWidget(m_CloseButton, 2, 3);
// this
this->setModal(true);
this->setSizeGripEnabled(true);
this->setWhatsThis("Dialog to set application wide preferences");
this->setWindowIcon(QIcon(":/org.mitk.gui.qt.common/preferences-system.png"));
QRect parentGeometry = parent->geometry();
int w = parentGeometry.width()/2; int h = parentGeometry.height()/2;
int x = parentGeometry.x()+(parentGeometry.width()-w)/2;
int y = parentGeometry.y()+(parentGeometry.height()-h)/2;
this->setGeometry(x,y,w,h);
this->setWindowTitle("Preferences");
this->setLayout(m_Layout);
this->UpdateTree();
}
QmitkPreferencesDialog::~QmitkPreferencesDialog()
{
}
void QmitkPreferencesDialog::SetSelectedPage(const std::string& id)
{
for(vector::iterator it = m_PrefPages.begin(); it != m_PrefPages.end(); ++it)
{
if(it->id == id)
{
m_PreferencesTree->setCurrentItem(it->treeWidgetItem);
break;
}
}
}
void QmitkPreferencesDialog::OnImportButtonClicked( bool /*triggered*/ )
{
int answer = QMessageBox::question(this, "Importing Preferences"
, "All existing preferences will be overwritten!\nAre you sure that you want to import other preferences?", QMessageBox::Yes | QMessageBox::No );
if(answer == QMessageBox::No)
return;
try
{
berry::IPreferencesService::Pointer prefService = m_PreferencesService.Lock();
if(prefService.IsNotNull())
{
berry::IBerryPreferencesService::Pointer berryPrefService = prefService.Cast();
if(berryPrefService != 0)
{
static QString importDir = "";
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose file to import preferences"),
importDir, tr("XML files (*.xml)"));
if(!fileName.isEmpty())
{
importDir = QFileInfo(fileName).absoluteDir().path();
Poco::File f(fileName.toLocal8Bit().data());
berryPrefService->ImportPreferences(f, "");
berry::IQtPreferencePage* prefPage = m_PrefPages[m_CurrentPage].prefPage;
if(prefPage)
prefPage->Update();
MITK_INFO("QmitkPreferencesDialog") << "Preferences successfully imported from " << f.path();
}
}
}
}
catch (Poco::Exception& pe)
{
QMessageBox::critical(this, "Error Importing", pe.message().c_str());
MITK_ERROR("QmitkPreferencesDialog") << pe.what();
}
catch (std::exception& e)
{
QMessageBox::critical(this, "Error Importing", e.what());
MITK_ERROR("QmitkPreferencesDialog") << e.what();
}
}
void QmitkPreferencesDialog::OnExportButtonClicked( bool /*triggered*/ )
{
try
{
berry::IPreferencesService::Pointer prefService = m_PreferencesService.Lock();
if(prefService.IsNotNull())
{
berry::IBerryPreferencesService::Pointer berryPrefService = prefService.Cast();
if(berryPrefService != 0)
{
SavePreferences();
static QString exportDir = "";
QString fileName = QFileDialog::getSaveFileName(this, tr("Choose file to export preferences"),
exportDir, tr("XML files (*.xml)"));
if(!fileName.isEmpty())
{
if(QFileInfo(fileName).suffix() != ".xml")
{
fileName += ".xml";
}
exportDir = QFileInfo(fileName).absoluteDir().path();
Poco::File f(fileName.toLocal8Bit().data());
berryPrefService->ExportPreferences(f, "");
MITK_INFO("QmitkPreferencesDialog") << "Preferences successfully exported to " << f.path();
}
}
}
}
catch (Poco::Exception& pe)
{
QMessageBox::critical(this, "Error Exporting", pe.message().c_str());
MITK_ERROR("QmitkPreferencesDialog") << pe.what();
}
catch (std::exception& e)
{
QMessageBox::critical(this, "Error Exporting", e.what());
MITK_ERROR("QmitkPreferencesDialog") << e.what();
}
}
void QmitkPreferencesDialog::SavePreferences()
{
berry::IQtPreferencePage* prefPage = 0;
for(vector::iterator it = m_PrefPages.begin(); it != m_PrefPages.end(); ++it)
{
prefPage = it->prefPage;
if(prefPage) {
prefPage->PerformOk();
}
}
/**
* Every preference page has its own preferences, which should stay the same after a system restart.
* Therefore this method flushes all the preferences, every time a change in the preferences is
* performed and confirmed.
*
*/
berry::IPreferencesService::Pointer prefService = m_PreferencesService.Lock();
if (prefService)
{
prefService->GetSystemPreferences()->Flush();
}
}
void QmitkPreferencesDialog::OnApplyButtonClicked( bool /*triggered*/ )
{
this->SavePreferences();
this->done(QDialog::Accepted);
}
void QmitkPreferencesDialog::OnCloseButtonClicked( bool /*triggered*/ )
{
berry::IQtPreferencePage* prefPage = m_PrefPages[m_CurrentPage].prefPage;
if(prefPage)
prefPage->PerformCancel();
this->done(QDialog::Accepted);
}
void QmitkPreferencesDialog::OnKeywordTextChanged(const QString & /*s*/)
{
// search for text
this->UpdateTree();
}
void QmitkPreferencesDialog::OnKeywordEditingFinished()
{
}
bool QmitkPreferencesDialog::eventFilter( QObject *obj, QEvent *event )
{
if(obj == m_Keyword)
{
if(event->type() == QEvent::FocusIn && m_Keyword->text() == "search ...")
{
m_Keyword->setText("");
m_Keyword->setStyleSheet("color: black;");
}
else if(event->type() == QEvent::FocusOut && m_Keyword->text() == "")
{
m_Keyword->setText("search ...");
m_Keyword->setStyleSheet("color: gray;");
}
}
return true;
}
void QmitkPreferencesDialog::OnPreferencesTreeItemSelectionChanged()
{
if(m_PreferencesTree == 0)
return;
// TODO: create page and show it
QList selectedItems = m_PreferencesTree->selectedItems();
if(selectedItems.size()>0)
{
m_CurrentPage = 0;
for(vector::iterator it = m_PrefPages.begin(); it != m_PrefPages.end(); ++it, ++m_CurrentPage)
{
if(it->treeWidgetItem == selectedItems.at(0))
{
m_Headline->setText(QString::fromStdString(it->name));
if(it->prefPage == 0)
{
berry::IPreferencePage* page = it->confElem->CreateExecutableExtension("class");
if (page == 0)
{
// support legacy BlueBerry extensions
page = it->confElem->CreateExecutableExtension("class", berry::IPreferencePage::GetManifestName());
}
it->prefPage = dynamic_cast(page);
it->prefPage->CreateQtControl(m_PreferencesPanel);
m_PreferencesPanel->addWidget(it->prefPage->GetQtControl());
}
m_PreferencesPanel->setCurrentWidget(it->prefPage->GetQtControl());
break;
}
}
}
}
void QmitkPreferencesDialog::UpdateTree()
{
if(m_PreferencesTree == 0)
return;
//m_PreferencesTree->clear();
- string keyword = m_Keyword->text().toStdString();
+ string keyword = m_Keyword->text().toLower().toStdString();
map items;
for(vector::iterator it = m_PrefPages.begin();
- it != m_PrefPages.end(); ++it)
+ it != m_PrefPages.end(); ++it)
{
if(it->treeWidgetItem == 0)
{
if(it->category.empty())
{
it->treeWidgetItem = new QTreeWidgetItem(m_PreferencesTree);
}
else
{
it->treeWidgetItem = new QTreeWidgetItem(items[it->category]);
}
it->treeWidgetItem->setText(0, QString::fromStdString(it->name));
items[it->id] = it->treeWidgetItem;
}
// hide treeWidgetItem if keyword not matches
if(!keyword.empty())
{
if( it->keywords.find(keyword) == string::npos )
it->treeWidgetItem->setHidden(true);
else
{
//#make the whole branch visible
QTreeWidgetItem* treeWidgetParent = it->treeWidgetItem->parent();
while(treeWidgetParent!=0)
{
treeWidgetParent->setHidden(false);
treeWidgetParent->setExpanded(true);
treeWidgetParent = treeWidgetParent->parent();
}
it->treeWidgetItem->setHidden(false);
QFont f = it->treeWidgetItem->font(0);
f.setBold(true);
it->treeWidgetItem->setFont(0, f);
}
}
else
{
QFont f = it->treeWidgetItem->font(0);
f.setBold(false);
it->treeWidgetItem->setFont(0, f);
it->treeWidgetItem->setHidden(false);
}
}
if(m_PrefPages.size()>0)
{
if(m_PrefPages.front().treeWidgetItem != 0)
m_PrefPages.front().treeWidgetItem->setSelected(true);
}
}
bool QmitkPreferencesDialog::PrefPage::operator==( const PrefPage& other )
{
return id == other.id;
}
bool QmitkPreferencesDialog::PrefPage::operator<( const PrefPage& other )
{
return name < other.name;
}
QmitkPreferencesDialog::PrefPage::PrefPage( std::string _id, std::string _name, std::string _category
, std::string _className, std::string _keywords
, berry::IConfigurationElement::Pointer _confElem )
: id(_id)
, name(_name)
, category(_category)
, className(_className)
, keywords(_keywords)
, prefPage(0)
, confElem(_confElem)
, treeWidgetItem(0)
{
}
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_ */