diff --git a/Modules/WebInteraction/include/mitkWebInteractionRegistry.h b/Modules/WebInteraction/include/mitkWebInteractionRegistry.h index c7eefd2e20..8c2c89b2e8 100644 --- a/Modules/WebInteraction/include/mitkWebInteractionRegistry.h +++ b/Modules/WebInteraction/include/mitkWebInteractionRegistry.h @@ -1,44 +1,44 @@ /*=================================================================== 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 MITKWEBINTERACTIONREGISTRY_H #define MITKWEBINTERACTIONREGISTRY_H #include "MitkWebInteractionExports.h" //QT #include "qstring.h" namespace mitk { class MITKWEBINTERACTION_EXPORT WebInteractionRegistry { public: WebInteractionRegistry(); - static void PageLoaded(QString html); + static QString PageLoaded(QString address, QString html); private: //us::ModuleContext* m_Context; }; } // end of namespace mitk #endif // MITKWEBINTERACTIONREGISTRY_H diff --git a/Modules/WebInteraction/src/mitkWebInteractionRegistry.cpp b/Modules/WebInteraction/src/mitkWebInteractionRegistry.cpp index 7bcf0af17c..b3d168bc91 100644 --- a/Modules/WebInteraction/src/mitkWebInteractionRegistry.cpp +++ b/Modules/WebInteraction/src/mitkWebInteractionRegistry.cpp @@ -1,33 +1,43 @@ /*=================================================================== 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 "mitkWebInteractionRegistry.h" #include "mitkLogMacros.h" namespace mitk { WebInteractionRegistry::WebInteractionRegistry() { } - void WebInteractionRegistry::PageLoaded(QString html) + QString WebInteractionRegistry::PageLoaded(QString address, QString html) { - std::string s = html.toStdString(); - MITK_INFO << s; + QString target = "Download Raw File"; + QString urlPattern = "https://phabricator.mitk.org/diffusion/"; + if (address.contains(urlPattern)) + { + int index = html.indexOf(target); + if (index > 0) + { + html.insert(index + 34, "
"); + MITK_INFO << html.toStdString(); + } + } + return html; } } // end of namespace mitk diff --git a/Plugins/org.mitk.gui.qt.webview/src/internal/MitkWebView.cpp b/Plugins/org.mitk.gui.qt.webview/src/internal/MitkWebView.cpp index cc51a43214..9a44de6d23 100644 --- a/Plugins/org.mitk.gui.qt.webview/src/internal/MitkWebView.cpp +++ b/Plugins/org.mitk.gui.qt.webview/src/internal/MitkWebView.cpp @@ -1,50 +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. ===================================================================*/ // Qmitk #include "MitkWebView.h" #include