diff --git a/CMakeLists.txt b/CMakeLists.txt index dded65b..b49c132 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,89 +1,89 @@ cmake_minimum_required(VERSION 3.5) project(Purpose) find_package(ECM 5.59.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) set(REQUIRED_QT_VERSION 5.10.0) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Qml Gui DBus Widgets Network Test) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(FeatureSummary) include(GenerateExportHeader) include(ECMSetupVersion) include(ECMAddTests) include(ECMInstallIcons) include(ECMGenerateHeaders) include(ECMMarkNonGuiExecutable) include(ECMQtDeclareLoggingCategory) set(KF5_VERSION "5.60.0") # handled by release scripts set(KF5_DEP_VERSION "5.59.0") # handled by release scripts -find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS CoreAddons I18n Config) +find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS CoreAddons I18n Config Kirigami) # Debian is a special snow flake and uses nodejs as binary name # https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html if(EXISTS "/etc/debian_version") # is debian system? set(NODEJS_BINARY "nodejs" CACHE PATH "The binary name for the nodejs interpreter") else() # sane system set(NODEJS_BINARY "node" CACHE PATH "The binary name for the nodejs interpreter") endif() ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX PURPOSE VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/purpose_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PurposeConfigVersion.cmake" SOVERSION 5) #add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000) add_definitions(-DQT_NO_FOREACH) add_subdirectory( src ) if (BUILD_TESTING) add_subdirectory( autotests ) add_subdirectory( tests ) endif() add_definitions(-DTRANSLATION_DOMAIN=\"purpose5\") if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() # create a Config.cmake and a ConfigVersion.cmake file and install them set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Purpose") include(CMakePackageConfigHelpers) configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KF5PurposeConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KF5PurposeConfig.cmake" INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KF5PurposeConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KF5PurposeConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel ) install(EXPORT KF5PurposeTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5PurposeTargets.cmake NAMESPACE KF5:: ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/purpose_version.h DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/purpose COMPONENT Devel ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) install(FILES purpose.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}) #TODO: Remove somewhen in the future install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/KDEExperimentalPurposeConfig.cmake" DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/KDEExperimentalPurpose" COMPONENT Devel ) diff --git a/src/plugins/bluetooth/bluetoothplugin_config.qml b/src/plugins/bluetooth/bluetoothplugin_config.qml index 62866f0..fe21f67 100644 --- a/src/plugins/bluetooth/bluetoothplugin_config.qml +++ b/src/plugins/bluetooth/bluetoothplugin_config.qml @@ -1,51 +1,71 @@ /* Copyright 2014 Aleix Pol Gonzalez 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, see . */ -import QtQuick 2.1 +import QtQuick 2.7 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.5 +import org.kde.kirigami 2.5 as Kirigami import org.kde.bluezqt 1.0 as BluezQt -ListView { +ColumnLayout { + id: root property string device: "" - Layout.fillWidth: true - Layout.fillHeight: true - header: Label { + anchors.fill: parent + anchors.bottomMargin: Kirigami.Units.smallSpacing + + Kirigami.Heading { text: i18n("Choose a device to send to:") visible: root.count !== 0 + level: 1 } - model: BluezQt.DevicesModel { } - - delegate: ItemDelegate { - width: parent.width - text: Name - onClicked: root.device = Ubi - checked: root.device === Ubi - highlighted: root.device === Ubi - } - Label { - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - visible: root.count === 0 - text: i18n("No devices found") + ScrollView { + id: scroll + + Layout.fillWidth: true + Layout.fillHeight: true + + Component.onCompleted: scroll.background.visible = true + + ListView { + Layout.fillWidth: true + Layout.fillHeight: true + + model: BluezQt.DevicesModel { } + + delegate: Kirigami.BasicListItem { + width: parent.width + text: Name + icon: Icon + onClicked: root.device = Ubi + checked: root.device === Ubi + highlighted: root.device === Ubi + } + + Label { + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + visible: root.count === 0 + text: i18n("No devices found") + } + } } } diff --git a/src/plugins/kdeconnect/kdeconnectplugin_config.qml b/src/plugins/kdeconnect/kdeconnectplugin_config.qml index 3956cd9..cd3bdc4 100644 --- a/src/plugins/kdeconnect/kdeconnectplugin_config.qml +++ b/src/plugins/kdeconnect/kdeconnectplugin_config.qml @@ -1,51 +1,73 @@ /* Copyright 2014 Aleix Pol Gonzalez 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, see . */ -import QtQuick 2.1 +import QtQuick 2.7 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.5 +import org.kde.kirigami 2.5 as Kirigami import org.kde.kdeconnect 1.0 -ListView { +ColumnLayout { + id: root property string device: "" - Layout.fillWidth: true - Layout.fillHeight: true - header: Label { - text: i18nd("purpose_kdeconnect","Choose a device to send to:") - } - model: DevicesModel { - id: connectDeviceModel - displayFilter: DevicesModel.Paired | DevicesModel.Reachable - } - delegate: ItemDelegate { - width: parent.width - text: model.display - onClicked: root.device = deviceId - checked: root.device === deviceId - highlighted: root.device === deviceId + anchors.fill: parent + anchors.bottomMargin: Kirigami.Units.smallSpacing + + Kirigami.Heading { + text: i18nd("purpose_kdeconnect", "Choose a device to send to:") + visible: root.count !== 0 + level: 1 } - Label { - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignHCenter - visible: root.count === 0 - text: i18nd("purpose_kdeconnect","No devices found") + ScrollView { + id: scroll + + Layout.fillWidth: true + Layout.fillHeight: true + + Component.onCompleted: scroll.background.visible = true + + ListView { + Layout.fillWidth: true + Layout.fillHeight: true + + model: DevicesModel { + id: connectDeviceModel + displayFilter: DevicesModel.Paired | DevicesModel.Reachable + } + + delegate: Kirigami.BasicListItem { + width: parent.width + text: model.display + icon: model.iconName + onClicked: root.device = deviceId + checked: root.device === deviceId + highlighted: root.device === deviceId + } + + Label { + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignHCenter + visible: root.count === 0 + text: i18nd("purpose_kdeconnect","No devices found") + } + } } } diff --git a/src/widgets/JobDialog.qml b/src/widgets/JobDialog.qml index 40c4759..5215799 100644 --- a/src/widgets/JobDialog.qml +++ b/src/widgets/JobDialog.qml @@ -1,125 +1,115 @@ /* Copyright 2015 Aleix Pol Gonzalez 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, see . */ import QtQuick 2.4 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.1 import org.kde.purpose 1.0 ApplicationWindow { id: window flags: Qt.Dialog + title: configuration.pluginName width: Math.max(screen.width/3, 200) height: Math.max(screen.height/2, 300) property bool finished: false property var configuration property QtObject q Component.onCompleted: adoptJob() onConfigurationChanged: adoptJob() minimumHeight: view.Layout.minimumHeight minimumWidth: view.Layout.minimumWidth onClosing: { q.finished(null, 1, i18n("Configuration cancelled")); } function adoptJob() { if (configuration == null) return; if (configuration.isReady) { startJob() } else { view.push(configWizardComponent) } } function startJob() { var job = window.configuration.createJob(); job.start() view.push(runningJobComponent, { job: job }) } StackView { id: view anchors { fill: parent margins: 5 } Layout.minimumWidth: (currentItem ? currentItem.Layout.minimumWidth : 0) + 2*anchors.margins Layout.minimumHeight: (currentItem ? currentItem.Layout.minimumHeight : 0) + 2*anchors.margins } Component { id: configWizardComponent Page { - header: Label { - TextMetrics { - id: fontMetrics - } - font.weight: Font.Light - font.styleName: "Light" - font.pointSize: fontMetrics.font.pointSize * 2 - elide: Text.ElideRight - maximumLineCount: 1 - text: i18n("%1 - %2", window.configuration.pluginName, window.configuration.pluginTypeName) - } PurposeWizard { id: wiz configuration: window.configuration focus: true anchors.fill: parent } footer: RowLayout { Button { text: i18n("Run") enabled: window.configuration && window.configuration.isReady onClicked: { view.pop(); window.startJob(); } } Button { text: i18n("Cancel") onClicked: { window.q.finished(null, 1, i18n("Configuration cancelled")); window.visible = false; } } Item { Layout.fillWidth: true } } } } Component { id: runningJobComponent RunningJob { onResult: { window.q.finished(job.output, job.error, job.errorString); window.visible = false } } } }