diff --git a/CMake/QBundleTemplate/project/AppTemplate.cpp b/CMake/QBundleTemplate/project/AppTemplate.cpp index 62a208b510..aa6e9b8cb2 100755 --- a/CMake/QBundleTemplate/project/AppTemplate.cpp +++ b/CMake/QBundleTemplate/project/AppTemplate.cpp @@ -1,6 +1,13 @@ -#include +#include + +#include int main(int argc, char** argv) { + // Create a QApplication instance first + QApplication myApp(argc, argv); + myApp.setApplicationName("@CUSTOM_PROJECT_NAME@"); + myApp.setOrganizationName("@PLUGIN_VENDOR@"); + return berry::Starter::Run(argc, argv); } diff --git a/CMake/QBundleTemplate/project/AppTemplate.ini b/CMake/QBundleTemplate/project/AppTemplate.ini index 785ef2b6c9..f6bad1ccef 100755 --- a/CMake/QBundleTemplate/project/AppTemplate.ini +++ b/CMake/QBundleTemplate/project/AppTemplate.ini @@ -1,3 +1,4 @@ BlueBerry.home=@BLUEBERRY_BINARY_DIR@ BlueBerry.plugin_dirs=@BLUEBERRY_PLUGINS_OUTPUT_DIR@;@MITK_PLUGIN_OUTPUT_DIRS@;@PLUGIN_OUTPUT_DIRS@ BlueBerry.application=org.mitk.qt.extapplication +BlueBerry.provisioning=@MITK_PLUGIN_PROVISIONING_FILE@ diff --git a/CMake/QBundleTemplate/project/CMakeListsTemplate.txt b/CMake/QBundleTemplate/project/CMakeListsTemplate.txt index 067577a5e1..67891b8605 100755 --- a/CMake/QBundleTemplate/project/CMakeListsTemplate.txt +++ b/CMake/QBundleTemplate/project/CMakeListsTemplate.txt @@ -1,63 +1,60 @@ PROJECT(@CUSTOM_PROJECT_NAME@) CMAKE_MINIMUM_REQUIRED(VERSION 2.6) SET(BUILD_SHARED_LIBS 1) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin" CACHE INTERNAL "Single output directory for building all libraries.") SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin" CACHE INTERNAL "Single output directory for building all executables.") # This variable will contain a list of directories # which contain your binary plug-ins SET(@CUSTOM_PROJECT_NAME@_PLUGIN_OUTPUT_DIRS "" CACHE INTERNAL "@CUSTOM_PROJECT_NAME@ base plugin directories." FORCE) @FIND_PACKAGE_QT4@ INCLUDE(${QT_USE_FILE}) SET(MITK_USE_BLUEBERRY 1) # Set the variable below to 0 if you do not want to # use the extended MITK functionality SET(MITK_USE_EXT 1) FIND_PACKAGE(MITK REQUIRED) ADD_SUBDIRECTORY(Bundles) # Now build a custom executable to start the # BlueBerry Workbench with our plug-ins INCLUDE_DIRECTORIES( - ${BLUEBERRY_PLUGIN_SOURCE_DIRS} - ${org.blueberry.osgi_BIN_DIR} + ${org_blueberry_osgi_INCLUDE_DIRS} ${Poco_INCLUDE_DIRS} + ${mbilog_INCLUDE_DIRS} ) LINK_DIRECTORIES("${org.blueberry.osgi_OUT_DIR}/bin" ${Poco_LIBRARY_DIR}) ADD_EXECUTABLE(@CUSTOM_PROJECT_EXECUTABLE@ @CUSTOM_PROJECT_EXECUTABLE@.cpp) -TARGET_LINK_LIBRARIES(@CUSTOM_PROJECT_EXECUTABLE@ - optimized PocoFoundation debug PocoFoundationd - optimized PocoUtil debug PocoUtild - optimized org_blueberry_osgi debug org_blueberry_osgi${BLUEBERRY_DEBUG_POSTFIX}) +TARGET_LINK_LIBRARIES(@CUSTOM_PROJECT_EXECUTABLE@ org_blueberry_osgi) IF(@CUSTOM_PROJECT_NAME@_ENABLED_PLUGINS) ADD_DEPENDENCIES(@CUSTOM_PROJECT_EXECUTABLE@ ${@CUSTOM_PROJECT_NAME@_ENABLED_PLUGINS}) ENDIF() # Configure the application's .ini file SET(PLUGIN_CACHE_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugin_cache") SET(PLUGIN_OUTPUT_DIRS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Bundles") CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/@CUSTOM_PROJECT_EXECUTABLE@.ini" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/@CUSTOM_PROJECT_EXECUTABLE@.ini" @ONLY) # If we are under Windows, create two batch files which correctly # set up the environment for the application and for VS 2008 IF(WIN32) SET(APP_BUILD_TYPE debug) CONFIGURE_FILE(start@CUSTOM_PROJECT_EXECUTABLE@.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/start@CUSTOM_PROJECT_EXECUTABLE@_${APP_BUILD_TYPE}.bat @ONLY) SET(APP_BUILD_TYPE release) CONFIGURE_FILE(start@CUSTOM_PROJECT_EXECUTABLE@.bat.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/start@CUSTOM_PROJECT_EXECUTABLE@_${APP_BUILD_TYPE}.bat @ONLY) # Configure VS batch file CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/startVS2008.bat.in" "${PROJECT_BINARY_DIR}/startVS2008.bat" @ONLY) ENDIF(WIN32) diff --git a/CMake/QBundleTemplate/src/internal/ViewTemplate.h b/CMake/QBundleTemplate/src/internal/ViewTemplate.h index 139f5956c6..3f38186310 100644 --- a/CMake/QBundleTemplate/src/internal/ViewTemplate.h +++ b/CMake/QBundleTemplate/src/internal/ViewTemplate.h @@ -1,58 +1,58 @@ @PLUGIN_COPYRIGHT@ #ifndef @VIEW_CLASS@_h #define @VIEW_CLASS@_h #include #include <@VIEW_BASE_CLASS_H@> #include "@VIEW_CONTROLS_FILE@" @BEGIN_NAMESPACE@ /*! \brief @VIEW_CLASS@ \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup Functionalities */ -class @VIEW_CLASS@ : public QObject, public QmitkFunctionality +class @VIEW_CLASS@ : public QmitkFunctionality { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; @VIEW_CLASS@(); virtual ~@VIEW_CLASS@(); virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); protected: /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged( std::vector nodes ); Ui::@VIEW_CONTROLS_CLASS@* m_Controls; QmitkStdMultiWidget* m_MultiWidget; }; @END_NAMESPACE@ #endif // @UBUNDLE_NAMESPACE@_@UVIEW_CLASS@_H_INCLUDED