diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 75b4c429..baae57b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,334 +1,334 @@ IF(POLICY CMP0017) CMAKE_POLICY(SET CMP0017 NEW) ENDIF(POLICY CMP0017) IF(POLICY CMP0022) CMAKE_POLICY(SET CMP0022 NEW) ENDIF(POLICY CMP0022) IF(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) ENDIF(POLICY CMP0063) SET(QT_MIN_VERSION "5.2.0") ADD_DEFINITIONS( ${KF5_DEFINITIONS} ${QT_DEFINITIONS} -fexceptions -Wno-error -Wno-reorder -Wno-error=deprecated-declarations ) # It doesn't work in sandboxes IF (NOT ENABLE_SINGLE_INSTANCE) ADD_DEFINITIONS(-DDISABLE_KDBUS_SERVICE=1) ENDIF() # Enable some useful warnings ADD_DEFINITIONS( -Wall -Wextra -Wmissing-declarations -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wswitch-enum -Winit-self -Wmissing-include-dirs -Wundef -Wmissing-format-attribute -Wno-reorder -Wunused -Wuninitialized -Woverloaded-virtual -Wunused-value -pedantic -Wnonnull -Wsequence-point #-Wsystem-headers -Wsizeof-pointer-memaccess #-Wuseless-cast -Wvarargs ) #Add more warnings for compilers that support it. I used this command: #curl https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Warning-Options.html | \ #grep -E "^[\t ]+
-W[a-zA-Z=-]*" -o | grep -E "\-W[a-zA-Z=-]*" -o > #cat /tmp/48 /tmp/49 | sort | uniq -u # IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_COMPILER_IS_GNUCC) IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9) ADD_DEFINITIONS( -Wunused-but-set-parameter -Wconditionally-supported -Wno-cpp # -Wdouble-promotion -Wdate-time -Wdelete-incomplete # -Wfloat-conversion ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.9) ADD_DEFINITIONS( -Wno-pragmas ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0) ADD_DEFINITIONS( -Wsuggest-override -Wsuggest-final-types -Wsuggest-final-methods -Wbool-compare -Wformat-signedness -Wlogical-not-parentheses -Wnormalized -Wshift-count-negative -Wshift-count-overflow -Wsized-deallocation -Wsizeof-array-argument ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.0) ADD_DEFINITIONS( -Wnull-dereference -Wtautological-compare -Wduplicated-cond -Wmisleading-indentation ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0) ADD_DEFINITIONS( -Wimplicit-fallthrough -Wduplicated-branches -Wswitch-unreachable -Wformat-overflow -Wformat-truncation -Wnonnull ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0) ADD_DEFINITIONS( -Wmultistatement-macros -Wstringop-truncation -Wif-not-aligned -Wmissing-attributes ) ENDIF() ENDIF() IF (CMAKE_COMPILER_IS_GNUCC) EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION) IF (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6.9 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6) #GCC 4.6 version of those warnings does detect valid C++0x/C++11 as invalid. ADD_DEFINITIONS( -Wno-error=pragmas -Wno-pragmas -Wno-error ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7) ADD_DEFINITIONS( -Wmaybe-uninitialized -Wunused-local-typedefs -pedantic ) ENDIF() IF (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8) # ADD_DEFINITIONS("-Wzero-as-null-pointer-constant") # ADD_DEFINITIONS( -DENABLE_IGNORE_NULL=true ) ENDIF() ELSE() ADD_DEFINITIONS(-Wno-unknown-pragmas -Wno-unknown-warning-option) ENDIF() ADD_DEFINITIONS("-std=c++0x") #Make sure it can access DBUS autogenerated files INCLUDE_DIRECTORIES(SYSTEM ${KF5_INCLUDES} ${Qt5Widgets_INCLUDES} ${Qt5PrintSupport_INCLUDES} ${Qt5Core_INCLUDES} ${CMAKE_BINARY_DIR} ${ringqt_INCLUDE_DIR} ${LIB_TIP_INCLUDE} ${LIB_CONFIG_INCLUDE} ${LIB_CONFIG_WIDGETS} ) # Shared C++ QML components ADD_SUBDIRECTORY( qmlwidgets ) #Build KDE specific files ADD_SUBDIRECTORY( jamikdeintegration ) # Build the QML based first run Wizard ADD_SUBDIRECTORY( wizard ) # Build the QML based interactive video canvas ADD_SUBDIRECTORY( callview ) # Build the advanced phone dialer ADD_SUBDIRECTORY( dialview ) # Build the views and widgets related to the social timeline feature ADD_SUBDIRECTORY( timeline ) # Build the contact and profile photo editor dialog ADD_SUBDIRECTORY( photoselector ) # Build the elements used to notify the users of events ADD_SUBDIRECTORY( canvasindicators ) # Build the contact manager subsystem ADD_SUBDIRECTORY( contactview ) # Build the account manager subsystem ADD_SUBDIRECTORY( accountview ) # Build the main desktop component ADD_SUBDIRECTORY( desktopview ) # ADD_DEPENDENCIES(desktopview DEPENDS jamikdeintegration) IF(${CMAKE_BUILD_TYPE} MATCHES Release) MESSAGE("NO DEBUG OUTPUT") ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT) ELSE() ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release) SET( ring_kde_SRCS main.cpp cmd.cpp ringapplication.cpp errormessage.cpp ) # generate rules for building source files from the resources SET(QtApp_RCCS qrc/resources.qrc # conf/confresources.qrc ../data/appicon.qrc ) QT5_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS}) # add_subdirectory( test ) #Enable again some day, it cause compile problems for some users IF(NOT (${ENABLE_VIDEO} MATCHES false)) SET(ENABLE_VIDEO 1 CACHE BOOLEAN "Enable video") ADD_DEFINITIONS( -DENABLE_VIDEO=true ) SET ( config_ui_files ${config_ui_files} conf/dlgvideobase.ui ) ENDIF(NOT (${ENABLE_VIDEO} MATCHES false)) IF(${DISABLE_UNIQUE_APPLICATION} MATCHES true) MESSAGE("KUniqueApplication disabled") SET(DISABLE_UNIQUE_APPLICATION 1 CACHE BOOLEAN "Disable KUniqueApplication") ADD_DEFINITIONS( -DDISABLE_UNIQUE_APPLICATION=true ) ENDIF(${DISABLE_UNIQUE_APPLICATION} MATCHES true) ki18n_wrap_ui(ring_kde_SRCS ${config_ui_files} ) IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ADD_EXECUTABLE(ring-kde MACOSX_BUNDLE ${ring_kde_SRCS} ${QtApp_RCC_SRCS}) set_source_files_properties( ../data/ring-kdeui.rc PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) file( COPY ../data/ring-kdeui.rc DESTINATION "ring-kde.app/Contents/Resources/" ) ELSE() ADD_EXECUTABLE(ring-kde ${ring_kde_SRCS} ${QtApp_RCC_SRCS}) ENDIF() IF(NOT ${ENABLE_STATIC} MATCHES false) FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED DBus) INCLUDE_DIRECTORIES(SYSTEM ${Qt5DBus_INCLUDE_DIRS} ) LINK_DIRECTORIES(${Qt5DBus_LIBRARY_DIRS} ) ADD_DEFINITIONS(${Qt5DBus_CFLAGS}) IF(NOT DEFINED OS_ANDROID) TARGET_LINK_LIBRARIES(ring-kde -lpthread ) ENDIF() TARGET_LINK_LIBRARIES(ring-kde ${ringqt_LIBRARY_STATIC} ) IF(NOT ${ENABLE_LIBWRAP}) TARGET_LINK_LIBRARIES(ring-kde ${Qt5DBus_LIBRARIES} ) ENDIF() ELSE() TARGET_LINK_LIBRARIES(ring-kde ${ringqt_LIBRARY_DYNAMIC}) ENDIF() QT5_ADD_DBUS_ADAPTOR(ring_kde_SRCS ../data/org.kde.kuiserver.xml cmd.h Cmd ) TARGET_LINK_LIBRARIES(ring-kde jamiwizard jamicallview - dialview + jamidialview libtimeline libphotoselector libcanvasindicator desktopview jamicontactview jamiaccountview libqmlwidgets kquickitemviews jamikdeintegration # RingQt ringqtquick # Qt5 Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Svg Qt5::PrintSupport # KF5 KF5::I18n KF5::WidgetsAddons KF5::ConfigCore KF5::ConfigGui KF5::DBusAddons KF5::XmlGui KF5::Notifications KF5::IconThemes KF5::Crash KF5::NotifyConfig KF5::GlobalAccel KF5::Declarative KF5::Kirigami2 ) IF (Qt5TextToSpeech_FOUND) TARGET_LINK_LIBRARIES(ring-kde Qt5::TextToSpeech ) ENDIF() ########### install files ############### INSTALL( TARGETS ring-kde DESTINATION ${BIN_INSTALL_DIR} ) INSTALL( FILES wizard/assets/beta_logo.svg DESTINATION ${DATA_INSTALL_DIR}/ring-kde ) diff --git a/src/dialview/CMakeLists.txt b/src/dialview/CMakeLists.txt index 3953ae72..bdd77286 100644 --- a/src/dialview/CMakeLists.txt +++ b/src/dialview/CMakeLists.txt @@ -1,85 +1,119 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.0) +cmake_minimum_required(VERSION 3.0) -ADD_DEFINITIONS("-std=c++11") +project(jamidialview) -PROJECT(dialview) - -IF(POLICY CMP0063) +if(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) -ENDIF(POLICY CMP0063) +endif(POLICY CMP0063) -IF(POLICY CMP0048) - CMAKE_POLICY(SET CMP0048 NEW) -ENDIF(POLICY CMP0048) +find_package(ECM 1.1.0 REQUIRED NO_MODULE) +list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}") -IF(POLICY CMP0017) - CMAKE_POLICY(SET CMP0017 NEW) -ENDIF(POLICY CMP0017) +include(ECMInstallIcons) +include(ECMOptionalAddSubdirectory) +include(CMakePackageConfigHelpers) -IF(POLICY CMP0028) - CMAKE_POLICY(SET CMP0028 NEW) -ENDIF(POLICY CMP0028) +include(KDEInstallDirs) +include(KDECMakeSettings) +include(KDECompilerSettings) -FIND_PACKAGE(ECM 1.1.0 REQUIRED NO_MODULE) +SET(CMAKE_C_VISIBILITY_PRESET hidden) +SET(CMAKE_CXX_VISIBILITY_PRESET hidden) +SET(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -INCLUDE(ECMInstallIcons) -INCLUDE(ECMOptionalAddSubdirectory) +# When used with `add_subdirectory`, assume it is a static Qt plugin +get_directory_property(USES_ADD_SUBDIRECTORY PARENT_DIRECTORY) +if(USES_ADD_SUBDIRECTORY) + set(BUILD_SHARED_LIBS OFF) +endif() -INCLUDE(KDEInstallDirs) -INCLUDE(KDECMakeSettings) -INCLUDE(KDECompilerSettings) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) -SET(CMAKE_AUTOMOC ON) -SET(CMAKE_AUTORCC ON) -SET(CMAKE_AUTOUIC ON) +set(CMAKE_CXX_STANDARD 14) -FIND_PACKAGE ( LibRingQt QUIET ) +if(NOT BUILD_SHARED_LIBS) + set(ENABLE_STATIC_PLUGIN 1) # Used in Config.cmake.in + add_definitions(-DQT_PLUGIN) + add_definitions(-DQT_STATICPLUGIN=1) + add_definitions(-DJAMIDIALVIEW_USE_STATIC_PLUGIN=1) +endif() -FIND_PACKAGE(Qt5 CONFIG REQUIRED - Core - Gui - Quick - QuickWidgets - QuickControls2 +find_package(Qt5 CONFIG REQUIRED + Core Gui Quick QuickControls2 ) -FIND_PACKAGE(KF5 REQUIRED COMPONENTS - I18n - Declarative +set(GENERIC_LIB_VERSION "1.0.0") + +#File to compile +set( jamidialview_LIB_SRCS + dialviewplugin.cpp ) -INCLUDE_DIRECTORIES(SYSTEM ${Qt5Widgets_INCLUDES} ${Qt5Core_INCLUDES} ${ringqt_INCLUDE_DIR}) +qt5_add_resources(jamidialview_LIB_SRCS + dialview.qrc +) -ADD_DEFINITIONS(${Qt5Core_DEFINITIONS}) +set(AUTOMOC_MOC_OPTIONS -Muri=org.kde.ringkde.jamidialview) -SET(GENERIC_LIB_VERSION "1.0.0") +add_library(jamidialview ${jamidialview_LIB_SRCS} ) -#File to compile -SET( dialview_LIB_SRCS - dialdock.cpp - dialviewplugin.cpp +target_link_libraries( jamidialview + # Project + ringqt + ringqtquick + + # Qt + Qt5::Core + Qt5::Gui + Qt5::Quick + Qt5::QuickControls2 ) -QT5_ADD_RESOURCES(dialview_LIB_SRCS - dialview.qrc +# Configure the target config +set(jamidialview_CONFIG_PATH "${CMAKE_CURRENT_BINARY_DIR}/JamiDialViewConfig.cmake") + +if(USES_ADD_SUBDIRECTORY) + set(JamiDialView_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) +endif() + +configure_package_config_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/JamiDialViewConfig.cmake.in" ${jamidialview_CONFIG_PATH} + INSTALL_DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/JamiDialView/ + PATH_VARS INCLUDE_INSTALL_DIR +) + +install( FILES ${jamidialview_CONFIG_PATH} + DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/JamiDialView/ + COMPONENT Devel ) -ADD_LIBRARY( dialview STATIC ${dialview_LIB_SRCS} ) +# Create the target +target_include_directories(jamidialview + PUBLIC + $ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/ +) -target_link_libraries( dialview - ringqt +set_target_properties(jamidialview PROPERTIES + PUBLIC_HEADER + "${jamidialview_EXPORT_HDRS}" +) - Qt5::Widgets - Qt5::Core - Qt5::Gui - Qt5::Quick - Qt5::QuickWidgets - Qt5::QuickControls2 +export(TARGETS jamidialview + FILE "${PROJECT_BINARY_DIR}/cmake/JamiDialViewTargets.cmake" +) - KF5::I18n - KF5::Declarative +install(TARGETS jamidialview + EXPORT JamiDialViewTargets + LIBRARY DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}" COMPONENT jamidialview + ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin + COMPONENT Devel ) -SET( dialview_LIB_HDRS - videowidget.h +install(EXPORT JamiDialViewTargets + DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/JamiDialView + COMPONENT Devel ) diff --git a/src/dialview/cmake/JamiDialViewConfig.cmake.in b/src/dialview/cmake/JamiDialViewConfig.cmake.in new file mode 100644 index 00000000..bf65d557 --- /dev/null +++ b/src/dialview/cmake/JamiDialViewConfig.cmake.in @@ -0,0 +1,8 @@ +@PACKAGE_INIT@ + +#Allow users to when to use Q_IMPORT_PLUGIN in main.cpp +if(@ENABLE_STATIC_PLUGIN@ MATCHES 1) + add_definitions(-DJAMIDIALVIEW_USE_STATIC_PLUGIN=1) +endif() + +include("${CMAKE_CURRENT_LIST_DIR}/JamiDialViewTargets.cmake") diff --git a/src/dialview/dialdock.cpp b/src/dialview/dialdock.cpp deleted file mode 100644 index e1a4a916..00000000 --- a/src/dialview/dialdock.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2017 by Bluesystems * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#include "dialdock.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include <../ringapplication.h> -#include "peerstimelinemodel.h" -#include -#include -#include -#include - -// #include "qrc_dialview.cpp" -// #include "src/contactview/qrc_contactview.cpp" //FIXME - -class DialDockPrivate { -public: - QQuickWidget* m_pQuickWidget; -}; - -DialDock::DialDock(QWidget* parent) : - QDockWidget(parent), d_ptr(new DialDockPrivate) -{ - d_ptr->m_pQuickWidget = new QQuickWidget(RingApplication::engine(), this); - setWidget(d_ptr->m_pQuickWidget); - - d_ptr->m_pQuickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView); - d_ptr->m_pQuickWidget->setSource(QUrl(QStringLiteral("qrc:/ContactList.qml"))); -} - -DialDock::~DialDock() -{ - setWidget(nullptr); - - d_ptr->m_pQuickWidget->setVisible(false); - d_ptr->m_pQuickWidget->hide(); - d_ptr->m_pQuickWidget->setParent(nullptr); - - delete d_ptr; -} - -// kate: space-indent on; indent-width 4; replace-tabs on; diff --git a/src/dialview/dialdock.h b/src/dialview/dialdock.h deleted file mode 100644 index 45e97969..00000000 --- a/src/dialview/dialdock.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2017 by Bluesystems * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ -#pragma once - -#include - -class DialDockPrivate; - -class DialDock final : public QDockWidget -{ - Q_OBJECT -public: - explicit DialDock(QWidget* parent = nullptr); - virtual ~DialDock(); - -private: - DialDockPrivate* d_ptr; - Q_DECLARE_PRIVATE(DialDock) -}; - -Q_DECLARE_METATYPE(DialDock*) diff --git a/src/dialview/dialview.json b/src/dialview/dialview.json new file mode 100644 index 00000000..63b9cf3e --- /dev/null +++ b/src/dialview/dialview.json @@ -0,0 +1,4 @@ +{ + "Keys": [ "org.kde.ringkde.dialview" ], + "uri": ["org.kde.ringkde.dialview"] +} diff --git a/src/dialview/dialviewplugin.cpp b/src/dialview/dialviewplugin.cpp index bbf4e0d4..8ec7ec46 100644 --- a/src/dialview/dialviewplugin.cpp +++ b/src/dialview/dialviewplugin.cpp @@ -1,26 +1,37 @@ -/*************************************************************************** - * Copyright (C) 2017 by Bluesystems * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ +/************************************************************************************ + * Copyright (C) 2018 by BlueSystems GmbH * + * Author : Emmanuel Lepage Vallee * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***********************************************************************************/ #include "dialviewplugin.h" -#include +// Qt +#include +#include +// QRC #include -void DialView::registerTypes(const char *) +void JamiDialView::registerTypes(const char *uri) { + Q_ASSERT(uri == QByteArray("org.kde.ringkde.jamidialview")); +} + +void JamiDialView::initializeEngine(QQmlEngine *engine, const char *uri) +{ + Q_UNUSED(engine) + Q_UNUSED(uri) } diff --git a/src/dialview/dialviewplugin.h b/src/dialview/dialviewplugin.h index e2f7165a..7fa31b04 100644 --- a/src/dialview/dialviewplugin.h +++ b/src/dialview/dialviewplugin.h @@ -1,30 +1,31 @@ -/*************************************************************************** - * Copyright (C) 2017 by Bluesystems * - * Author : Emmanuel Lepage Vallee * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 3 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see . * - **************************************************************************/ +/************************************************************************************ + * Copyright (C) 2019 by BlueSystems GmbH * + * Author : Emmanuel Lepage Vallee * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Lesser General Public * + * License as published by the Free Software Foundation; either * + * version 2.1 of the License, or (at your option) any later version. * + * * + * This library is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with this library; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***********************************************************************************/ #pragma once -#include +#include -//![plugin] -class DialView final : public QObject +class Q_DECL_EXPORT JamiDialView final : public QQmlExtensionPlugin { Q_OBJECT + Q_PLUGIN_METADATA(IID "org.kde.ringkde.jamidialview" FILE "dialview.json") public: - void registerTypes(const char *uri); + void registerTypes(const char* uri) override; + virtual void initializeEngine(QQmlEngine* engine, const char* uri) override; }; -//![plugin] diff --git a/src/main.cpp b/src/main.cpp index 7f9932b8..d28f4d73 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,201 +1,216 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Jérémy Quentin * * Emmanuel Lepage Vallee * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * **************************************************************************/ //Qt #include #include #include #include //KDE #include #include #include //Ring #include "ringapplication.h" #include "kcfg_settings.h" #include "cmd.h" #include #include #ifdef KQUICKITEMVIEWS_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(KQuickItemViews) #else #include #endif #ifdef JAMIKDEINTEGRATION_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(JamiKDEIntegration) #else #include #endif #ifdef JAMIWIZARD_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(JamiWizard) #else #include #endif #ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(JamiAccountView) #else #include #endif #ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(JamiCallView) #else #include #endif #ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN Q_IMPORT_PLUGIN(JamiContactView) #else #include #endif +#ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN +Q_IMPORT_PLUGIN(JamiDialView) +#else +#include +#endif + Q_IMPORT_PLUGIN(RingQtQuick) constexpr static const char version[] = "3.1.0"; int main(int argc, char **argv) { try { //QQmlDebuggingEnabler enabler; QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); RingApplication app( argc, argv ); KLocalizedString::setApplicationDomain("ring-kde"); //FIXME remove #ifdef KQUICKITEMVIEWS_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_KQuickItemViews().instance())->registerTypes("org.kde.playground.kquickitemviews"); #else KQuickItemViews v; v.registerTypes("org.kde.playground.kquickitemviews"); #endif qobject_cast(qt_static_plugin_RingQtQuick().instance())->registerTypes("net.lvindustries.ringqtquick"); qobject_cast(qt_static_plugin_RingQtQuick().instance())->initializeEngine(app.engine(), "net.lvindustries.ringqtquick"); #ifdef JAMIKDEINTEGRATION_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_JamiKDEIntegration().instance())->registerTypes("org.kde.ringkde.jamikdeintegration"); qobject_cast(qt_static_plugin_JamiKDEIntegration().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamikdeintegration"); #else JamiKDEIntegration v2; v2.registerTypes("org.kde.ringkde.jamikdeintegration"); v2.initializeEngine(app.engine(), "org.kde.ringkde.jamikdeintegration"); #endif #ifdef JAMIWIZARD_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_JamiWizard().instance())->registerTypes("org.kde.ringkde.jamiwizard"); qobject_cast(qt_static_plugin_JamiWizard().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamiwizard"); #else JamiWizard v3; v3.registerTypes("org.kde.ringkde.jamiwizard"); v3.initializeEngine(app.engine(), "org.kde.ringkde.jamiwizard"); #endif #ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_JamiAccountView().instance())->registerTypes("org.kde.ringkde.jamiaccountview"); qobject_cast(qt_static_plugin_JamiAccountView().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamiaccountview"); #else JamiAccountView v4; v4.registerTypes("org.kde.ringkde.jamiaccountview"); v4.initializeEngine(app.engine(), "org.kde.ringkde.jamiaccountview"); #endif #ifdef JAMIACCOUNTVIEW_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_JamiCallView().instance())->registerTypes("org.kde.ringkde.jamicallview"); qobject_cast(qt_static_plugin_JamiCallView().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamicallview"); #else JamiCallViewPlugin v5; v5.registerTypes("org.kde.ringkde.jamicallview"); v5.initializeEngine(app.engine(), "org.kde.ringkde.jamicallview"); #endif #ifdef JAMICONTACTVIEW_USE_STATIC_PLUGIN qobject_cast(qt_static_plugin_JamiContactView().instance())->registerTypes("org.kde.ringkde.jamicontactview"); qobject_cast(qt_static_plugin_JamiContactView().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamicontactview"); #else JamiContactViewPlugin v6; v6.registerTypes("org.kde.ringkde.jamicontactview"); v6.initializeEngine(app.engine(), "org.kde.ringkde.jamicontactview"); #endif +#ifdef JAMIDIALVIEW_USE_STATIC_PLUGIN + qobject_cast(qt_static_plugin_JamiDialView().instance())->registerTypes("org.kde.ringkde.jamidialview"); + qobject_cast(qt_static_plugin_JamiDialView().instance())->initializeEngine(app.engine(), "org.kde.ringkde.jamidialview"); +#else + JamiDialView v7; + v7.registerTypes("org.kde.ringkde.jamidialview"); + v7.initializeEngine(app.engine(), "org.kde.ringkde.jamidialview"); +#endif + KAboutData about(QStringLiteral("ring-kde"), i18n("ring-kde"), /*QStringLiteral(*/version/*)*/, i18n("RING, a secured and distributed communication software"), KAboutLicense::GPL_V3, i18n("(C) 2004-2015 Savoir-faire Linux\n2016-2017 Emmanuel Lepage Vallee"), QString(), QStringLiteral("http://www.ring.cx"), QStringLiteral("ring@gnu.org") ); about.setOrganizationDomain(QByteArray("kde.org")); about.setProgramLogo(QImage(QStringLiteral(":appicon/icons/64-apps-ring-kde.png"))); about.addAuthor( i18n( "Emmanuel Lepage-Vallée" ), QString(), QStringLiteral("elv1313@gmail.com" )); about.addAuthor( i18n( "Alexandre Lision" ), QString(), QStringLiteral("alexandre.lision@savoirfairelinux.com")); about.addCredit( i18n( "Based on the SFLphone teamworks" ), QString(), QString() ); if (!Cmd::parseCmd(argc, argv, about)) return 0; KAboutData::setApplicationData(about); app.setOrganizationDomain(QStringLiteral("ring.cx")); //Only start the application once #ifdef Q_OS_LINUX #ifndef DISABLE_KDBUS_SERVICE KDBusService service(KDBusService::Unique); QObject::connect(&service, &KDBusService::activateActionRequested, Cmd::instance(), &Cmd::slotActivateActionRequested); QObject::connect(&service, &KDBusService::activateRequested , Cmd::instance(), &Cmd::slotActivateRequested ); QObject::connect(&service, &KDBusService::openRequested , Cmd::instance(), &Cmd::slotOpenRequested ); #endif #endif //The app will have quitted by now if an instance already exist app.newInstance(); const int retVal = app.exec(); ConfigurationSkeleton::self()->save(); return retVal; } catch(const char * msg) { qDebug() << msg; } catch(QString& msg) { qDebug() << msg; } } // kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/photoselector/CMakeLists.txt b/src/photoselector/CMakeLists.txt index 95030a15..bbb13bd4 100644 --- a/src/photoselector/CMakeLists.txt +++ b/src/photoselector/CMakeLists.txt @@ -1,68 +1,67 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.4) ADD_DEFINITIONS("-std=c++11") PROJECT(libphotoselector) FIND_PACKAGE(ECM 1.1.0 REQUIRED NO_MODULE) INCLUDE(ECMInstallIcons) INCLUDE(ECMOptionalAddSubdirectory) INCLUDE(KDEInstallDirs) INCLUDE(KDECMakeSettings) INCLUDE(KDECompilerSettings) SET(CMAKE_AUTOMOC ON) SET(CMAKE_AUTORCC ON) SET(CMAKE_AUTOUIC ON) FIND_PACKAGE ( LibRingQt QUIET ) FIND_PACKAGE(Qt5 CONFIG REQUIRED Core Gui Widgets Quick QuickWidgets QuickControls2 ) FIND_PACKAGE(KF5 REQUIRED COMPONENTS I18n Config ConfigWidgets ) INCLUDE_DIRECTORIES(SYSTEM ${Qt5Widgets_INCLUDES} ${Qt5Core_INCLUDES} ${ringqt_INCLUDE_DIR}) ADD_DEFINITIONS(${Qt5Core_DEFINITIONS}) SET(GENERIC_LIB_VERSION "1.0.0") #File to compile SET( libphotoselector_LIB_SRCS photoselector.cpp photoplugin.cpp ) QT5_ADD_RESOURCES(libphotoselector_LIB_SRCS photoselector.qrc ) ADD_LIBRARY( libphotoselector STATIC ${libphotoselector_LIB_SRCS} ) target_link_libraries( libphotoselector ringqt # KF5 KF5::I18n # Qt5 Qt5::Core Qt5::Gui Qt5::Quick Qt5::Widgets - Qt5::QuickWidgets Qt5::QuickControls2 ) diff --git a/src/qmlwidgets/CMakeLists.txt b/src/qmlwidgets/CMakeLists.txt index 4c534476..6cc7506e 100644 --- a/src/qmlwidgets/CMakeLists.txt +++ b/src/qmlwidgets/CMakeLists.txt @@ -1,81 +1,80 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0) ADD_DEFINITIONS("-std=c++11") PROJECT(libqmlwidgets) IF(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) ENDIF(POLICY CMP0063) FIND_PACKAGE(ECM 1.1.0 REQUIRED NO_MODULE) INCLUDE(ECMInstallIcons) INCLUDE(ECMOptionalAddSubdirectory) INCLUDE(KDEInstallDirs) INCLUDE(KDECMakeSettings) INCLUDE(KDECompilerSettings) SET(CMAKE_AUTOMOC ON) SET(CMAKE_AUTORCC ON) SET(CMAKE_AUTOUIC ON) FIND_PACKAGE ( LibRingQt QUIET ) FIND_PACKAGE(Qt5 CONFIG REQUIRED Core Gui Quick QuickWidgets QuickControls2 ) FIND_PACKAGE(KF5 REQUIRED COMPONENTS I18n Config ConfigWidgets ) INCLUDE_DIRECTORIES(SYSTEM ${Qt5Widgets_INCLUDES} ${Qt5Core_INCLUDES} ${ringqt_INCLUDE_DIR}) ADD_DEFINITIONS(${Qt5Core_DEFINITIONS}) SET(GENERIC_LIB_VERSION "1.0.0") #File to compile SET( libqmlwidgets_LIB_SRCS bubble.cpp plugin.cpp treehelper.cpp multicall.cpp timelinedots.cpp symboliccolorizer.cpp ) QT5_ADD_RESOURCES(libqmlwidgets_LIB_SRCS qmlwidgets.qrc ) ADD_LIBRARY( libqmlwidgets STATIC ${libqmlwidgets_LIB_SRCS} ) target_link_libraries( libqmlwidgets ringqt Qt5::Core Qt5::Gui Qt5::Quick - Qt5::QuickWidgets Qt5::QuickControls2 KF5::ConfigCore KF5::ConfigGui KF5::ConfigWidgets KF5::XmlGui ) SET( libqmlwidgets_LIB_HDRS bubble.h plugin.h ) diff --git a/src/ringapplication.cpp b/src/ringapplication.cpp index 26a58a49..f292e4af 100644 --- a/src/ringapplication.cpp +++ b/src/ringapplication.cpp @@ -1,344 +1,339 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Emmanuel Lepage Valle * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * **************************************************************************/ //Parent #include "ringapplication.h" //Qt #include #include #include #include #include #include #include #include #include #include #include //KDE #include #include #include #include //LRC #include #include #include #include #include #include #include //Ring #include "kcfg_settings.h" #include "cmd.h" #include "errormessage.h" #include "wizard/welcome.h" #include "jamikdeintegration/src/windowevent.h" //Models #include #include #include #include #include //Delegates #include "extensions/presencecollectionextension.h" //QML #include #include "qmlwidgets/plugin.h" #include "qmlwidgets/symboliccolorizer.h" #include "photoselector/photoplugin.h" #include "canvasindicators/canvasindicator.h" #include "canvasindicators/ringingimageprovider.h" #include "desktopview/desktopviewplugin.h" -#include "dialview/dialviewplugin.h" #include "timeline/timelineplugin.h" KDeclarative::KDeclarative* RingApplication::m_pDeclarative {nullptr}; RingQmlWidgets* RingApplication::m_pQmlWidget {nullptr}; PhotoSelectorPlugin* RingApplication::m_pPhotoSelector {nullptr}; DesktopView* RingApplication::m_pDesktopView {nullptr}; -DialView* RingApplication::m_pDialView {nullptr}; TimelinePlugin* RingApplication::m_pTimeline {nullptr}; CanvasIndicator* RingApplication::m_pCanvasIndicator {nullptr}; RingApplication* RingApplication::m_spInstance {nullptr}; //This code detect if the window is active, innactive or minimzed class PhoneWindowEvent final : public QObject { Q_OBJECT public: PhoneWindowEvent(RingApplication* ev) : QObject(ev),m_pParent(ev) { QTimer::singleShot(0, [this]() { m_pParent->desktopWindow()->installEventFilter(this); }); } protected: virtual bool eventFilter(QObject *obj, QEvent *event) override { Q_UNUSED(obj) if (event->type() == QEvent::WindowDeactivate) { m_pParent->m_HasFocus = false; } else if (event->type() == QEvent::WindowActivate) { m_pParent->m_HasFocus = true; } return false; } private: RingApplication* m_pParent; Q_SIGNALS: void minimized(bool); }; /** * The application constructor */ RingApplication::RingApplication(int & argc, char ** argv) : QApplication(argc,argv),m_StartIconified(false) { Q_ASSERT(argc != -1); setAttribute(Qt::AA_EnableHighDpiScaling); m_pEventFilter = new PhoneWindowEvent(this); m_spInstance = this; } void RingApplication::init() { if ((!Session::instance()->callModel()->isConnected()) || (!Session::instance()->callModel()->isValid())) { QTimer::singleShot(5000,this,&RingApplication::daemonTimeout); } } /** * Destructor */ RingApplication::~RingApplication() { delete m_pDeclarative; delete engine(); delete m_pCanvasIndicator; delete m_pPhotoSelector; delete m_pQmlWidget; m_spInstance = nullptr; } RingApplication* RingApplication::instance() { Q_ASSERT(m_spInstance); return m_spInstance; } ///Parse command line arguments int RingApplication::newInstance() { static bool displayWizard = ConfigurationSkeleton::enableWizard() || ConfigurationSkeleton::showSplash(); const bool displayOnStart = ConfigurationSkeleton::displayOnStart() && !startIconified(); static bool init = true; //Only call on the first instance if (init) { init = false; desktopWindow(); } // The first run wizard if (displayOnStart && displayWizard) { // Also add this object engine()->rootContext()->setContextProperty( QStringLiteral("RingApplication"), this ); if (ConfigurationSkeleton::enableWizard()) WindowEvent::instance()->showWizard(); if (!Session::instance()->accountModel()->size()) WindowEvent::instance()->showWizard(); ConfigurationSkeleton::setEnableWizard(false); displayWizard = false; return 0; } return 0; } bool RingApplication::startIconified() const { return m_StartIconified; } void RingApplication::setIconify(bool iconify) { m_StartIconified = iconify; } #define QML_TYPE(name) qmlRegisterUncreatableType(AppName, 1,0, #name, #name "cannot be instantiated"); #define QML_NS(name) qmlRegisterUncreatableMetaObject( name :: staticMetaObject, #name, 1, 0, #name, "Namespaces cannot be instantiated" ); #define QML_CRTYPE(name) qmlRegisterType(AppName, 1,0, #name); constexpr static const char AppName[]= "Ring"; /// Create a QML engine for various canvas widgets QQmlApplicationEngine* RingApplication::engine() { static QQmlApplicationEngine* e = nullptr; static std::atomic_flag engineInit = ATOMIC_FLAG_INIT; if (!engineInit.test_and_set()) { m_pQmlWidget = new RingQmlWidgets; m_pQmlWidget->registerTypes("RingQmlWidgets"); m_pPhotoSelector = new PhotoSelectorPlugin; m_pPhotoSelector->registerTypes("PhotoSelectorPlugin"); m_pDesktopView = new DesktopView; m_pDesktopView->registerTypes("DesktopView"); - m_pDialView = new DialView; - m_pDialView->registerTypes("DialView"); - m_pTimeline = new TimelinePlugin; m_pTimeline->registerTypes("TimeLine"); m_pCanvasIndicator = new CanvasIndicator; m_pCanvasIndicator->registerTypes("CanvasIndicator"); QML_TYPE( QAction) QML_CRTYPE( QItemSelectionModel ) QML_NS(Ring) e = new QQmlApplicationEngine(QGuiApplication::instance()); // Setup the icon theme provider and ki18n m_pDeclarative = new KDeclarative::KDeclarative; m_pDeclarative->setDeclarativeEngine(e); try { auto im = new RingingImageProvider(); e->addImageProvider( QStringLiteral("RingingImageProvider"), im ); e->addImportPath(QStringLiteral("qrc:/")); auto im2 = new SymbolicColorizer(); e->addImageProvider( QStringLiteral("SymbolicColorizer"), im2 ); } catch(char const* e) { qDebug() << "Failed to connect to the daemon" << e; sync(); ::exit(1); } catch(...) { qDebug() << "Failed to connect to the daemon with an unknown problem"; ::exit(2); } } return e; } #undef QML_TYPE #undef QML_CRTYPE QQuickWindow* RingApplication::desktopWindow() const { static QQuickWindow* dw = nullptr; if (!dw) { QQmlComponent component(engine()); component.loadUrl(QUrl(QStringLiteral("qrc:/DesktopWindow.qml"))); if ( component.isReady() ) { qDebug() << "Previous error" << component.errorString(); auto obj2 = component.create(); // I have *no* clue why this is needed... A race somewhere while (component.errorString().isEmpty() && !obj2) obj2 = component.create(); if (!(dw = qobject_cast(obj2))) qWarning() << "Failed to load:" << component.errorString(); } else qWarning() << component.errorString(); } Q_ASSERT(dw); return dw; } ///The daemon is not found void RingApplication::daemonTimeout() { if ((!Session::instance()->callModel()->isConnected()) || (!Session::instance()->callModel()->isValid())) { KMessageBox::error(nullptr, ErrorMessage::NO_DAEMON_ERROR); exit(1); } } ///Exit gracefully bool RingApplication::notify (QObject* receiver, QEvent* e) { try { return QApplication::notify(receiver,e); } catch (const Call::State& state) { qDebug() << ErrorMessage::GENERIC_ERROR << "CallState" << state; QTimer::singleShot(2500, this, &RingApplication::daemonTimeout); } catch (const Call::Action& state) { qDebug() << ErrorMessage::GENERIC_ERROR << "Call Action" << state; QTimer::singleShot(2500, this, &RingApplication::daemonTimeout); } catch (const QString& errorMessage) { KMessageBox::error(nullptr,errorMessage); QTimer::singleShot(2500, this, &RingApplication::daemonTimeout); } catch (const std::exception& e) { qDebug() << ErrorMessage::GENERIC_ERROR << e.what(); KMessageBox::error(nullptr,ErrorMessage::GENERIC_ERROR); QTimer::singleShot(2500, this, &RingApplication::daemonTimeout); } catch (...) { Q_ASSERT(false); qDebug() << ErrorMessage::GENERIC_ERROR; KMessageBox::error(nullptr, ErrorMessage::GENERIC_ERROR); QTimer::singleShot(2500, this, &RingApplication::daemonTimeout); } return false; } bool RingApplication::mayHaveFocus() { return m_HasFocus; } #include // kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/ringapplication.h b/src/ringapplication.h index 56e5b973..c07fc907 100644 --- a/src/ringapplication.h +++ b/src/ringapplication.h @@ -1,106 +1,105 @@ /*************************************************************************** * Copyright (C) 2009-2015 by Savoir-Faire Linux * * Author : Jérémy Quentin * * Emmanuel Lepage Vallee * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 3 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * **************************************************************************/ #ifndef RINGAPPLICATION_H #define RINGAPPLICATION_H #include //Qt class QEvent; class QQmlApplicationEngine; class QQuickWindow; //KF5 namespace KDeclarative { class KDeclarative; } //Ring class RingQmlWidgets; class PhotoSelectorPlugin; class CanvasIndicator; class DesktopView; class DialView; class TimelinePlugin; class Call; class PhoneWindowEvent; ///RingApplication: Main application class RingApplication final : public QApplication { Q_OBJECT public: // Constructor RingApplication(int & argc, char ** argv); // Destructor virtual ~RingApplication(); // Manage new instances Q_INVOKABLE virtual int newInstance(); // Exit gracefully virtual bool notify (QObject* receiver, QEvent* e) override; //Getter bool startIconified() const; QQuickWindow* desktopWindow() const; static QQmlApplicationEngine* engine(); static RingApplication* instance(); void init(); /** * An unreliable way to track the application focus * * It is better than nothing */ bool mayHaveFocus(); //Setter void setIconify(bool iconify); bool m_HasFocus {false}; private: //Attributes bool m_StartIconified {false}; bool m_StartPhone {false}; bool m_StartTimeLine {false}; static KDeclarative::KDeclarative* m_pDeclarative; static RingQmlWidgets* m_pQmlWidget; static PhotoSelectorPlugin* m_pPhotoSelector; static CanvasIndicator* m_pCanvasIndicator; static RingApplication* m_spInstance; static DesktopView* m_pDesktopView; - static DialView* m_pDialView; static TimelinePlugin* m_pTimeline; PhoneWindowEvent* m_pEventFilter {nullptr}; private Q_SLOTS: void daemonTimeout(); }; #endif // RINGAPPLICATION_H // kate: space-indent on; indent-width 3; replace-tabs on; diff --git a/src/timeline/CMakeLists.txt b/src/timeline/CMakeLists.txt index 70d8cd95..d2abee09 100644 --- a/src/timeline/CMakeLists.txt +++ b/src/timeline/CMakeLists.txt @@ -1,86 +1,85 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0) ADD_DEFINITIONS("-std=c++11") PROJECT(libtimeline) IF(POLICY CMP0063) CMAKE_POLICY(SET CMP0063 NEW) ENDIF(POLICY CMP0063) IF(POLICY CMP0048) CMAKE_POLICY(SET CMP0048 NEW) ENDIF(POLICY CMP0048) IF(POLICY CMP0017) CMAKE_POLICY(SET CMP0017 NEW) ENDIF(POLICY CMP0017) IF(POLICY CMP0028) CMAKE_POLICY(SET CMP0028 NEW) ENDIF(POLICY CMP0028) FIND_PACKAGE(ECM 1.1.0 REQUIRED NO_MODULE) INCLUDE(ECMInstallIcons) INCLUDE(ECMOptionalAddSubdirectory) INCLUDE(KDEInstallDirs) INCLUDE(KDECMakeSettings) INCLUDE(KDECompilerSettings) SET(CMAKE_AUTOMOC ON) SET(CMAKE_AUTORCC ON) SET(CMAKE_AUTOUIC ON) FIND_PACKAGE ( LibRingQt QUIET ) FIND_PACKAGE(Qt5 CONFIG REQUIRED Core Gui Quick QuickWidgets ) FIND_PACKAGE(KF5 REQUIRED COMPONENTS I18n ) INCLUDE_DIRECTORIES(SYSTEM ${Qt5Widgets_INCLUDES} ${Qt5Core_INCLUDES} ${ringqt_INCLUDE_DIR}) ADD_DEFINITIONS(${Qt5Core_DEFINITIONS}) SET(GENERIC_LIB_VERSION "1.0.0") #File to compile SET( libtimeline_LIB_SRCS timelineplugin.cpp ) QT5_ADD_RESOURCES(libtimeline_LIB_SRCS recentdock.qrc ) ADD_LIBRARY( libtimeline STATIC ${libtimeline_LIB_SRCS} ) target_link_libraries( libtimeline ringqt sharedassets Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Quick - Qt5::QuickWidgets Qt5::QuickControls2 KF5::I18n KF5::WidgetsAddons KF5::ConfigCore KF5::ConfigGui KF5::Kirigami2 ) SET( libtimeline_LIB_HDRS recentdock.h )