diff --git a/CMakeLists.txt b/CMakeLists.txt index ebe6412a..a5536e62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,94 +1,94 @@ project(discover) set(PROJECT_VERSION "5.18.3") set(PROJECT_VERSION_MAJOR 5) cmake_minimum_required(VERSION 2.8.12) set(QT_MIN_VERSION "5.14.0") -set(KF5_MIN_VERSION "5.62.0") +set(KF5_MIN_VERSION "5.69.0") find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} "${CMAKE_SOURCE_DIR}/cmake") find_package(Qt5 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets Test Network Xml Concurrent DBus Quick) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(ECMMarkAsTest) include(ECMAddTests) include(GenerateExportHeader) include(ECMQtDeclareLoggingCategory) include(KDEClangFormat) find_package(PkgConfig REQUIRED) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED CoreAddons Config Crash DBusAddons I18n Archive XmlGui ItemModels KIO Declarative) find_package(KF5Kirigami2 2.7.0) find_package(packagekitqt5 1.0.1 CONFIG) find_package(AppStreamQt 0.11.1 CONFIG) find_package(KF5Attica 5.23 CONFIG) find_package(KF5NewStuff 5.53 CONFIG) pkg_check_modules(Flatpak IMPORTED_TARGET flatpak>=0.11.8) pkg_check_modules(Fwupd IMPORTED_TARGET fwupd>=1.0.6) pkg_check_modules(Markdown IMPORTED_TARGET libmarkdown) find_package(KUserFeedback) if(NOT CMAKE_VERSION VERSION_LESS "3.10.0") # CMake 3.9+ warns about automoc on files without Q_OBJECT, and doesn't know about other macros. # 3.10+ lets us provide more macro names that require automoc. list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "DISCOVER_BACKEND_PLUGIN") endif() configure_file(DiscoverVersion.h.in DiscoverVersion.h) add_subdirectory(libdiscover) add_subdirectory(discover) add_subdirectory(exporter) add_subdirectory(update) option(WITH_NOTIFIER "Build and install the notifier plasmoid" ON) if(WITH_NOTIFIER) find_package(KF5 REQUIRED Notifications KIO) add_subdirectory(notifier) endif() set_package_properties(KF5Attica PROPERTIES DESCRIPTION "KDE Framework that implements the Open Collaboration Services API" PURPOSE "Required to build the KNewStuff3 backend" TYPE OPTIONAL) set_package_properties(KF5Kirigami2 PROPERTIES DESCRIPTION "KDE's lightweight user interface framework for mobile and convergent applications" URL "https://techbase.kde.org/Kirigami" PURPOSE "Required by discover qml components" TYPE RUNTIME) set_package_properties(KF5NewStuff PROPERTIES DESCRIPTION "Qt library that allows to interact with KNewStuff implementations" PURPOSE "Required to build the KNS backend" TYPE OPTIONAL) set_package_properties(packagekitqt5 PROPERTIES DESCRIPTION "Library that exposes PackageKit resources" URL "https://www.freedesktop.org/software/PackageKit/" PURPOSE "Required to build the PackageKit backend" TYPE OPTIONAL) set_package_properties(AppStreamQt PROPERTIES DESCRIPTION "Library that lists Appstream resources" URL "https://www.freedesktop.org" PURPOSE "Required to build the PackageKit and Flatpak backends" TYPE OPTIONAL) add_feature_info(Flatpak Flatpak_FOUND "Library that exposes flatpak repositories. Required to build the Flatpak backend" ) add_feature_info(Fwupd Fwupd_FOUND "Exposes fwupd") feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) # add clang-format target for all our real source files file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h) kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES}) install(FILES discover.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) diff --git a/discover/qml/ReviewDialog.qml b/discover/qml/ReviewDialog.qml index f5ab08e8..faf8b271 100644 --- a/discover/qml/ReviewDialog.qml +++ b/discover/qml/ReviewDialog.qml @@ -1,94 +1,91 @@ import QtQuick 2.3 import QtQuick.Controls 2.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 import org.kde.kirigami 2.10 as Kirigami Kirigami.OverlaySheet { id: reviewDialog property QtObject application readonly property alias rating: ratingInput.rating readonly property alias summary: titleInput.text readonly property alias review: reviewInput.text property QtObject backend: null signal accepted() + header: Kirigami.Heading { + wrapMode: Text.WordWrap + text: i18n("Reviewing %1", application.name) + } + ColumnLayout { Layout.maximumWidth: Kirigami.Units.gridUnit * 8 - Kirigami.Heading { - Layout.fillWidth: true - Layout.bottomMargin: Kirigami.Units.largeSpacing * 2 - wrapMode: Text.WordWrap - level: 2 - text: i18n("Reviewing %1", application.name) - } - Kirigami.FormLayout { id: contentLayout Layout.fillHeight: true Rating { id: ratingInput Kirigami.FormData.label: i18n("Rating:") editable: true } Label { Kirigami.FormData.label: i18n("Name:") visible: reviewDialog.backend.userName.length > 0 Layout.fillWidth: true elide: Text.ElideRight text: visible ? reviewDialog.backend.userName : "" } TextField { id: titleInput Kirigami.FormData.label: i18n("Title:") Layout.fillWidth: true validator: RegExpValidator { regExp: /.{3,70}/ } } } TextArea { id: reviewInput readonly property bool acceptableInput: length > 15 && length < 3000 Layout.fillWidth: true Layout.minimumHeight: Kirigami.Units.gridUnit * 8 } RowLayout { Label { id: instructionalLabel Layout.fillWidth: true text: { if (rating < 2) return i18n("Enter a rating"); if (! titleInput.acceptableInput) return i18n("Write the title"); if (reviewInput.length === 0) return i18n("Write the review"); if (reviewInput.length < 15) return i18n("Keep writing..."); if (reviewInput.length > 3000) return i18n("Too long!"); return ""; } wrapMode: Text.WordWrap opacity: 0.6 visible: text.length > 0 } Item { Layout.fillWidth: true visible: !instructionalLabel.visible } Button { id: acceptButton enabled: !instructionalLabel.visible text: i18n("Submit review") onClicked: { reviewDialog.accepted() reviewDialog.sheetOpen = false } } } } }