diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/files.cmake b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/files.cmake index fe593005bc..ce3944d94d 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/files.cmake +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/files.cmake @@ -1,39 +1,42 @@ set(SRC_CPP_FILES ) set(INTERNAL_CPP_FILES QmitkMitkWorkbenchIntroPlugin.cpp QmitkMitkWorkbenchIntroPart.cpp + QmitkMitkWorkbenchIntroPreferencePage.cpp ) set(MOC_H_FILES src/internal/QmitkMitkWorkbenchIntroPlugin.h src/internal/QmitkMitkWorkbenchIntroPart.h + src/internal/QmitkMitkWorkbenchIntroPreferencePage.h ) set(UI_FILES src/internal/QmitkWelcomeScreenViewControls.ui + src/internal/QmitkMitkWorkbenchIntroPreferencePage.ui ) 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 ) set(QRC_FILES resources/QmitkWelcomeScreenView.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.mitkworkbench.intro/plugin.xml b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/plugin.xml index dda81a0406..002333fb74 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/plugin.xml +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/plugin.xml @@ -1,12 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> <plugin> <extension point="org.blueberry.ui.intro"> <intro id="org.mitk.qt.extapplicationintro" class="QmitkMitkWorkbenchIntroPart" role="editor"/> <introProductBinding productId="org.mitk.gui.qt.extapplication.workbench" introId="org.mitk.qt.extapplicationintro"/> </extension> + <extension point="org.blueberry.ui.preferencePages"> + <page id="org.mitk.gui.qt.application.MitkWorkbenchIntroPreferencePage" name="Welcome Page" class="QmitkMitkWorkbenchIntroPreferencePage"> + <keywordreference id="org.mitk.gui.qt.application.MitkWorkbenchIntroPreferencePageKeywords"></keywordreference> + </page> + </extension> </plugin> diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/index.html b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/index.html index fd791bbff8..4f2113bf1f 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/index.html +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/index.html @@ -1,84 +1,84 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Welcome to the MITK Workbench!</title> <link rel="stylesheet" href="style.css"> <script src="script.js"></script> </head> <body> <div class="content"> <h1>Welcome to the MITK Workbench!</h1> <p> Load and view medical images from all kinds of imaging modalities like X-ray, US, CT, MRI, and many more. Use our tools to efficiently create segmentations, measure anatomical structures, inspect image statistics, or register multiple images to each other. </p> <p> <small> The MITK Workbench is developed at the <a href="https://www.dkfz.de">↪ German Cancer Research Center (DKFZ)</a>.<br> It is based on the free open source <a href="https://www.mitk.org">↪ Medical Imaging Interaction Toolkit (MITK)</a>. </small> </p> <div class="tips"> <button class="button" style="float: right;" onclick="showNextTip()">Next tip »</button> <div class="tip"> <h2>Mouse navigation</h2> <div class="tip-content"> <img class="center" style="width: 50%" alt="Crosshair" src="img/mousenavigation/crosshair.svg"> <p> Your images are typically shown from three different view directions at once: axial, sagittal, and coronal. Together, the view planes resemble the shape of a three-dimensional crosshair slicing through your image data. Use the mouse to navigate in these views. </p> <div class="table"> <div class="tr"> <div class="td"> <h3>Focus</h3> <img style="width: 100%" alt="Left mouse button" src="img/mousenavigation/click.svg"> <p>Use the left mouse button to focus all views on the clicked position.</p> </div> <div class="td"> <h3>Zoom</h3> <img style="width: 100%" alt="Right mouse button" src="img/mousenavigation/zoom.svg"> <p>Press and hold the right mouse button and move the mouse up and down to zoom in and out.</p> </div> <div class="td"> <h3>Pan</h3> <img style="width: 100%" alt="Middle mouse button" src="img/mousenavigation/pan.svg"> <p>Press and hold the middle mouse button and move the mouse to pan around.</p> </div> <div class="td"> <h3>Scroll</h3> <img style="width: 100%" alt="Scroll wheel" src="img/mousenavigation/scroll.svg"> <p>Use the scroll wheel to scroll through slices along the view's direction.</p> </div> </div> </div> </div> </div> - <div class="tip" hidden> + <div class="tip"> <h2>Image contrast</h2> <div class="tip-content"> <img class="float-left" style="width: 40%;" alt="Standard display with level window" src="img/levelwindow/standarddisplay.svg"> <p> For images, a vertical scale is shown right next to the views. It is called the <b>level window</b>. </p> <p> The values shown in the level window represent the pixel intensities of an image. The blue bar defines the range of pixel intensities that is mapped onto the whole range of displayable pixel brightness. Hence, a shorter range of pixel intensities results in higher displayed image contrast. </p> <p> Grab the blue bar to move it up and down.<br> Grab the tips of the blue bar to change its size. </p> <p> Right-click on the level window for many more options. </p> </div> </div> </div> </div> </body> </html> diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/script.js b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/script.js index a09441a664..45b56caa01 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/script.js +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/resources/script.js @@ -1,10 +1,32 @@ function showNextTip() { var tips = document.querySelectorAll('.tip'); for (let i = 0; i < tips.length; ++i) { if (!tips[i].hasAttribute('hidden')) { tips[i].setAttribute('hidden', ''); tips[(i + 1) % tips.length].removeAttribute('hidden'); break; } } } + +function showRandomTip() { + var tips = document.querySelectorAll('.tip'); + var show = Math.floor(Math.random() * tips.length); + for (let i = 0; i < tips.length; ++i) { + if (i != show) { + tips[i].setAttribute('hidden', ''); + } else { + tips[i].removeAttribute('hidden'); + } + } +} + +function showTips() { + var tips = document.querySelector('.tips'); + tips.removeAttribute('hidden'); +} + +function hideTips() { + var tips = document.querySelector('.tips'); + tips.setAttribute('hidden', ''); +} diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.cpp b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.cpp index 2d3ecff848..c2fcf07cde 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.cpp +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.cpp @@ -1,220 +1,223 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "QmitkMitkWorkbenchIntroPart.h" +#include "QmitkMitkWorkbenchIntroPlugin.h" -#include <berryIWorkbenchWindow.h> +#include <berryIPerspectiveDescriptor.h> +#include <berryIPreferences.h> +#include <berryIPreferencesService.h> #include <berryIWorkbench.h> #include <berryIWorkbenchPage.h> -#include <berryIPerspectiveRegistry.h> +#include <berryIWorkbenchWindow.h> #include <berryWorkbenchPreferenceConstants.h> -#include <berryIPreferences.h> -#include <berryIPreferencesService.h> -#include <berryPlatform.h> - -#include <berryIEditorReference.h> -#include <berryIEditorInput.h> - -#include <ctkPluginContext.h> -#include <mitkIDataStorageService.h> #include <mitkDataStorageEditorInput.h> +#include <mitkIDataStorageService.h> -#include <mitkLogMacros.h> - -#include <QLabel> -#include <QMessageBox> -#include <QtCore/qconfig.h> - -#include <QString> -#include <QStringList> -#include <QRegExp> -#include <QChar> -#include <QByteArray> #include <QDesktopServices> - -#include "QmitkMitkWorkbenchIntroPlugin.h" -#include "mitkDataStorageEditorInput.h" -#include <string> - -#include <QWebEngineView> #include <QWebEnginePage> -#include <QUrlQuery> +#include <QWebEngineView> class QmitkMitkWorkbenchIntroPart::Impl { public: Impl() : View(nullptr) { } ~Impl() { } QWebEngineView* View; private: Impl(const Impl&); Impl& operator=(const Impl&); }; namespace { class QmitkWebEnginePage final : public QWebEnginePage { public: explicit QmitkWebEnginePage(QmitkMitkWorkbenchIntroPart* introPart, QObject* parent = nullptr); ~QmitkWebEnginePage() override; private: bool acceptNavigationRequest(const QUrl& url, NavigationType type, bool isMainFrame) override; QmitkMitkWorkbenchIntroPart* m_IntroPart; }; QmitkWebEnginePage::QmitkWebEnginePage(QmitkMitkWorkbenchIntroPart* introPart, QObject* parent) : QWebEnginePage(parent), m_IntroPart(introPart) { } QmitkWebEnginePage::~QmitkWebEnginePage() { } bool QmitkWebEnginePage::acceptNavigationRequest(const QUrl& url, NavigationType, bool) { QString scheme = url.scheme(); if (scheme.contains("mitk")) { if (url.path().isEmpty()) return false; if (url.host().contains("perspectives")) { QString id = url.path().simplified().replace("/", ""); auto introSite = m_IntroPart->GetIntroSite(); auto workbenchWindow = introSite->GetWorkbenchWindow(); auto workbench = workbenchWindow->GetWorkbench(); workbench->ShowPerspective(id, workbenchWindow); auto context = QmitkMitkWorkbenchIntroPlugin::GetDefault()->GetPluginContext(); auto serviceReference = context->getServiceReference<mitk::IDataStorageService>(); mitk::IDataStorageService* service = serviceReference ? context->getService<mitk::IDataStorageService>(serviceReference) : nullptr; if (service) { berry::IEditorInput::Pointer editorInput(new mitk::DataStorageEditorInput(service->GetActiveDataStorage())); auto page = introSite->GetPage(); auto editorPart = page->FindEditor(editorInput); if (editorPart.IsNotNull()) page->Activate(editorPart); } } } else if (scheme.contains("https")) { QDesktopServices::openUrl(url); } else { return true; } return false; } } QmitkMitkWorkbenchIntroPart::QmitkMitkWorkbenchIntroPart() : m_Controls(nullptr), m_Impl(new Impl) { berry::IPreferences::Pointer workbenchPrefs = QmitkMitkWorkbenchIntroPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, true); workbenchPrefs->Flush(); } QmitkMitkWorkbenchIntroPart::~QmitkMitkWorkbenchIntroPart() { // if the workbench is not closing (that means, welcome screen was closed explicitly), set "Show_intro" false if (!this->GetIntroSite()->GetPage()->GetWorkbenchWindow()->GetWorkbench()->IsClosing()) { berry::IPreferences::Pointer workbenchPrefs = QmitkMitkWorkbenchIntroPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, false); workbenchPrefs->Flush(); } else { berry::IPreferences::Pointer workbenchPrefs = QmitkMitkWorkbenchIntroPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences(); workbenchPrefs->PutBool(berry::WorkbenchPreferenceConstants::SHOW_INTRO, true); workbenchPrefs->Flush(); } // if workbench is not closing (Just welcome screen closing), open last used perspective if (this->GetIntroSite()->GetPage()->GetPerspective()->GetId() == "org.mitk.mitkworkbench.perspectives.editor" && !this->GetIntroSite()->GetPage()->GetWorkbenchWindow()->GetWorkbench()->IsClosing()) { berry::IPerspectiveDescriptor::Pointer perspective = this->GetIntroSite()->GetWorkbenchWindow()->GetWorkbench()->GetPerspectiveRegistry()->FindPerspectiveWithId("org.mitk.mitkworkbench.perspectives.editor"); if (perspective) { this->GetIntroSite()->GetPage()->SetPerspective(perspective); } } delete m_Impl; } void QmitkMitkWorkbenchIntroPart::CreateQtPartControl(QWidget* parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkWelcomeScreenViewControls; m_Controls->setupUi(parent); // create a QWebView as well as a QWebPage and QWebFrame within the QWebview m_Impl->View = new QWebEngineView(parent); + this->CreateConnections(); + auto page = new QmitkWebEnginePage(this, parent); m_Impl->View->setPage(page); QUrl urlQtResource(QString("qrc:/org.mitk.gui.qt.welcomescreen/index.html"), QUrl::TolerantMode); m_Impl->View->load( urlQtResource ); // adds the webview as a widget parent->layout()->addWidget(m_Impl->View); - - this->CreateConnections(); } } void QmitkMitkWorkbenchIntroPart::CreateConnections() { + connect(m_Impl->View, &QWebEngineView::loadFinished, this, &QmitkMitkWorkbenchIntroPart::OnLoadFinished); } void QmitkMitkWorkbenchIntroPart::StandbyStateChanged(bool /*standby*/) { } void QmitkMitkWorkbenchIntroPart::SetFocus() { } + +void QmitkMitkWorkbenchIntroPart::ReloadPage() +{ + if (m_Impl->View != nullptr) + m_Impl->View->reload(); +} + +void QmitkMitkWorkbenchIntroPart::OnLoadFinished(bool ok) +{ + if (!ok) + return; + + auto prefs = QmitkMitkWorkbenchIntroPlugin::GetDefault()->GetPreferencesService()->GetSystemPreferences()->Node("/org.mitk.qt.extapplicationintro"); + bool showTips = prefs->GetBool("show tips", true); + + if (showTips) + { + m_Impl->View->page()->runJavaScript("showRandomTip(); showTips()"); + } + else + { + m_Impl->View->page()->runJavaScript("hideTips()"); + } +} diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h index df259e5983..4165230a60 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h @@ -1,77 +1,75 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QMITKWORKBENCHINTROPART_H_ #define QMITKWORKBENCHINTROPART_H_ #include <QtCore/qconfig.h> #include <berryQtIntroPart.h> #include <ui_QmitkWelcomeScreenViewControls.h> /** * \ingroup org_mitk_gui_qt_welcomescreen_internal * \brief QmitkMitkWorkbenchIntroPart * The WelcomeView Module is an helpful feature to people new to MITK. The main idea is to provide first * information about the MITK Workbench. * The WelcomeView is realized by making use of the QTWebKit Module. The Qt WebKit module * provides an HTML browser engine that makes it easy to embed web content into native applications, and to enhance * web content with native controls. * For the welcome view of the application the QWebView, QWebPage classes have been used. The shown WelcomeView * html start page is styled by an external css stylesheet. The required resources as well as the html pages are integrated * into the QtResource system. The QT resource system allows the storage of files like html pages, css pages, jpgs etc. * as binaries within the executable. * This minimizes the risk of loosing resource files as well as the risk of getting files deleted. In order to use the Qt * resource system the resource files have to be added to the associated qrt resource file list. * * The foundation is set to design more complex html pages. The Q::WebPage gives options to set a * LinkDelegationPolicy. The used policy defines how links to external or internal resources are handled. To fit our needs * the delegate all links policy is used. This requires all external as well as internal links of the html pages to be handle * explicitly. In order to change mitk working modes (perspectives) a mitk url scheme has been designed. The url scheme * is set to mitk. The url host provides information about what's next to do. In our case, the case of switching to a * particular working mode the host is set to perspectives. The followed path provides information about the perspective id. * (e.g. mitk//::mitk.perspectives/org.mitk.qt.defaultperspective) The the generic design of the mitk url scheme allows to * execute other task depending on the mitk url host. * \sa QmitkWelcomePage Editor */ class QmitkMitkWorkbenchIntroPart : public berry::QtIntroPart { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: QmitkMitkWorkbenchIntroPart(); ~QmitkMitkWorkbenchIntroPart() override; - void CreateQtPartControl(QWidget *parent) override; - void StandbyStateChanged(bool) override; - void SetFocus() override; + void ReloadPage(); - virtual void CreateConnections(); - -protected: +private: + void CreateConnections(); + void OnLoadFinished(bool ok); Ui::QmitkWelcomeScreenViewControls* m_Controls; class Impl; Impl* m_Impl; }; #endif /* QMITKWORKBENCHINTROPART_H_ */ diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.cpp b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.cpp index c38924e45c..a0af12b0f1 100644 --- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.cpp +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.cpp @@ -1,53 +1,55 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "QmitkMitkWorkbenchIntroPlugin.h" #include "QmitkMitkWorkbenchIntroPart.h" +#include "QmitkMitkWorkbenchIntroPreferencePage.h" #include <mitkVersion.h> #include <mitkLogMacros.h> #include <service/cm/ctkConfigurationAdmin.h> #include <service/cm/ctkConfiguration.h> #include <QFileInfo> #include <QDateTime> QmitkMitkWorkbenchIntroPlugin* QmitkMitkWorkbenchIntroPlugin::inst = nullptr; QmitkMitkWorkbenchIntroPlugin::QmitkMitkWorkbenchIntroPlugin() { inst = this; } QmitkMitkWorkbenchIntroPlugin::~QmitkMitkWorkbenchIntroPlugin() { } QmitkMitkWorkbenchIntroPlugin* QmitkMitkWorkbenchIntroPlugin::GetDefault() { return inst; } void QmitkMitkWorkbenchIntroPlugin::start(ctkPluginContext* context) { berry::AbstractUICTKPlugin::start(context); this->context = context; - BERRY_REGISTER_EXTENSION_CLASS(QmitkMitkWorkbenchIntroPart, context); + BERRY_REGISTER_EXTENSION_CLASS(QmitkMitkWorkbenchIntroPart, context) + BERRY_REGISTER_EXTENSION_CLASS(QmitkMitkWorkbenchIntroPreferencePage, context) } ctkPluginContext* QmitkMitkWorkbenchIntroPlugin::GetPluginContext() const { return context; } diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.cpp b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.cpp new file mode 100644 index 0000000000..f1222ec90f --- /dev/null +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.cpp @@ -0,0 +1,76 @@ +/*============================================================================ + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center (DKFZ) +All rights reserved. + +Use of this source code is governed by a 3-clause BSD license that can be +found in the LICENSE file. + +============================================================================*/ + +#include "QmitkMitkWorkbenchIntroPreferencePage.h" +#include "QmitkMitkWorkbenchIntroPart.h" + +#include <berryIPreferencesService.h> +#include <berryPlatform.h> +#include <berryPlatformUI.h> + +#include <ui_QmitkMitkWorkbenchIntroPreferencePage.h> + +QmitkMitkWorkbenchIntroPreferencePage::QmitkMitkWorkbenchIntroPreferencePage() + : m_Ui(new Ui::QmitkMitkWorkbenchIntroPreferencePage), + m_Control(nullptr) +{ +} + +QmitkMitkWorkbenchIntroPreferencePage::~QmitkMitkWorkbenchIntroPreferencePage() +{ +} + +void QmitkMitkWorkbenchIntroPreferencePage::Init(berry::IWorkbench::Pointer) +{ +} + +void QmitkMitkWorkbenchIntroPreferencePage::CreateQtControl(QWidget* parent) +{ + auto* prefService = berry::Platform::GetPreferencesService(); + m_MitkWorkbenchIntroPreferencesNode = prefService->GetSystemPreferences()->Node("/org.mitk.qt.extapplicationintro"); + + m_Control = new QWidget(parent); + m_Ui->setupUi(m_Control); + + this->Update(); +} + +QWidget* QmitkMitkWorkbenchIntroPreferencePage::GetQtControl() const +{ + return m_Control; +} + +bool QmitkMitkWorkbenchIntroPreferencePage::PerformOk() +{ + m_MitkWorkbenchIntroPreferencesNode->PutBool("show tips", m_Ui->showTipsCheckBox->isChecked()); + + auto intro = berry::PlatformUI::GetWorkbench()->GetIntroManager()->GetIntro(); + + if (intro.IsNotNull()) + { + auto* workbenchIntro = dynamic_cast<QmitkMitkWorkbenchIntroPart*>(intro.GetPointer()); + + if (workbenchIntro != nullptr) + workbenchIntro->ReloadPage(); + } + + return true; +} + +void QmitkMitkWorkbenchIntroPreferencePage::PerformCancel() +{ +} + +void QmitkMitkWorkbenchIntroPreferencePage::Update() +{ + m_Ui->showTipsCheckBox->setChecked(m_MitkWorkbenchIntroPreferencesNode->GetBool("show tips", true)); +} diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.h b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.h new file mode 100644 index 0000000000..e41d1e0c89 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.h @@ -0,0 +1,46 @@ +/*============================================================================ + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center (DKFZ) +All rights reserved. + +Use of this source code is governed by a 3-clause BSD license that can be +found in the LICENSE file. + +============================================================================*/ + +#ifndef QmitkMitkWorkbenchIntroPreferencePage_h +#define QmitkMitkWorkbenchIntroPreferencePage_h + +#include <berryIQtPreferencePage.h> + +namespace Ui +{ + class QmitkMitkWorkbenchIntroPreferencePage; +} + +class QmitkMitkWorkbenchIntroPreferencePage : public QObject, public berry::IQtPreferencePage +{ + Q_OBJECT + Q_INTERFACES(berry::IPreferencePage) + +public: + QmitkMitkWorkbenchIntroPreferencePage(); + ~QmitkMitkWorkbenchIntroPreferencePage() override; + + void Init(berry::IWorkbench::Pointer workbench) override; + void CreateQtControl(QWidget* parent) override; + QWidget* GetQtControl() const override; + bool PerformOk() override; + void PerformCancel() override; + void Update() override; + +private: + berry::IPreferences::Pointer m_MitkWorkbenchIntroPreferencesNode; + + Ui::QmitkMitkWorkbenchIntroPreferencePage* m_Ui; + QWidget* m_Control; +}; + +#endif diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.ui b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.ui new file mode 100644 index 0000000000..b56753d42f --- /dev/null +++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPreferencePage.ui @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>QmitkMitkWorkbenchIntroPreferencePage</class> + <widget class="QWidget" name="QmitkMitkWorkbenchIntroPreferencePage"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Welcome Page</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QCheckBox" name="showTipsCheckBox"> + <property name="text"> + <string>Show tips</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui>