diff --git a/CMakeLists.txt b/CMakeLists.txt index dd1013320..251576173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,416 +1,416 @@ cmake_minimum_required(VERSION 2.8.12) cmake_policy(SET CMP0043 NEW) project(gcompris-qt C CXX) # get all the redist dll needed for windows when compiling with vc set(CMAKE_INSTALL_UCRT_LIBRARIES 1) include(InstallRequiredSystemLibraries) # Set c++11 support include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(my_cxx_flags "-std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(my_cxx_flags "-std=c++0x") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}") # enable qml debugging for DEBUG builds: set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG") set(GCOMPRIS_MAJOR_VERSION 0) set(GCOMPRIS_MINOR_VERSION 98) set(GCOMPRIS_PATCH_VERSION 0) # Set the BUILD_DATE string(TIMESTAMP BUILD_DATE %Y%m) # cmake modules setup find_package(ECM 1.4.0 QUIET NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake/) set(CMAKE_PREFIX_PATH "${Qt5_DIR}/lib/cmake/Qt5") # KDE po to qm tools if(ECM_FOUND) include(kdeFetchTranslation) include(ECMAddTests) include(ECMPoQmTools) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ecm_install_po_files_as_qm(po) endif() option(BUILD_TESTING "Build and enable unit tests" OFF) include(ECMCoverageOption) endif(ECM_FOUND) # add tools (cppcheck, clang-tidy...) if build on testing mode only # (slower compilation) if(BUILD_TESTING) include(CodeQualityUtils) endif() set(QT_REQUIRED_VERSION 5.6.0) if(CMAKE_SYSTEM_NAME STREQUAL Android) find_package(ECM) set(ANDROID 1) # TODO: possibly should be setup by toolchain one day set(QT_QMAKE_EXECUTABLE "${_qt5Core_install_prefix}/bin/qmake") if(ECM_VERSION VERSION_GREATER "5.55.0") set(QT_REQUIRED_VERSION 5.12.0) endif() # workaround until this fix is in released ECM if(ECM_VERSION VERSION_LESS "5.15.0") add_definitions(-DANDROID) endif() endif() # Set executable filename if(ANDROID) set(GCOMPRIS_EXECUTABLE_NAME GCompris) elseif(SAILFISHOS) set(GCOMPRIS_EXECUTABLE_NAME harbour-gcompris-qt) elseif(WIN32) set(GCOMPRIS_EXECUTABLE_NAME GCompris) else() set(GCOMPRIS_EXECUTABLE_NAME gcompris-qt) endif() set(GCOMPRIS_VERSION ${GCOMPRIS_MAJOR_VERSION}.${GCOMPRIS_MINOR_VERSION}) # An integer value that represents the version of the application # Increase it at each release math(EXPR GCOMPRIS_VERSION_CODE "${GCOMPRIS_MAJOR_VERSION}*10000 + ${GCOMPRIS_MINOR_VERSION}*100 + ${GCOMPRIS_PATCH_VERSION}") # prevent build in source directory if("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") message(SEND_ERROR "Building in the source directory is not supported.") message(FATAL_ERROR "Please remove the created \"CMakeCache.txt\" file, the \"CMakeFiles\" directory and create a build directory and call \"${CMAKE_COMMAND} \".") endif("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED - Qml Quick Gui Multimedia Core Svg Xml XmlPatterns LinguistTools Sensors) + Qml Quick Gui Multimedia Core Svg Xml XmlPatterns LinguistTools Sensors QuickControls2) if(ANDROID) find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED AndroidExtras) endif(ANDROID) if(SAILFISHOS) find_package(Qt5 ${QT_REQUIRED_VERSION} REQUIRED Widgets) endif(SAILFISHOS) ## For now we workaround CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION to clang with a command variable, so not needed # if(ANDROID AND ECM_VERSION VERSION_LESS "5.56.0" AND Qt5Core_VERSION VERSION_GREATER "5.11.99") # message(FATAL_ERROR "ECM ${ECM_VERSION} not compatible with Qt ${Qt5Core_VERSION} version for android.") # endif() if((UNIX AND NOT APPLE AND NOT SAILFISHOS AND NOT ANDROID) OR WIN32) find_package(OpenSSL REQUIRED) endif() find_package (KF5 QUIET COMPONENTS DocTools ) if(ECM_FOUND) include(KDEInstallDirs) if(ECM_VERSION VERSION_GREATER "1.6.0") add_subdirectory(images) install(FILES org.kde.gcompris.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES org.kde.gcompris.desktop DESTINATION ${KDE_INSTALL_APPDIR}) else() message(STATUS "ECM_VERSION is ${ECM_VERSION}, icons and desktop files won't be installed.") endif() endif() # Tell CMake to run moc when necessary: set(CMAKE_AUTOMOC ON) # As moc files are generated in the binary dir, tell CMake # to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) #get_cmake_property(_variableNames VARIABLES) #foreach (_variableName ${_variableNames}) # message("${_variableName}=${${_variableName}}") #endforeach() set(ACTIVATION_MODE "no" CACHE STRING "Policy for activation [no|inapp|internal]") option(WITH_DEMO_ONLY "Include only demo activities" OFF) option(WITH_DOWNLOAD "Internal download" ON) # @FIXME These permissions should be removed if download is disable # but it makes the application crash on exit (tested on Android 6) set(ANDROID_INTERNET_PERMISSION "") set(ANDROID_ACCESS_NETWORK_STATE_PERMISSION "") set(GRAPHICAL_RENDERER "auto" CACHE STRING "Policy for choosing the renderer backend [opengl|software|auto]") # Set output directory if(CMAKE_HOST_APPLE) set(_bundle_bin gcompris-qt.app/Contents/MacOS) set(_data_dest_dir bin/${_bundle_bin}/../Resources) else() set(_data_dest_dir share/${GCOMPRIS_EXECUTABLE_NAME}) endif() if(ANDROID) # Android .so output set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/android/libs/${ANDROID_ABI}/) set(GCOMPRIS_TRANSLATIONS_DIR ${CMAKE_BINARY_DIR}/${_data_dest_dir} CACHE INTERNAL "" FORCE) set(GCOMPRIS_RCC_DIR ${CMAKE_BINARY_DIR}/android/assets/${_data_dest_dir}/rcc CACHE INTERNAL "" FORCE) if(ACTIVATION_MODE STREQUAL "inapp") set(ANDROID_BILLING_PERMISSION "") set(ANDROID_PACKAGE "net.gcompris") else(ACTIVATION_MODE) set(ANDROID_PACKAGE "net.gcompris.full") endif() add_subdirectory(android) elseif(CMAKE_HOST_APPLE) # MacOSX build set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(GCOMPRIS_TRANSLATIONS_DIR ${CMAKE_BINARY_DIR}/${_data_dest_dir}/translations CACHE INTERNAL "" FORCE) set(GCOMPRIS_RCC_DIR ${CMAKE_BINARY_DIR}/${_data_dest_dir}/rcc CACHE INTERNAL "" FORCE) else() # Desktop build set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(GCOMPRIS_TRANSLATIONS_DIR ${CMAKE_BINARY_DIR}/${_data_dest_dir}/translations CACHE INTERNAL "" FORCE) set(GCOMPRIS_RCC_DIR ${CMAKE_BINARY_DIR}/${_data_dest_dir}/rcc CACHE INTERNAL "" FORCE) endif(ANDROID) # Always create these folders add_custom_command( OUTPUT shareFolders COMMAND cmake -E make_directory ${GCOMPRIS_TRANSLATIONS_DIR} COMMAND cmake -E make_directory ${GCOMPRIS_RCC_DIR} ) add_custom_target( createShareFolders ALL DEPENDS shareFolders ) include(cmake/rcc.cmake) # Translations handling # Simple command calling the python script add_custom_command( OUTPUT retrievePoFilesFromSvn COMMAND python2 tools/l10n-fetch-po-files.py WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) # Install translations add_custom_target(getSvnTranslations DEPENDS retrievePoFilesFromSvn COMMENT "Re-run cmake after this to be able to run BuildTranslations with the latest files" ) # Get all po files in po/. You can get them doing: python2 tools/l10n-fetch-po-files.py file(GLOB TRANSLATIONS_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "po/*.po") # Set the output dir for the translation files to /bin foreach(PoSource ${TRANSLATIONS_FILES}) # Changes the .po extension to .ts string(REPLACE ".po" ".ts" TsSource ${PoSource}) # Removes the po/ folder string(REPLACE "po/" "" TsSource ${TsSource}) # qm filename string(REPLACE ".ts" ".qm" QmOutput ${TsSource}) set(OutTsFile ${CMAKE_BINARY_DIR}/tmp/${TsSource}) add_custom_command( OUTPUT ${QmOutput} COMMAND cmake -E make_directory ${GCOMPRIS_TRANSLATIONS_DIR} COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/tmp # Remove the obsolete translations and set po in the ts output file COMMAND msgattrib --no-obsolete ${CMAKE_CURRENT_SOURCE_DIR}/${PoSource} -o ${OutTsFile} # Convert the po into ts COMMAND Qt5::lconvert -if po -of ts -i ${OutTsFile} -o ${OutTsFile} # Convert the ts in qm removing non finished translations COMMAND Qt5::lrelease -compress -nounfinished ${OutTsFile} -qm ${GCOMPRIS_TRANSLATIONS_DIR}/${QmOutput} ) list(APPEND QM_FILES ${QmOutput}) endforeach() # Install translations if (WIN32) add_custom_target(BuildTranslations DEPENDS ${QM_FILES} COMMENT "If you don't have the .po, you need to run make getSvnTranslations first then re-run cmake" ) else() add_custom_target(BuildTranslations ALL DEPENDS ${QM_FILES} COMMENT "If you don't have the .po, you need to run make getSvnTranslations first then re-run cmake" ) endif() add_custom_command( OUTPUT doBundleTranslations COMMAND 7z a -w${CMAKE_BINARY_DIR}/share/${GCOMPRIS_EXECUTABLE_NAME} ${CMAKE_BINARY_DIR}/translations-${GCOMPRIS_VERSION}.7z ${CMAKE_BINARY_DIR}/share/${GCOMPRIS_EXECUTABLE_NAME}/translations WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) # Bundle translations add_custom_target(BundleTranslations DEPENDS doBundleTranslations COMMENT "If you want to provide a zip of the translations on a server (run make BuildTranslations first)" ) add_custom_command( OUTPUT doDlAndInstallBundledTranslations COMMAND curl -fsS -o translations-${GCOMPRIS_VERSION}.7z http://gcompris.net/download/translations-${GCOMPRIS_VERSION}.7z COMMAND 7z x -y -o${CMAKE_BINARY_DIR}/share/${GCOMPRIS_EXECUTABLE_NAME} translations-${GCOMPRIS_VERSION}.7z WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ) # Download and install bundled translations add_custom_target(DlAndInstallBundledTranslations DEPENDS doDlAndInstallBundledTranslations COMMENT "Download the bundled translation and install them in the build dir" ) if(CMAKE_HOST_APPLE) install(DIRECTORY ${GCOMPRIS_TRANSLATIONS_DIR} DESTINATION ${_bundle_bin}) elseif(ANDROID) install(DIRECTORY ${GCOMPRIS_TRANSLATIONS_DIR} DESTINATION "share") else() install(DIRECTORY ${GCOMPRIS_TRANSLATIONS_DIR} DESTINATION ${_data_dest_dir}) endif() # Build standalone package option -> if ON, we will copy the required Qt files in the build package. # If OFF, "make install" will not copy Qt files so only GCompris files will be packaged. # By default, it is true on Windows (as we deliver NSIS package), macOS (bundled), android (apk) and false on linux (to do make install) # If you want to create a STGZ package for linux (auto-extractible), override this variable by typing : cmake -DBUILD_STANDALONE=ON if(UNIX AND NOT ANDROID AND NOT APPLE) option(BUILD_STANDALONE "Build a standalone package when typing 'make package'" OFF) else() option(BUILD_STANDALONE "Build a standalone package when typing 'make package'" ON) endif() option(WITH_KIOSK_MODE "Set the kiosk mode by default" OFF) if(WIN32) set(COMPRESSED_AUDIO "mp3" CACHE STRING "Compressed Audio format [ogg|aac|mp3]") elseif(APPLE) set(COMPRESSED_AUDIO "aac" CACHE STRING "Compressed Audio format [ogg|aac|mp3]") else() set(COMPRESSED_AUDIO "ogg" CACHE STRING "Compressed Audio format [ogg|aac|mp3]") endif() file(GLOB_RECURSE OGG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/ "*.ogg") foreach(OGG_FILE ${OGG_FILES}) # This should only replace the extension string(REGEX REPLACE "ogg$" "aac" AAC_FILE ${OGG_FILE}) add_custom_command( OUTPUT ${AAC_FILE} # Put the good line depending on your installation COMMAND avconv -v warning -i ${OGG_FILE} -acodec libvo_aacenc ${AAC_FILE} #COMMAND ffmpeg -v warning -i ${OGG_FILE} -acodec aac -strict -2 ${AAC_FILE} ) list(APPEND AAC_FILES ${AAC_FILE}) # This should only replace the extension string(REGEX REPLACE "ogg$" "mp3" MP3_FILE ${OGG_FILE}) add_custom_command( OUTPUT ${MP3_FILE} # Put the good line depending on your installation #COMMAND avconv -v warning -i ${OGG_FILE} -acodec mp3 ${MP3_FILE} COMMAND ffmpeg -v warning -i ${OGG_FILE} -acodec mp3 -strict -2 ${MP3_FILE} ) list(APPEND MP3_FILES ${MP3_FILE}) endforeach() add_custom_target( createAacFromOgg DEPENDS ${AAC_FILES} ) add_custom_target( createMp3FromOgg DEPENDS ${MP3_FILES} ) # predownload assets (voices and images) and install them in the rcc folder set(DOWNLOAD_ASSETS "" CACHE STRING "Download and packages images and voices. use a list like: words,en,fr,pt_BR to retrieve multiple files") add_custom_command( OUTPUT predownloadAssets COMMAND python tools/download-assets.py ${DOWNLOAD_ASSETS} ${COMPRESSED_AUDIO} ${GCOMPRIS_RCC_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) add_custom_command( OUTPUT assetsFolders COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2" COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2/voices-${COMPRESSED_AUDIO}" COMMAND cmake -E make_directory "${GCOMPRIS_RCC_DIR}/data2/words" ) # Install assets add_custom_target(getAssets DEPENDS assetsFolders predownloadAssets ) add_custom_command( OUTPUT doBundleConvertedOggs COMMAND 7z a converted_ogg_to_${COMPRESSED_AUDIO}-${GCOMPRIS_VERSION}.7z '-ir!src/*${COMPRESSED_AUDIO}' WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) # Bundle oggs ready to be uploaded on a server. This ease build on system without the appropriate audio # convertion tools. add_custom_target(BundleConvertedOggs DEPENDS doBundleConvertedOggs COMMENT "Bundle the converted oggs to upload them on a server. First set COMPRESSED_AUDIO appropriately." ) add_custom_command( OUTPUT doDlAndInstallBundledConvertedOggs COMMAND curl -fsS -o converted_ogg_to_${COMPRESSED_AUDIO}-${GCOMPRIS_VERSION}.7z http://gcompris.net/download/converted_ogg_to_${COMPRESSED_AUDIO}-${GCOMPRIS_VERSION}.7z COMMAND 7z x -y converted_ogg_to_${COMPRESSED_AUDIO}-${GCOMPRIS_VERSION}.7z WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) # Download and install bundled converted oggs add_custom_target(DlAndInstallBundledConvertedOggs DEPENDS doDlAndInstallBundledConvertedOggs COMMENT "Download the bundled converted oggs and install them in the source dir" ) set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${GCOMPRIS_VERSION}) add_custom_target(dist COMMAND git archive --prefix=${ARCHIVE_NAME}/ HEAD | xz > ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.xz WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) if(KF5_FOUND) add_subdirectory(docs/docbook) endif(KF5_FOUND) # qml-box2d include(cmake/box2d.cmake) add_subdirectory(src) if(SAILFISHOS) # Need to be done at the end, after src add_subdirectory(platforms/sailfishOS) endif() # only enable unit tests for linux if(BUILD_TESTING) enable_testing() add_subdirectory(tests) endif(BUILD_TESTING) add_custom_target(binaries) add_dependencies(binaries ${GCOMPRIS_EXECUTABLE_NAME} rcc_core rcc_menu rcc_activities all_activities) diff --git a/src/activities/activities.txt b/src/activities/activities.txt index 1e22120a9..1ce4ecfd7 100644 --- a/src/activities/activities.txt +++ b/src/activities/activities.txt @@ -1,156 +1,157 @@ # The list of activities that will be loaded at GCompris start. # Keep it sorted advanced_colors algebra_by algebra_div algebra_minus algebra_plus algorithm align4 align4-2players alphabet-sequence babymatch babyshapes baby_tangram baby_wordprocessor balancebox ballcatch bargame bargame_2players binary_bulb braille_alphabets braille_fun calendar canal_lock categorization checkers checkers_2players chess chess_2players chess_partyend chronos clickanddraw clickgame click_on_letter click_on_letter_up clockgame color_mix color_mix_light colors crane details digital_electricity drawletters drawnumbers enumerate erase erase_2clic erase_clic explore_farm_animals explore_monuments explore_world_animals explore_world_music family family_find_relative fifteen find_the_day followline football geo-country geography gletters gnumch-equality gnumch-factors gnumch-inequality gnumch-multiples gnumch-primes graph-coloring guesscount guessnumber hangman hanoi hanoi_real hexagon imagename instruments intro_gravity land_safe lang leftright letter-in-word lightsoff louis-braille magic-hat-minus magic-hat-plus maze mazeinvisible mazerelative melody memory memory-case-association memory-case-association-tux memory-enumerate memory-math-add memory-math-add-minus memory-math-add-minus-mult-div memory-math-add-minus-mult-div-tux memory-math-add-minus-tux memory-math-add-tux memory-math-div memory-math-div-tux memory-math-minus memory-math-minus-tux memory-math-mult memory-math-mult-div memory-math-mult-div-tux memory-math-mult-tux memory-sound memory-sound-tux memory-tux memory-wordnumber mining missing-letter money money_back money_back_cents money_cents mosaic nine_men_morris nine_men_morris_2players note_names number_sequence numbers-odd-even paintings penalty -piano_composition photo_hunter +piano_composition planegame play_piano play_rhythm programmingMaze railroad readingh readingv redraw redraw_symmetrical renewable_energy reversecount roman_numerals scalesboard scalesboard_weight scalesboard_weight_avoirdupois +server share simplepaint smallnumbers smallnumbers2 solar_system submarine sudoku superbrain tangram target tic_tac_toe tic_tac_toe_2players traffic watercycle wordsgame diff --git a/src/activities/server/ActivityInfo.qml b/src/activities/server/ActivityInfo.qml new file mode 100644 index 000000000..118834192 --- /dev/null +++ b/src/activities/server/ActivityInfo.qml @@ -0,0 +1,40 @@ +/* GCompris - ActivityInfo.qml + * + * Copyright (C) 2018 Your Name + * + * 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 . + */ +import GCompris 1.0 + +ActivityInfo { + name: "server/Server.qml" + difficulty: 1 + icon: "server/server.svg" + author: "Your Name <yy@zz.org>" + demo: true + //: Activity title + title: "Server activity" + //: Help title + description: "" + //intro: "put here in comment the text for the intro voice" + //: Help goal + goal: "" + //: Help prerequisite + prerequisite: "" + //: Help manual + manual: "" + credit: "" + section: "fun" + createdInVersion: 9800 +} diff --git a/src/activities/server/CMakeLists.txt b/src/activities/server/CMakeLists.txt new file mode 100644 index 000000000..bb8a54794 --- /dev/null +++ b/src/activities/server/CMakeLists.txt @@ -0,0 +1 @@ +GCOMPRIS_ADD_RCC(activities/server *.qml *.svg *.js resource/* views/* controllers/* models/* assets/*) diff --git a/src/activities/server/Server.qml b/src/activities/server/Server.qml new file mode 100644 index 000000000..d87e13128 --- /dev/null +++ b/src/activities/server/Server.qml @@ -0,0 +1,222 @@ +/* GCompris - server.qml + * + * Copyright (C) 2018 YOUR NAME + * + * Authors: + * (GTK+ version) + * YOUR NAME (Qt Quick port) + * + * 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 . + */ +/*import QtQuick 2.2 +import QtQuick.Controls 2.2 +import QtQuick.Dialogs 1.2 +import QtQuick.Controls.Material 2.1*/ + +import QtQuick 2.0 +import QtQuick.Controls 2.2 +import QtQuick.Dialogs 1.2 +import QtQuick.Controls.Material 2.1 +//import assets 1.0 + + +import GCompris 1.0 + + + +import "../../core" +import "server.js" as Activity + +ActivityBase { + id: activity + + onStart: focus = true + onStop: {} + + pageComponent: Rectangle { + id: background + anchors.fill: parent + color: "#ABCDEF" + signal start + signal stop + + Component.onCompleted: { + activity.start.connect(start) + activity.stop.connect(stop) + contentFrame.replace("views/DashboardView.qml"); + } + + // Add here the QML items you need to access in javascript + QtObject { + id: items + property Item main: activity.main + property alias background: background + property alias bar: bar + property alias bonus: bonus + } + + onStart: { Activity.start(items) } + onStop: { Activity.stop() } + + + Connections { + target: masterController.ui_navigationController + onGoCreateClientView: contentFrame.replace("views/CreateClientView.qml") + onGoDashboardView: contentFrame.replace("views/DashboardView.qml") + onGoEditClientView: contentFrame.replace("views/EditClientView.qml", {selectedClient: client}) + onGoFindClientView: contentFrame.replace("views/FindClientView.qml") + onGoManagePupilsView: contentFrame.replace("views/ManagePupilsView.qml") + onGoManageGroupsView: contentFrame.replace("views/ManageGroupsView.qml") + } + + Rectangle { + id: navigationBar + anchors { + top: parent.top + bottom: parent.bottom + left: parent.left + } + width: 100 + color: "#000000" + + Column { + Button { + text: "Dashboard" + onClicked: masterController.ui_navigationController.goDashboardView() + } + Button { + text: "New Client" + onClicked: masterController.ui_navigationController.goCreateClientView() + } + Button { + text: "Find Client" + onClicked: masterController.ui_navigationController.goFindClientView() + } + Button { + text: "Manage Pupils" + onClicked: masterController.ui_navigationController.goManagePupilsView() + } + Button { + text: "Manage Groups" + onClicked: masterController.ui_navigationController.goManageGroupsView() + } + } + } + + StackView { + id: contentFrame + anchors { + top: parent.top + bottom: parent.bottom + right: parent.right + left: navigationBar.right + } + initialItem: "qrc:/gcompris/src/activities/server/views/SplashView.qml" + clip: true + } + +/* Drawer { + id: drawer + + width: Math.min(background.width, background.height) / 3 * 2 + height: background.height + + ListView { + focus: true + currentIndex: -1 + anchors.fill: parent + + delegate: ItemDelegate { + width: parent.width + text: model.text + highlighted: ListView.isCurrentItem + onClicked: { + drawer.close() + //model.triggered() + } + } + + model: ListModel { + ListElement { + text: qsTr("Open...") + // triggered: { fileOpenDialog.open(); } + } + ListElement { + text: qsTr("About...") + // triggered: function(){ console.log("f"); } + } + } + + ScrollIndicator.vertical: ScrollIndicator { } + } + } + + ToolBar { + Material.background: Material.Orange + + anchors.top: parent.top + anchors.left: parent.left + + ToolButton { + id: menuButton + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + icon.source: "resource/baseline-menu-24px.svg" + onClicked: drawer.open() + } + Label { + anchors.centerIn: parent + text: "Image Viewer" + font.pixelSize: 20 + elide: Label.ElideRight + } + } + + + FileDialog { + id: fileOpenDialog + title: "Select an image file" + folder: shortcuts.documents + nameFilters: [ + "Image files (*.png *.jpeg *.jpg)", + ] + onAccepted: { + image.source = fileOpenDialog.fileUrl + } + }*/ + + + DialogHelp { + id: dialogHelp + onClose: home() + } + + Bar { + id: bar + content: BarEnumContent { value: help | home | level } + onHelpClicked: { + displayDialog(dialogHelp) + } + onPreviousLevelClicked: Activity.previousLevel() + onNextLevelClicked: Activity.nextLevel() + onHomeClicked: activity.home() + } + + Bonus { + id: bonus + Component.onCompleted: win.connect(Activity.nextLevel) + } + } + +} diff --git a/src/activities/server/assets/Style.qml b/src/activities/server/assets/Style.qml new file mode 100644 index 000000000..8b1a4267b --- /dev/null +++ b/src/activities/server/assets/Style.qml @@ -0,0 +1,37 @@ +pragma Singleton +import QtQuick 2.9 + +Item { + property alias fontAwesome: fontAwesomeLoader.name + + readonly property color colourBackground: "#efefef" + + readonly property color colourNavigationBarBackground: "#000000" + readonly property color colourNavigationBarFont: "#ffffff" + readonly property int pixelSizeNavigationBarIcon: 42 + readonly property int pixelSizeNavigationBarText: 22 + readonly property real widthNavigationBarCollapsed: widthNavigationButtonIcon + readonly property real heightNavigationBarExpanded: widthNavigationButton + + readonly property real widthNavigationButtonIcon: 80 + readonly property real heightNavigationButtonIcon: widthNavigationButtonIcon + readonly property real widthNavigationButtonDescription: 160 + readonly property real heightNavigationButtonDescription: heightNavigationButtonIcon + readonly property real widthNavigationButton: widthNavigationButtonIcon + widthNavigationButtonDescription + readonly property real heightNavigationButton: Math.max(heightNavigationButtonIcon, heightNavigationButtonDescription) + + readonly property color colourCommandBarBackground: "#cecece" + readonly property color colourCommandBarFont: "#131313" + readonly property color colourCommandBarFontDisabled: "#636363" + readonly property real heightCommandBar: heightCommandButton + readonly property int pixelSizeCommandBarIcon: 32 + readonly property int pixelSizeCommandBarText: 12 + + readonly property real widthCommandButton: 80 + readonly property real heightCommandButton: widthCommandButton + + FontLoader { + id: fontAwesomeLoader + source: "qrc:/assets/fontawesome.ttf" + } +} diff --git a/src/activities/server/assets/fontawesome-webfont.ttf b/src/activities/server/assets/fontawesome-webfont.ttf new file mode 100644 index 000000000..35acda2fa Binary files /dev/null and b/src/activities/server/assets/fontawesome-webfont.ttf differ diff --git a/src/activities/server/assets/qmldir b/src/activities/server/assets/qmldir new file mode 100644 index 000000000..47ec3b227 --- /dev/null +++ b/src/activities/server/assets/qmldir @@ -0,0 +1,2 @@ +module assets +singleton Style 1.0 Style.qml diff --git a/src/activities/server/resource/baseline-menu-24px.svg b/src/activities/server/resource/baseline-menu-24px.svg new file mode 100644 index 000000000..fd6e2538a --- /dev/null +++ b/src/activities/server/resource/baseline-menu-24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/activities/server/server.js b/src/activities/server/server.js new file mode 100644 index 000000000..9e6840322 --- /dev/null +++ b/src/activities/server/server.js @@ -0,0 +1,54 @@ +/* GCompris - server.js + * + * Copyright (C) 2018 YOUR NAME + * + * Authors: + * (GTK+ version) + * "YOUR NAME" (Qt Quick port) + * + * 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 library +.import QtQuick 2.6 as Quick + +var currentLevel = 0 +var numberOfLevel = 4 +var items + +function start(items_) { + items = items_ + currentLevel = 0 + initLevel() +} + +function stop() { +} + +function initLevel() { + items.bar.level = currentLevel + 1 +} + +function nextLevel() { + if(numberOfLevel <= ++currentLevel) { + currentLevel = 0 + } + initLevel(); +} + +function previousLevel() { + if(--currentLevel < 0) { + currentLevel = numberOfLevel - 1 + } + initLevel(); +} diff --git a/src/activities/server/server.svg b/src/activities/server/server.svg new file mode 100644 index 000000000..330db7e72 --- /dev/null +++ b/src/activities/server/server.svg @@ -0,0 +1,83 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/src/activities/server/views/CreateClientView.qml b/src/activities/server/views/CreateClientView.qml new file mode 100644 index 000000000..34eb9e76a --- /dev/null +++ b/src/activities/server/views/CreateClientView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Createclient View" + } + } +} diff --git a/src/activities/server/views/DashboardView.qml b/src/activities/server/views/DashboardView.qml new file mode 100644 index 000000000..0a4614e87 --- /dev/null +++ b/src/activities/server/views/DashboardView.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 +//import assets 1.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Dashboard View" + } + } +} diff --git a/src/activities/server/views/EditClientView.qml b/src/activities/server/views/EditClientView.qml new file mode 100644 index 000000000..4159dcfa3 --- /dev/null +++ b/src/activities/server/views/EditClientView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Edit Client View" + } + } +} diff --git a/src/activities/server/views/FindClientView.qml b/src/activities/server/views/FindClientView.qml new file mode 100644 index 000000000..0e5586bdc --- /dev/null +++ b/src/activities/server/views/FindClientView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Find Client View" + } + } +} diff --git a/src/activities/server/views/ManageGroupsView.qml b/src/activities/server/views/ManageGroupsView.qml new file mode 100644 index 000000000..4159dcfa3 --- /dev/null +++ b/src/activities/server/views/ManageGroupsView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Edit Client View" + } + } +} diff --git a/src/activities/server/views/ManagePupilsView.qml b/src/activities/server/views/ManagePupilsView.qml new file mode 100644 index 000000000..4159dcfa3 --- /dev/null +++ b/src/activities/server/views/ManagePupilsView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Edit Client View" + } + } +} diff --git a/src/activities/server/views/SplashView.qml b/src/activities/server/views/SplashView.qml new file mode 100644 index 000000000..64e8c5a6e --- /dev/null +++ b/src/activities/server/views/SplashView.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Rectangle { + anchors.fill: parent + color: "#f4c842" + Text { + anchors.centerIn: parent + text: "Splash View" + } + } +} diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b0229178d..a4f12bd19 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -1,357 +1,363 @@ include(qt_helper) configure_file(config.h.in "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY) if(WITH_KIOSK_MODE) add_definitions(-DWITH_KIOSK_MODE) endif() if(SAILFISHOS) add_definitions(-DSAILFISHOS) endif() if(ANDROID) # needed since ECM 5.45 (https://bugs.kde.org/show_bug.cgi?id=394042) include_directories(SYSTEM "${CMAKE_SYSROOT}/usr/include" ) endif() set(gcompris_SRCS ActivityInfo.cpp ActivityInfo.h ActivityInfoTree.cpp ActivityInfoTree.h ApplicationInfo.cpp ApplicationInfo.h ApplicationSettings.cpp ApplicationSettings.h File.cpp File.h Directory.cpp Directory.h DownloadManager.cpp DownloadManager.h GComprisPlugin.cpp GComprisPlugin.h main.cpp config.h.in synth/ADSRenvelope.cpp synth/ADSRenvelope.h synth/GSynth.cpp synth/GSynth.h synth/linearSynthesis.cpp synth/linearSynthesis.h synth/modulation.cpp synth/modulation.h synth/generator.cpp synth/generator.h synth/preset.h synth/preset.cpp synth/waveform.cpp synth/waveform.h + serverMasterController/controllers/cm-lib_global.h + serverMasterController/controllers/master-controller.cpp + serverMasterController/controllers/master-controller.h + serverMasterController/controllers/navigation-controller.h + serverMasterController/models/client.cpp + serverMasterController/models/client.h ) if(ANDROID) list(APPEND gcompris_SRCS ApplicationAndroid.cpp) else() list(APPEND gcompris_SRCS ApplicationSettingsDefault.cpp ApplicationInfoDefault.cpp) endif() # Resources set(GCOMPRIS_RESOURCES "${PROJECT_SOURCE_DIR}/installer") if(CMAKE_HOST_WIN32) set(gcompris_icon GCompris.ico) set(gcompris_RES ${GCOMPRIS_RESOURCES}/${gcompris_icon} GCompris.rc ) elseif(CMAKE_HOST_APPLE) set(gcompris_icon GCompris.icns) set(gcompris_RES ${GCOMPRIS_RESOURCES}/${gcompris_icon}) set_source_files_properties(${gcompris_RES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() -set(used_qt_modules Qt5::Qml Qt5::Quick Qt5::Gui Qt5::Multimedia Qt5::Core Qt5::Svg Qt5::Xml Qt5::XmlPatterns Qt5::Sensors) +set(used_qt_modules Qt5::Qml Qt5::Quick Qt5::Gui Qt5::Multimedia Qt5::Core Qt5::Svg Qt5::Xml Qt5::XmlPatterns Qt5::Sensors Qt5::QuickControls2) if(ANDROID) add_library(${GCOMPRIS_EXECUTABLE_NAME} SHARED ${gcompris_SRCS}) set(used_qt_modules ${used_qt_modules} Qt5::AndroidExtras) elseif(CMAKE_HOST_APPLE) add_executable(${GCOMPRIS_EXECUTABLE_NAME} MACOSX_BUNDLE ${gcompris_SRCS} ${gcompris_RES}) elseif(CMAKE_HOST_WIN32) add_executable(${GCOMPRIS_EXECUTABLE_NAME} WIN32 ${gcompris_SRCS} ${gcompris_RES}) elseif(SAILFISHOS) add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) set(used_qt_modules ${used_qt_modules} Qt5::Widgets) else() add_executable(${GCOMPRIS_EXECUTABLE_NAME} ${gcompris_SRCS} ${gcompris_RES}) endif() # only build the lib for testing purpose if(BUILD_TESTING) add_library(gcompris_core SHARED ${gcompris_SRCS}) target_link_libraries(gcompris_core ${used_qt_modules}) endif() target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${used_qt_modules}) GCOMPRIS_ADD_RCC(core *.qml *.js resource/*.${COMPRESSED_AUDIO} resource/*.gif resource/*.png resource/*.svg resource/bonus/* resource/sounds/* resource/fonts/* qmldir COPYING) # Installation # ============ install(TARGETS ${GCOMPRIS_EXECUTABLE_NAME} ARCHIVE DESTINATION bin RUNTIME DESTINATION bin LIBRARY DESTINATION lib BUNDLE DESTINATION .) if(BUILD_STANDALONE) # Qt plugins to install set(_qt_plugins "") if(NOT SAILFISHOS) list(APPEND _qt_plugins Qt5::QJpegPlugin) endif() if(APPLE) list(APPEND _qt_plugins Qt5::QTgaPlugin Qt5::QTiffPlugin Qt5::QCocoaIntegrationPlugin) elseif(WIN32) list(APPEND _qt_plugins Qt5::QWindowsIntegrationPlugin Qt5::QWindowsAudioPlugin Qt5::AudioCaptureServicePlugin Qt5::DSServicePlugin) elseif(UNIX AND NOT ANDROID AND NOT SAILFISHOS) list(APPEND _qt_plugins Qt5::QXcbIntegrationPlugin Qt5::QXcbEglIntegrationPlugin Qt5::QXcbGlxIntegrationPlugin Qt5::QAlsaPlugin Qt5::QPulseAudioPlugin) endif() list(APPEND _qt_plugins Qt5::genericSensorPlugin Qt5::QtSensorGesturePlugin Qt5::QShakeSensorGesturePlugin) # Qml plugins to install if(WIN32) set(_lib_prefix "") else() set(_lib_prefix "lib") endif() set(_qt_plugins2 imageformats/${_lib_prefix}qsvg) if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT SAILFISHOS) list(APPEND _qt_plugins2 mediaservice/${_lib_prefix}gstaudiodecoder mediaservice/${_lib_prefix}gstcamerabin mediaservice/${_lib_prefix}gstmediacapture mediaservice/${_lib_prefix}gstmediaplayer) elseif(APPLE) list(APPEND _qt_plugins2 audio/${_lib_prefix}qtaudio_coreaudio mediaservice/${_lib_prefix}qavfmediaplayer mediaservice/${_lib_prefix}qtmedia_audioengine mediaservice/${_lib_prefix}qavfcamera) endif() set(_qml_plugins QtGraphicalEffects/${_lib_prefix}qtgraphicaleffectsplugin QtGraphicalEffects/private/${_lib_prefix}qtgraphicaleffectsprivate QtQuick/Window.2/${_lib_prefix}windowplugin QtQuick/Particles.2/${_lib_prefix}particlesplugin QtQuick.2/${_lib_prefix}qtquick2plugin QtMultimedia/${_lib_prefix}declarative_multimedia QtSensors/${_lib_prefix}declarative_sensors) if(NOT SAILFISHOS) list(APPEND _qml_plugins QtQuick/Controls/${_lib_prefix}qtquickcontrolsplugin QtQuick/Layouts/${_lib_prefix}qquicklayoutsplugin) endif() set(GCOMPRIS_OTHER_LIBS) if(APPLE) set(_app gcompris-qt.app) set(_qtconf_destdir ${_app}/Contents/Resources) set(_qt_plugins_destdir ${_app}/Contents/plugins) set(_qt_qml_destdir ${_app}/Contents/qml) set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/${_app}") set_target_properties(gcompris-qt PROPERTIES MACOSX_BUNDLE_INFO_STRING "GCompris, Educational game for children 2 to 10" MACOSX_BUNDLE_ICON_FILE "${gcompris_icon}" MACOSX_BUNDLE_GUI_IDENTIFIER "net.gcompris" MACOSX_BUNDLE_LONG_VERSION_STRING "${GCOMPRIS_MAJOR_VERSION}.${GCOMPRIS_MINOR_VERSION}.${GCOMPRIS_PATCH_VERSION}" MACOSX_BUNDLE_BUNDLE_NAME "gcompris-qt" MACOSX_BUNDLE_SHORT_VERSION_STRING "${GCOMPRIS_VERSION}" MACOSX_BUNDLE_BUNDLE_VERSION "${GCOMPRIS_VERSION}" MACOSX_BUNDLE_COPYRIGHT "GPL License, Copyright 2000-2019 Timothee Giet and Others.") set_source_files_properties(${GCOMPRIS_RESOURCES}/${gcompris_icon} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") else() set(_qtconf_destdir bin) set(_qt_plugins_destdir bin/plugins) set(_qt_qml_destdir bin/qml) if(CMAKE_HOST_WIN32) set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/bin/${GCOMPRIS_EXECUTABLE_NAME}.exe") else() set(GCOMPRIS_BUNDLE "\${CMAKE_INSTALL_PREFIX}/bin/${GCOMPRIS_EXECUTABLE_NAME}") endif() endif() # install qt.conf file install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/qt.conf DESTINATION ${_qtconf_destdir}) # install qt plugins foreach(_plugin ${_qt_plugins}) installQtPlugin(${_plugin} ${_qt_plugins_destdir} _lib) list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() foreach(_plugin ${_qt_plugins2}) if(APPLE) installQtPlugin2(${_plugin} ${_qt_plugins_destdir}/../Plugins _lib) else() installQtPlugin2(${_plugin} ${_qt_plugins_destdir} _lib) endif() list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() # install qml plugins foreach(_plugin ${_qml_plugins}) installQmlPlugin(${_plugin} ${_qt_qml_destdir} _lib) list(APPEND GCOMPRIS_OTHER_LIBS ${_lib}) endforeach() ## install QtGraphicalEffects (which is not a lib but only qml files) # BUT, actually there are some libs in it, and this does not work on APPLE. Moved to _qml_plugins instead # #set(_qml_subdir QtGraphicalEffects) #getQtQmlPath(_qt_qml_path) #install(DIRECTORY ${_qt_qml_path}/QtGraphicalEffects DESTINATION ${_qt_qml_destdir}) # Fix for Linux 'make package' that fails to link with libicu; also package OpenSSL libs from system if(UNIX AND NOT APPLE AND NOT SAILFISHOS AND NOT ANDROID) add_library( libicudata SHARED IMPORTED ) FILE(GLOB LIBICUDATA_SO "${Qt5_DIR}/../../libicudata.so.[0-9][0-9]") if ("${LIBICUDATA_SO}" STREQUAL "") FILE(GLOB LIBICUDATA_SO "/usr/lib/*/libicudata.so.[0-9][0-9]") endif() set_target_properties( libicudata PROPERTIES IMPORTED_LOCATION ${LIBICUDATA_SO} ) add_library( libicui18n SHARED IMPORTED ) FILE(GLOB LIBICUI18N_SO "${Qt5_DIR}/../../libicui18n.so.[0-9][0-9]") if ("${LIBICUI18N_SO}" STREQUAL "") FILE(GLOB LIBICUI18N_SO "/usr/lib/*/libicui18n.so.[0-9][0-9]") endif() set_target_properties( libicui18n PROPERTIES IMPORTED_LOCATION ${LIBICUI18N_SO} ) add_library( libicuuc SHARED IMPORTED ) FILE(GLOB LIBICUUC_SO "${Qt5_DIR}/../../libicuuc.so.[0-9][0-9]") if ("${LIBICUUC_SO}" STREQUAL "") FILE(GLOB LIBICUUC_SO "/usr/lib/*/libicuuc.so.[0-9][0-9]") endif() set_target_properties( libicuuc PROPERTIES IMPORTED_LOCATION ${LIBICUUC_SO} ) TARGET_LINK_LIBRARIES(${GCOMPRIS_EXECUTABLE_NAME} libicudata libicui18n libicuuc) # package installed OpenSSL libraries install(FILES "${OPENSSL_SSL_LIBRARY}" DESTINATION bin) install(FILES "${OPENSSL_CRYPTO_LIBRARY}" DESTINATION bin) install(FILES "${OPENSSL_SSL_LIBRARY}.10" DESTINATION bin) install(FILES "${OPENSSL_CRYPTO_LIBRARY}.10" DESTINATION bin) install(FILES "${OPENSSL_SSL_LIBRARY}.1.0.2k" DESTINATION bin) install(FILES "${OPENSSL_CRYPTO_LIBRARY}.1.0.2k" DESTINATION bin) TARGET_LINK_LIBRARIES(${GCOMPRIS_EXECUTABLE_NAME} OpenSSL::SSL OpenSSL::Crypto) endif() #Add OpenSSL support on Windows builds if(WIN32) if(MINGW) if(CMAKE_SIZEOF_VOID_P EQUAL 8) #64bit set(OPENSSL_DLL_SUFFIX "-x64") endif() install(FILES "${Qt5_DIR}/../../../bin/libcrypto-1_1${OPENSSL_DLL_SUFFIX}.dll" DESTINATION bin) install(FILES "${Qt5_DIR}/../../../bin/libssl-1_1${OPENSSL_DLL_SUFFIX}.dll" DESTINATION bin) else(MINGW) # appveyor install(FILES "${OPENSSL_INCLUDE_DIR}/../libeay32.dll" DESTINATION bin) install(FILES "${OPENSSL_INCLUDE_DIR}/../libssl32.dll" DESTINATION bin) install(FILES "${OPENSSL_INCLUDE_DIR}/../ssleay32.dll" DESTINATION bin) endif() target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} OpenSSL::SSL OpenSSL::Crypto) endif() endif(BUILD_STANDALONE) # Hack: do not fixup Qt and Qml plugins on Windows because fixup_bundle takes ages (cmake bug ?) -> Johnny : we need this even if it takes time because some required dependencies are pulled here #if(WIN32) set(GCOMPRIS_OTHER_LIBS "") endif() # install fixup_bundle script to resolve and fixup runtime dependencies if(BUILD_STANDALONE AND NOT ANDROID) configure_file(${CMAKE_SOURCE_DIR}/cmake/FixBundle.cmake.in FixBundle.cmake) install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/FixBundle.cmake) # install a startup script for linux bundle if(UNIX AND NOT APPLE AND NOT SAILFISHOS) install(PROGRAMS ../../tools/gcompris-qt.sh DESTINATION bin) endif() endif() if(WIN32 AND NOT MINGW) # install libEGL.dll, libGLESv2.dll, d3dcompiler_47.dll from Qt installation. Not sure if there is a clean way to get them... # Qt5_Dir is like C:/Qt/Qt5.5.1/5.5/mingw492_32/lib/cmake/Qt5 install(FILES ${Qt5_DIR}/../../../bin/libEGL.dll DESTINATION bin) install(FILES ${Qt5_DIR}/../../../bin/libGLESv2.dll DESTINATION bin) install(FILES ${Qt5_DIR}/../../../bin/d3dcompiler_47.dll DESTINATION bin) target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${Qt5_DIR}/../../libEGL.lib) target_link_libraries(${GCOMPRIS_EXECUTABLE_NAME} ${Qt5_DIR}/../../libGLESv2.lib) install(FILES ${Qt5_DIR}/../../../bin/opengl32sw.dll DESTINATION bin) # CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS contains visual c++ libraries install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin) endif() # Packaging # ========= set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GCompris is a high quality educational software suite, including a large number of activities for children aged 2 to 10.") set(CPACK_PACKAGE_VERSION_MAJOR ${GCOMPRIS_MAJOR_VERSION}) set(CPACK_PACKAGE_VERSION_MINOR ${GCOMPRIS_MINOR_VERSION}) set(CPACK_PACKAGE_VERSION_PATCH ${GCOMPRIS_PATCH_VERSION}) set(CPACK_PACKAGE_VERSION ${GCOMPRIS_VERSION}) set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING") set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README") if(WIN32) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${GCOMPRIS_EXECUTABLE_NAME}-Qt") set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${GCOMPRIS_EXECUTABLE_NAME}-Qt") set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/installer\\\\gcompris-header.bmp") set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}/installer\\\\GCompris-install.ico") set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}/installer\\\\GCompris-uninstall.ico") set(CPACK_NSIS_EXECUTABLES_DIRECTORY "bin") set(CPACK_PACKAGE_EXECUTABLES "${GCOMPRIS_EXECUTABLE_NAME};GCompris") set(CPACK_CREATE_DESKTOP_LINKS "${GCOMPRIS_EXECUTABLE_NAME};GCompris") set(CPACK_NSIS_URL_INFO_ABOUT "https:\\\\\\\\gcompris.net") set(CPACK_NSIS_DISPLAY_NAME "GCompris Educational Software") set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${GCOMPRIS_EXECUTABLE_NAME}") set(CPACK_PACKAGE_VENDOR "GCompris team") # Create shortcuts in menu to be able to launch in software or opengl mode list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA " CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\GCompris (Safe Mode).lnk' '$INSTDIR\\\\bin\\\\${GCOMPRIS_EXECUTABLE_NAME}.exe' '--software-renderer'") list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA " CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\GCompris.lnk' '$INSTDIR\\\\bin\\\\${GCOMPRIS_EXECUTABLE_NAME}.exe' '--opengl-renderer'") string (REPLACE ";" "\n" CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA}") else(WIN32) set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}/GCompris64.png") endif() if(APPLE) set(CPACK_GENERATOR "DragNDrop") set(CPACK_DMG_DS_STORE "${GCOMPRIS_RESOURCES}/dmg_DS_Store") set(CPACK_DMG_BACKGROUND_IMAGE "${GCOMPRIS_RESOURCES}/dmg_background.png") elseif(WIN32) set(CPACK_GENERATOR "NSIS") elseif(SAILFISHOS) configure_file(${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.spec.cmake ${CMAKE_BINARY_DIR}/harbour-gcompris-qt.spec @ONLY) install(FILES ${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.desktop DESTINATION share/applications) install(FILES ${PROJECT_SOURCE_DIR}/platforms/sailfishOS/harbour-gcompris-qt.png DESTINATION share/icons/hicolor/86x86/apps) set(CPACK_RPM_PACKAGE_SUMMARY "gcompris-qt") # BUILD_ARCH is either armv7hl or i486 set(CPACK_RPM_PACKAGE_ARCHITECTURE "${BUILD_ARCH}") set(CPACK_RPM_PACKAGE_NAME "${GCOMPRIS_EXECUTABLE_NAME}") set(CPACK_RPM_PACKAGE_VERSION "${GCOMPRIS_VERSION}") set(CPACK_RPM_PACKAGE_LICENSED "GPLv3") set(CPACK_RPM_PACKAGE_URL "https://www.gcompris.org") set(CPACK_RPM_PACKAGE_DESCRIPTION "GCompris is a high quality educational software suite comprising of numerous activities for children aged 2 to 10.") set(CPACK_RPM_USER_BINARY_SPECFILE "${CMAKE_BINARY_DIR}/harbour-gcompris-qt.spec") set(CMAKE_INSTALL_PREFIX "/usr") set(CPACK_PACKAGING_INSTALL_PREFIX "/usr") set(CPACK_GENERATOR "RPM") else() set(CPACK_GENERATOR "STGZ") endif() include(CPack) diff --git a/src/core/GComprisPlugin.cpp b/src/core/GComprisPlugin.cpp index d698959f2..41ddca5db 100644 --- a/src/core/GComprisPlugin.cpp +++ b/src/core/GComprisPlugin.cpp @@ -1,61 +1,60 @@ /* GCompris - GComprisPlugin.cpp * * Copyright (C) 2018 Johnny Jazeix * * Authors: * Johnny Jazeix * * 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 "GComprisPlugin.h" #include "ApplicationInfo.h" #include "ActivityInfoTree.h" #include "ApplicationSettings.h" #include "File.h" #include "Directory.h" #include "DownloadManager.h" #include "synth/GSynth.h" #include const int versionMajor = 1; const int versionMinor = 0; GComprisPlugin::GComprisPlugin(QObject *parent) : QQmlExtensionPlugin(parent) { } void GComprisPlugin::registerTypes(const char *uri) { qmlRegisterType(uri, versionMajor, versionMinor, "File"); qmlRegisterType(uri, versionMajor, versionMinor, "Directory"); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "ApplicationInfo", ApplicationInfo::applicationInfoProvider); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "ActivityInfoTree", ActivityInfoTree::menuTreeProvider); qmlRegisterType(uri, versionMajor, versionMinor, "ActivityInfo"); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "ApplicationSettings", ApplicationSettings::applicationSettingsProvider); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "DownloadManager", DownloadManager::downloadManagerProvider); qmlRegisterSingletonType(uri, versionMajor, versionMinor, "GSynth", GSynth::synthProvider); - } diff --git a/src/core/main.cpp b/src/core/main.cpp index c0a701b9b..a0d611627 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1,296 +1,307 @@ /* GCompris - main.cpp * * Copyright (C) 2014 Bruno Coudoin * * Authors: * Bruno Coudoin * * 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 #include #include #include #include #include #include #include #include #include #include +#include + +#include #include "GComprisPlugin.h" #include "ApplicationInfo.h" #include "ActivityInfoTree.h" #include "DownloadManager.h" +#include "serverMasterController/controllers/master-controller.h" + bool loadAndroidTranslation(QTranslator &translator, const QString &locale) { QFile file("assets:/share/GCompris/gcompris_" + locale + ".qm"); file.open(QIODevice::ReadOnly); QDataStream in(&file); uchar *data = (uchar*)malloc(file.size()); if(!file.exists()) qDebug() << "file assets:/share/GCompris/gcompris_" << locale << ".qm does not exist"; in.readRawData((char*)data, file.size()); if(!translator.load(data, file.size())) { qDebug() << "Unable to load translation for locale " << locale << ", use en_US by default"; free(data); return false; } // Do not free data, it is still needed by translator return true; } // Return the locale QString loadTranslation(QSettings &config, QTranslator &translator) { QString locale; // Get locale locale = config.value("General/locale", GC_DEFAULT_LOCALE).toString(); if(locale == GC_DEFAULT_LOCALE) locale = QString(QLocale::system().name() + ".UTF-8"); if(locale == "C.UTF-8" || locale == "en_US.UTF-8") return "en_US"; // Load translation // Remove .UTF8 locale.remove(".UTF-8"); #if defined(Q_OS_ANDROID) if(!loadAndroidTranslation(translator, locale)) loadAndroidTranslation(translator, ApplicationInfo::localeShort(locale)); #else #if (defined(Q_OS_LINUX) || defined(Q_OS_UNIX)) // only useful for translators: load from $application_dir/../share/... if exists as it is where kde scripts install translations if(translator.load("gcompris_qt.qm", QString("%1/../share/locale/%2/LC_MESSAGES").arg(QCoreApplication::applicationDirPath(), locale))) { qDebug() << "load translation for locale " << locale << " in " << QString("%1/../share/locale/%2/LC_MESSAGES").arg(QCoreApplication::applicationDirPath(), locale); } else if(translator.load("gcompris_qt.qm", QString("%1/../share/locale/%2/LC_MESSAGES").arg(QCoreApplication::applicationDirPath(), locale.split('_')[0]))) { qDebug() << "load translation for locale " << locale << " in " << QString("%1/../share/locale/%2/LC_MESSAGES").arg(QCoreApplication::applicationDirPath(), locale.split('_')[0]); } else #endif if(!translator.load("gcompris_" + locale, QString("%1/%2/translations").arg(QCoreApplication::applicationDirPath(), GCOMPRIS_DATA_FOLDER))) { qDebug() << "Unable to load translation for locale " << locale << ", use en_US by default"; } #endif return locale; } int main(int argc, char *argv[]) { // Disable it because we already support HDPI display natively qunsetenv("QT_DEVICE_PIXEL_RATIO"); QApplication app(argc, argv); app.setOrganizationName("KDE"); app.setApplicationName(GCOMPRIS_APPLICATION_NAME); app.setOrganizationDomain("kde.org"); app.setApplicationVersion(ApplicationInfo::GCVersion()); + + QQuickStyle::setStyle("Material"); #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) // Set desktop file name, as the built-in (orgDomain + appName) is not // the one we use (because appName is gcompris-qt, not gcompris) QGuiApplication::setDesktopFileName("org.kde.gcompris"); #endif //add a variable to disable default fullscreen on Mac, see below.. #if defined(Q_OS_MAC) // Sandboxing on MacOSX as documented in: // http://doc.qt.io/qt-5/osx-deployment.html QDir dir(QGuiApplication::applicationDirPath()); dir.cdUp(); dir.cd("Plugins"); QGuiApplication::setLibraryPaths(QStringList(dir.absolutePath())); #endif // Local scope for config QSettings config(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/gcompris/" + GCOMPRIS_APPLICATION_NAME + ".conf", QSettings::IniFormat); // Load translations QTranslator translator; loadTranslation(config, translator); // Apply translation app.installTranslator(&translator); QCommandLineParser parser; parser.setApplicationDescription("GCompris is an educational software for children 2 to 10"); parser.addHelpOption(); parser.addVersionOption(); QCommandLineOption exportActivitiesAsSQL("export-activities-as-sql", "Export activities as SQL"); parser.addOption(exportActivitiesAsSQL); QCommandLineOption clDefaultCursor(QStringList() << "c" << "cursor", QObject::tr("Run GCompris with the default system cursor.")); parser.addOption(clDefaultCursor); QCommandLineOption clNoCursor(QStringList() << "C" << "nocursor", QObject::tr("Run GCompris without cursor (touch screen mode).")); parser.addOption(clNoCursor); QCommandLineOption clFullscreen(QStringList() << "f" << "fullscreen", QObject::tr("Run GCompris in fullscreen mode.")); parser.addOption(clFullscreen); QCommandLineOption clWindow(QStringList() << "w" << "window", QObject::tr("Run GCompris in window mode.")); parser.addOption(clWindow); QCommandLineOption clSound(QStringList() << "s" << "sound", QObject::tr("Run GCompris with sound enabled.")); parser.addOption(clSound); QCommandLineOption clMute(QStringList() << "m" << "mute", QObject::tr("Run GCompris without sound.")); parser.addOption(clMute); QCommandLineOption clWithoutKioskMode(QStringList() << "disable-kioskmode", QObject::tr("Disable the kiosk mode (default).")); parser.addOption(clWithoutKioskMode); QCommandLineOption clWithKioskMode(QStringList() << "enable-kioskmode", QObject::tr("Enable the kiosk mode.")); parser.addOption(clWithKioskMode); QCommandLineOption clSoftwareRenderer(QStringList() << "software-renderer", QObject::tr("Use software renderer instead of openGL (slower but should run with any graphical card, needs Qt 5.8 minimum).")); parser.addOption(clSoftwareRenderer); QCommandLineOption clOpenGLRenderer(QStringList() << "opengl-renderer", QObject::tr("Use openGL renderer instead of software (faster but crash potentially depending on your graphical card).")); parser.addOption(clOpenGLRenderer); parser.process(app); GComprisPlugin plugin; plugin.registerTypes("GCompris"); ActivityInfoTree::registerResources(); // Tell media players to stop playing, it's GCompris time ApplicationInfo::getInstance()->requestAudioFocus(); // Must be done after ApplicationSettings is constructed because we get an // async callback from the payment system ApplicationSettings::getInstance()->checkPayment(); // Disable default fullscreen launch on Mac as it's a bit broken, window is behind desktop bars #if defined(Q_OS_MAC) bool isFullscreen = false; #else // for other platforms, fullscreen is the default value bool isFullscreen = true; #endif { isFullscreen = config.value("General/fullscreen", isFullscreen).toBool(); // Set the cursor image bool defaultCursor = config.value("General/defaultCursor", false).toBool(); if(!defaultCursor && !parser.isSet(clDefaultCursor)) QGuiApplication::setOverrideCursor( QCursor(QPixmap(":/gcompris/src/core/resource/cursor.svg"), 0, 0)); // Hide the cursor bool noCursor = config.value("General/noCursor", false).toBool(); if(noCursor || parser.isSet(clNoCursor)) QGuiApplication::setOverrideCursor(QCursor(Qt::BlankCursor)); } // Update execution counter ApplicationSettings::getInstance()->setExeCount(ApplicationSettings::getInstance()->exeCount() + 1); if(parser.isSet(clFullscreen)) { isFullscreen = true; } if(parser.isSet(clWindow)) { isFullscreen = false; } if(parser.isSet(clMute)) { ApplicationSettings::getInstance()->setIsAudioEffectsEnabled(false); ApplicationSettings::getInstance()->setIsAudioVoicesEnabled(false); } if(parser.isSet(clSound)) { ApplicationSettings::getInstance()->setIsAudioEffectsEnabled(true); ApplicationSettings::getInstance()->setIsAudioVoicesEnabled(true); } if(parser.isSet(clWithoutKioskMode)) { ApplicationSettings::getInstance()->setKioskMode(false); } if(parser.isSet(clWithKioskMode)) { ApplicationSettings::getInstance()->setKioskMode(true); } if(parser.isSet(clSoftwareRenderer)) { ApplicationSettings::getInstance()->setRenderer(QStringLiteral("software")); } if(parser.isSet(clOpenGLRenderer)) { ApplicationSettings::getInstance()->setRenderer(QStringLiteral("opengl")); } // Set the renderer used const QString &renderer = ApplicationSettings::getInstance()->renderer(); ApplicationInfo::getInstance()->setUseOpenGL(renderer != QLatin1String("software")); #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) if(renderer == QLatin1String("software")) QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); else if(renderer == QLatin1String("opengl")) QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGL); #endif QQmlApplicationEngine engine(QUrl("qrc:/gcompris/src/core/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::quit, DownloadManager::getInstance(), &DownloadManager::shutdown); + cm::controllers::MasterController masterController; + engine.rootContext()->setContextProperty("masterController", &masterController); + + // add import path for shipped qml modules: #ifdef SAILFISHOS engine.addImportPath(QStringLiteral("%1/../share/%2/lib/qml") .arg(QCoreApplication::applicationDirPath()).arg(GCOMPRIS_APPLICATION_NAME)); #else engine.addImportPath(QStringLiteral("%1/../lib/qml") .arg(QCoreApplication::applicationDirPath())); #endif ApplicationInfo::getInstance()->setBox2DInstalled(engine); if(parser.isSet(exportActivitiesAsSQL)) { ActivityInfoTree *menuTree(qobject_cast(ActivityInfoTree::menuTreeProvider(&engine, nullptr))); menuTree->exportAsSQL(); exit(0); } QObject *topLevel = engine.rootObjects().value(0); QQuickWindow *window = qobject_cast(topLevel); if (window == nullptr) { qWarning("Error: Your root item has to be a Window."); return -1; } ApplicationInfo::setWindow(window); window->setIcon(QIcon(QPixmap(QString::fromUtf8(":/gcompris/src/core/resource/gcompris-icon.png")))); if(isFullscreen) { window->showFullScreen(); } else { window->show(); } return app.exec(); } diff --git a/src/core/serverMasterController/controllers/cm-lib_global.h b/src/core/serverMasterController/controllers/cm-lib_global.h new file mode 100644 index 000000000..fadde8dff --- /dev/null +++ b/src/core/serverMasterController/controllers/cm-lib_global.h @@ -0,0 +1,12 @@ +#ifndef CMLIB_GLOBAL_H +#define CMLIB_GLOBAL_H + +#include + +#if defined(CMLIB_LIBRARY) +# define CMLIBSHARED_EXPORT Q_DECL_EXPORT +#else +# define CMLIBSHARED_EXPORT Q_DECL_IMPORT +#endif + +#endif diff --git a/src/core/serverMasterController/controllers/master-controller.cpp b/src/core/serverMasterController/controllers/master-controller.cpp new file mode 100644 index 000000000..6a16eb903 --- /dev/null +++ b/src/core/serverMasterController/controllers/master-controller.cpp @@ -0,0 +1,40 @@ +#include "master-controller.h" + +namespace cm { +namespace controllers { + +class MasterController::Implementation +{ +public: + Implementation(MasterController* _masterController) + : masterController(_masterController) + { + navigationController = new NavigationController(masterController); + } + + MasterController* masterController{nullptr}; + NavigationController* navigationController{nullptr}; + QString welcomeMessage = "This is MasterController to Major Tom"; +}; + +MasterController::MasterController(QObject* parent) + : QObject(parent) +{ + implementation.reset(new Implementation(this)); +} + +MasterController::~MasterController() +{ +} + +NavigationController* MasterController::navigationController() +{ + return implementation->navigationController; +} + +const QString& MasterController::welcomeMessage() const +{ + return implementation->welcomeMessage; +} + +}} diff --git a/src/core/serverMasterController/controllers/master-controller.h b/src/core/serverMasterController/controllers/master-controller.h new file mode 100644 index 000000000..6ae8b0fc6 --- /dev/null +++ b/src/core/serverMasterController/controllers/master-controller.h @@ -0,0 +1,35 @@ +#ifndef MASTERCONTROLLER_H +#define MASTERCONTROLLER_H + +#include +#include +#include + +#include "cm-lib_global.h" +#include "navigation-controller.h" + +namespace cm { +namespace controllers { + +class CMLIBSHARED_EXPORT MasterController : public QObject +{ + Q_OBJECT + + Q_PROPERTY( QString ui_welcomeMessage READ welcomeMessage CONSTANT ) + Q_PROPERTY( cm::controllers::NavigationController* ui_navigationController READ navigationController CONSTANT ) + +public: + explicit MasterController(QObject* parent = nullptr); + ~MasterController(); + + NavigationController* navigationController(); + const QString& welcomeMessage() const; + +private: + class Implementation; + QScopedPointer implementation; +}; + +}} + +#endif diff --git a/src/core/serverMasterController/controllers/navigation-controller.h b/src/core/serverMasterController/controllers/navigation-controller.h new file mode 100644 index 000000000..8af546022 --- /dev/null +++ b/src/core/serverMasterController/controllers/navigation-controller.h @@ -0,0 +1,29 @@ +#ifndef NAVIGATIONCONTROLLER_H +#define NAVIGATIONCONTROLLER_H + +#include + +#include "cm-lib_global.h" +#include "../models/client.h" + +namespace cm { + namespace controllers { + + class CMLIBSHARED_EXPORT NavigationController : public QObject + { + Q_OBJECT + public: + explicit NavigationController(QObject* parent = nullptr) : QObject(parent){} + + signals: + void goCreateClientView(); + void goDashboardView(); + void goEditClientView(cm::models::Client* client); + void goFindClientView(); + void goManagePupilsView(); + void goManageGroupsView(); + }; + } +} + +#endif diff --git a/src/core/serverMasterController/models/client.cpp b/src/core/serverMasterController/models/client.cpp new file mode 100644 index 000000000..e1400037a --- /dev/null +++ b/src/core/serverMasterController/models/client.cpp @@ -0,0 +1,11 @@ +#include "client.h" + +namespace cm { +namespace models { + +Client::Client() +{ +} + +} +} diff --git a/src/core/serverMasterController/models/client.h b/src/core/serverMasterController/models/client.h new file mode 100644 index 000000000..d9fa4cd57 --- /dev/null +++ b/src/core/serverMasterController/models/client.h @@ -0,0 +1,21 @@ +#ifndef CLIENT_H +#define CLIENT_H + +#include "../controllers/cm-lib_global.h" + +namespace cm { +namespace models { + +class CMLIBSHARED_EXPORT Client +{ + +public: + Client(); +}; + +} +} + +#endif + +