diff --git a/CMakeLists.txt b/CMakeLists.txt index 499abf1..2d5b965 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,59 +1,59 @@ project(angelfish) cmake_minimum_required(VERSION 2.8.12) set(KF5_MIN_VERSION "5.62.0") -set(QT_MIN_VERSION "5.12.0") +set(QT_MIN_VERSION "5.13.0") option(BUILD_TESTING "Build test programs" ON) ################# Disallow in-source build ################# if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") message(FATAL_ERROR "This application requires an out of source build. Please create a separate build directory.") endif() include(FeatureSummary) ################# set KDE specific information ################# find_package(ECM 5.64.0 REQUIRED NO_MODULE) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(ECMSetupVersion) include(ECMGenerateHeaders) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEClangFormat) include(ECMPoQmTools) include(KDECompilerSettings NO_POLICY_SCOPE) ################# Find dependencies ################# find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2 Sql) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 Purpose I18n Config CoreAddons) # Necessary to support QtWebEngine installed in a different prefix than the rest of Qt (e.g flatpak) find_package(Qt5WebEngine REQUIRED) ################# Definitions to pass to the compiler ################# add_definitions(-DQT_NO_FOREACH) kde_enable_exceptions() ################# build and install ################# add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(autotests) endif() add_subdirectory(angelfish-webapp) install(PROGRAMS org.kde.mobile.angelfish.desktop DESTINATION ${KDE_INSTALL_APPDIR}) install(FILES org.kde.mobile.angelfish.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) install(FILES org.kde.mobile.angelfish.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) diff --git a/src/contents/ui/PermissionQuestion.qml b/src/contents/ui/PermissionQuestion.qml index 0fc9ef9..9a15828 100644 --- a/src/contents/ui/PermissionQuestion.qml +++ b/src/contents/ui/PermissionQuestion.qml @@ -1,43 +1,58 @@ import org.kde.kirigami 2.4 as Kirigami -import QtWebEngine 1.5 +import QtWebEngine 1.9 Kirigami.InlineMessage { property int permission property string origin id: permissionQuestion text: { - if (permission === WebEngineView.Geolocation) + switch(permission) { + case WebEngineView.Geolocation: i18n("Do you want to allow the website to access the geo location?") - else if (permission === WebEngineView.MediaAudioCapture) + break + case WebEngineView.MediaAudioCapture: i18n("Do you want to allow the website to access the microphone?") - else if (permission === WebEngineView.MediaVideoCapture) + break + case WebEngineView.MediaVideoCapture: i18n("Do you want to allow the website to access the camera?") - else if (permission === WebEngineView.MediaAudioVideoCapture) + break + case WebEngineView.MediaAudioVideoCapture: i18n("Do you want to allow the website to access the camera and the microphone?") + break + case WebEngineView.DesktopVideoCapture: + i18n("Do you want to allow the website to share your screen?") + break + case WebEngineView.DesktopAudioVideoCapture: + i18n("Do you want to allow the website to share the sound output?") + break + case WebEngineView.Notifications: + i18n("Do you want to allow the website to send you notifications?") + break + } } showCloseButton: false actions: [ Kirigami.Action { icon.name: "dialog-ok-apply" text: i18n("Accept") onTriggered: { currentWebView.grantFeaturePermission( permissionQuestion.origin, permissionQuestion.permission, true) permissionQuestion.visible = false } }, Kirigami.Action { icon.name: "dialog-cancel" text: i18n("Decline") onTriggered: { currentWebView.grantFeaturePermission( permissionQuestion.origin, permissionQuestion.permission, false) permissionQuestion.visible = false } } ] }