diff options
Diffstat (limited to 'src')
260 files changed, 654 insertions, 12196 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..0e91047 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,6 @@ +add_subdirectory(networksettings) +add_subdirectory(doc) + +if(TARGET Qt::Qml) + add_subdirectory(networksettingsqml) +endif() diff --git a/src/bluetoothsettings/bluetoothdevice.cpp b/src/bluetoothsettings/bluetoothdevice.cpp deleted file mode 100644 index dda2386..0000000 --- a/src/bluetoothsettings/bluetoothdevice.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <discoverymodel.h> -#include "bluetoothdevice.h" -#include "bluetoothdevice_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \module QtBluetoothSettings - \qtvariable bluetoothsettings - \ingroup qtdevice-utilities-cpp-modules - \ingroup modules - \title Qt Bluetooth Settings C++ Classes - \brief Provides functionality for controlling Bluetooth settings. - - To use classes from this module, add this directive into the C++ files: - - \code - #include <QtBluetoothSettings> - \endcode - - To link against the corresponding C++ libraries, add the following to your - qmake project file: - - \code - QT += bluetoothsettings - \endcode -*/ - -/*! - \class BluetoothDevice - \inmodule QtBluetoothSettings - - \brief The BluetoothDevice class controls Bluetooth settings. - - The Bluetooth settings contain information about the local Bluetooth device, - such as the device model and whether the device is powered on and available - for connections with other Bluetooth devices. - - The Bluetooth device can scan for other Bluetooth devices in range and - retrieve information about them. The Bluetooth device then uses the address - of another device to attempt pairing to it, and connects to it if the - pairing was successful. -*/ - -/*! - \property BluetoothDevice::scanning - \brief Whether the Bluetooth device is scanning for remote devices. -*/ - -/*! - \property BluetoothDevice::powered - \brief Whether the power in the Bluetooth device is on or off. -*/ - -/*! - \property BluetoothDevice::available - \brief Whether the Bluetooth device is available. -*/ - -/*! - \property BluetoothDevice::deviceModel - \brief The model of the Bluetooth device. -*/ - -/*! - Creates a new Bluetooth device with the parent \a parent. -*/ -BluetoothDevice::BluetoothDevice(QObject *parent) : QObject(parent) - ,d_ptr(new BluetoothDevicePrivate(this)) -{ -} - -/*! - Returns \c true if the power is switched on in the Bluetooth device. -*/ -bool BluetoothDevice::powered() const -{ - Q_D(const BluetoothDevice); - return d->powered(); -} - -/*! - Sets the powered state in the Bluetooth device to \a aPowered. -*/ -void BluetoothDevice::setPowered(const bool& aPowered) -{ - Q_D(BluetoothDevice); - d->setPowered(aPowered); -} - -/*! - Returns the model of the Bluetooth device. -*/ -DiscoveryModel* BluetoothDevice::deviceModel() const -{ - Q_D(const BluetoothDevice); - return d->deviceModel(); -} - -/*! - Returns whether the Bluetooth device is scanning for remote devices. -*/ -bool BluetoothDevice::scanning() const -{ - Q_D(const BluetoothDevice); - return d->scanning(); -} - -/*! - Sets scanning in the Bluetooth device to \a aScan. -*/ -void BluetoothDevice::setScanning(const bool& aScan) -{ - Q_D(BluetoothDevice); - d->setScanning(aScan); -} - -/*! - Starts the process of pairing to a remote device specified by \a address, - and connects to it if the pairing was successful. - - \sa requestConnect -*/ -void BluetoothDevice::requestPairing(const QString& address) -{ - Q_D(BluetoothDevice); - d->requestPairing(address); -} - -/*! - Connects to the remote device specified by \a address. -*/ -void BluetoothDevice::requestConnect(const QString& address) -{ - Q_D(BluetoothDevice); - d->requestConnect(address); -} - -/*! - Disconnects from the remote device specified by \a address. -*/ -void BluetoothDevice::requestDisconnect(const QString& address) -{ - Q_D(BluetoothDevice); - d->requestDisconnect(address); -} - -/*! - Returns the availability of the Bluetooth device. -*/ -bool BluetoothDevice::available() const -{ - Q_D(const BluetoothDevice); - return d->available(); -} - -QT_END_NAMESPACE diff --git a/src/bluetoothsettings/bluetoothdevice.h b/src/bluetoothsettings/bluetoothdevice.h deleted file mode 100644 index 1c51b87..0000000 --- a/src/bluetoothsettings/bluetoothdevice.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BLUETOOTHDEVICE_H -#define BLUETOOTHDEVICE_H - -#include <QObject> -#include "discoverymodel.h" - -QT_FORWARD_DECLARE_CLASS(DiscoveryModel) -QT_FORWARD_DECLARE_CLASS(BluetoothDevicePrivate) - -QT_BEGIN_NAMESPACE - -class Q_DECL_EXPORT BluetoothDevice : public QObject -{ - Q_OBJECT - Q_PROPERTY(bool scanning READ scanning WRITE setScanning NOTIFY scanningChanged) - Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged) - Q_PROPERTY(bool available READ available NOTIFY availabilityChanged) - Q_PROPERTY(DiscoveryModel* deviceModel READ deviceModel CONSTANT) -public: - explicit BluetoothDevice(QObject *parent = Q_NULLPTR); - bool powered() const; - void setPowered(const bool& aPowered); - DiscoveryModel *deviceModel() const; - bool scanning() const; - void setScanning(const bool& aScan); - bool available() const; - Q_INVOKABLE void requestPairing(const QString& address); - Q_INVOKABLE void requestConnect(const QString& address); - Q_INVOKABLE void requestDisconnect(const QString& address); -Q_SIGNALS: - void poweredChanged(); - void scanningChanged(); - void availabilityChanged(); -protected: - BluetoothDevicePrivate *d_ptr; -private: -Q_DISABLE_COPY(BluetoothDevice) -Q_DECLARE_PRIVATE(BluetoothDevice) -}; - -QT_END_NAMESPACE - -#endif // BLUETOOTHDEVICE_H diff --git a/src/bluetoothsettings/bluetoothsettings.pro b/src/bluetoothsettings/bluetoothsettings.pro deleted file mode 100644 index 7f46c58..0000000 --- a/src/bluetoothsettings/bluetoothsettings.pro +++ /dev/null @@ -1,18 +0,0 @@ -load(qt_build_config) - -TARGET = QtBluetoothSettings -VERSION = 1.0 - -QT += core bluetooth - -MODULE = bluetoothsettings -load(qt_module) - -include(bluez/bluez.pri) - -HEADERS += \ - bluetoothdevice.h \ - discoverymodel.h - -SOURCES += bluetoothdevice.cpp \ - discoverymodel.cpp diff --git a/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp b/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp deleted file mode 100644 index 7b29ec9..0000000 --- a/src/bluetoothsettings/bluez/bluetoothdevice_p.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "discoverymodel.h" -#include "bluetoothdevice_p.h" -#include "datatypes.h" -#include "objectmanager_interface.cpp" -#include "moc_objectmanager_interface.cpp" -#include "device1_interface.h" - -#ifdef USE_CONNMAN_BLUETOOTH -#include "connman_technology_interface.h" -#include "connmancommon.h" -#endif - -QT_BEGIN_NAMESPACE - -BluetoothDevicePrivate::BluetoothDevicePrivate(BluetoothDevice *parent) : QObject(parent) - ,q_ptr(parent) - ,m_localDevice(Q_NULLPTR) - ,m_powered(false) - ,m_scanning(false) - ,m_adapter(QStringLiteral("")) - ,m_deviceModel(new DiscoveryModel(this)) -{ - qDBusRegisterMetaType<InterfaceList>(); - qDBusRegisterMetaType<ManagedObjectList>(); - - m_manager = new OrgFreedesktopDBusObjectManagerInterface(QStringLiteral("org.bluez"), - QStringLiteral("/"), - QDBusConnection::systemBus(), this); -#ifdef USE_CONNMAN_BLUETOOTH - m_technology = new NetConnmanTechnologyInterface(QStringLiteral("net.connman"), - QStringLiteral("/net/connman/technology/bluetooth"), - QDBusConnection::systemBus(), this); -#endif - QDBusPendingReply<ManagedObjectList> reply = m_manager->GetManagedObjects(); - QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); - connect(watcher, &QDBusPendingCallWatcher::finished, - this, &BluetoothDevicePrivate::getManagedObjectsFinished, Qt::QueuedConnection); -} - -void BluetoothDevicePrivate::deviceStateChanged(QBluetoothLocalDevice::HostMode state) -{ - Q_Q(BluetoothDevice); - m_powered = state != QBluetoothLocalDevice::HostPoweredOff; - emit q->poweredChanged(); -} - -bool BluetoothDevicePrivate::powered() const -{ - return m_powered; -} - -void BluetoothDevicePrivate::setPowered(const bool& aPowered) -{ - if (!m_localDevice) - return; - -#ifdef USE_CONNMAN_BLUETOOTH - m_technology->SetProperty(PropertyPowered, QDBusVariant(QVariant(aPowered))); -#endif - - if (aPowered) { - m_localDevice->powerOn(); - } - else { - m_localDevice->setHostMode(QBluetoothLocalDevice::HostPoweredOff); - } -} - -DiscoveryModel* BluetoothDevicePrivate::deviceModel() const -{ - return m_deviceModel; -} - -void BluetoothDevicePrivate::scanFinished() -{ - Q_Q(BluetoothDevice); - m_scanning = false; - emit q->scanningChanged(); - updateConnectionStatuses(); -} - -bool BluetoothDevicePrivate::scanning() const -{ - return m_scanning; -} - -void BluetoothDevicePrivate::setScanning(const bool& aScan) -{ - Q_Q(BluetoothDevice); - if (m_scanning && !aScan) { - m_deviceModel->stopScanning(); - } - else if (aScan && !m_scanning) { - m_deviceModel->scanDevices(); - } - m_scanning = aScan; - emit q->scanningChanged(); -} - -bool BluetoothDevicePrivate::available() const -{ - return (!m_adapter.isEmpty()); -} - -void BluetoothDevicePrivate::updateConnectionStatuses() -{ - QList<QBluetoothAddress> connectedDevices = - m_localDevice->connectedDevices(); - - foreach (QBluetoothAddress addr, connectedDevices) { - m_deviceModel->setConnected(addr.toString(), true); - } -} - -void BluetoothDevicePrivate::requestPairing(const QString& address) -{ - QBluetoothAddress addr(address); - if (m_localDevice) { - m_localDevice->requestPairing(addr, QBluetoothLocalDevice::Paired); - connect(m_localDevice, &QBluetoothLocalDevice::pairingDisplayConfirmation, this, &BluetoothDevicePrivate::pairingDisplayConfirmation); - - connect(m_localDevice, &QBluetoothLocalDevice::pairingDisplayPinCode, this, &BluetoothDevicePrivate::pairingDisplayPinCode); - - connect(m_localDevice, &QBluetoothLocalDevice::pairingFinished, this, &BluetoothDevicePrivate::pairingFinished); - } -} - -void BluetoothDevicePrivate::requestConnect(const QString &address) -{ - OrgBluezDevice1Interface *dev = findPeerDevice(address); - if (dev) { - dev->Connect(); - dev->deleteLater(); - } -} - -void BluetoothDevicePrivate::requestDisconnect(const QString& address) -{ - OrgBluezDevice1Interface *dev = findPeerDevice(address); - if (dev) { - dev->Disconnect(); - dev->deleteLater(); - } -} - -void BluetoothDevicePrivate::pairingDisplayConfirmation(const QBluetoothAddress & address, QString pin) -{ - Q_UNUSED(address); - Q_UNUSED(pin); -} - -void BluetoothDevicePrivate::pairingDisplayPinCode(const QBluetoothAddress & address, QString pin) -{ - Q_UNUSED(address); - Q_UNUSED(pin); -} - -void BluetoothDevicePrivate::pairingFinished(const QBluetoothAddress & address, QBluetoothLocalDevice::Pairing pairing) -{ - if (pairing == QBluetoothLocalDevice::Paired) { - requestConnect(address.toString()); - } -} - -void BluetoothDevicePrivate::deviceConnected(const QBluetoothAddress & address) -{ - m_deviceModel->setConnected(address.toString(), true); -} - -void BluetoothDevicePrivate::deviceDisconnected(const QBluetoothAddress & address) -{ - m_deviceModel->setConnected(address.toString(), false); -} - -void BluetoothDevicePrivate::getManagedObjectsFinished(QDBusPendingCallWatcher *watcher) -{ - Q_Q(BluetoothDevice); - - QDBusPendingReply<ManagedObjectList> reply = *watcher; - watcher->deleteLater(); - if (reply.isError()) { - return; - } - - //Find adapter - ManagedObjectList managedObjectList = reply.value(); - for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) { - const InterfaceList &ifaceList = it.value(); - for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) { - const QString &iface = jt.key(); - const QVariantMap &ifaceValues = jt.value(); - - if (iface == QStringLiteral("org.bluez.Adapter1")) { - m_adapter = ifaceValues[QStringLiteral("Address")].toString(); - break; - } - } - } - - if (!m_adapter.isEmpty()) { - m_localDevice = new QBluetoothLocalDevice(this); - m_powered = m_localDevice->hostMode() != QBluetoothLocalDevice::HostPoweredOff; - - connect(m_localDevice, &QBluetoothLocalDevice::hostModeStateChanged, this, &BluetoothDevicePrivate::deviceStateChanged); - connect(m_localDevice, &QBluetoothLocalDevice::deviceConnected, this, &BluetoothDevicePrivate::deviceConnected); - connect(m_localDevice, &QBluetoothLocalDevice::deviceDisconnected, this, &BluetoothDevicePrivate::deviceDisconnected); - connect(m_deviceModel, &DiscoveryModel::scanFinished, this, &BluetoothDevicePrivate::scanFinished); - - if (m_powered) { - emit q->poweredChanged(); - if (!m_scanning) { - m_deviceModel->scanDevices(); - m_scanning = true; - emit q->scanningChanged(); - } - } - - emit q->availabilityChanged(); - } -} - -OrgBluezDevice1Interface* BluetoothDevicePrivate::findPeerDevice(const QString &address) -{ - QDBusPendingReply<ManagedObjectList> reply = m_manager->GetManagedObjects(); - reply.waitForFinished(); - if (reply.isError()) { - qWarning() << "Failed to get objects"; - return NULL; - } - - ManagedObjectList managedObjectList = reply.value(); - for (ManagedObjectList::const_iterator it = managedObjectList.constBegin(); it != managedObjectList.constEnd(); ++it) { - const QDBusObjectPath &path = it.key(); - - const InterfaceList &ifaceList = it.value(); - for (InterfaceList::const_iterator jt = ifaceList.constBegin(); jt != ifaceList.constEnd(); ++jt) { - const QString &iface = jt.key(); - const QVariantMap &ifaceValues = jt.value(); - if (iface == QStringLiteral("org.bluez.Device1")) { - if (ifaceValues[QStringLiteral("Address")] == address) { - OrgBluezDevice1Interface *devIf = new OrgBluezDevice1Interface(QStringLiteral("org.bluez"), path.path(), QDBusConnection::systemBus()); - return devIf; - } - } - } - } - return NULL; -} - -QT_END_NAMESPACE diff --git a/src/bluetoothsettings/bluez/bluetoothdevice_p.h b/src/bluetoothsettings/bluez/bluetoothdevice_p.h deleted file mode 100644 index 0e1777e..0000000 --- a/src/bluetoothsettings/bluez/bluetoothdevice_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BLUETOOTHDEVICE__P_H -#define BLUETOOTHDEVICE__P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QBluetoothLocalDevice> -#include <QtDBus> -#include "bluetoothdevice.h" - -// Automatically generated classes in global namespace -class OrgBluezDevice1Interface; -class OrgFreedesktopDBusObjectManagerInterface; - -#ifdef USE_CONNMAN_BLUETOOTH -class NetConnmanTechnologyInterface; -#endif - -QT_BEGIN_NAMESPACE - -class BluetoothDevicePrivate : public QObject -{ - Q_OBJECT - Q_DECLARE_PUBLIC(BluetoothDevice) -public: - BluetoothDevice *q_ptr; - BluetoothDevicePrivate(BluetoothDevice *parent); - bool powered() const; - void setPowered(const bool& aPowered); - bool scanning() const; - bool available() const; - void setScanning(const bool& aScan); - void requestPairing(const QString& address); - void requestConnect(const QString& address); - void requestDisconnect(const QString& address); - DiscoveryModel* deviceModel() const; - -public Q_SLOTS: - void deviceStateChanged(QBluetoothLocalDevice::HostMode state); - void scanFinished(); - //These are not yet signaled - //See bug https://bugreports.qt.io/browse/QTBUG-38401 - void pairingDisplayConfirmation(const QBluetoothAddress & address, QString pin); - void pairingDisplayPinCode(const QBluetoothAddress & address, QString pin); - void pairingFinished(const QBluetoothAddress & address, QBluetoothLocalDevice::Pairing pairing); - void deviceConnected(const QBluetoothAddress & address); - void deviceDisconnected(const QBluetoothAddress & address); - void getManagedObjectsFinished(QDBusPendingCallWatcher *watcher); - -private: - void updateConnectionStatuses(); - OrgBluezDevice1Interface* findPeerDevice(const QString& address); - -private: - QBluetoothLocalDevice* m_localDevice; - bool m_powered; - bool m_scanning; - QString m_adapter; - DiscoveryModel *m_deviceModel; - OrgFreedesktopDBusObjectManagerInterface *m_manager; - -#ifdef USE_CONNMAN_BLUETOOTH - NetConnmanTechnologyInterface *m_technology; -#endif -}; - -QT_END_NAMESPACE - -#endif // BLUETOOTHDEVICE__P_H diff --git a/src/bluetoothsettings/bluez/bluez.pri b/src/bluetoothsettings/bluez/bluez.pri deleted file mode 100644 index 60a3b17..0000000 --- a/src/bluetoothsettings/bluez/bluez.pri +++ /dev/null @@ -1,22 +0,0 @@ -QT += core dbus - -INCLUDEPATH += $${PWD} -INCLUDEPATH += $${PWD}/bluez - -DBUS_INTERFACES = \ - $${PWD}/objectmanager.xml \ - $${PWD}/device1.xml - -HEADERS += \ - $$PWD/bluetoothdevice_p.h \ - $$PWD/datatypes.h \ - -SOURCES += \ - $$PWD/bluetoothdevice_p.cpp - -qtHaveModule(networksettings) { - DEFINES += USE_CONNMAN_BLUETOOTH - INCLUDEPATH += $${PWD}/../../networksettings/connman - DBUS_INTERFACES += $${PWD}/../../networksettings/connman/connman_technology.xml - -} diff --git a/src/bluetoothsettings/bluez/datatypes.h b/src/bluetoothsettings/bluez/datatypes.h deleted file mode 100644 index 9458dbe..0000000 --- a/src/bluetoothsettings/bluez/datatypes.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DATATYPES_H -#define DATATYPES_H - -#include <QObject> -#include <QtDBus> -#include <QMap> -#include <QVariantMap> -#include <QtDBus/QDBusObjectPath> -#include <QtCore/QMetaType> - -QT_BEGIN_NAMESPACE - -typedef QMap<QString, QVariantMap> InterfaceList; -typedef QMap<QDBusObjectPath, InterfaceList> ManagedObjectList; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(InterfaceList) -Q_DECLARE_METATYPE(ManagedObjectList) - - -#endif // DATATYPES_H diff --git a/src/bluetoothsettings/bluez/device1.xml b/src/bluetoothsettings/bluez/device1.xml deleted file mode 100644 index 5b16992..0000000 --- a/src/bluetoothsettings/bluez/device1.xml +++ /dev/null @@ -1,31 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node> - <interface name="org.bluez.Device1"> - <method name="Disconnect"></method> - <method name="Connect"></method> - <method name="ConnectProfile"> - <arg name="UUID" type="s" direction="in"/> - </method> - <method name="DisconnectProfile"> - <arg name="UUID" type="s" direction="in"/> - </method> - <method name="Pair"></method> - <method name="CancelPairing"></method> - <property name="Address" type="s" access="read"></property> - <property name="Name" type="s" access="read"></property> - <property name="Alias" type="s" access="readwrite"></property> - <property name="Appearance" type="q" access="read"></property> - <property name="Icon" type="s" access="read"></property> - <property name="Paired" type="b" access="read"></property> - <property name="Trusted" type="b" access="readwrite"></property> - <property name="Blocked" type="b" access="readwrite"></property> - <property name="LegacyPairing" type="b" access="read"></property> - <property name="RSSI" type="n" access="read"></property> - <property name="Connected" type="b" access="read"></property> - <property name="UUIDs" type="as" access="read"></property> - <property name="Modalias" type="s" access="read"></property> - <property name="Adapter" type="o" access="read"></property> - </interface> -</node> - diff --git a/src/bluetoothsettings/bluez/objectmanager.xml b/src/bluetoothsettings/bluez/objectmanager.xml deleted file mode 100644 index e52d6fe..0000000 --- a/src/bluetoothsettings/bluez/objectmanager.xml +++ /dev/null @@ -1,20 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" - "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node name="/" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> - <interface name="org.freedesktop.DBus.ObjectManager"> - <method name="GetManagedObjects"> - <arg type="a{oa{sa{sv}}}" name="object_paths_interfaces_and_properties" direction="out"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="ManagedObjectList"/> - </method> - <signal name="InterfacesAdded"> - <arg type="o" name="object_path"/> - <arg type="a{sa{sv}}" name="interfaces_and_properties"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="InterfaceList"/> - </signal> - <signal name="InterfacesRemoved"> - <arg type="o" name="object_path"/> - <arg type="as" name="interfaces"/> - </signal> - </interface> -</node> - diff --git a/src/bluetoothsettings/discoverymodel.cpp b/src/bluetoothsettings/discoverymodel.cpp deleted file mode 100644 index 31cf972..0000000 --- a/src/bluetoothsettings/discoverymodel.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QBluetoothAddress> -#include "discoverymodel.h" - -QT_BEGIN_NAMESPACE - -BtDeviceItem::BtDeviceItem(const QBluetoothDeviceInfo& bt, QObject *parent) - : QObject(parent) - ,m_name(bt.name()) - ,m_address(bt.address().toString()) - ,m_connected(false) -{ - m_type = getDeviceType(bt.majorDeviceClass(), bt.minorDeviceClass()); -} - -QString BtDeviceItem::name() const -{ - return m_name; -} - -QString BtDeviceItem::address() const -{ - return m_address; -} - -bool BtDeviceItem::connected() const -{ - return m_connected; -} - -void BtDeviceItem::setConnected(bool aConnected) -{ - m_connected = aConnected; - emit connectedChanged(); -} - -BtDeviceItem::DeviceType BtDeviceItem::type() const -{ - return m_type; -} - -BtDeviceItem::DeviceType BtDeviceItem::getDeviceType(const QBluetoothDeviceInfo::MajorDeviceClass major, const quint8 minor) const -{ - switch (major) { - case QBluetoothDeviceInfo::ComputerDevice: - return getComputerDeviceType(minor); - break; - case QBluetoothDeviceInfo::PhoneDevice: - return getPhoneDeviceType(minor); - break; - case QBluetoothDeviceInfo::AudioVideoDevice: - return getAudioDeviceType(minor); - break; - case QBluetoothDeviceInfo::PeripheralDevice: - return getPeripheralDeviceType(minor); - break; - case QBluetoothDeviceInfo::ImagingDevice: - return getImagingDeviceType(minor); - break; - default: - return GenericDevice; - } - return GenericDevice; -} - -BtDeviceItem::DeviceType BtDeviceItem::getComputerDeviceType(const quint8 minor) const -{ - Q_UNUSED(minor); - return Computer; -} - -BtDeviceItem::DeviceType BtDeviceItem::getAudioDeviceType(const quint8 minor) const -{ - switch (minor) { - case QBluetoothDeviceInfo::Microphone: - return Microphone; - break; - case QBluetoothDeviceInfo::WearableHeadsetDevice: - case QBluetoothDeviceInfo::Headphones: - return Headphones; - break; - case QBluetoothDeviceInfo::Camcorder: - case QBluetoothDeviceInfo::VideoCamera: - return Camcorder; - break; - default: - return GenericDevice; - break; - } -} - -BtDeviceItem::DeviceType BtDeviceItem::getPeripheralDeviceType(const quint8 minor) const -{ - switch (minor) { - case QBluetoothDeviceInfo::KeyboardPeripheral: - return Keyboard; - break; - case QBluetoothDeviceInfo::PointingDevicePeripheral: - return Mouse; - break; - default: - return GenericDevice; - break; - } -} - -BtDeviceItem::DeviceType BtDeviceItem::getImagingDeviceType(const quint8 minor) const -{ - switch (minor) { - case QBluetoothDeviceInfo::ImageCamera: - return Camera; - break; - default: - return GenericDevice; - break; - } -} - -BtDeviceItem::DeviceType BtDeviceItem::getPhoneDeviceType(const quint8 minor) const -{ - Q_UNUSED(minor); - return Phone; -} - - -DiscoveryModel::DiscoveryModel(QObject *parent) - : QAbstractListModel(parent) - ,m_discoveryAgent(Q_NULLPTR) -{ - m_roleNames.insert(Qt::UserRole, "modelData"); - m_roleNames.insert(Address, "address"); - m_roleNames.insert(Name, "name"); - m_roleNames.insert(Type, "type"); - m_roleNames.insert(Connected, "connected"); -} - -void DiscoveryModel::deviceDiscovered(const QBluetoothDeviceInfo &device) -{ - int index; - - // Insert the device to alphabetically sorted location - for (index = 0; index < m_items.count(); index++) - { - if (device.name() < m_items.at(index)->name()) - break; - } - - beginInsertRows(QModelIndex(), index, index); - BtDeviceItem *item = new BtDeviceItem(device); - m_items.insert(index, item); - endInsertRows(); -} - -DiscoveryModel::~DiscoveryModel() -{ - -} - -void DiscoveryModel::scanDevices() -{ - if (!m_discoveryAgent) { - m_discoveryAgent = new QBluetoothDeviceDiscoveryAgent(this); - connect(m_discoveryAgent, SIGNAL(deviceDiscovered(QBluetoothDeviceInfo)), - this, SLOT(deviceDiscovered(QBluetoothDeviceInfo))); - - connect(m_discoveryAgent, SIGNAL(finished()), - this, SIGNAL(scanFinished())); - } - - // Reset previous list, devices are already cached by bluez - clearDeviceList(); - - m_discoveryAgent->start(); -} - -void DiscoveryModel::stopScanning() -{ - if (m_discoveryAgent) { - m_discoveryAgent->stop(); - } -} - -QHash<int, QByteArray> DiscoveryModel::roleNames() const -{ - return m_roleNames; -} - -int DiscoveryModel::rowCount(const QModelIndex & parent) const -{ - Q_UNUSED(parent); - return m_items.count(); -} - -QVariant DiscoveryModel::data(const QModelIndex & index, int role) const -{ - if (!index.isValid()) return QVariant(); - - BtDeviceItem *item = m_items[index.row()]; - - switch (role) { - case DiscoveryModel::Name: - return item->name(); - break; - case DiscoveryModel::Address: - return item->address(); - break; - case DiscoveryModel::Type: - return item->type(); - break; - case DiscoveryModel::Connected: - return item->connected(); - default: - return QVariant(); - } -} - -void DiscoveryModel::setConnected(const QString &aAddress, bool connected) -{ - bool found = false; - int i = 0; - QVector<int> role; - role.append(DiscoveryModel::Connected); - foreach (BtDeviceItem *item, m_items) { - if (item->address() == aAddress) { - item->setConnected(connected); - found = true; - break; - } - i++; - } - - if (found) - emit dataChanged(index(i, 0), index(i, 0), role); -} - -void DiscoveryModel::clearDeviceList() -{ - beginResetModel(); - m_items.clear(); - endResetModel(); -} - -QT_END_NAMESPACE diff --git a/src/bluetoothsettings/discoverymodel.h b/src/bluetoothsettings/discoverymodel.h deleted file mode 100644 index 56f8299..0000000 --- a/src/bluetoothsettings/discoverymodel.h +++ /dev/null @@ -1,127 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DISCOVERYMODEL_H -#define DISCOVERYMODEL_H - - -#include <QObject> -#include <QAbstractListModel> -#include <QBluetoothDeviceInfo> -#include <QBluetoothDeviceDiscoveryAgent> - -QT_BEGIN_NAMESPACE - -class Q_DECL_EXPORT BtDeviceItem : public QObject -{ - Q_OBJECT - Q_ENUMS(DeviceType) - Q_PROPERTY(QString address READ address CONSTANT) - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(bool connected READ connected NOTIFY connectedChanged) - Q_PROPERTY(DeviceType type READ type CONSTANT) -public: - explicit BtDeviceItem(const QBluetoothDeviceInfo& id, QObject *parent = Q_NULLPTR); - //The list of device type we want to show the icon - enum DeviceType { - Phone, - Computer, - Mouse, - Keyboard, - Headphones, - Microphone, - Camera, - Camcorder, - Clock, - HealthDevice, - GenericDevice=1000 - }; - QString name() const; - QString address() const; - DeviceType type() const; - bool connected() const; - void setConnected(bool aConnected); - -Q_SIGNALS: - void connectedChanged(); - -protected: - DeviceType getDeviceType(const QBluetoothDeviceInfo::MajorDeviceClass major, - const quint8 minor) const; - DeviceType getComputerDeviceType(const quint8 minor) const; - DeviceType getAudioDeviceType(const quint8 minor) const; - DeviceType getPeripheralDeviceType(const quint8 minor) const; - DeviceType getImagingDeviceType(const quint8 minor) const; - DeviceType getHealthDeviceType(const quint8 minor) const; - DeviceType getPhoneDeviceType(const quint8 minor) const; - -private: - QString m_name; - QString m_address; - bool m_connected; - DeviceType m_type; -}; - -class Q_DECL_EXPORT DiscoveryModel : public QAbstractListModel -{ - Q_OBJECT - Q_ENUMS(DeviceType) -public: - explicit DiscoveryModel(QObject *parent = Q_NULLPTR); - virtual ~DiscoveryModel(); - // from QAbstractItemModel - int rowCount(const QModelIndex & parent = QModelIndex()) const; - QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - QHash<int, QByteArray> roleNames() const; - void setConnected(const QString& aAddress, bool connected); - void scanDevices(); - void stopScanning(); - - enum Roles { - Name = Qt::UserRole, - Address, - Type, - Connected - }; - -Q_SIGNALS: - void scanFinished(); - -private Q_SLOTS: - void deviceDiscovered(const QBluetoothDeviceInfo &device); -private: - void clearDeviceList(); - - QList<BtDeviceItem*> m_items; - QHash<int, QByteArray> m_roleNames; - QBluetoothDeviceDiscoveryAgent *m_discoveryAgent; -}; - -QT_END_NAMESPACE - -#endif // DISCOVERYMODEL_H diff --git a/src/displaysettings/displaysettings.cpp b/src/displaysettings/displaysettings.cpp deleted file mode 100644 index c7c93c8..0000000 --- a/src/displaysettings/displaysettings.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "displaysettings.h" -#include "displaysettings_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \module QtDisplaySettings - \qtvariable displaysettings - \ingroup qtdevice-utilities-cpp-modules - \ingroup modules - \title Qt Display Settings C++ Classes - \brief Provides access to display settings. - - To use classes from this module, add this directive into the C++ files: - - \code - #include <QtDisplaySettings> - \endcode - - To link against the corresponding C++ libraries, add the following to your - qmake project file: - - \code - QT += displaysettings - \endcode -*/ - -/*! - \class DisplaySettings - \inmodule QtDisplaySettings - - \brief The DisplaySettings class specifies display settings. - - The Boot to Qt demo launcher and Qt Quick Controls scale automatically to - screens of different sizes, from 7-inch touch screens to 60-inch or larger - television screens to ensure readability and touch friendliness. For this, - Qt has to know the physical dimensions of the screen. By default, it tries - to query these values from the framebuffer devices. However, many kernel - drivers do not provide this information. - - The display settings enable overriding and manually setting the physical - screen size. - - In addition, you can set the display brightness. That is, the intensity of - the backlight. -*/ - -/*! - \property DisplaySettings::displayBrightness - \brief The display brightness. - - A value of \c 255 requests the maximum brightness, while that of \c 0 - requests the minimum (typically, the backlight turned off). -*/ - - -/*! - \property DisplaySettings::physicalScreenSizeInch - \brief The physical screen size in inches. -*/ - -/*! - \property DisplaySettings::physicalScreenWidthMm - \brief The physical screen width in millimeters. -*/ - -/*! - \property DisplaySettings::physicalScreenHeightMm - \brief The physical screen height in millimeters. -*/ - -/*! - \property DisplaySettings::physicalScreenSizeOverride - \brief Whether to use the value set for the physical screen size. -*/ - -/*! - Creates a new display settings object with the parent \a parent. -*/ -DisplaySettings::DisplaySettings(QObject *parent) - : QObject(parent) - ,d_ptr(new DisplaySettingsPrivate(this)) -{ -} - -/*! - Deletes the display settings object. -*/ -DisplaySettings::~DisplaySettings() -{ -} - - -/*! - Sets the display brightness to \a v. - - Returns \c true on success. -*/ -bool DisplaySettings::setDisplayBrightness(int v) -{ - Q_D(DisplaySettings); - return d->setDisplayBrightness(v); -} - - -/*! - * Returns the current backlight intensity. - * \sa setDisplayBrightness - */ -int DisplaySettings::displayBrightness() -{ - Q_D(DisplaySettings); - return d->displayBrightness(); -} - -/*! - Returns the physical screen size in inches. -*/ -int DisplaySettings::physicalScreenSizeInch() const -{ - Q_D(const DisplaySettings); - return d->physicalScreenSizeInch(); -} - -/*! - Returns the physical screen width in millimeters. -*/ -int DisplaySettings::physicalScreenWidthMm() const -{ - Q_D(const DisplaySettings); - return d->physicalScreenWidthMm(); -} - -/*! - Returns the physical screen height in millimeters. -*/ -int DisplaySettings::physicalScreenHeightMm() const -{ - Q_D(const DisplaySettings); - return d->physicalScreenHeightMm(); -} - -/*! - Sets the physical screen size to \a inches. -*/ -void DisplaySettings::setPhysicalScreenSizeInch(int inches) -{ - Q_D(DisplaySettings); - d->setPhysicalScreenSizeInch(inches); -} - -/*! - Sets the physical screen width to \a newWidth. -*/ -void DisplaySettings::setPhysicalScreenWidthMm(int newWidth) -{ - Q_D(DisplaySettings); - d->setPhysicalScreenWidthMm(newWidth); -} - -/*! - Sets the physical screen height to \a newHeight. -*/ -void DisplaySettings::setPhysicalScreenHeightMm(int newHeight) -{ - Q_D(DisplaySettings); - d->setPhysicalScreenHeightMm(newHeight); -} - -/*! - Returns whether the value set for the physical screen size is used. - - \sa physicalScreenSizeInch() -*/ -bool DisplaySettings::physicalScreenSizeOverride() const -{ - Q_D(const DisplaySettings); - return d->physicalScreenSizeOverride(); -} - -/*! - Sets whether the value set for the physical screen size is used to - \a enable. - - \sa physicalScreenSizeInch() -*/ -void DisplaySettings::setPhysicalScreenSizeOverride(bool enable) -{ - Q_D(DisplaySettings); - d->setPhysicalScreenSizeOverride(enable); -} - -QT_END_NAMESPACE diff --git a/src/displaysettings/displaysettings.h b/src/displaysettings/displaysettings.h deleted file mode 100644 index 835da3f..0000000 --- a/src/displaysettings/displaysettings.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DISPLAYSETTINGS_H -#define DISPLAYSETTINGS_H - -#include <qobject.h> - -QT_BEGIN_NAMESPACE - -class DisplaySettingsPrivate; - -class Q_DECL_EXPORT DisplaySettings : public QObject -{ - Q_OBJECT - - Q_PROPERTY(int displayBrightness READ displayBrightness WRITE setDisplayBrightness NOTIFY displayBrightnessChanged) - Q_PROPERTY(int physicalScreenSizeInch READ physicalScreenSizeInch WRITE setPhysicalScreenSizeInch NOTIFY physicalScreenSizeInchChanged) - Q_PROPERTY(int physicalScreenWidthMm READ physicalScreenWidthMm WRITE setPhysicalScreenWidthMm NOTIFY physicalScreenWidthMmChanged) - Q_PROPERTY(int physicalScreenHeightMm READ physicalScreenHeightMm WRITE setPhysicalScreenHeightMm NOTIFY physicalScreenHeightMmChanged) - Q_PROPERTY(bool physicalScreenSizeOverride READ physicalScreenSizeOverride WRITE setPhysicalScreenSizeOverride NOTIFY physicalScreenSizeOverrideChanged) - -public: - DisplaySettings(QObject *parent = Q_NULLPTR); - ~DisplaySettings(); - - int displayBrightness(); - int physicalScreenSizeInch() const; - int physicalScreenWidthMm() const; - int physicalScreenHeightMm() const; - bool physicalScreenSizeOverride() const; - -public Q_SLOTS: - bool setDisplayBrightness(int value); - void setPhysicalScreenSizeInch(int inches); - void setPhysicalScreenSizeOverride(bool enable); - void setPhysicalScreenWidthMm(int newWidth); - void setPhysicalScreenHeightMm(int newHeight); - -Q_SIGNALS: - void displayBrightnessChanged(int newValue); - void physicalScreenSizeInchChanged(int newInches); - void physicalScreenSizeOverrideChanged(bool newValue); - void physicalScreenWidthMmChanged(int newValue); - void physicalScreenHeightMmChanged(int newValue); - -protected: - DisplaySettingsPrivate *d_ptr; - - Q_DISABLE_COPY(DisplaySettings) - Q_DECLARE_PRIVATE(DisplaySettings) -}; - -QT_END_NAMESPACE - -#endif // DISPLAYSETTINGS_H diff --git a/src/displaysettings/displaysettings.pro b/src/displaysettings/displaysettings.pro deleted file mode 100644 index f19d872..0000000 --- a/src/displaysettings/displaysettings.pro +++ /dev/null @@ -1,16 +0,0 @@ -load(qt_build_config) - -TARGET = QtDisplaySettings -VERSION = 1.0 - -QT = core - -MODULE = displaysettings -load(qt_module) - -SOURCES += displaysettings.cpp \ - displaysettings_p.cpp - -HEADERS += displaysettings.h \ - displaysettings_p.h - diff --git a/src/displaysettings/displaysettings_p.cpp b/src/displaysettings/displaysettings_p.cpp deleted file mode 100644 index e62fca7..0000000 --- a/src/displaysettings/displaysettings_p.cpp +++ /dev/null @@ -1,278 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtMath> -#include <QDirIterator> -#include "displaysettings_p.h" - -QT_BEGIN_NAMESPACE - -DisplaySettingsPrivate::DisplaySettingsPrivate(DisplaySettings *qq) - :q_ptr(qq) - ,m_brightness(255) - ,m_lightDevicesInitialized(false) - ,m_physScreenSize(new PhysicalScreenSize(qq)) -{ - -} - -void DisplaySettingsPrivate::initLightDevices() -{ - if (m_lightDevicesInitialized) - return; - QDirIterator it(QStringLiteral("/sys/class/backlight")); - while (it.hasNext()) { - LightDevice ld; - ld.deviceFile = it.next() + QStringLiteral("/brightness"); - QFile maxFile(it.filePath() + QStringLiteral("/max_brightness")); - if (!maxFile.open(QIODevice::ReadOnly)) - continue; - bool ok = false; - ld.maxValue = maxFile.read(10).simplified().toUInt(&ok); - if (!ok || !ld.maxValue) - continue; - QFile valFile(ld.deviceFile); - if (!valFile.open(QIODevice::ReadOnly)) - continue; - ok = false; - uint val = valFile.read(10).simplified().toUInt(&ok); - if (!ok) - continue; - // map max->max as that is a common case, otherwise choose a reasonable value - ld.value = (val == ld.maxValue) ? 255 : (val * 256)/(ld.maxValue+1); - ld.name = it.fileName(); - m_lightDevices.append(ld); - } - if (!m_lightDevices.isEmpty()) - m_brightness = m_lightDevices.at(0).value; - m_lightDevicesInitialized = true; -} - - -bool DisplaySettingsPrivate::setDisplayBrightness(int v) -{ - quint8 value = qBound(0, v, 255); - initLightDevices(); - for (int i = 0; i < m_lightDevices.size(); i++) { - LightDevice &ld = m_lightDevices[i]; - QFile devFile(ld.deviceFile); - if (!devFile.open(QIODevice::WriteOnly)) - continue; - // Maps only 0 to 0, since 0 often means "off"; other values are degrees of "on". - uint newVal = value ? 1 + ((value * ld.maxValue) / 256) : 0; - devFile.write(QByteArray::number(newVal)); - ld.value = value; - } - m_brightness = value; - return true; -} - -int DisplaySettingsPrivate::displayBrightness() -{ - initLightDevices(); - return m_brightness; -} - -int DisplaySettingsPrivate::physicalScreenSizeInch() const -{ - return m_physScreenSize->size(); -} - -int DisplaySettingsPrivate::physicalScreenWidthMm() const -{ - return m_physScreenSize->widthMm(); -} - -int DisplaySettingsPrivate::physicalScreenHeightMm() const -{ - return m_physScreenSize->heightMm(); -} - -void DisplaySettingsPrivate::setPhysicalScreenSizeInch(int inches) -{ - Q_Q(DisplaySettings); - if (m_physScreenSize->size() != inches) { - m_physScreenSize->setSize(inches); - emit q->physicalScreenSizeInchChanged(inches); - } -} - -void DisplaySettingsPrivate::setPhysicalScreenWidthMm(int newWidth) -{ - Q_Q(DisplaySettings); - if (m_physScreenSize->widthMm() != newWidth) { - m_physScreenSize->setSizeMm(newWidth, m_physScreenSize->heightMm()); - emit q->physicalScreenWidthMmChanged(newWidth); - } -} - -void DisplaySettingsPrivate::setPhysicalScreenHeightMm(int newHeight) -{ - Q_Q(DisplaySettings); - if (m_physScreenSize->heightMm() != newHeight) { - m_physScreenSize->setSizeMm(m_physScreenSize->widthMm(), newHeight); - emit q->physicalScreenHeightMmChanged(newHeight); - } -} - -bool DisplaySettingsPrivate::physicalScreenSizeOverride() const -{ - return m_physScreenSize->enabled(); -} - -void DisplaySettingsPrivate::setPhysicalScreenSizeOverride(bool enable) -{ - Q_Q(DisplaySettings); - if (m_physScreenSize->enabled() != enable) { - m_physScreenSize->setEnabled(enable); - emit q->physicalScreenSizeOverrideChanged(enable); - } -} - -PhysicalScreenSize::PhysicalScreenSize(QObject *parent) - : QObject(parent) - ,physScreenSizeEnabled(false), physScreenSizeInch(7) -{ - physWriteTimer.setSingleShot(true); - physWriteTimer.setInterval(1000); - QObject::connect(&physWriteTimer, SIGNAL(timeout()), this, SLOT(onTimeout())); - - read(QStringLiteral("/etc/appcontroller.conf")); - read(QStringLiteral("/var/lib/b2qt/appcontroller.conf.d/physical_screen_size.conf")); -} - -PhysicalScreenSize::~PhysicalScreenSize() -{ - -} - -void PhysicalScreenSize::read(const QString &filename) -{ - QFile f(filename); - if (!f.open(QIODevice::ReadOnly | QIODevice::Text)) - return; - - physScreenWidthMm = 154; - physScreenHeightMm = 90; - int found = 0; - while (!f.atEnd()) { - QByteArray line = f.readLine().trimmed(); - if (line.startsWith(QByteArrayLiteral("env="))) { - QByteArrayList values = line.split('='); - if (values.count() == 3) { - bool ok; - if (values[1] == QByteArrayLiteral("QT_QPA_EGLFS_PHYSICAL_WIDTH")) { - int val = values[2].toInt(&ok); - if (ok) { - ++found; - physScreenWidthMm = val; - } - } else if (values[1] == QByteArrayLiteral("QT_QPA_EGLFS_PHYSICAL_HEIGHT")) { - int val = values[2].toInt(&ok); - if (ok) { - ++found; - physScreenHeightMm = val; - } - } - } - } - } - if (found == 2) - physScreenSizeEnabled = true; - - const qreal diagMM = qSqrt(physScreenWidthMm * physScreenWidthMm + physScreenHeightMm * physScreenHeightMm); - physScreenSizeInch = qRound(diagMM / 25.4); -} - -void PhysicalScreenSize::onTimeout() -{ - write(); -} - -void PhysicalScreenSize::write(bool includePhysSize) -{ - QDir(QStringLiteral("/var/lib")).mkpath(QStringLiteral("b2qt/appcontroller.conf.d")); - write(QStringLiteral("/var/lib/b2qt/appcontroller.conf.d/physical_screen_size.conf"), includePhysSize); -} - -void PhysicalScreenSize::write(const QString &filename, bool includePhysSize) -{ - QFile f(filename); - - QByteArrayList lines; - if (f.open(QIODevice::ReadOnly | QIODevice::Text)) { - while (!f.atEnd()) { - QByteArray line = f.readLine().trimmed(); - if (!line.startsWith(QByteArrayLiteral("env=QT_QPA_EGLFS_PHYSICAL_WIDTH=")) - && !line.startsWith(QByteArrayLiteral("env=QT_QPA_EGLFS_PHYSICAL_HEIGHT="))) - lines.append(line); - } - f.close(); - } - - if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) - return; - - const int physScreenHeight = physScreenHeightMm; - const int physScreenWidth = physScreenWidthMm; - - foreach (const QByteArray &line, lines) - f.write(line + QByteArrayLiteral("\n")); - - if (includePhysSize) - f.write(QByteArrayLiteral("env=QT_QPA_EGLFS_PHYSICAL_WIDTH=") + QByteArray::number(physScreenWidth) - + QByteArrayLiteral("\nenv=QT_QPA_EGLFS_PHYSICAL_HEIGHT=") + QByteArray::number(physScreenHeight) - + QByteArrayLiteral("\n")); -} - -void PhysicalScreenSize::setSize(int inches) -{ - physScreenSizeInch = inches; - physWriteTimer.start(); -} - -void PhysicalScreenSize::setSizeMm(int width, int height) -{ - physScreenWidthMm = width; - physScreenHeightMm = height; - physWriteTimer.start(); -} - -bool PhysicalScreenSize::enabled() const -{ - return physScreenSizeEnabled; -} - -void PhysicalScreenSize::setEnabled(bool enable) -{ - physScreenSizeEnabled = enable; - // Rewrite appcontroller.conf with or without the physical width/height lines. - write(enable); -} - -QT_END_NAMESPACE diff --git a/src/displaysettings/displaysettings_p.h b/src/displaysettings/displaysettings_p.h deleted file mode 100644 index 91825e8..0000000 --- a/src/displaysettings/displaysettings_p.h +++ /dev/null @@ -1,119 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DISPLAYSETTINGSPRIVATE_H -#define DISPLAYSETTINGSPRIVATE_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QTimer> -#include "displaysettings.h" - -QT_BEGIN_NAMESPACE - -class PhysicalScreenSize : public QObject -{ - Q_OBJECT - -public: - explicit PhysicalScreenSize(QObject *parent = Q_NULLPTR); - virtual ~PhysicalScreenSize(); - - void setSize(int inches); - void setSizeMm(int widthMm, int heightMm); - int size() const { return physScreenSizeInch; } - int widthMm() const { return physScreenWidthMm; } - int heightMm() const { return physScreenHeightMm; } - bool enabled() const; - void setEnabled(bool enable); - -private slots: - void onTimeout(); - -private: - void read(const QString &filename); - void write(bool includePhysSize = true); - void write(const QString &filename, bool includePhysSize = true); - - bool physScreenSizeEnabled; - int physScreenSizeInch; - int physScreenWidthMm; - int physScreenHeightMm; - QTimer physWriteTimer; -}; - -class LightDevice -{ -public: - QString name; - QString deviceFile; - quint8 value; - uint maxValue; -}; - -class DisplaySettingsPrivate -{ - Q_DECLARE_PUBLIC(DisplaySettings) -public: - DisplaySettingsPrivate(DisplaySettings* qq); - int displayBrightness(); - int physicalScreenSizeInch() const; - int physicalScreenWidthMm() const; - int physicalScreenHeightMm() const; - bool physicalScreenSizeOverride() const; - - bool setDisplayBrightness(int value); - void setPhysicalScreenSizeInch(int inches); - void setPhysicalScreenWidthMm(int newWidth); - void setPhysicalScreenHeightMm(int newHeight); - void setPhysicalScreenSizeOverride(bool enable); -private: - void initLightDevices(); - DisplaySettings *q_ptr; - int m_brightness; - int m_screenSizeInch; - int m_screenWidthMm; - int m_screenHeightMm; - bool m_sizeOverride; - QList<LightDevice> m_lightDevices; - bool m_lightDevicesInitialized; - PhysicalScreenSize *m_physScreenSize; -}; - -QT_END_NAMESPACE - -#endif // DISPLAYSETTINGSPRIVATE_H diff --git a/src/doc/CMakeLists.txt b/src/doc/CMakeLists.txt new file mode 100644 index 0000000..e4a4b7f --- /dev/null +++ b/src/doc/CMakeLists.txt @@ -0,0 +1,12 @@ +add_library(DeviceUtilities INTERFACE) +target_link_libraries(DeviceUtilities INTERFACE Qt::Core) + +if(QT_BUILD_ONLINE_DOCS) + set(DOC_CONF "online/qtdeviceutilities.qdocconf") +else() + set(DOC_CONF "qtdeviceutilities.qdocconf") +endif() + +qt_internal_add_docs(DeviceUtilities + ${DOC_CONF} +) diff --git a/src/doc/QtDeviceUtilitiesDoc b/src/doc/QtDeviceUtilitiesDoc index 3b3e297..2a4573c 100644 --- a/src/doc/QtDeviceUtilitiesDoc +++ b/src/doc/QtDeviceUtilitiesDoc @@ -1,6 +1 @@ #include <QtNetworkSettings/QtNetworkSettings> -#include <QtBluetoothSettings/QtBluetoothSettings> -#include <QtLocaleSettings/QtLocaleSettings> -#include <QtTimeDateSettings/QtTimeDateSettings> -#include <QtDisplaySettings/QtDisplaySettings> -#include <QtLocalDevice/QtLocalDevice> diff --git a/src/doc/config/style/qt5-sidebar.html b/src/doc/config/style/qt5-sidebar.html deleted file mode 100644 index 3879827..0000000 --- a/src/doc/config/style/qt5-sidebar.html +++ /dev/null @@ -1,16 +0,0 @@ -<div class="sectionlist normallist"> - <div class="heading"> - <h2>Qt Device Utilities</h2> - </div> - <ul> - <li><a href="qtee-module-reference.html">Home</a></li> - </ul> -</div> -<div class="sectionlist normallist"> - <div class="heading"> - <h2>See Also</h2> - </div> - <ul> - <li><a href="https://doc.qt.io/QtForDeviceCreation">Qt for Device Creation</a></li> - </ul> -</div> diff --git a/src/doc/doc.pro b/src/doc/doc.pro deleted file mode 100644 index c038f1e..0000000 --- a/src/doc/doc.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = aux - -CONFIG += force_qt # Needed for Qt include paths - -QMAKE_DOCS = $$PWD/qtdeviceutilities.qdocconf - -build_online_docs: QMAKE_DOCS_TARGETDIR = qtdeviceutilities - -QMAKE_DOCS_OUTPUTDIR = $$OUT_PWD/qtdeviceutilities diff --git a/src/doc/online/qtdeviceutilities.qdocconf b/src/doc/online/qtdeviceutilities.qdocconf new file mode 100644 index 0000000..c8e4c21 --- /dev/null +++ b/src/doc/online/qtdeviceutilities.qdocconf @@ -0,0 +1,9 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults-online.qdocconf) +include(../qtdeviceutilities-project.qdocconf) + +# Sidebar used for online template +HTML.stylesheets += style/qt5-sidebar.html + +# Turn off single-directory output mode +HTML.nosubdirs = "false" +HTML.outputsubdir = qtdeviceutilities diff --git a/src/doc/online/style/qt5-sidebar.html b/src/doc/online/style/qt5-sidebar.html new file mode 100644 index 0000000..d402ad0 --- /dev/null +++ b/src/doc/online/style/qt5-sidebar.html @@ -0,0 +1,11 @@ +<div class="sectionlist normallist"> + <div class="heading"> + <h2>Qt Device Utilities</h2> + </div> + <ul> + <li><a href="index.html">Home</a></li> + <li><a href="qtdeviceutilities-cpp-classes.html">C++ Classes</a></li> + <li><a href="qtdeviceutilities-qml-types.html">QML Types</a></li> + <li><a href="qtdeviceutilities-examples.html">Examples</a></li> + </ul> +</div> diff --git a/src/doc/qtdeviceutilities-project.qdocconf b/src/doc/qtdeviceutilities-project.qdocconf index 5898e49..3a3bfdb 100644 --- a/src/doc/qtdeviceutilities-project.qdocconf +++ b/src/doc/qtdeviceutilities-project.qdocconf @@ -1,43 +1,20 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) - project = QtDeviceUtilities description = Qt Device Utilities $QT_VERSION version = $QT_VERSION -macro.maintitle = "\\title Qt Device Utilities $QT_VERSION" +projectname = "Qt Device Utilities" +macro.maintitle = "\\title $projectname $QT_VERSION\n\\keyword $projectname" -includepaths += -I . -# -I ../bluetoothsettings \ -# -I ../displaysettings \ -# -I ../localdevice \ -# -I ../localesettings \ -# -I ../networksettings \ -# -I ../timedatesettings +includepaths += -I . \ + -I ../networksettings # pass a custom module header to Clang moduleheader = QtDeviceUtilitiesDoc sourcedirs += src \ - ../imports/localesettings \ - ../imports/bluetoothsettings \ - ../imports/displaysettings \ - ../imports/localdevice \ - ../imports/localesettings \ - ../imports/timedatesettings \ - ../imports/networksettings \ - ../bluetoothsettings \ - ../displaysettings \ - ../localdevice \ - ../localesettings \ - ../networksettings \ - ../timedatesettings \ - ../settingsui/settingsuiplugin - -headerdirs += ../bluetoothsettings \ - ../displaysettings \ - ../localdevice \ - ../localesettings \ - ../networksettings \ - ../timedatesettings + ../networksettingsqml \ + ../networksettings + +headerdirs += ../networksettings exampledirs += ../../examples @@ -77,8 +54,8 @@ macro.B2QA = "\\e {Boot to Qt for embedded Android}" macro.B2QL = "\\e {Boot to Qt for embedded Linux}" macro.QtDU = "Qt Device Utilities" -# Keep Device Creation as the landing page -navigation.landingpage = "Qt for Device Creation" +# Qt Device Utilities as the landing page +navigation.landingpage = "Qt Device Utilities" navigation.qmltypespage = "Qt Device Utilities QML Types" navigation.cppclassespage = "Qt Device Utilities C++ Classes" diff --git a/src/doc/qtdeviceutilities.qdocconf b/src/doc/qtdeviceutilities.qdocconf index 5b56cf1..bd38e0f 100644 --- a/src/doc/qtdeviceutilities.qdocconf +++ b/src/doc/qtdeviceutilities.qdocconf @@ -1,3 +1,4 @@ +include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) include(qtdeviceutilities-project.qdocconf) # Turn off single-directory output mode diff --git a/src/doc/src/external-resources.qdoc b/src/doc/src/external-resources.qdoc index 38e9654..12da259 100644 --- a/src/doc/src/external-resources.qdoc +++ b/src/doc/src/external-resources.qdoc @@ -24,10 +24,6 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -/*! - \externalpage https://doc.qt.io/QtForDeviceCreation - \title Qt for Device Creation -*/ /*! \externalpage http://code.qt.io/cgit/qt/qtdeviceutilities.git/ @@ -35,6 +31,7 @@ */ /*! - \externalpage http://code.qt.io/cgit/qt/qtdeviceutilities.git/tree/src/settingsui + \externalpage https://code.qt.io/cgit/qt/qtdeviceutilities.git/tree/examples/deviceutilities/settingsuiapp/ + \title Settings UI */ diff --git a/src/doc/src/qtdeviceutilities-index.qdoc b/src/doc/src/qtdeviceutilities-index.qdoc index 53627da..c7e0d96 100644 --- a/src/doc/src/qtdeviceutilities-index.qdoc +++ b/src/doc/src/qtdeviceutilities-index.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -31,7 +31,7 @@ \brief Provides functionality for controlling settings in embedded applications. \QtDU provides functionality that is useful for controlling settings in embedded - applications. The functionality in \QtDU is divided into the following C++ modules: + applications. \QtDU provides the following C++ modules: \annotatedlist qtdevice-utilities-cpp-modules @@ -41,35 +41,27 @@ \section1 Getting Started - To include the definitions of the module's classes, use the following - directives: + To include the definitions of the module's class, use the following + directive: - \code - #include <QtBluetoothSettings> - #include <QtDisplaySettings> - #include <QtLocalDevice> - #include <QtLocaleSettings> + \badcode #include <QtNetworkSettings> - #include <QtTimeDateSettings> \endcode - To link against the modules, add this line to your qmake .pro file: + \section2 Building with CMake + + If you're using CMake to build your application, add the following lines to your CMakeLists.txt file: \badcode - QT += bluetoothsettings displaysettings localdevice localesettings networksettings timedatesettings + find_package(Qt6 COMPONENTS NetworkSettings REQUIRED) + target_link_libraries(mytarget Qt6::NetworkSettings) \endcode To import the QML types into your application, use the following import statements in your .qml file: \code - import QtDeviceUtilities.BluetoothSettings 1.0 - import QtDeviceUtilities.DisplaySettings 1.0 - import QtDeviceUtilities.LocalDeviceSettings 1.0 - import QtDeviceUtilities.LocaleSettings 1.0 - import QtDeviceUtilities.NetworkSettings 1.0 - import QtDeviceUtilities.SettingsUI 1.0 - import QtDeviceUtilities.TimeDateSettings 1.0 + import QtDeviceUtilities.NetworkSettings \endcode \section1 Examples diff --git a/src/doc/src/qtdeviceutilities-module-cpp.qdoc b/src/doc/src/qtdeviceutilities-module-cpp.qdoc index a6eef84..377bb25 100644 --- a/src/doc/src/qtdeviceutilities-module-cpp.qdoc +++ b/src/doc/src/qtdeviceutilities-module-cpp.qdoc @@ -35,22 +35,7 @@ \section1 Classes - \section2 Qt Bluetooth Settings Module - \generatelist {classesbymodule QtBluetoothSettings} - - \section2 Qt Display Settings Module - \generatelist {classesbymodule QtDisplaySettings} - - \section2 Qt Local Device Settings Module - \generatelist {classesbymodule QtLocalDeviceSettings} - - \section2 Qt Locale Settings Module - \generatelist {classesbymodule QtLocaleSettings} - \section2 Qt Network Settings Module \generatelist {classesbymodule QtNetworkSettings} - - \section2 Qt Time and Date Settings Module - \generatelist {classesbymodule QtTimeDateSettings} */ diff --git a/src/doc/src/qtdeviceutilities-module-qml.qdoc b/src/doc/src/qtdeviceutilities-module-qml.qdoc index bd08a8a..510fc01 100644 --- a/src/doc/src/qtdeviceutilities-module-qml.qdoc +++ b/src/doc/src/qtdeviceutilities-module-qml.qdoc @@ -34,36 +34,12 @@ following import statements in your .qml file: \badcode - import QtDeviceUtilities.BluetoothSettings 1.0 - import QtDeviceUtilities.DisplaySettings 1.0 - import QtDeviceUtilities.LocalDeviceSettings 1.0 - import QtDeviceUtilities.LocaleSettings 1.0 - import QtDeviceUtilities.NetworkSettings 1.0 - import QtDeviceUtilities.SettingsUI 1.0 - import QtDeviceUtilities.TimeDateSettings 1.0 + import QtDeviceUtilities.NetworkSettings \endcode \section1 QML Types - \section2 Qt Bluetooth Settings Module - \generatelist qmltypesbymodule QtDeviceUtilities.BluetoothSettings - - \section2 Qt Display Settings Module - \generatelist qmltypesbymodule QtDeviceUtilities.DisplaySettings - - \section2 Qt Local Device Settings Module - \generatelist qmltypesbymodule QtDeviceUtilities.LocalDeviceSettings - - \section2 Qt Locale Settings Module - \generatelist qmltypesbymodule QtDeviceUtilities.LocaleSettings - \section2 Qt Network Settings Module \generatelist qmltypesbymodule QtDeviceUtilities.NetworkSettings - - \section2 Qt Settings UI Module - \generatelist qmltypesbymodule QtDeviceUtilities.SettingsUI - - \section2 Qt Time and Date Settings Module - \generatelist qmltypesbymodule QtDeviceUtilities.TimeDateSettings */ diff --git a/src/doc/src/wifiexample.qdoc b/src/doc/src/wifiexample.qdoc index 2de002b..9a75f86 100644 --- a/src/doc/src/wifiexample.qdoc +++ b/src/doc/src/wifiexample.qdoc @@ -33,7 +33,7 @@ Import the NetworkSettings module as follows: \badcode - import QtDeviceUtilities.NetworkSettings 1.0 + import QtDeviceUtilities.NetworkSettings \endcode \section1 Filtering WiFi Networks diff --git a/src/imports/bluetoothsettings/bluetoothsettings.pro b/src/imports/bluetoothsettings/bluetoothsettings.pro deleted file mode 100644 index 8facaf3..0000000 --- a/src/imports/bluetoothsettings/bluetoothsettings.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += qml bluetooth bluetoothsettings - -CONFIG += no_cxx_module - -TARGET = btsettingsplugin -TARGETPATH = QtDeviceUtilities/BluetoothSettings - -SOURCES += plugin.cpp - -load(qml_plugin) diff --git a/src/imports/bluetoothsettings/plugin.cpp b/src/imports/bluetoothsettings/plugin.cpp deleted file mode 100644 index db180f7..0000000 --- a/src/imports/bluetoothsettings/plugin.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtQml/QQmlExtensionPlugin> -#include <QtQml/qqml.h> -#include <qcoreapplication.h> -#include <QQmlEngine> -#include <QQmlContext> - -#include "bluetoothdevice.h" -#include "discoverymodel.h" - -/*! - \qmlmodule QtDeviceUtilities.BluetoothSettings 1.0 - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Bluetooth Settings QML Types - - \brief Provides a singleton QML type for controlling bluetooth settings. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.BluetoothSettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype BtDevice - \inqmlmodule QtDeviceUtilities.BluetoothSettings - \brief A singleton QML type for controlling bluetooth settings. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.BluetoothSettings} module. -*/ - -/*! - \qmlproperty bool BtDevice::scanning - - Controls whether the Bluetooth device is scanning for remote devices. -*/ - -/*! - \qmlproperty bool BtDevice::powered - - Powers the Bluetooth device on or off. -*/ - -/*! - \qmlproperty object BtDevice::deviceModel - \readonly - - Holds the device model. -*/ - -/*! - \qmlmethod void BtDevice::requestPairing(string address) - - Starts the process of pairing to a remove device specified by \a address, - and connects to it if the pairing was successful. -*/ - -/*! - \qmlmethod void BtDevice::requestConnect(string address) - - Connects to a remove device specified by \a address. - - \sa requestDisconnect() -*/ - -/*! - \qmlmethod void BtDevice::requestDisconnect(string address) - - Disconnects from the remove device specified by \a address. - - \sa requestConnect() -*/ - -QT_BEGIN_NAMESPACE - -template <typename T> -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -class BluetoothSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) - { - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtDeviceUtilities.BluetoothSettings")); - qmlRegisterUncreatableType<BtDeviceItem>(uri, 1, 0, "BtDeviceItem", "Cannot be instantiated directly."); - qmlRegisterSingletonType<BluetoothDevice>(uri, 1, 0, "BtDevice", &instance<BluetoothDevice>); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/bluetoothsettings/plugins.qmltypes b/src/imports/bluetoothsettings/plugins.qmltypes deleted file mode 100644 index 0270419..0000000 --- a/src/imports/bluetoothsettings/plugins.qmltypes +++ /dev/null @@ -1,89 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.BluetoothSettings 1.0' - -Module { - dependencies: [] - Component { - name: "BluetoothDevice" - prototype: "QObject" - exports: ["QtDeviceUtilities.BluetoothSettings/BtDevice 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "scanning"; type: "bool" } - Property { name: "powered"; type: "bool" } - Property { name: "deviceModel"; type: "QObject"; isReadonly: true; isPointer: true } - Method { - name: "deviceStateChanged" - Parameter { name: "state"; type: "QBluetoothLocalDevice::HostMode" } - } - Method { name: "scanFinished" } - Method { - name: "pairingDisplayConfirmation" - Parameter { name: "address"; type: "QBluetoothAddress" } - Parameter { name: "pin"; type: "string" } - } - Method { - name: "pairingDisplayPinCode" - Parameter { name: "address"; type: "QBluetoothAddress" } - Parameter { name: "pin"; type: "string" } - } - Method { - name: "pairingFinished" - Parameter { name: "address"; type: "QBluetoothAddress" } - Parameter { name: "pairing"; type: "QBluetoothLocalDevice::Pairing" } - } - Method { - name: "deviceConnected" - Parameter { name: "address"; type: "QBluetoothAddress" } - } - Method { - name: "deviceDisconnected" - Parameter { name: "address"; type: "QBluetoothAddress" } - } - Method { - name: "requestPairing" - Parameter { name: "address"; type: "string" } - } - Method { - name: "requestConnect" - Parameter { name: "address"; type: "string" } - } - Method { - name: "requestDisconnect" - Parameter { name: "address"; type: "string" } - } - } - Component { - name: "BtDeviceItem" - prototype: "QObject" - exports: ["QtDeviceUtilities.BluetoothSettings/BtDeviceItem 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "DeviceType" - values: { - "Phone": 0, - "Computer": 1, - "Mouse": 2, - "Keyboard": 3, - "Headphones": 4, - "Microphone": 5, - "Camera": 6, - "Camcorder": 7, - "Clock": 8, - "HealthDevice": 9, - "GenericDevice": 1000 - } - } - Property { name: "address"; type: "string"; isReadonly: true } - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "connected"; type: "bool"; isReadonly: true } - Property { name: "type"; type: "DeviceType"; isReadonly: true } - } -} diff --git a/src/imports/bluetoothsettings/qmldir b/src/imports/bluetoothsettings/qmldir deleted file mode 100644 index f0c15f5..0000000 --- a/src/imports/bluetoothsettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.BluetoothSettings -plugin btsettingsplugin -classname BluetoothSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/displaysettings/displaysettings.pro b/src/imports/displaysettings/displaysettings.pro deleted file mode 100644 index efa1903..0000000 --- a/src/imports/displaysettings/displaysettings.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += qml displaysettings - -CONFIG += no_cxx_module - -TARGET = qmldisplaysettingsplugin -TARGETPATH = QtDeviceUtilities/DisplaySettings - -SOURCES += plugin.cpp \ - -load(qml_plugin) diff --git a/src/imports/displaysettings/plugin.cpp b/src/imports/displaysettings/plugin.cpp deleted file mode 100644 index 1fd56b0..0000000 --- a/src/imports/displaysettings/plugin.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtQml/QQmlExtensionPlugin> -#include <QtQml/qqml.h> -#include <QQmlEngine> -#include <qcoreapplication.h> -#include "displaysettings.h" - -/*! - \qmlmodule QtDeviceUtilities.DisplaySettings 1.0 - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Display Settings QML Types - - \brief Provides a singleton QML type for controlling display settings. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.DisplaySettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype DisplaySettings - \inqmlmodule QtDeviceUtilities.DisplaySettings - \brief A singleton QML type for controlling display settings. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.DisplaySettings} module. -*/ - -/*! - \qmlproperty int DisplaySettings::displayBrightness - - Holds the display brightness (intensity of the backlight). A valid - range for the property is from 0 to 255, where 255 is the maximum - brightness and 0 is the minimum (typically, the backlight turned off). -*/ - -/*! - \qmlproperty int DisplaySettings::physicalScreenSizeInch - - Holds the physical (diagonal) screen size in inches. -*/ - -/*! - \qmlproperty bool DisplaySettings::physicalScreenSizeOverride - - Holds whether the value in physicalScreenSizeInch should be - used or not. -*/ - -QT_BEGIN_NAMESPACE - -template <typename T> -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -class DisplaySettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) - { - qmlRegisterType(QUrl("qrc:/Display.qml"), uri, 1, 0, "Display"); - qmlRegisterSingletonType<DisplaySettings>(uri, 1, 0, "DisplaySettings", &instance<DisplaySettings>); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/displaysettings/plugins.qmltypes b/src/imports/displaysettings/plugins.qmltypes deleted file mode 100644 index bebb50e..0000000 --- a/src/imports/displaysettings/plugins.qmltypes +++ /dev/null @@ -1,47 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.DisplaySettings 1.0' - -Module { - dependencies: [] - Component { - name: "DisplaySettings" - prototype: "QObject" - exports: ["QtDeviceUtilities.DisplaySettings/DisplaySettings 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "displayBrightness"; type: "int" } - Property { name: "physicalScreenSizeInch"; type: "int" } - Property { name: "physicalScreenSizeOverride"; type: "bool" } - Signal { - name: "displayBrightnessChanged" - Parameter { name: "newValue"; type: "int" } - } - Signal { - name: "physicalScreenSizeInchChanged" - Parameter { name: "newInches"; type: "int" } - } - Signal { - name: "physicalScreenSizeOverrideChanged" - Parameter { name: "newValue"; type: "bool" } - } - Method { - name: "setDisplayBrightness" - type: "bool" - Parameter { name: "value"; type: "int" } - } - Method { - name: "setPhysicalScreenSizeInch" - Parameter { name: "inches"; type: "int" } - } - Method { - name: "setPhysicalScreenSizeOverride" - Parameter { name: "enable"; type: "bool" } - } - } -} diff --git a/src/imports/displaysettings/qmldir b/src/imports/displaysettings/qmldir deleted file mode 100644 index 1bfbe93..0000000 --- a/src/imports/displaysettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.DisplaySettings -plugin qmldisplaysettingsplugin -classname DisplaySettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/imports.pro b/src/imports/imports.pro deleted file mode 100644 index c39e30f..0000000 --- a/src/imports/imports.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += localdevice \ - displaysettings - -qtHaveModule(bluetoothsettings): SUBDIRS += bluetoothsettings -qtHaveModule(networksettings): SUBDIRS += networksettings -qtHaveModule(localesettings): SUBDIRS += localesettings -qtHaveModule(timedatesettings): SUBDIRS += timedatesettings diff --git a/src/imports/localdevice/localdevice.pro b/src/imports/localdevice/localdevice.pro deleted file mode 100644 index e34a3d5..0000000 --- a/src/imports/localdevice/localdevice.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += qml localdevice - -CONFIG += no_cxx_module - -TARGET = localdeviceplugin -TARGETPATH = QtDeviceUtilities/LocalDeviceSettings - -SOURCES += plugin.cpp - -load(qml_plugin) diff --git a/src/imports/localdevice/plugin.cpp b/src/imports/localdevice/plugin.cpp deleted file mode 100644 index 8a59a27..0000000 --- a/src/imports/localdevice/plugin.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <qlocaldevice.h> -#include <QtQml> - -/*! - \qmlmodule QtDeviceUtilities.LocalDeviceSettings 1.0 - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Local Device Settings QML Types - - \brief Provides a collection of local device related utility functions. - - Qt Local Device Settings QML modules provides utility functions for controlling - an embedded device, such as device shutdown and reboot. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.LocalDeviceSettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype LocalDevice - \inqmlmodule QtDeviceUtilities.LocalDeviceSettings - \brief Singleton QML type providing access to utility functions. - - LocalDevice QML type is the interface to various utility - functions. - - There is no need to create an instance of this object. To use it, - simply import the \c QtDeviceUtilities.LocalDeviceSettings module: - - \badcode - import QtDeviceUtilities.LocalDeviceSettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. -*/ - -/*! - \qmlmethod LocalDevice::reboot() - - Reboots the system. Does not return. - - \sa powerOff() -*/ - -/*! - \qmlmethod LocalDevice::powerOff() - - Shuts down the system. Does not return. - - \sa reboot() -*/ - -QT_BEGIN_NAMESPACE - -static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine) -{ - Q_UNUSED(engine) - Q_UNUSED(scriptEngine) - QLocalDevice *api = new QLocalDevice(); - - return api; -} - -class LocalDeviceSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) - { - Q_ASSERT(QLatin1String(uri) == "QtDeviceUtilities.LocalDeviceSettings"); - qmlRegisterSingletonType<QLocalDevice>(uri, 1, 0, "LocalDevice", module_api_factory); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/localdevice/plugins.qmltypes b/src/imports/localdevice/plugins.qmltypes deleted file mode 100644 index 1becd85..0000000 --- a/src/imports/localdevice/plugins.qmltypes +++ /dev/null @@ -1,21 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.LocalDeviceSettings 1.0' - -Module { - dependencies: [] - Component { - name: "QLocalDevice" - prototype: "QObject" - exports: ["QtDeviceUtilities.LocalDeviceSettings/LocalDevice 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Method { name: "reboot" } - Method { name: "powerOff" } - } -} diff --git a/src/imports/localdevice/qmldir b/src/imports/localdevice/qmldir deleted file mode 100644 index 81b12d4..0000000 --- a/src/imports/localdevice/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.LocalDeviceSettings -plugin localdeviceplugin -classname LocalDeviceSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/localesettings/locale.xml b/src/imports/localesettings/locale.xml deleted file mode 100644 index b722456..0000000 --- a/src/imports/localesettings/locale.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<node name="/Service" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> -<node> - <interface name="org.freedesktop.locale1"> - <property name="Locale" type="as" access="read"/> - <method name="SetLocale"> - <arg name="locale" type="as" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - </interface> -</node> - diff --git a/src/imports/localesettings/localesettings.pro b/src/imports/localesettings/localesettings.pro deleted file mode 100644 index 5dcb5f7..0000000 --- a/src/imports/localesettings/localesettings.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += qml localesettings - -CONFIG += no_cxx_module - -TARGET = localesettingsplugin -TARGETPATH = QtDeviceUtilities/LocaleSettings - -SOURCES += plugin.cpp - -load(qml_plugin) diff --git a/src/imports/localesettings/plugin.cpp b/src/imports/localesettings/plugin.cpp deleted file mode 100644 index 573e5bc..0000000 --- a/src/imports/localesettings/plugin.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtQml/QQmlExtensionPlugin> -#include <QtQml/qqml.h> -#include <qcoreapplication.h> -#include <QQmlEngine> -#include <QQmlContext> - -#include <systemlocale.h> -#include "localefiltermodel.h" - -/*! - \qmlmodule QtDeviceUtilities.LocaleSettings 1.0 - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Locale Settings QML Types - - \brief Provides singleton QML types for controlling locale settings. - - Qt Local Device Settings QML module provides singleton QML types for - controlling locale settings in an embedded device. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.LocaleSettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype LocaleManager - \inqmlmodule QtDeviceUtilities.LocaleSettings - \brief A singleton QML type for managing the system locale. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.LocaleSettings} module. - - The \l locale property holds the current system locale string. - Pass it to \l {QtQml::Qt::locale()}{Qt.locale}() to - retrieve locale-specific properties. - - For example: - - \qml - import QtQuick 2.6 - import QtDeviceUtilities.LocaleSettings 1.0 - - Item { - property var currentLocale: Qt.locale(LocaleManager.locale) - Text { text: currentLocale.nativeLanguageName } - } - \endqml - - \sa LocaleFilter, {QtQml::}{Locale} -*/ - -/*! - \qmlproperty string LocaleManager::locale - - Holds the system locale string in the format \e language_country, - for example, "en_US". - - \sa QLocale::name() -*/ - -/*! - \qmltype LocaleFilter - \inqmlmodule QtDeviceUtilities.LocaleSettings - \brief Provides a filtered model for the available locales. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.LocaleSettings} module. - - The LocaleFilter QML type can be used as the model in a view - that lists the available locales. - - For example: - - \code - ListView { - model: LocaleFilter - delegate: Text { text: language + " | " + country } - } - \endcode - - Available \e roles in the locale model: - - \table - \header \li Role \li Description - - \row \li \c code \li Locale code string in the format \e language_country. - See QLocale::name() for details. - - \row \li \c country \li The name of the country. If available, the native - country name is used. - - \row \li \c language \li The name of the language. If available, the - native language name is used. - \endtable - - \sa LocaleManager -*/ - -/*! - \qmlproperty string LocaleFilter::filter - - Holds a string that filters out the locales in the model. - The filtering process is a case-insensitive match for - whether the region (country) name contains the \e filter - substring; it can be taken from user input. -*/ - -/*! - \qmlmethod object LocaleFilter::itemFromRow(int index) - - Returns the item at \a index in the model. This item can - assigned to \l [QML] {LocaleManager::locale} - {LocaleManager.locale}, when the user selects a locale - from a list. -*/ - -QT_BEGIN_NAMESPACE - -template <typename T> -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -class LocaleSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) - { - qmlRegisterSingletonType<SystemLocale>(uri, 1, 0, "LocaleManager", &instance<SystemLocale>); - qmlRegisterSingletonType<LocaleFilterModel>(uri, 1, 0, "LocaleFilter", &instance<LocaleFilterModel>); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/localesettings/plugins.qmltypes b/src/imports/localesettings/plugins.qmltypes deleted file mode 100644 index 01e66b5..0000000 --- a/src/imports/localesettings/plugins.qmltypes +++ /dev/null @@ -1,349 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.LocaleSettings 1.0' - -Module { - dependencies: [] - Component { - name: "LocaleFilterModel" - prototype: "QSortFilterProxyModel" - exports: ["QtDeviceUtilities.LocaleSettings/LocaleFilter 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "filter"; type: "string" } - Method { - name: "itemFromRow" - type: "QVariant" - Parameter { name: "row"; type: "int" } - } - } - Component { - name: "QAbstractItemModel" - prototype: "QObject" - Enum { - name: "LayoutChangeHint" - values: { - "NoLayoutChangeHint": 0, - "VerticalSortHint": 1, - "HorizontalSortHint": 2 - } - } - Signal { - name: "dataChanged" - Parameter { name: "topLeft"; type: "QModelIndex" } - Parameter { name: "bottomRight"; type: "QModelIndex" } - Parameter { name: "roles"; type: "QVector<int>" } - } - Signal { - name: "dataChanged" - Parameter { name: "topLeft"; type: "QModelIndex" } - Parameter { name: "bottomRight"; type: "QModelIndex" } - } - Signal { - name: "headerDataChanged" - Parameter { name: "orientation"; type: "Qt::Orientation" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "layoutChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } - } - Signal { - name: "layoutChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - } - Signal { name: "layoutChanged" } - Signal { - name: "layoutAboutToBeChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } - } - Signal { - name: "layoutAboutToBeChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - } - Signal { name: "layoutAboutToBeChanged" } - Signal { - name: "rowsAboutToBeInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsAboutToBeRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsAboutToBeInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsAboutToBeRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { name: "modelAboutToBeReset" } - Signal { name: "modelReset" } - Signal { - name: "rowsAboutToBeMoved" - Parameter { name: "sourceParent"; type: "QModelIndex" } - Parameter { name: "sourceStart"; type: "int" } - Parameter { name: "sourceEnd"; type: "int" } - Parameter { name: "destinationParent"; type: "QModelIndex" } - Parameter { name: "destinationRow"; type: "int" } - } - Signal { - name: "rowsMoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - Parameter { name: "destination"; type: "QModelIndex" } - Parameter { name: "row"; type: "int" } - } - Signal { - name: "columnsAboutToBeMoved" - Parameter { name: "sourceParent"; type: "QModelIndex" } - Parameter { name: "sourceStart"; type: "int" } - Parameter { name: "sourceEnd"; type: "int" } - Parameter { name: "destinationParent"; type: "QModelIndex" } - Parameter { name: "destinationColumn"; type: "int" } - } - Signal { - name: "columnsMoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - Parameter { name: "destination"; type: "QModelIndex" } - Parameter { name: "column"; type: "int" } - } - Method { name: "submit"; type: "bool" } - Method { name: "revert" } - Method { - name: "hasIndex" - type: "bool" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "hasIndex" - type: "bool" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - } - Method { - name: "index" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "index" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - } - Method { - name: "parent" - type: "QModelIndex" - Parameter { name: "child"; type: "QModelIndex" } - } - Method { - name: "sibling" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "idx"; type: "QModelIndex" } - } - Method { - name: "rowCount" - type: "int" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "rowCount"; type: "int" } - Method { - name: "columnCount" - type: "int" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "columnCount"; type: "int" } - Method { - name: "hasChildren" - type: "bool" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "hasChildren"; type: "bool" } - Method { - name: "data" - type: "QVariant" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "data" - type: "QVariant" - Parameter { name: "index"; type: "QModelIndex" } - } - Method { - name: "setData" - type: "bool" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "setData" - type: "bool" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "headerData" - type: "QVariant" - Parameter { name: "section"; type: "int" } - Parameter { name: "orientation"; type: "Qt::Orientation" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "headerData" - type: "QVariant" - Parameter { name: "section"; type: "int" } - Parameter { name: "orientation"; type: "Qt::Orientation" } - } - Method { - name: "fetchMore" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "canFetchMore" - type: "bool" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "flags" - type: "Qt::ItemFlags" - Parameter { name: "index"; type: "QModelIndex" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "hits"; type: "int" } - Parameter { name: "flags"; type: "Qt::MatchFlags" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "hits"; type: "int" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - } - } - Component { - name: "QAbstractProxyModel" - prototype: "QAbstractItemModel" - Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true } - Method { - name: "mapToSource" - type: "QModelIndex" - Parameter { name: "proxyIndex"; type: "QModelIndex" } - } - Method { - name: "mapFromSource" - type: "QModelIndex" - Parameter { name: "sourceIndex"; type: "QModelIndex" } - } - Method { - name: "mapSelectionToSource" - type: "QItemSelection" - Parameter { name: "selection"; type: "QItemSelection" } - } - Method { - name: "mapSelectionFromSource" - type: "QItemSelection" - Parameter { name: "selection"; type: "QItemSelection" } - } - } - Component { - name: "QSortFilterProxyModel" - prototype: "QAbstractProxyModel" - Property { name: "filterRegExp"; type: "QRegExp" } - Property { name: "filterKeyColumn"; type: "int" } - Property { name: "dynamicSortFilter"; type: "bool" } - Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" } - Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" } - Property { name: "isSortLocaleAware"; type: "bool" } - Property { name: "sortRole"; type: "int" } - Property { name: "filterRole"; type: "int" } - Method { - name: "setFilterRegExp" - Parameter { name: "pattern"; type: "string" } - } - Method { - name: "setFilterWildcard" - Parameter { name: "pattern"; type: "string" } - } - Method { - name: "setFilterFixedString" - Parameter { name: "pattern"; type: "string" } - } - Method { name: "clear" } - Method { name: "invalidate" } - } - Component { - name: "SystemLocale" - prototype: "QObject" - exports: ["QtDeviceUtilities.LocaleSettings/LocaleManager 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "locale"; type: "string" } - } -} diff --git a/src/imports/localesettings/qmldir b/src/imports/localesettings/qmldir deleted file mode 100644 index 0106d12..0000000 --- a/src/imports/localesettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.LocaleSettings -plugin localesettingsplugin -classname LocaleSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/networksettings/networksettings.pro b/src/imports/networksettings/networksettings.pro deleted file mode 100644 index 7c1dc0a..0000000 --- a/src/imports/networksettings/networksettings.pro +++ /dev/null @@ -1,15 +0,0 @@ -QT += qml quick networksettings - -CONFIG += no_cxx_module - -TARGET = networksettingsplugin -TARGETPATH = QtDeviceUtilities/NetworkSettings - -SOURCES += \ - plugin.cpp \ - -HEADERS += \ - plugin.h \ - -load(qml_plugin) - diff --git a/src/imports/networksettings/plugin.h b/src/imports/networksettings/plugin.h deleted file mode 100644 index 0cae114..0000000 --- a/src/imports/networksettings/plugin.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef NETWORKSETTINGSPLUGIN_PLUGIN_H -#define NETWORKSETTINGSPLUGIN_PLUGIN_H - -#include <QQmlExtensionPlugin> - -QT_BEGIN_NAMESPACE - -class NetworkSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri); -}; - -QT_END_NAMESPACE - -#endif // NETWORKSETTINGSPLUGIN_PLUGIN_H - diff --git a/src/imports/networksettings/plugins.qmltypes b/src/imports/networksettings/plugins.qmltypes deleted file mode 100644 index f2603eb..0000000 --- a/src/imports/networksettings/plugins.qmltypes +++ /dev/null @@ -1,205 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.NetworkSettings 1.0' - -Module { - dependencies: ["QtQuick 2.8"] - Component { - name: "QNetworkSettingsIPv4" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsIPv4 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Dhcp": 0, - "Manual": 1, - "Off": 2 - } - } - Property { name: "address"; type: "string" } - Property { name: "gateway"; type: "string" } - Property { name: "method"; type: "MethodType" } - Property { name: "mask"; type: "string" } - } - Component { - name: "QNetworkSettingsIPv6" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsIPv6 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Auto": 0, - "Manual": 1, - "Off": 2 - } - } - Enum { - name: "PrivacyType" - values: { - "Disabled": 0, - "Enabled": 1, - "Preferred": 2 - } - } - Property { name: "address"; type: "string" } - Property { name: "gateway"; type: "string" } - Property { name: "method"; type: "MethodType" } - Property { name: "privacy"; type: "PrivacyType" } - Property { name: "prefixLength"; type: "int" } - } - Component { - name: "QNetworkSettingsInterface" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkInterface 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "state"; type: "QNetworkSettingsState::States"; isReadonly: true } - Property { name: "type"; type: "QNetworkSettingsType::Types"; isReadonly: true } - Property { name: "powered"; type: "bool" } - Method { name: "scanServices" } - } - Component { - name: "QNetworkSettingsManager" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsManager 1.0" - ] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { - name: "services" - type: "QNetworkSettingsServiceFilter" - isReadonly: true - isPointer: true - } - Property { - name: "interfaces" - type: "QNetworkSettingsInterfaceModel" - isReadonly: true - isPointer: true - } - Property { - name: "userAgent" - type: "QNetworkSettingsUserAgent" - isReadonly: true - isPointer: true - } - Method { - name: "service" - type: "QNetworkSettingsService*" - Parameter { name: "name"; type: "string" } - Parameter { name: "type"; type: "int" } - } - Method { - name: "interface" - type: "QNetworkSettingsInterface*" - Parameter { name: "type"; type: "int" } - Parameter { name: "instance"; type: "int" } - } - } - Component { - name: "QNetworkSettingsProxy" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsProxy 1.0" - ] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "MethodType" - values: { - "Direct": 0, - "Auto": 1, - "Manual": 2 - } - } - Property { name: "url"; type: "QUrl" } - Property { name: "servers"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "excludes"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "method"; type: "MethodType" } - } - Component { - name: "QNetworkSettingsService" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkService 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "id"; type: "string"; isReadonly: true } - Property { name: "name"; type: "string"; isReadonly: true } - Property { name: "state"; type: "QNetworkSettingsState::States"; isReadonly: true } - Property { name: "type"; type: "QNetworkSettingsType::Types"; isReadonly: true } - Property { name: "ipv4"; type: "QNetworkSettingsIPv4"; isReadonly: true; isPointer: true } - Property { name: "ipv6"; type: "QNetworkSettingsIPv6"; isReadonly: true; isPointer: true } - Property { name: "proxy"; type: "QNetworkSettingsProxy"; isReadonly: true; isPointer: true } - Property { - name: "wirelessConfig" - type: "QNetworkSettingsWireless" - isReadonly: true - isPointer: true - } - Property { name: "domains"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Property { name: "nameservers"; type: "QAbstractItemModel"; isReadonly: true; isPointer: true } - Signal { name: "wirelessChanged" } - Method { - name: "setAutoConnect" - Parameter { name: "autoconnect"; type: "bool" } - } - Method { name: "setupIpv4Config" } - Method { name: "setupIpv6Config" } - Method { name: "setupNameserversConfig" } - Method { name: "setupDomainsConfig" } - Method { name: "setupNetworkSettingsProxy" } - Method { name: "connectService" } - Method { name: "disconnectService" } - } - Component { - name: "QNetworkSettingsState" - prototype: "QObject" - exports: [ - "QtDeviceUtilities.NetworkSettings/NetworkSettingsState 1.0" - ] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "States" - values: { - "Idle": 0, - "Failure": 1, - "Association": 2, - "Configuration": 3, - "Ready": 4, - "Disconnect": 5, - "Online": 6, - "Undefined": 7 - } - } - Property { name: "state"; type: "States" } - } - Component { - name: "QNetworkSettingsType" - prototype: "QObject" - exports: ["QtDeviceUtilities.NetworkSettings/NetworkSettingsType 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "Types" - values: { - "Wired": 0, - "Wifi": 1, - "Bluetooth": 2, - "Unknown": 3 - } - } - Property { name: "type"; type: "Types" } - } -} diff --git a/src/imports/networksettings/qmldir b/src/imports/networksettings/qmldir deleted file mode 100644 index 64b8d6e..0000000 --- a/src/imports/networksettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.NetworkSettings -plugin networksettingsplugin -classname NetworkSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/timedatesettings/plugin.cpp b/src/imports/timedatesettings/plugin.cpp deleted file mode 100644 index 70a766c..0000000 --- a/src/imports/timedatesettings/plugin.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtQml/QQmlExtensionPlugin> -#include <QtQml/qqml.h> -#include <qcoreapplication.h> -#include <QQmlEngine> -#include <QQmlContext> - -#include <systemtime.h> -#include "timezonefiltermodel.h" - -/*! - \qmlmodule QtDeviceUtilities.TimeDateSettings 1.0 - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \title Qt Time and Date Settings QML Types - - \brief Provides singleton QML types for controlling date and time settings. - - Qt Time and Date Settings QML module provides singleton QML types for controlling - date and time settings in an embedded device. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.TimeDateSettings 1.0 - \endcode - - \note Some functions may not be available on all of the platforms. - - \section1 QML Types -*/ - -/*! - \qmltype TimeManager - \inqmlmodule QtDeviceUtilities.TimeDateSettings - \brief A singleton QML type for managing the system date and time. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.TimeDateSettings} module. -*/ - -/*! - \qmlproperty string TimeManager::timeZone - - Holds the current time zone string. -*/ - -/*! - \qmlproperty bool TimeManager::ntp - - Holds whether the system time is synchronized using NTP (Network - Time Protocol). -*/ - -/*! - \qmlproperty Date TimeManager::time - - Holds the current date and time. -*/ - -/*! - \qmltype TimezonesFilter - \inqmlmodule QtDeviceUtilities.TimeDateSettings - \brief Provides a filtered model for the available time zones. - - There is no need to create an instance of this object. To use it, - simply import the \c {QtDeviceUtilities.TimeDateSettings} module. - - The TimezonesFilter QML type can be used as the model in a view - that lists the available time zones. - - For example: - - \code - ListView { - model: TimezonesFilter - delegate: Text { text: name + " | " + country } - } - \endcode - - Available \e roles in the time zone model: - - \table - \header \li Role \li Description - - \row \li \c name - \li Display name of the time zone. See QTimeZone::displayName() for - details. - - \row \li \c country - \li Name of the country for the zone time. - - \row \li \c id - \li IANA time zone ID. - \endtable -*/ - -/*! - \qmlproperty string TimezonesFilter::filter - - Holds a string that filters out the time zones in the model. - The filtering process is a case-insensitive match for - whether the time zone's name or country name contain the - \e filter substring; it can be taken from user input. -*/ - -/*! - \qmlmethod object TimezonesFilter::itemFromRow(int index) - - Returns the item at \a index in the model. This item can - be assigned to \l [QML] {TimeManager::timeZone} - {TimeManager.timeZone}, when the user selects a time zone - from a list. -*/ - -QT_BEGIN_NAMESPACE - -template <typename T> -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -class TimeDateSettingsQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - void registerTypes(const char *uri) - { - qmlRegisterSingletonType<SystemTime>(uri, 1, 0, "TimeManager", &instance<SystemTime>); - qmlRegisterSingletonType<TimezoneFilterModel>(uri, 1, 0, "TimezonesFilter", &instance<TimezoneFilterModel>); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/timedatesettings/plugins.qmltypes b/src/imports/timedatesettings/plugins.qmltypes deleted file mode 100644 index 26acfc4..0000000 --- a/src/imports/timedatesettings/plugins.qmltypes +++ /dev/null @@ -1,351 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.TimeDateSettings 1.0' - -Module { - dependencies: [] - Component { - name: "QAbstractItemModel" - prototype: "QObject" - Enum { - name: "LayoutChangeHint" - values: { - "NoLayoutChangeHint": 0, - "VerticalSortHint": 1, - "HorizontalSortHint": 2 - } - } - Signal { - name: "dataChanged" - Parameter { name: "topLeft"; type: "QModelIndex" } - Parameter { name: "bottomRight"; type: "QModelIndex" } - Parameter { name: "roles"; type: "QVector<int>" } - } - Signal { - name: "dataChanged" - Parameter { name: "topLeft"; type: "QModelIndex" } - Parameter { name: "bottomRight"; type: "QModelIndex" } - } - Signal { - name: "headerDataChanged" - Parameter { name: "orientation"; type: "Qt::Orientation" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "layoutChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } - } - Signal { - name: "layoutChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - } - Signal { name: "layoutChanged" } - Signal { - name: "layoutAboutToBeChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - Parameter { name: "hint"; type: "QAbstractItemModel::LayoutChangeHint" } - } - Signal { - name: "layoutAboutToBeChanged" - Parameter { name: "parents"; type: "QList<QPersistentModelIndex>" } - } - Signal { name: "layoutAboutToBeChanged" } - Signal { - name: "rowsAboutToBeInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsAboutToBeRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "rowsRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsAboutToBeInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsInserted" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsAboutToBeRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { - name: "columnsRemoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "first"; type: "int" } - Parameter { name: "last"; type: "int" } - } - Signal { name: "modelAboutToBeReset" } - Signal { name: "modelReset" } - Signal { - name: "rowsAboutToBeMoved" - Parameter { name: "sourceParent"; type: "QModelIndex" } - Parameter { name: "sourceStart"; type: "int" } - Parameter { name: "sourceEnd"; type: "int" } - Parameter { name: "destinationParent"; type: "QModelIndex" } - Parameter { name: "destinationRow"; type: "int" } - } - Signal { - name: "rowsMoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - Parameter { name: "destination"; type: "QModelIndex" } - Parameter { name: "row"; type: "int" } - } - Signal { - name: "columnsAboutToBeMoved" - Parameter { name: "sourceParent"; type: "QModelIndex" } - Parameter { name: "sourceStart"; type: "int" } - Parameter { name: "sourceEnd"; type: "int" } - Parameter { name: "destinationParent"; type: "QModelIndex" } - Parameter { name: "destinationColumn"; type: "int" } - } - Signal { - name: "columnsMoved" - Parameter { name: "parent"; type: "QModelIndex" } - Parameter { name: "start"; type: "int" } - Parameter { name: "end"; type: "int" } - Parameter { name: "destination"; type: "QModelIndex" } - Parameter { name: "column"; type: "int" } - } - Method { name: "submit"; type: "bool" } - Method { name: "revert" } - Method { - name: "hasIndex" - type: "bool" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "hasIndex" - type: "bool" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - } - Method { - name: "index" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "index" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - } - Method { - name: "parent" - type: "QModelIndex" - Parameter { name: "child"; type: "QModelIndex" } - } - Method { - name: "sibling" - type: "QModelIndex" - Parameter { name: "row"; type: "int" } - Parameter { name: "column"; type: "int" } - Parameter { name: "idx"; type: "QModelIndex" } - } - Method { - name: "rowCount" - type: "int" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "rowCount"; type: "int" } - Method { - name: "columnCount" - type: "int" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "columnCount"; type: "int" } - Method { - name: "hasChildren" - type: "bool" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { name: "hasChildren"; type: "bool" } - Method { - name: "data" - type: "QVariant" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "data" - type: "QVariant" - Parameter { name: "index"; type: "QModelIndex" } - } - Method { - name: "setData" - type: "bool" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "setData" - type: "bool" - Parameter { name: "index"; type: "QModelIndex" } - Parameter { name: "value"; type: "QVariant" } - } - Method { - name: "headerData" - type: "QVariant" - Parameter { name: "section"; type: "int" } - Parameter { name: "orientation"; type: "Qt::Orientation" } - Parameter { name: "role"; type: "int" } - } - Method { - name: "headerData" - type: "QVariant" - Parameter { name: "section"; type: "int" } - Parameter { name: "orientation"; type: "Qt::Orientation" } - } - Method { - name: "fetchMore" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "canFetchMore" - type: "bool" - Parameter { name: "parent"; type: "QModelIndex" } - } - Method { - name: "flags" - type: "Qt::ItemFlags" - Parameter { name: "index"; type: "QModelIndex" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "hits"; type: "int" } - Parameter { name: "flags"; type: "Qt::MatchFlags" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - Parameter { name: "hits"; type: "int" } - } - Method { - name: "match" - type: "QModelIndexList" - Parameter { name: "start"; type: "QModelIndex" } - Parameter { name: "role"; type: "int" } - Parameter { name: "value"; type: "QVariant" } - } - } - Component { - name: "QAbstractProxyModel" - prototype: "QAbstractItemModel" - Property { name: "sourceModel"; type: "QAbstractItemModel"; isPointer: true } - Method { - name: "mapToSource" - type: "QModelIndex" - Parameter { name: "proxyIndex"; type: "QModelIndex" } - } - Method { - name: "mapFromSource" - type: "QModelIndex" - Parameter { name: "sourceIndex"; type: "QModelIndex" } - } - Method { - name: "mapSelectionToSource" - type: "QItemSelection" - Parameter { name: "selection"; type: "QItemSelection" } - } - Method { - name: "mapSelectionFromSource" - type: "QItemSelection" - Parameter { name: "selection"; type: "QItemSelection" } - } - } - Component { - name: "QSortFilterProxyModel" - prototype: "QAbstractProxyModel" - Property { name: "filterRegExp"; type: "QRegExp" } - Property { name: "filterKeyColumn"; type: "int" } - Property { name: "dynamicSortFilter"; type: "bool" } - Property { name: "filterCaseSensitivity"; type: "Qt::CaseSensitivity" } - Property { name: "sortCaseSensitivity"; type: "Qt::CaseSensitivity" } - Property { name: "isSortLocaleAware"; type: "bool" } - Property { name: "sortRole"; type: "int" } - Property { name: "filterRole"; type: "int" } - Method { - name: "setFilterRegExp" - Parameter { name: "pattern"; type: "string" } - } - Method { - name: "setFilterWildcard" - Parameter { name: "pattern"; type: "string" } - } - Method { - name: "setFilterFixedString" - Parameter { name: "pattern"; type: "string" } - } - Method { name: "clear" } - Method { name: "invalidate" } - } - Component { - name: "SystemTime" - prototype: "QObject" - exports: ["QtDeviceUtilities.TimeDateSettings/TimeManager 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "timeZone"; type: "string" } - Property { name: "ntp"; type: "bool" } - Property { name: "time"; type: "QDateTime" } - } - Component { - name: "TimezoneFilterModel" - prototype: "QSortFilterProxyModel" - exports: ["QtDeviceUtilities.TimeDateSettings/TimezonesFilter 1.0"] - isCreatable: false - isSingleton: true - exportMetaObjectRevisions: [0] - Property { name: "filter"; type: "string" } - Method { - name: "itemFromRow" - type: "QVariant" - Parameter { name: "row"; type: "int" } - } - } -} diff --git a/src/imports/timedatesettings/qmldir b/src/imports/timedatesettings/qmldir deleted file mode 100644 index 3489ac2..0000000 --- a/src/imports/timedatesettings/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.TimeDateSettings -plugin qmltimedatesettingsplugin -classname TimeDateSettingsQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/imports/timedatesettings/timedatesettings.pro b/src/imports/timedatesettings/timedatesettings.pro deleted file mode 100644 index 7ef6756..0000000 --- a/src/imports/timedatesettings/timedatesettings.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += qml timedatesettings - -CONFIG += no_cxx_module - -TARGET = qmltimedatesettingsplugin -TARGETPATH = QtDeviceUtilities/TimeDateSettings - -SOURCES += plugin.cpp - -load(qml_plugin) diff --git a/src/localdevice/localdevice.pro b/src/localdevice/localdevice.pro deleted file mode 100644 index 9adc183..0000000 --- a/src/localdevice/localdevice.pro +++ /dev/null @@ -1,15 +0,0 @@ -load(qt_build_config) - -TARGET = QtLocalDevice -VERSION = 1.0 - -QT = core - -MODULE = localdevice -load(qt_module) - -HEADERS += \ - $$PWD/qlocaldevice.h - -SOURCES += \ - $$PWD/qlocaldevice.cpp diff --git a/src/localdevice/qlocaldevice.cpp b/src/localdevice/qlocaldevice.cpp deleted file mode 100644 index fc17eae..0000000 --- a/src/localdevice/qlocaldevice.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "qlocaldevice.h" -#include <unistd.h> -#include <sys/reboot.h> - -QT_BEGIN_NAMESPACE - -/*! - \module QtLocalDeviceSettings - \qtvariable localdevice - \ingroup qtdevice-utilities-cpp-modules - \ingroup modules - \title QtLocalDeviceSettings C++ Classes - \brief Provides functionality for controlling a local device settings. - - To use classes from this module, add this directive into the C++ files: - - \code - #include <QtLocalDevice> - \endcode - - To link against the corresponding C++ libraries, add the following to your - qmake project file: - - \code - QT += localdevice - \endcode -*/ - -/*! - \class QLocalDevice - \inmodule QtLocalDeviceSettings - - \brief The QLocalDevice class provides utility functions for controlling an - embedded device. - - The methods in this class enable shutting down and rebooting an embedded - device. -*/ - -/*! - Creates a new local device with the parent \a parent. -*/ -QLocalDevice::QLocalDevice(QObject *parent) - : QObject(parent) -{ -} - -/*! - Deletes the local device. -*/ -QLocalDevice::~QLocalDevice() -{ -} - -/*! - * Reboots the system. Does not return. - * - * \sa powerOff() - */ -void QLocalDevice::reboot() -{ - sync(); - ::reboot(RB_AUTOBOOT); - qWarning("reboot returned"); -} - - -/*! - * Shuts down the system. Does not return. - * - * \sa reboot() - */ -void QLocalDevice::powerOff() -{ - sync(); - ::reboot(RB_POWER_OFF); - qWarning("powerOff returned"); -} - -QT_END_NAMESPACE diff --git a/src/localdevice/qlocaldevice.h b/src/localdevice/qlocaldevice.h deleted file mode 100644 index 4a0071a..0000000 --- a/src/localdevice/qlocaldevice.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QLOCALDEVICE_H -#define QLOCALDEVICE_H - -#include <qobject.h> - -QT_BEGIN_NAMESPACE - -class Q_DECL_EXPORT QLocalDevice : public QObject -{ - Q_OBJECT - -public: - QLocalDevice(QObject *parent = Q_NULLPTR); - ~QLocalDevice(); - -public Q_SLOTS: - void reboot(); - void powerOff(); -}; - -QT_END_NAMESPACE - -#endif // QLOCALDEVICE_H diff --git a/src/localesettings/locale.xml b/src/localesettings/locale.xml deleted file mode 100644 index b722456..0000000 --- a/src/localesettings/locale.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<node name="/Service" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> -<node> - <interface name="org.freedesktop.locale1"> - <property name="Locale" type="as" access="read"/> - <method name="SetLocale"> - <arg name="locale" type="as" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - </interface> -</node> - diff --git a/src/localesettings/localefiltermodel.cpp b/src/localesettings/localefiltermodel.cpp deleted file mode 100644 index e3eecd4..0000000 --- a/src/localesettings/localefiltermodel.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "localemodel.h" -#include "localefiltermodel.h" - -QT_BEGIN_NAMESPACE - -/*! - \module QtLocaleSettings - \qtvariable localesettings - \ingroup qtdevice-utilities-cpp-modules - \ingroup modules - \title Qt Locale Settings C++ Classes - \brief Provides functionality for controlling locale settings. - - To use classes from this module, add this directive into the C++ files: - - \code - #include <QtLocaleSettings> - \endcode - - To link against the corresponding C++ libraries, add the following to your - qmake project file: - - \code - QT += localesettings - \endcode -*/ - -/*! - \class LocaleFilterModel - \inmodule QtLocaleSettings - - \brief The LocaleFilterModel class provides a filtered model for the - available locales. - - This class can be used as the model in a view that lists the available - locales. - - \sa LocaleModel -*/ - -/*! - \property LocaleFilterModel::filter - \brief Holds a string that filters out the locales in the model. - - The filtering process is a case-insensitive matching for whether the region - (country) name contains this string. The string can be taken from user - input. - - \sa LocaleItem::country -*/ - -/*! - Creates a locale filer model with the parent \a parent. -*/ -LocaleFilterModel::LocaleFilterModel(QObject* parent) - :QSortFilterProxyModel(parent) -{ - connect(this, &LocaleFilterModel::filterChanged, this, &LocaleFilterModel::invalidate); - LocaleModel *localeModel = new LocaleModel(this); - setSourceModel(localeModel); -} - -/*! - Deletes the locale filter model. -*/ -LocaleFilterModel::~LocaleFilterModel() -{ - -} - -/*! - Returns the locale filter string. -*/ -QString LocaleFilterModel::filter() const -{ - return m_filter; -} - -/*! - Sets the locale filter string to \a aFilter. -*/ -void LocaleFilterModel::setFilter(const QString& aFilter) -{ - m_filter = aFilter; - emit filterChanged(); -} - -/*! - Returns whether the row \a source_row has the country role and whether it is - found in the locale model \a source_parent. -*/ -bool LocaleFilterModel::filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const -{ - bool ret = false; - if (this->sourceModel()) - { - QModelIndex index = this->sourceModel()->index( source_row, 0, source_parent ); - if (index.isValid()) - { - QVariant nameRole = index.data(LocaleModel::Country); - if (nameRole.isValid()) - { - QString name = nameRole.toString(); - if (name.contains(m_filter, Qt::CaseInsensitive)) { - ret = true; - } - } - } - } - return ret; -} - -/*! - Returns the locale item at \a row in the locale filter model. - - This item can be assigned to LocaleManager::locale(), when the user selects - a locale from a list. - - \sa LocaleItem -*/ -QVariant LocaleFilterModel::itemFromRow(const int row) const -{ - QModelIndex idx = index(row, 0); - QModelIndex mapped = mapToSource(idx); - if (mapped.isValid()) - { - QVariant nameRole = mapped.data(LocaleModel::Code); - if (nameRole.isValid()) - { - return nameRole; - } - } - return QVariant(); -} - -/*! - Returns the index for the country \a country in the locale filter model. - - The index is used by item views, delegates, and selection models to locate - an item in the model. -*/ -int LocaleFilterModel::indexForCountry(const QString &country) const -{ - QAbstractItemModel *model = this->sourceModel(); - LocaleModel *localModel = qobject_cast<LocaleModel*>(model); - QModelIndex i = localModel->indexForCountry(country); - QModelIndex ret = mapFromSource(i); - return ret.row(); -} - -QT_END_NAMESPACE diff --git a/src/localesettings/localefiltermodel.h b/src/localesettings/localefiltermodel.h deleted file mode 100644 index 1ddcb9c..0000000 --- a/src/localesettings/localefiltermodel.h +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef LOCALEFILTERMODEL_H -#define LOCALEFILTERMODEL_H - - -#include <QSortFilterProxyModel> - -QT_BEGIN_NAMESPACE - -class Q_DECL_EXPORT LocaleFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) -public: - explicit LocaleFilterModel(QObject* parent); - virtual ~LocaleFilterModel(); - bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const override; - QString filter() const; - void setFilter(const QString& aFilter); - Q_INVOKABLE QVariant itemFromRow(const int row) const; - Q_INVOKABLE int indexForCountry(const QString &country) const; -Q_SIGNALS: - void filterChanged(); -private: - QString m_filter; - -}; - -QT_END_NAMESPACE - -#endif // LOCALEFILTERMODEL_H diff --git a/src/localesettings/localemodel.cpp b/src/localesettings/localemodel.cpp deleted file mode 100644 index 043376a..0000000 --- a/src/localesettings/localemodel.cpp +++ /dev/null @@ -1,324 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QLocale> -#include <QFuture> -#include <QFutureWatcher> -#include <QThread> -#include <QtConcurrent/QtConcurrentRun> -#include "localemodel.h" - -QT_BEGIN_NAMESPACE - -/*! - \class LocaleItem - \inmodule QtLocaleSettings - - \brief The LocaleItem class represents a locale. - - This class holds the name, language, and country code of a locale. - - If available, the native country name and language are used. For example, - \e Deutsch and \e Deutschland for the German locale. - - \sa QLocale, LocaleModel -*/ - -/*! - \property LocaleItem::code - \brief The locale code string. - - The locale code is in the format \e language_country, where \e language is - a lowercase, two-letter ISO 639 language code, and \e country is an - uppercase, two- or three-letter ISO 3166 country code. - - \sa QLocale::name() -*/ - -/*! - \property LocaleItem::country - \brief The name of the country. - - \sa QLocale::Country -*/ - -/*! - \property LocaleItem::language - \brief The name of the language. - - \sa QLocale::Language -*/ - - -/*! - Creates the locale item \a locale with the parent \a parent. -*/ -LocaleItem::LocaleItem(const QLocale& locale, QObject *parent) - :QObject(parent) -{ - m_code = locale.name(); - m_country = locale.nativeCountryName(); - if (m_country.isEmpty()) { - m_country = locale.countryToString(locale.country()); - } - - m_language = locale.nativeLanguageName(); - if (m_language.isEmpty()) { - m_language = locale.languageToString(locale.language()); - } -} - -/*! - Returns the language of the country. -*/ -QString LocaleItem::language() const -{ - return m_language; -} - -/*! - Returns the name of the country. -*/ -QString LocaleItem::country() const -{ - return m_country; -} - -/*! - Returns the country code of the country. -*/ -QString LocaleItem::code() const -{ - return m_code; -} - -/*! - \class LocaleModel - \inmodule QtLocaleSettings - - \brief The LocaleModel class provides a model for the available locales. - - Each item in the model has a set of data elements associated with it, each - with its own role. The roles are used by the view to indicate to the model - which type of data it needs. Custom models should return data in these - types. - - The data in a locale model can be filtered according to the country code, - name, or language. - - \sa LocaleItem, LocaleFilterModel -*/ - -/*! - \enum LocaleModel::Roles - - This enum holds the role of the locale item. - - For user roles, it is up to the developer to decide which types to use and - ensure that components use the correct types when accessing and setting - data. - - \value Language - The language of the country. - \value Country - The name of the country. - \value Code - The locale code string in the format \e language_country. - - \sa Qt::UserRole -*/ - -/*! - \fn LocaleModel::addItem(LocaleItem* item) - - This signal is emitted when the locale item \a item is added to the locale - model. -*/ - -/*! - \fn LocaleModel::ready() - - This signal is emitted when the locale model has been reset. -*/ - -/*! - Creates a locale model with the parent \a parent. -*/ -LocaleModel::LocaleModel(QObject *parent) - : QAbstractListModel(parent) -{ - m_roleNames.insert(Qt::UserRole, "modelData"); - m_roleNames.insert(Country, "country"); - m_roleNames.insert(Language, "language"); - m_roleNames.insert(Code, "code"); - - QFutureWatcher<void> *watcher = new QFutureWatcher<void>(this); - QFuture<void> future = QtConcurrent::run(LocaleModel::generateModel, this); - watcher->setFuture(future); - connect(watcher, SIGNAL(finished()), this, SLOT(modelReady())); -} - -/*! - This signal is emitted when the locale model has been reset. -*/ -void LocaleModel::modelReady() -{ - beginResetModel(); - sort(0); - endResetModel(); - - emit ready(); -} - -/*! - Creates the locale model \a model. -*/ -void LocaleModel::generateModel(LocaleModel* model) -{ - QList<QLocale> allLocales = QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry); - - for (const QLocale &locale : allLocales) { - if (locale.name() != QStringLiteral("C")) { - LocaleItem *l = new LocaleItem(locale); - l->moveToThread(model->thread()); - QMetaObject::invokeMethod(model, "addNewItem", Q_ARG( QObject*, qobject_cast<QObject*>(l))); - } - } -} - -void LocaleModel::addNewItem(QObject *item) -{ - beginInsertRows(QModelIndex(), m_items.count(), m_items.count()); - LocaleItem* newItem = qobject_cast<LocaleItem*>(item); - if (newItem) - m_items.append(newItem); - endInsertRows(); -} - -/*! - Deletes the locale model. -*/ -LocaleModel::~LocaleModel() -{ - qDeleteAll(m_items); -} - -/*! - Returns an array of user roles. - - \sa Roles -*/ -QHash<int, QByteArray> LocaleModel::roleNames() const -{ - return m_roleNames; -} - -/*! - Returns the number of rows in the locale model that has \a parent. -*/ -int LocaleModel::rowCount(const QModelIndex & parent) const -{ - Q_UNUSED(parent); - return m_items.count(); -} - -/*! - Returns the locale item at \a index in the locale model for \a role. - - This item can be assigned to LocaleManager::locale(), when the user selects - a locale from a list. - - \sa LocaleItem, Roles -*/ -QVariant LocaleModel::data(const QModelIndex & index, int role) const -{ - if (!index.isValid()) return QVariant(); - - LocaleItem *item = m_items[index.row()]; - - switch (role) { - case Qt::UserRole: - return QVariant::fromValue(static_cast<QObject*>(item)); - break; - case Country: - return item->country(); - break; - case Language: - return item->language(); - break; - case Code: - return item->code(); - break; - default: - return QVariant(); - } -} - -/*! - Returns whether the locale item has more than one languages specified. - - If the language variant of the locale item if \a v1 is less than \a v2 ##? - -*/ -bool LocaleModel::variantLessThan(const LocaleItem* v1, const LocaleItem* v2) -{ - return v1->language() < v2->language(); -} - -/*! - Sets the sorting order of the \a column items in the locale model to \a order. - - The sort order can be either \l {Qt::AscendingOrder}{ascending} or - \l {Qt::DescendingOrder}{descending}. -*/ -void LocaleModel::sort(int column, Qt::SortOrder order) -{ - Q_UNUSED(column); - Q_UNUSED(order); - std::sort(m_items.begin(), m_items.end(), LocaleModel::variantLessThan); -} - -/*! - Returns the index for the country \a country in the locale model. - - The index is used by item views, delegates, and selection models to locate - an item in the model. -*/ -QModelIndex LocaleModel::indexForCountry(const QString &country) const -{ - for (int i = 0; i < m_items.count(); i++) { - LocaleItem *item = m_items.at(i); - if (item->country() == country || - item->language() == country) { - return index(i); - } - } - return QModelIndex(); -} - -QT_END_NAMESPACE diff --git a/src/localesettings/localemodel.h b/src/localesettings/localemodel.h deleted file mode 100644 index fac0b94..0000000 --- a/src/localesettings/localemodel.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef LOCALEMODEL_H -#define LOCALEMODEL_H - -#include <QObject> -#include <QAbstractListModel> -#include <QLocale> -#include <QMutex> - -QT_BEGIN_NAMESPACE - -class LocaleItem : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString code READ code CONSTANT) - Q_PROPERTY(QString country READ country CONSTANT) - Q_PROPERTY(QString language READ language CONSTANT) -public: - explicit LocaleItem(const QLocale &locale, QObject *parent = Q_NULLPTR); - QString country() const; - QString language() const; - QString code() const; - -private: - QString m_country; - QString m_language; - QString m_code; -}; - -class Q_DECL_EXPORT LocaleModel : public QAbstractListModel -{ - Q_OBJECT - -public: - explicit LocaleModel(QObject *parent = Q_NULLPTR); - virtual ~LocaleModel(); - // from QAbstractItemModel - int rowCount(const QModelIndex & parent = QModelIndex()) const; - QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - QHash<int, QByteArray> roleNames() const; - void sort(int column, Qt::SortOrder order=Qt::AscendingOrder); - static bool variantLessThan(const LocaleItem* v1, const LocaleItem* v2); - QModelIndex indexForCountry(const QString &country) const; - - enum Roles { - Language = Qt::UserRole + 1, - Country, - Code - }; - - static void generateModel(LocaleModel* model); - -Q_SIGNALS: - void addItem(LocaleItem* item); - void ready(); - -private Q_SLOTS: - void addNewItem(QObject* item); - void modelReady(); - -private: - QList<LocaleItem*> m_items; - QHash<int, QByteArray> m_roleNames; -}; - -QT_END_NAMESPACE - -#endif // LOCALEMODEL_H diff --git a/src/localesettings/localesettings.pro b/src/localesettings/localesettings.pro deleted file mode 100644 index 7f5f98a..0000000 --- a/src/localesettings/localesettings.pro +++ /dev/null @@ -1,21 +0,0 @@ -load(qt_build_config) - -TARGET = QtLocaleSettings -VERSION = 1.0 - -QT = core dbus - -MODULE = localesettings -load(qt_module) - -DBUS_INTERFACES = locale.xml - -HEADERS = \ - systemlocale.h \ - systemlocale_p.h \ - localemodel.h \ - localefiltermodel.h -SOURCES += systemlocale.cpp \ - localemodel.cpp \ - localefiltermodel.cpp - diff --git a/src/localesettings/systemlocale.cpp b/src/localesettings/systemlocale.cpp deleted file mode 100644 index e6de431..0000000 --- a/src/localesettings/systemlocale.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QLocale> -#include "systemlocale.h" -#include "systemlocale_p.h" - -QT_BEGIN_NAMESPACE - -SystemLocale::SystemLocale(QObject *parent) - :QObject(parent) - ,d_ptr(new SystemLocalePrivate(this)) -{ -} - -QString SystemLocale::locale() const -{ - Q_D(const SystemLocale); - return d->locale(); -} - -void SystemLocale::setLocale(const QString& aLocale) -{ - Q_D(SystemLocale); - d->setLocale(aLocale); - emit localeChanged(); -} - -QT_END_NAMESPACE diff --git a/src/localesettings/systemlocale.h b/src/localesettings/systemlocale.h deleted file mode 100644 index b10c5a1..0000000 --- a/src/localesettings/systemlocale.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef LOCALE_H -#define LOCALE_H - -#include <QObject> - -QT_BEGIN_NAMESPACE - -class SystemLocalePrivate; - -class Q_DECL_EXPORT SystemLocale : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString locale READ locale WRITE setLocale NOTIFY localeChanged) -public: - explicit SystemLocale(QObject *parent = Q_NULLPTR); - QString locale() const; - void setLocale(const QString& aLocale); -Q_SIGNALS: - void localeChanged(); -public Q_SLOTS: - -protected: - SystemLocalePrivate *d_ptr; - - Q_DISABLE_COPY(SystemLocale) - Q_DECLARE_PRIVATE(SystemLocale) -}; - -QT_END_NAMESPACE - -#endif // LOCALE_H diff --git a/src/localesettings/systemlocale_p.h b/src/localesettings/systemlocale_p.h deleted file mode 100644 index a3d1a5f..0000000 --- a/src/localesettings/systemlocale_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef LOCALE_P_H -#define LOCALE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "systemlocale.h" -#include "locale_interface.h" - -QT_BEGIN_NAMESPACE - -class SystemLocalePrivate -{ - Q_DECLARE_PUBLIC(SystemLocale) -public: - SystemLocalePrivate(SystemLocale *qq) - :q_ptr(qq) - { - m_localeInterface = new OrgFreedesktopLocale1Interface(QStringLiteral("org.freedesktop.locale1"), - QStringLiteral("/org/freedesktop/locale1"), - QDBusConnection::systemBus(), qq); - - QStringList locale = m_localeInterface->locale(); - foreach (QString l, locale) { - QStringList nameValue = l.split('='); - if (nameValue.length() == 2) - m_localeCache[nameValue.at(0)] = nameValue.at(1); - } - } - - QString locale() const { - return m_localeCache[QStringLiteral("LANG")]; - } - - void setLocale(const QString& aLocale) { - m_localeCache[QStringLiteral("LANG")] = aLocale; - updateLocale(); - } - - void updateLocale() { - QStringList newLocale; - QMap<QString, QString>::iterator i; - for (i = m_localeCache.begin(); i != m_localeCache.end(); ++i) { - QString val = i.key() + QLatin1String("=") + i.value(); - newLocale.append(val); - } - m_localeInterface->SetLocale(newLocale, true); - } - - -private: - QMap<QString, QString> m_localeCache; - OrgFreedesktopLocale1Interface *m_localeInterface; - SystemLocale *q_ptr; -}; - -QT_END_NAMESPACE - -#endif // LOCALE_P_H diff --git a/src/networksettings/CMakeLists.txt b/src/networksettings/CMakeLists.txt new file mode 100644 index 0000000..03e43f4 --- /dev/null +++ b/src/networksettings/CMakeLists.txt @@ -0,0 +1,38 @@ +# Generated from networksettings.pro. + +##################################################################### +## NetworkSettings Module: +##################################################################### + +qt_internal_add_module(NetworkSettings + SOURCES + connman/connmancommon.cpp connman/connmancommon.h + connman/qnetworksettingsinterface_p.cpp connman/qnetworksettingsinterface_p.h + connman/qnetworksettingsmanager_p.cpp connman/qnetworksettingsmanager_p.h + connman/qnetworksettingsservice_p.cpp connman/qnetworksettingsservice_p.h + connman/qnetworksettingsuseragent_p.cpp connman/qnetworksettingsuseragent_p.h + qnetworksettings.cpp qnetworksettings.h + qnetworksettingsaddressmodel.cpp qnetworksettingsaddressmodel.h + qnetworksettingsinterface.cpp qnetworksettingsinterface.h + qnetworksettingsinterfacemodel.cpp qnetworksettingsinterfacemodel.h + qnetworksettingsmanager.cpp qnetworksettingsmanager.h + qnetworksettingsservice.cpp qnetworksettingsservice.h + qnetworksettingsservicemodel.cpp qnetworksettingsservicemodel.h + qnetworksettingsuseragent.cpp qnetworksettingsuseragent.h + qnetworksettingsglobal.h + DBUS_INTERFACE_SOURCES + connman/connman_manager.xml + connman/connman_service.xml + connman/connman_technology.xml + DBUS_INTERFACE_FLAGS # special case + -iconnmancommon.h # special case + INCLUDE_DIRECTORIES + connman + PUBLIC_LIBRARIES + Qt::Core + Qt::DBus + Qt::Network + GENERATE_CPP_EXPORTS +) + +file(MAKE_DIRECTORY header_connman) diff --git a/src/networksettings/connman.pri b/src/networksettings/connman.pri deleted file mode 100644 index 957f2f0..0000000 --- a/src/networksettings/connman.pri +++ /dev/null @@ -1,22 +0,0 @@ -QT += core network dbus - -INCLUDEPATH += $${PWD}/connman - -DBUS_INTERFACES = \ - connman/connman_manager.xml \ - connman/connman_service.xml \ - connman/connman_technology.xml - -SOURCES += \ - $$PWD/connman/qnetworksettingsinterface_p.cpp \ - $$PWD/connman/qnetworksettingsservice_p.cpp \ - $$PWD/connman/qnetworksettingsuseragent_p.cpp \ - $$PWD/connman/qnetworksettingsmanager_p.cpp \ - $$PWD/connman/connmancommon.cpp - -HEADERS += \ - $$PWD/connman/qnetworksettingsinterface_p.h \ - $$PWD/connman/qnetworksettingsservice_p.h \ - $$PWD/connman/qnetworksettingsuseragent_p.h \ - $$PWD/connman/qnetworksettingsmanager_p.h \ - $$PWD/connman/connmancommon.h diff --git a/src/networksettings/connman/connman_manager.xml b/src/networksettings/connman/connman_manager.xml index 95bc0cb..ba95e8b 100644 --- a/src/networksettings/connman/connman_manager.xml +++ b/src/networksettings/connman/connman_manager.xml @@ -80,7 +80,7 @@ <signal name="TechnologyAdded" tp:name-for-bindings="Technology_Added"> <arg name="technology" type="o"/> <arg name="properties" type="a{sv}"/> - <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="QVariantMap"/> + <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="QVariantMap"/> </signal> <signal name="TechnologyRemoved" tp:name-for-bindings="Technology_Removed"> diff --git a/src/networksettings/connman/connmancommon.cpp b/src/networksettings/connman/connmancommon.cpp index 887af48..a77bb1d 100644 --- a/src/networksettings/connman/connmancommon.cpp +++ b/src/networksettings/connman/connmancommon.cpp @@ -28,6 +28,8 @@ ****************************************************************************/ #include "connmancommon.h" +#include <QtNetworkSettings/qnetworksettings.h> + QT_BEGIN_NAMESPACE //Conversion operations for datatypes diff --git a/src/networksettings/connman/connmancommon.h b/src/networksettings/connman/connmancommon.h index 3c8aa67..3b3cb79 100644 --- a/src/networksettings/connman/connmancommon.h +++ b/src/networksettings/connman/connmancommon.h @@ -30,10 +30,9 @@ #define CONNMANCOMMON_H #include <QtCore/QMetaType> -#include <QtDBus> -#include <QtNetworkSettings/qnetworksettings.h> +#include <QtDBus/QtDBus> -#define AgentPath "/ConnmanAgent" +#define PropertyAgentPath QStringLiteral("/ConnmanAgent") #define PropertyState QStringLiteral("State") #define PropertyName QStringLiteral("Name") #define PropertyType QStringLiteral("Type") @@ -54,6 +53,9 @@ QT_BEGIN_NAMESPACE +class QNetworkSettingsType; +class QNetworkSettingsState; + struct ConnmanMapStruct { QDBusObjectPath objectPath; QVariantMap propertyMap; diff --git a/src/networksettings/connman/qnetworksettingsinterface_p.cpp b/src/networksettings/connman/qnetworksettingsinterface_p.cpp index 5f008ff..eeb2abc 100644 --- a/src/networksettings/connman/qnetworksettingsinterface_p.cpp +++ b/src/networksettings/connman/qnetworksettingsinterface_p.cpp @@ -27,7 +27,6 @@ ** ****************************************************************************/ #include "qnetworksettingsinterface_p.h" -#include "qnetworksettingsinterface.h" #include "connman_technology_interface.h" #include "connmancommon.h" @@ -35,10 +34,9 @@ QT_BEGIN_NAMESPACE QNetworkSettingsInterfacePrivate::QNetworkSettingsInterfacePrivate(QNetworkSettingsInterface* parent) : QObject(parent) - , m_technology(Q_NULLPTR) + , m_technology(nullptr) ,q_ptr(parent) { - } void QNetworkSettingsInterfacePrivate::initialize(const QString& path, const QVariantMap& properties) @@ -83,7 +81,7 @@ void QNetworkSettingsInterfacePrivate::updateProperty(const QString &name, const } } -void QNetworkSettingsInterfacePrivate::setState(QNetworkSettingsState::States aState) +void QNetworkSettingsInterfacePrivate::setState(QNetworkSettingsState::State aState) { Q_Q(QNetworkSettingsInterface); m_state.setState(aState); diff --git a/src/networksettings/connman/qnetworksettingsinterface_p.h b/src/networksettings/connman/qnetworksettingsinterface_p.h index d85712a..25fbd2d 100644 --- a/src/networksettings/connman/qnetworksettingsinterface_p.h +++ b/src/networksettings/connman/qnetworksettingsinterface_p.h @@ -41,10 +41,11 @@ // #include <QObject> -#include <QtDBus> +#include <QtDBus/QDBusVariant> #include "qnetworksettings.h" #include "qnetworksettingsinterface.h" +// Automatically generated class in global namespace class NetConnmanTechnologyInterface; QT_BEGIN_NAMESPACE @@ -57,11 +58,11 @@ public: explicit QNetworkSettingsInterfacePrivate(QNetworkSettingsInterface* parent); void initialize(const QString& path, const QVariantMap& properties); void setPowered(const bool power); - void setState(QNetworkSettingsState::States aState); + void setState(QNetworkSettingsState::State aState); void scan(); QString name() const {return m_name;} - QNetworkSettingsType::Types type() const {return m_type.type();} - QNetworkSettingsState::States state() const {return m_state.state();} + QNetworkSettingsType::Type type() const {return m_type.type();} + QNetworkSettingsState::State state() const {return m_state.state();} bool powered() const {return m_powered;} QString path() const; @@ -84,21 +85,19 @@ class ConnmanSettingsInterface : public QNetworkSettingsInterface { Q_OBJECT public: - ConnmanSettingsInterface(const QString& path, const QVariantMap& properties, QObject *parent = Q_NULLPTR) + ConnmanSettingsInterface(const QString& path, const QVariantMap& properties, QObject *parent = nullptr) :QNetworkSettingsInterface(parent) { if (d_ptr) d_ptr->initialize(path, properties); } - void setState(QNetworkSettingsState::States aState) { + void setState(QNetworkSettingsState::State aState) { Q_D(QNetworkSettingsInterface); d->setState(aState); } - virtual ~ConnmanSettingsInterface() { - - } + virtual ~ConnmanSettingsInterface() {} QString path() const { if (d_ptr) diff --git a/src/networksettings/connman/qnetworksettingsmanager_p.cpp b/src/networksettings/connman/qnetworksettingsmanager_p.cpp index 5bea9e2..94eec14 100644 --- a/src/networksettings/connman/qnetworksettingsmanager_p.cpp +++ b/src/networksettings/connman/qnetworksettingsmanager_p.cpp @@ -26,13 +26,12 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "qnetworksettingsservice.h" #include "qnetworksettingsmanager_p.h" -#include "connman_manager_interface.cpp" -#include "moc_connman_manager_interface.cpp" -#include "qnetworksettingsinterface.h" #include "qnetworksettingsinterface_p.h" #include "qnetworksettingsservicemodel.h" #include "qnetworksettingsuseragent.h" +#include "moc_connman_manager_interface.cpp" QT_BEGIN_NAMESPACE @@ -41,16 +40,18 @@ const QString ConnManServiceName(QStringLiteral("net.connman")); QNetworkSettingsManagerPrivate::QNetworkSettingsManagerPrivate(QNetworkSettingsManager *parent) :QObject(parent) ,q_ptr(parent) - , m_interfaceModel(Q_NULLPTR) - , m_serviceModel(Q_NULLPTR) - , m_serviceFilter(Q_NULLPTR) - , m_manager(Q_NULLPTR) - , m_agent(Q_NULLPTR) - , m_serviceWatcher(Q_NULLPTR) - , m_currentWifiConnection(Q_NULLPTR) - , m_currentWiredConnection(Q_NULLPTR) + , m_interfaceModel(nullptr) + , m_serviceModel(nullptr) + , m_serviceFilter(nullptr) + , m_manager(nullptr) + , m_agent(nullptr) + , m_serviceWatcher(nullptr) + , m_currentWifiConnection(nullptr) + , m_currentWiredConnection(nullptr) , m_initialized(false) { + qRegisterMetaType<ConnmanMapStruct>("ConnmanMapStruct"); + qRegisterMetaType<ConnmanMapStructList>("ConnmanMapStructList"); qDBusRegisterMetaType<ConnmanMapStruct>(); qDBusRegisterMetaType<ConnmanMapStructList>(); @@ -97,7 +98,7 @@ bool QNetworkSettingsManagerPrivate::initialize() connect(m_manager, &NetConnmanManagerInterface::TechnologyAdded, this, &QNetworkSettingsManagerPrivate::onTechnologyAdded); connect(m_manager, &NetConnmanManagerInterface::TechnologyRemoved, this, &QNetworkSettingsManagerPrivate::onTechnologyRemoved); - m_manager->RegisterAgent(QDBusObjectPath(AgentPath)); + m_manager->RegisterAgent(QDBusObjectPath(PropertyAgentPath)); m_initialized = true; } else { delete m_manager; @@ -137,8 +138,7 @@ void QNetworkSettingsManagerPrivate::tryNextConnection() } if (!service) { if (!m_unnamedServicesForSsidConnection.isEmpty()) { - service = *m_unnamedServicesForSsidConnection.begin(); - m_unnamedServicesForSsidConnection.erase(m_unnamedServicesForSsidConnection.begin()); + service = m_unnamedServicesForSsidConnection.take(m_unnamedServicesForSsidConnection.firstKey()); } else { q->clearConnectionState(); } @@ -148,6 +148,26 @@ void QNetworkSettingsManagerPrivate::tryNextConnection() } } +void QNetworkSettingsManagerPrivate::setCurrentWifiConnection(QNetworkSettingsService *connection) +{ + m_currentWifiConnection = connection; +} + +QNetworkSettingsService *QNetworkSettingsManagerPrivate::currentWifiConnection() const +{ + return m_currentWifiConnection.data(); +} + +void QNetworkSettingsManagerPrivate::setCurrentWiredConnection(QNetworkSettingsService *connection) +{ + m_currentWiredConnection = connection; +} + +QNetworkSettingsService *QNetworkSettingsManagerPrivate::currentWiredConnection() const +{ + return m_currentWiredConnection.data(); +} + void QNetworkSettingsManagerPrivate::onConnmanServiceRegistered(const QString &serviceName) { if (serviceName == ConnManServiceName) { @@ -160,31 +180,34 @@ void QNetworkSettingsManagerPrivate::onTechnologyAdded(const QDBusObjectPath &te { Q_Q(QNetworkSettingsManager); - foreach (QNetworkSettingsInterface* item, m_interfaceModel.getModel()) { - ConnmanSettingsInterface* tech = qobject_cast<ConnmanSettingsInterface*>(item); - if (tech->path() != technology.path()) { - ConnmanSettingsInterface *interface = new ConnmanSettingsInterface(technology.path(), properties, this); - interface->scanServices(); - - if (interface->type() == QNetworkSettingsType::Wired) { - m_interfaceModel.insert(0, interface); - } - else if (interface->type() == QNetworkSettingsType::Wifi) { - m_interfaceModel.append(interface); - } - emit q->interfacesChanged(); + for (QNetworkSettingsInterface* item : m_interfaceModel.getModel()) { + ConnmanSettingsInterface* interface = qobject_cast<ConnmanSettingsInterface*>(item); + if (interface->path() == technology.path()) { + return; // we already know the interface/technology } } + + ConnmanSettingsInterface *interface = new ConnmanSettingsInterface(technology.path(), properties, this); + interface->scanServices(); + + if (interface->type() == QNetworkSettingsType::Wired) { + m_interfaceModel.insert(0, interface); + } + else if (interface->type() == QNetworkSettingsType::Wifi) { + m_interfaceModel.append(interface); + } + + emit q->interfacesChanged(); } void QNetworkSettingsManagerPrivate::onTechnologyRemoved(const QDBusObjectPath &technology) { Q_Q(QNetworkSettingsManager); - foreach (QNetworkSettingsInterface* item, m_interfaceModel.getModel()) { + for (QNetworkSettingsInterface* item : m_interfaceModel.getModel()) { ConnmanSettingsInterface* tech = qobject_cast<ConnmanSettingsInterface*>(item); if (tech->path() == technology.path()) { - m_interfaceModel.removeInterface(technology.path()); + m_interfaceModel.removeInterface(tech->name()); emit q->interfacesChanged(); } } @@ -198,7 +221,7 @@ void QNetworkSettingsManagerPrivate::getServicesFinished(QDBusPendingCallWatcher if (reply.isError()) return; - foreach (const ConnmanMapStruct &object, reply.value()) { + for (const ConnmanMapStruct &object : reply.value()) { const QString servicePath = object.objectPath.path(); handleNewService(servicePath); } @@ -213,7 +236,7 @@ void QNetworkSettingsManagerPrivate::getTechnologiesFinished(QDBusPendingCallWat if (reply.isError()) return; - foreach (const ConnmanMapStruct &object, reply.value()) { + for (const ConnmanMapStruct &object : reply.value()) { ConnmanSettingsInterface *item = new ConnmanSettingsInterface(object.objectPath.path(), object.propertyMap, this); item->scanServices(); @@ -229,21 +252,43 @@ void QNetworkSettingsManagerPrivate::getTechnologiesFinished(QDBusPendingCallWat void QNetworkSettingsManagerPrivate::onServicesChanged(ConnmanMapStructList changed, const QList<QDBusObjectPath> &removed) { - foreach (QDBusObjectPath path, removed) { - m_serviceModel->removeService(path.path()); - auto serviceIter = m_unnamedServices.find(path.path()); - if (serviceIter != m_unnamedServices.end()) { - serviceIter.value()->deleteLater(); - m_unnamedServices.erase(serviceIter); - } + Q_Q(QNetworkSettingsManager); + for (const QDBusObjectPath &dpath : removed) { + QString path = dpath.path(); + + if (m_serviceModel->removeService(path)) + emit q->servicesChanged(); + + if (auto service = m_unnamedServices.take(path)) + if (!service->placeholderState()) { + disconnect(service, &QNetworkSettingsService::nameChanged, + this, &QNetworkSettingsManagerPrivate::serviceReady); + disconnect(service, &QNetworkSettingsService::typeChanged, + this, &QNetworkSettingsManagerPrivate::serviceReady); + service->deleteLater(); + } + if (auto service = m_unknownServices.take(path)) + if (!service->placeholderState()) { + disconnect(service, &QNetworkSettingsService::nameChanged, + this, &QNetworkSettingsManagerPrivate::serviceReady); + disconnect(service, &QNetworkSettingsService::typeChanged, + this, &QNetworkSettingsManagerPrivate::serviceReady); + service->deleteLater(); + } + m_unnamedServicesForSsidConnection.remove(path); // do not delete here } QStringList newServices; - foreach (ConnmanMapStruct map, changed) { + for (const ConnmanMapStruct &map : changed) { + QString path = map.objectPath.path(); + + if (m_unknownServices.contains(path) || m_unnamedServices.contains(path)) + continue; + bool found = false; - foreach (QNetworkSettingsService* service, m_serviceModel->getModel()) { - if (service->id() == map.objectPath.path() && service->placeholderState() == false) { - found =true; + for (QNetworkSettingsService* service : m_serviceModel->getModel()) { + if (service->id() == path && service->placeholderState() == false) { + found = true; break; } } @@ -251,9 +296,10 @@ void QNetworkSettingsManagerPrivate::onServicesChanged(ConnmanMapStructList chan newServices.append(map.objectPath.path()); } - foreach (QString newService, newServices) { + for (QString newService : newServices) { handleNewService(newService); } + } void QNetworkSettingsManagerPrivate::handleNewService(const QString &servicePath) @@ -278,9 +324,20 @@ void QNetworkSettingsManagerPrivate::handleNewService(const QString &servicePath } } else { + bool isUnnamedWifi = false; + //Service name or type not set, wait for update - connect(service, &QNetworkSettingsService::nameChanged, this, &QNetworkSettingsManagerPrivate::serviceReady); - connect(service, &QNetworkSettingsService::typeChanged, this, &QNetworkSettingsManagerPrivate::serviceReady); + if (service->name().isEmpty()) { + connect(service, &QNetworkSettingsService::nameChanged, this, &QNetworkSettingsManagerPrivate::serviceReady); + isUnnamedWifi = (service->type() == QNetworkSettingsType::Wifi); + } + if (service->type() == QNetworkSettingsType::Unknown) + connect(service, &QNetworkSettingsService::typeChanged, this, &QNetworkSettingsManagerPrivate::serviceReady); + + if (isUnnamedWifi) + m_unnamedServices.insert(service->id(), service); + else + m_unknownServices.insert(service->id(), service); } } @@ -295,11 +352,14 @@ void QNetworkSettingsManagerPrivate::serviceReady() QNetworkSettingsService* service = qobject_cast<QNetworkSettingsService*>(sender()); - if (service->type() != QNetworkSettingsType::Unknown - && service->type() == QNetworkSettingsType::Wifi) { + // the type changed from Unknown to Wifi + if ((service->type() == QNetworkSettingsType::Wifi) + && m_unknownServices.contains(service->id())) { + m_unknownServices.remove(service->id()); m_unnamedServices.insert(service->id(), service); } + // we have a name and a length now if (service->name().length() > 0 && service->type() != QNetworkSettingsType::Unknown) { service->disconnect(this); m_unnamedServices.remove(service->id()); @@ -310,13 +370,12 @@ void QNetworkSettingsManagerPrivate::serviceReady() } //Update the interface state accordingly - foreach (QNetworkSettingsInterface* item, m_interfaceModel.getModel()) { + for (QNetworkSettingsInterface* item : m_interfaceModel.getModel()) { ConnmanSettingsInterface* technology = qobject_cast<ConnmanSettingsInterface*>(item); if (technology->name() == service->name() && technology->type() == service->type()) { technology->setState(technology->state()); } } - } } diff --git a/src/networksettings/connman/qnetworksettingsmanager_p.h b/src/networksettings/connman/qnetworksettingsmanager_p.h index 8b5d1a7..0b0c39b 100644 --- a/src/networksettings/connman/qnetworksettingsmanager_p.h +++ b/src/networksettings/connman/qnetworksettingsmanager_p.h @@ -41,20 +41,22 @@ // #include <QObject> -#include <QtDBus> #include <QMap> +#include <QPointer> +#include <QtDBus/QDBusServiceWatcher> #include "connmancommon.h" #include "qnetworksettingsmanager.h" #include "qnetworksettingsinterfacemodel.h" - -// Automatically generated class in global namespace -class NetConnmanManagerInterface; -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsServiceModel) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsServiceFilter) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsService) +#include "connman_manager_interface.h" QT_BEGIN_NAMESPACE +class QDBusObjectPath; +class QDBusPendingCallWatcher; +class QNetworkSettingsService; +class QNetworkSettingsServiceModel; +class QNetworkSettingsServiceFilter; + class QNetworkSettingsManagerPrivate : public QObject { Q_OBJECT @@ -70,10 +72,10 @@ public: void connectBySsid(const QString &name); void clearConnectionState(); void tryNextConnection(); - void setCurrentWifiConnection(QNetworkSettingsService *connection) {m_currentWifiConnection = connection;} - QNetworkSettingsService* currentWifiConnection() const {return m_currentWifiConnection;} - void setCurrentWiredConnection(QNetworkSettingsService *connection) {m_currentWiredConnection = connection;} - QNetworkSettingsService* currentWiredConnection() const {return m_currentWiredConnection;} + void setCurrentWifiConnection(QNetworkSettingsService *connection); + QNetworkSettingsService* currentWifiConnection() const; + void setCurrentWiredConnection(QNetworkSettingsService *connection); + QNetworkSettingsService* currentWiredConnection() const; public slots: void getServicesFinished(QDBusPendingCallWatcher *watcher); @@ -84,12 +86,15 @@ public slots: void onConnmanServiceRegistered(const QString &serviceName); void onTechnologyAdded(const QDBusObjectPath &technology, const QVariantMap &properties); void onTechnologyRemoved(const QDBusObjectPath &technology); + private: bool initialize(); - void handleNewService(const QString& servicePath); + void handleNewService(const QString &servicePath); + protected: QNetworkSettingsInterfaceModel m_interfaceModel; QNetworkSettingsServiceModel *m_serviceModel; + QMap<QString, QNetworkSettingsService*> m_unknownServices; QMap<QString, QNetworkSettingsService*> m_unnamedServices; QMap<QString, QNetworkSettingsService*> m_unnamedServicesForSsidConnection; QNetworkSettingsServiceFilter *m_serviceFilter; @@ -98,8 +103,8 @@ private: QNetworkSettingsUserAgent *m_agent; QDBusServiceWatcher *m_serviceWatcher; QString m_currentSsid; - QNetworkSettingsService *m_currentWifiConnection; - QNetworkSettingsService *m_currentWiredConnection; + QPointer<QNetworkSettingsService> m_currentWifiConnection; + QPointer<QNetworkSettingsService> m_currentWiredConnection; bool m_initialized; }; diff --git a/src/networksettings/connman/qnetworksettingsservice_p.cpp b/src/networksettings/connman/qnetworksettingsservice_p.cpp index 2523e81..082b458 100644 --- a/src/networksettings/connman/qnetworksettingsservice_p.cpp +++ b/src/networksettings/connman/qnetworksettingsservice_p.cpp @@ -438,20 +438,22 @@ void QNetworkSettingsServicePrivate::updateProperty(const QString& key, const QV } else if (key == PropertySecurity) { QStringList value = qdbus_cast<QStringList>(val); - foreach (const QString str, value) { + QNetworkSettingsWireless::Securities securities; + for (const QString &str : value) { if (str == AttributeNone || str == AttributeWps) { - m_wifiConfig.setSecurity(QNetworkSettingsWireless::None); + securities |= QNetworkSettingsWireless::Security::None; } else if (str == AttributeWep) { - m_wifiConfig.setSecurity(QNetworkSettingsWireless::WEP); + securities |= QNetworkSettingsWireless::Security::WEP; } else if (str == AttributePsk) { - m_wifiConfig.setSecurity(QNetworkSettingsWireless::WPA); + securities |=QNetworkSettingsWireless::Security::WPA; } else if (str == AttributeIeee) { - m_wifiConfig.setSecurity(QNetworkSettingsWireless::WPA2); + securities |=QNetworkSettingsWireless::Security::WPA2; } } + m_wifiConfig.setSecurity(securities); } else if (key == PropertyAutoConnect) { m_autoConnect = qdbus_cast<bool>(val); diff --git a/src/networksettings/connman/qnetworksettingsservice_p.h b/src/networksettings/connman/qnetworksettingsservice_p.h index 9190e2d..8c798c3 100644 --- a/src/networksettings/connman/qnetworksettingsservice_p.h +++ b/src/networksettings/connman/qnetworksettingsservice_p.h @@ -43,20 +43,19 @@ #include "qnetworksettingsservice.h" #include "qnetworksettings.h" -QT_FORWARD_DECLARE_CLASS(QDBusPendingCallWatcher) -QT_FORWARD_DECLARE_CLASS(QDBusVariant) - // Automatically generated class in global namespace class NetConnmanServiceInterface; QT_BEGIN_NAMESPACE +class QDBusVariant; +class QDBusPendingCallWatcher; class QNetworkSettingsServicePrivate : public QObject { Q_OBJECT Q_DECLARE_PUBLIC(QNetworkSettingsService) public: - QNetworkSettingsServicePrivate(const QString& aPath, QNetworkSettingsService *parent = Q_NULLPTR); + QNetworkSettingsServicePrivate(const QString& aPath, QNetworkSettingsService *parent = nullptr); QNetworkSettingsService *q_ptr; private slots: diff --git a/src/networksettings/connman/qnetworksettingsuseragent_p.cpp b/src/networksettings/connman/qnetworksettingsuseragent_p.cpp index 5052b74..6ba8be7 100644 --- a/src/networksettings/connman/qnetworksettingsuseragent_p.cpp +++ b/src/networksettings/connman/qnetworksettingsuseragent_p.cpp @@ -26,6 +26,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include <QtDBus/QDBusConnection> + +#include "qnetworksettingsuseragent.h" #include "qnetworksettingsuseragent_p.h" #include "connmancommon.h" @@ -76,7 +79,7 @@ void QNetworkSettingsUserAgentPrivate::ReportError(const QDBusObjectPath &path, void QNetworkSettingsUserAgentPrivate::registerAgent() { Q_Q(QNetworkSettingsUserAgent); - QDBusConnection::systemBus().registerObject(QStringLiteral(AgentPath), q); + QDBusConnection::systemBus().registerObject(PropertyAgentPath, q); } QVariantMap QNetworkSettingsUserAgentPrivate::RequestInput(const QDBusObjectPath &path, const QVariantMap ¶ms, const QDBusMessage &msg) diff --git a/src/networksettings/connman/qnetworksettingsuseragent_p.h b/src/networksettings/connman/qnetworksettingsuseragent_p.h index 31170d3..8f356d9 100644 --- a/src/networksettings/connman/qnetworksettingsuseragent_p.h +++ b/src/networksettings/connman/qnetworksettingsuseragent_p.h @@ -41,26 +41,20 @@ // #include <QtCore/QObject> -#include <QtDBus/QtDBus> -#include "qnetworksettingsuseragent.h" +#include <QtDBus/QDBusMessage> +#include <QtDBus/QDBusObjectPath> +#include <QtDBus/QDBusAbstractAdaptor> QT_BEGIN_NAMESPACE -class QByteArray; -template<class T> class QList; -template<class Key, class Value> class QMap; -class QString; -class QStringList; -class QVariant; - -const QString AgentPath(QStringLiteral("/ConnmanAgent")); +class QNetworkSettingsUserAgent; class QNetworkSettingsUserAgentPrivate : public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "net.connman.Agent") Q_DECLARE_PUBLIC(QNetworkSettingsUserAgent) public: - QNetworkSettingsUserAgentPrivate(QNetworkSettingsUserAgent *parent = Q_NULLPTR); + QNetworkSettingsUserAgentPrivate(QNetworkSettingsUserAgent *parent = nullptr); void setPassphrase(const QString &passphrase); QString passphrase() const {return m_passphrase;} void cancel(); @@ -83,3 +77,4 @@ private: QT_END_NAMESPACE #endif // QNETWORKSETTINGSUSERAGENTPRIVATE_H + diff --git a/src/networksettings/networksettings.pro b/src/networksettings/networksettings.pro deleted file mode 100644 index 78e7573..0000000 --- a/src/networksettings/networksettings.pro +++ /dev/null @@ -1,31 +0,0 @@ -load(qt_build_config) - -TARGET = QtNetworkSettings -VERSION = 1.0 - -QT = core network - -MODULE = networksettings -load(qt_module) -include(connman.pri) - -# Input -SOURCES += \ - qnetworksettingsinterfacemodel.cpp \ - qnetworksettings.cpp \ - qnetworksettingsmanager.cpp \ - qnetworksettingsaddressmodel.cpp \ - qnetworksettingsservicemodel.cpp \ - qnetworksettingsservice.cpp \ - qnetworksettingsuseragent.cpp \ - qnetworksettingsinterface.cpp \ - -HEADERS += \ - qnetworksettingsinterfacemodel.h \ - qnetworksettings.h \ - qnetworksettingsmanager.h \ - qnetworksettingsaddressmodel.h \ - qnetworksettingsservicemodel.h \ - qnetworksettingsservice.h \ - qnetworksettingsuseragent.h \ - qnetworksettingsinterface.h \ diff --git a/src/networksettings/qnetworksettings.cpp b/src/networksettings/qnetworksettings.cpp index e4ddbad..b984835 100644 --- a/src/networksettings/qnetworksettings.cpp +++ b/src/networksettings/qnetworksettings.cpp @@ -44,8 +44,15 @@ QT_BEGIN_NAMESPACE #include <QtNetworkSettings> \endcode - To link against the corresponding C++ libraries, add the following to your - qmake project file: + To link against the corresponding C++ libraries when using CMake to build you application, + add the following to your CMakeLists.txt file: + + \code + find_package(Qt6 COMPONENTS NetworkSettings REQUIRED) + target_link_libraries(mytarget Qt6::NetworkSettings) + \endcode + + Or if you are using qmake to build your application, add the following line to your qmake .pro project file: \code QT += networksettings @@ -63,7 +70,7 @@ QT_BEGIN_NAMESPACE */ /*! - \enum QNetworkSettingsState::States + \enum QNetworkSettingsState::State This enum type holds the state of the network interface. @@ -88,21 +95,21 @@ QT_BEGIN_NAMESPACE \property QNetworkSettingsState::state \brief The state of the network interface. - \sa QNetworkSettingsState::States + \sa QNetworkSettingsState::State */ /*! \fn QNetworkSettingsState::stateChanged() This signal is emitted when the state of the network interface changes. - \sa QNetworkSettingsState::States + \sa QNetworkSettingsState::State */ /*! Creates a new network interface state object with the state \a state and the parent \a parent. */ -QNetworkSettingsState::QNetworkSettingsState(States state, QObject *parent) +QNetworkSettingsState::QNetworkSettingsState(State state, QObject *parent) : QObject(parent) , m_state(state) { @@ -120,14 +127,14 @@ QNetworkSettingsState::QNetworkSettingsState(QObject *parent) /*! Returns the network interface state. */ -QNetworkSettingsState::States QNetworkSettingsState::state() const { +QNetworkSettingsState::State QNetworkSettingsState::state() const { return m_state; } /*! Sets the network interface state to \a state. */ -void QNetworkSettingsState::setState(const States state) { +void QNetworkSettingsState::setState(const State state) { m_state = state; emit stateChanged(); } @@ -143,7 +150,7 @@ void QNetworkSettingsState::setState(const States state) { */ /*! - \enum QNetworkSettingsType::Types + \enum QNetworkSettingsType::Type This enum type holds the type of the network interface. @@ -161,21 +168,21 @@ void QNetworkSettingsState::setState(const States state) { \property QNetworkSettingsType::type \brief The type of the network interface. - \sa QNetworkSettingsType::Types + \sa QNetworkSettingsType::Type */ /*! \fn QNetworkSettingsType::typeChanged() This signal is emitted when the type of the network interface changes. - \sa QNetworkSettingsType::Types + \sa QNetworkSettingsType::Type */ /*! Creates a new network interface type object with the type \a type and parent \a parent. */ -QNetworkSettingsType::QNetworkSettingsType(Types type, QObject *parent) +QNetworkSettingsType::QNetworkSettingsType(Type type, QObject *parent) : QObject(parent) , m_type(type) { @@ -194,14 +201,14 @@ QNetworkSettingsType::QNetworkSettingsType(QObject *parent) /*! Returns the network interface type. */ -QNetworkSettingsType::Types QNetworkSettingsType::type() const { +QNetworkSettingsType::Type QNetworkSettingsType::type() const { return m_type; } /*! Sets the network interface type to \a type. */ -void QNetworkSettingsType::setType(const Types type) { +void QNetworkSettingsType::setType(const Type type) { m_type = type; emit typeChanged(); } @@ -215,7 +222,7 @@ void QNetworkSettingsType::setType(const Types type) { */ /*! - \enum QNetworkSettingsIPv4::MethodType + \enum QNetworkSettingsIPv4::Method This enum type holds the method used for IPv4 configuration. @@ -241,7 +248,7 @@ void QNetworkSettingsType::setType(const Types type) { \property QNetworkSettingsIPv4::method \brief Holds the method of IPv4 configuration. - \sa QNetworkSettingsIPv4::MethodType + \sa QNetworkSettingsIPv4::Method */ /*! @@ -275,11 +282,11 @@ void QNetworkSettingsIPv4::setGateway(const QString& gateway) { emit gatewayChanged(); } -QNetworkSettingsIPv4::MethodType QNetworkSettingsIPv4::method() const { +QNetworkSettingsIPv4::Method QNetworkSettingsIPv4::method() const { return m_method; } -void QNetworkSettingsIPv4::setMethod(const MethodType method) { +void QNetworkSettingsIPv4::setMethod(const Method method) { m_method = method; emit methodChanged(); } @@ -302,7 +309,7 @@ void QNetworkSettingsIPv4::setMask(const QString& mask) { */ /*! - \enum QNetworkSettingsIPv6::MethodType + \enum QNetworkSettingsIPv6::Method This enum type holds the method used for IPv6 configuration. @@ -315,7 +322,7 @@ void QNetworkSettingsIPv4::setMask(const QString& mask) { */ /*! - \enum QNetworkSettingsIPv6::PrivacyType + \enum QNetworkSettingsIPv6::Privacy \brief Holds the method of applying the privacy extensions in IPv6. \value Disabled @@ -342,14 +349,14 @@ void QNetworkSettingsIPv4::setMask(const QString& mask) { \property QNetworkSettingsIPv6::method \brief Holds the method of IPv6 configuration. - \sa QNetworkSettingsIPv6::MethodType + \sa QNetworkSettingsIPv6::Method */ /*! \property QNetworkSettingsIPv6::privacy \brief Holds the method of applying privacy extensions for IPv6. - \sa QNetworkSettingsIPv6::PrivacyType + \sa QNetworkSettingsIPv6::Privacy */ /*! @@ -384,20 +391,20 @@ void QNetworkSettingsIPv6::setGateway(const QString& gateway) { emit gatewayChanged(); } -QNetworkSettingsIPv6::MethodType QNetworkSettingsIPv6::method() const { +QNetworkSettingsIPv6::Method QNetworkSettingsIPv6::method() const { return m_method; } -void QNetworkSettingsIPv6::setMethod(const MethodType method) { +void QNetworkSettingsIPv6::setMethod(const Method method) { m_method = method; emit methodChanged(); } -QNetworkSettingsIPv6::PrivacyType QNetworkSettingsIPv6::privacy() const { +QNetworkSettingsIPv6::Privacy QNetworkSettingsIPv6::privacy() const { return m_privacy; } -void QNetworkSettingsIPv6::setPrivacy(const PrivacyType privacy) { +void QNetworkSettingsIPv6::setPrivacy(const Privacy privacy) { m_privacy = privacy; emit privacyChanged(); } @@ -420,7 +427,7 @@ void QNetworkSettingsIPv6::setPrefixLength(const int& prefixLength) { */ /*! - \enum QNetworkSettingsProxy::MethodType + \enum QNetworkSettingsProxy::Method \brief Holds the network proxy configuration method. \value Direct @@ -437,7 +444,7 @@ void QNetworkSettingsIPv6::setPrefixLength(const int& prefixLength) { \property QNetworkSettingsProxy::method \brief Holds the network proxy configuration method. - \sa MethodType + \sa QNetworkSettingsProxy::Method */ /*! @@ -447,7 +454,7 @@ void QNetworkSettingsIPv6::setPrefixLength(const int& prefixLength) { For manual proxy configuration, this property holds the proxy server address. For automatic configuration, it holds the proxy auto-config URL. - \sa MethodType + \sa QNetworkSettingsProxy::Method */ /*! @@ -530,11 +537,11 @@ void QNetworkSettingsProxy::setExcludes(const QStringList& excludes) { emit excludesChanged(); } -QNetworkSettingsProxy::MethodType QNetworkSettingsProxy::method(void) const { +QNetworkSettingsProxy::Method QNetworkSettingsProxy::method(void) const { return m_method; } -void QNetworkSettingsProxy::setMethod(const MethodType& method) { +void QNetworkSettingsProxy::setMethod(const Method& method) { m_method = method; emit methodChanged(); } @@ -547,7 +554,7 @@ void QNetworkSettingsProxy::setMethod(const MethodType& method) { */ /*! - \enum QNetworkSettingsWireless::SecurityFlags + \enum QNetworkSettingsWireless::Security \brief This enum type holds the wireless security protocol used to protect the connection. @@ -592,15 +599,12 @@ QNetworkSettingsWireless::QNetworkSettingsWireless(QObject* parent) /*! Returns whether the Wifi network supports the wireless security - protocols specified in \a security. + protocol specified in \a security. - \sa QNetworkSettingsWireless::SecurityFlags + \sa QNetworkSettingsWireless::Security */ -bool QNetworkSettingsWireless::supportsSecurity(SecurityFlags security) { - if (m_securityFlags & security) { - return true; - } - return false; +bool QNetworkSettingsWireless::supportsSecurity(Security security) { + return m_supportedSecurites.testFlag(security); } bool QNetworkSettingsWireless::hidden() const { @@ -628,14 +632,10 @@ void QNetworkSettingsWireless::setSignalStrength(const int signalStrength) { } /*! - Sets \a security flags. + Sets \a securities flags. */ -void QNetworkSettingsWireless::setSecurity(const SecurityFlags security) { - if (security == None) { - m_securityFlags = None; - } else { - m_securityFlags |= security; - } +void QNetworkSettingsWireless::setSecurity(const Securities securities) { + m_supportedSecurites = securities; } void QNetworkSettingsWireless::setOutOfRange(const bool aOutOfRange) { diff --git a/src/networksettings/qnetworksettings.h b/src/networksettings/qnetworksettings.h index 84f5899..6006149 100644 --- a/src/networksettings/qnetworksettings.h +++ b/src/networksettings/qnetworksettings.h @@ -29,82 +29,96 @@ #ifndef QNETWORKSETTINGS_H #define QNETWORKSETTINGS_H -#include <QObject> -#include <QUrl> -#include <QVariantMap> +#include <QtNetworkSettings/qnetworksettingsglobal.h> + +#include <QtCore/qobject.h> +#include <QtCore/qurl.h> #include <QtNetworkSettings/qnetworksettingsaddressmodel.h> QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsState : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsState : public QObject { Q_OBJECT - Q_ENUMS(States) - Q_PROPERTY(States state READ state WRITE setState NOTIFY stateChanged) + Q_PROPERTY(State state READ state WRITE setState NOTIFY stateChanged) public: - enum States {Idle, Failure, Association, Configuration, Ready, Disconnect, Online, Undefined}; + enum State { + Idle = 0, + Failure, + Association, + Configuration, + Ready, + Disconnect, + Online, + Undefined + }; + Q_ENUM(State) - explicit QNetworkSettingsState(States state, QObject *parent = Q_NULLPTR); - explicit QNetworkSettingsState(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsState(State state, QObject *parent = nullptr); + explicit QNetworkSettingsState(QObject *parent = nullptr); - States state() const; - void setState(const States state); + State state() const; + void setState(const State state); Q_SIGNALS: void stateChanged(); private: - States m_state; + State m_state; }; -class Q_DECL_EXPORT QNetworkSettingsType : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsType : public QObject { Q_OBJECT - Q_ENUMS(Types) - Q_PROPERTY(Types type READ type WRITE setType NOTIFY typeChanged) + Q_PROPERTY(Type type READ type WRITE setType NOTIFY typeChanged) public: - enum Types { - Wired, + enum Type { + Wired = 0, Wifi, Bluetooth, Unknown }; + Q_ENUM(Type) - explicit QNetworkSettingsType(Types type, QObject *parent = Q_NULLPTR); - explicit QNetworkSettingsType(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsType(Type type, QObject *parent = nullptr); + explicit QNetworkSettingsType(QObject *parent = nullptr); - Types type() const; - void setType(const Types type); + Type type() const; + void setType(const Type type); Q_SIGNALS: void typeChanged(); private: - Types m_type; + Type m_type; }; -class Q_DECL_EXPORT QNetworkSettingsIPv4 : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsIPv4 : public QObject { Q_OBJECT - Q_ENUMS(MethodType) Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged) Q_PROPERTY(QString gateway READ gateway WRITE setGateway NOTIFY gatewayChanged) - Q_PROPERTY(MethodType method READ method WRITE setMethod NOTIFY methodChanged) + Q_PROPERTY(Method method READ method WRITE setMethod NOTIFY methodChanged) Q_PROPERTY(QString mask READ mask WRITE setMask NOTIFY maskChanged) public: - explicit QNetworkSettingsIPv4(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsIPv4(QObject *parent = nullptr); - enum MethodType {Dhcp, Manual, Off}; + enum Method { + Dhcp = 0, + Manual, + Off + }; + Q_ENUM(Method) QString address() const; void setAddress(const QString& address); QString gateway() const; void setGateway(const QString& gateway); - MethodType method() const; - void setMethod(const MethodType method); + Method method() const; + void setMethod(const Method method); QString mask() const; void setMask(const QString& mask); @@ -117,35 +131,44 @@ Q_SIGNALS: private: QString m_address; QString m_gateway; - MethodType m_method; + Method m_method; QString m_mask; }; - -class Q_DECL_EXPORT QNetworkSettingsIPv6 : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsIPv6 : public QObject { Q_OBJECT - Q_ENUMS(MethodType PrivacyType) Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged) Q_PROPERTY(QString gateway READ gateway WRITE setGateway NOTIFY gatewayChanged) - Q_PROPERTY(MethodType method READ method WRITE setMethod NOTIFY methodChanged) - Q_PROPERTY(PrivacyType privacy READ privacy WRITE setPrivacy NOTIFY privacyChanged) + Q_PROPERTY(Method method READ method WRITE setMethod NOTIFY methodChanged) + Q_PROPERTY(Privacy privacy READ privacy WRITE setPrivacy NOTIFY privacyChanged) Q_PROPERTY(int prefixLength READ prefixLength WRITE setPrefixLength NOTIFY prefixLengthChanged) public: - explicit QNetworkSettingsIPv6(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsIPv6(QObject *parent = nullptr); - enum MethodType {Auto, Manual, Off}; - enum PrivacyType {Disabled, Enabled, Preferred}; + enum Method { + Auto = 0, + Manual, + Off + }; + Q_ENUM(Method) + + enum Privacy { + Disabled = 0, + Enabled, + Preferred + }; + Q_ENUM(Privacy) QString address() const; void setAddress(const QString& address); QString gateway() const; void setGateway(const QString& gateway); - MethodType method() const; - void setMethod(const MethodType method); - PrivacyType privacy() const; - void setPrivacy(const PrivacyType privacy); + Method method() const; + void setMethod(const Method method); + Privacy privacy() const; + void setPrivacy(const Privacy privacy); int prefixLength() const; void setPrefixLength(const int& prefixLength); @@ -159,23 +182,27 @@ Q_SIGNALS: private: QString m_address; QString m_gateway; - MethodType m_method; - PrivacyType m_privacy; + Method m_method; + Privacy m_privacy; int m_prefixLength; }; -class Q_DECL_EXPORT QNetworkSettingsProxy : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsProxy : public QObject { Q_OBJECT - Q_ENUMS(MethodType) Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged) Q_PROPERTY(QAbstractItemModel* servers READ servers NOTIFY serversChanged) Q_PROPERTY(QAbstractItemModel* excludes READ excludes NOTIFY excludesChanged) - Q_PROPERTY(MethodType method READ method WRITE setMethod NOTIFY methodChanged) + Q_PROPERTY(Method method READ method WRITE setMethod NOTIFY methodChanged) public: - explicit QNetworkSettingsProxy(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsProxy(QObject *parent = nullptr); - enum MethodType {Direct, Auto, Manual}; + enum Method { + Direct = 0, + Auto, + Manual + }; + Q_ENUM(Method) QUrl url() const; void setUrl(const QUrl& url); @@ -185,8 +212,8 @@ public: QAbstractItemModel* excludes(); QStringList excludes() const; void setExcludes(const QStringList& excludes); - MethodType method() const; - void setMethod(const MethodType& method); + Method method() const; + void setMethod(const Method& method); Q_SIGNALS: void urlChanged(); @@ -197,27 +224,32 @@ private: QUrl m_url; QNetworkSettingsAddressModel m_servers; QNetworkSettingsAddressModel m_excludes; - MethodType m_method; + Method m_method; }; -class Q_DECL_EXPORT QNetworkSettingsWireless : public QObject +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsWireless : public QObject { Q_OBJECT - Q_ENUMS(SecurityFlags) Q_PROPERTY(int signalStrength READ signalStrength WRITE setSignalStrength NOTIFY signalStrengthChanged) Q_PROPERTY(bool hidden READ hidden NOTIFY hiddenChanged) Q_PROPERTY(bool isOutOfRange READ outOfRange WRITE setOutOfRange NOTIFY outOfRangeChanged) public: - explicit QNetworkSettingsWireless(QObject* parent = Q_NULLPTR); + explicit QNetworkSettingsWireless(QObject* parent = nullptr); - enum SecurityFlags {None=1, WEP=2, WPA=4, WPA2=8}; + enum class Security { + None = 0x0000, + WEP = 0x0002, + WPA = 0x0004, + WPA2 = 0x0008 + }; + Q_DECLARE_FLAGS(Securities, Security) - Q_INVOKABLE bool supportsSecurity(SecurityFlags security); + Q_INVOKABLE bool supportsSecurity(Security security); bool hidden() const; void setHidden(const bool hidden); int signalStrength() const; void setSignalStrength(const int signalStrength); - void setSecurity(const SecurityFlags security); + void setSecurity(const Securities securities); void setOutOfRange(const bool aOutOfRange); bool outOfRange() const; @@ -227,11 +259,12 @@ Q_SIGNALS: void passwordChanged(); void outOfRangeChanged(); private: - quint16 m_securityFlags; + Securities m_supportedSecurites; bool m_hidden; int m_signalStrength; bool m_isOutOfRange; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkSettingsWireless::Securities) QT_END_NAMESPACE diff --git a/src/networksettings/qnetworksettingsaddressmodel.h b/src/networksettings/qnetworksettingsaddressmodel.h index 3b0ed8d..b08f381 100644 --- a/src/networksettings/qnetworksettingsaddressmodel.h +++ b/src/networksettings/qnetworksettingsaddressmodel.h @@ -29,17 +29,18 @@ #ifndef QNETWORKSETTINGSADDRESSMODEL_H #define QNETWORKSETTINGSADDRESSMODEL_H -#include <QStringListModel> +#include <QtCore/qstringlistmodel.h> +#include <QtNetworkSettings/qnetworksettingsglobal.h> QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsAddressModel : public QStringListModel +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsAddressModel : public QStringListModel { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) public: - explicit QNetworkSettingsAddressModel(QObject *parent = Q_NULLPTR); - explicit QNetworkSettingsAddressModel(const QStringList &strings, QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsAddressModel(QObject *parent = nullptr); + explicit QNetworkSettingsAddressModel(const QStringList &strings, QObject *parent = nullptr); Q_INVOKABLE void append(const QString& address); Q_INVOKABLE void remove(int index); Q_INVOKABLE void resetChanges(); diff --git a/src/settingsui/locale/TableValue.qml b/src/networksettings/qnetworksettingsglobal.h index 523f0dd..c9af207 100644 --- a/src/settingsui/locale/TableValue.qml +++ b/src/networksettings/qnetworksettingsglobal.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Device Utilities module of the Qt Toolkit. @@ -26,10 +26,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -import QtQuick 2.0 +#ifndef QNETWORKSETTINGSGLOBAL_H +#define QNETWORKSETTINGSGLOBAL_H -Text { - color: "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont -} +#include <QtNetworkSettings/qtnetworksettingsexports.h> + +#endif // QNETWORKSETTINGSGLOBAL_H diff --git a/src/networksettings/qnetworksettingsinterface.cpp b/src/networksettings/qnetworksettingsinterface.cpp index d885394..9907867 100644 --- a/src/networksettings/qnetworksettingsinterface.cpp +++ b/src/networksettings/qnetworksettingsinterface.cpp @@ -28,7 +28,6 @@ ****************************************************************************/ #include "qnetworksettingsinterface.h" #include "qnetworksettingsinterface_p.h" -#include "qnetworksettings.h" QT_BEGIN_NAMESPACE @@ -49,7 +48,7 @@ QT_BEGIN_NAMESPACE \readonly \brief Holds the state of the network interface. - \sa QNetworkSettingsState::States + \sa QNetworkSettingsState::State */ /*! @@ -68,7 +67,7 @@ QT_BEGIN_NAMESPACE \readonly \brief Holds the type of the network interface. - \sa QNetworkSettingsType::Types + \sa QNetworkSettingsType::Type */ /*! @@ -146,7 +145,7 @@ QString QNetworkSettingsInterface::name() const /*! Returns the state of the network interface. */ -QNetworkSettingsState::States QNetworkSettingsInterface::state() +QNetworkSettingsState::State QNetworkSettingsInterface::state() { Q_D(QNetworkSettingsInterface); return d->state(); @@ -168,7 +167,7 @@ QNetworkSettingsState::States QNetworkSettingsInterface::state() /*! Returns the type of the network interface. */ -QNetworkSettingsType::Types QNetworkSettingsInterface::type() +QNetworkSettingsType::Type QNetworkSettingsInterface::type() { Q_D(QNetworkSettingsInterface); return d->type(); diff --git a/src/networksettings/qnetworksettingsinterface.h b/src/networksettings/qnetworksettingsinterface.h index 20c1187..5fb9636 100644 --- a/src/networksettings/qnetworksettingsinterface.h +++ b/src/networksettings/qnetworksettingsinterface.h @@ -29,25 +29,25 @@ #ifndef QNETWORKSETTINGSINTERFACE_H #define QNETWORKSETTINGSINTERFACE_H -#include <QObject> +#include <QtCore/qobject.h> #include <QtNetworkSettings/qnetworksettings.h> -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsInterfacePrivate) - QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsInterface : public QObject { +class QNetworkSettingsInterfacePrivate; +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsInterface : public QObject +{ Q_OBJECT Q_PROPERTY(QString name READ name NOTIFY nameChanged) - Q_PROPERTY(QNetworkSettingsState::States state READ state NOTIFY stateChanged) - Q_PROPERTY(QNetworkSettingsType::Types type READ type NOTIFY typeChanged) + Q_PROPERTY(QNetworkSettingsState::State state READ state NOTIFY stateChanged) + Q_PROPERTY(QNetworkSettingsType::Type type READ type NOTIFY typeChanged) Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged) public: - explicit QNetworkSettingsInterface(QObject* parent = Q_NULLPTR); + explicit QNetworkSettingsInterface(QObject* parent = nullptr); QString name() const; - QNetworkSettingsState::States state(); - QNetworkSettingsType::Types type(); + QNetworkSettingsState::State state(); + QNetworkSettingsType::Type type(); bool powered() const; void setPowered(const bool powered); Q_INVOKABLE void scanServices(); diff --git a/src/networksettings/qnetworksettingsinterfacemodel.cpp b/src/networksettings/qnetworksettingsinterfacemodel.cpp index 045d3ff..95eff25 100644 --- a/src/networksettings/qnetworksettingsinterfacemodel.cpp +++ b/src/networksettings/qnetworksettingsinterfacemodel.cpp @@ -46,9 +46,9 @@ QT_BEGIN_NAMESPACE \brief This enum type holds information about a network interface. \value Type - Network interface \l{QNetworkSettingsType::Types}{type}. + Network interface \l{QNetworkSettingsType::Type}{type}. \value Status - Network interface \l{QNetworkSettingsState::States}{state}. + Network interface \l{QNetworkSettingsState::State}{state}. \value Name Network interface name. \value Powered @@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE QNetworkSettingsInterfaceModel::QNetworkSettingsInterfaceModel(QObject *parent) : QAbstractListModel(parent) { - m_roleNames.insert(Qt::UserRole, "modelData"); + m_roleNames.insert(Qt::UserRole, "entry"); m_roleNames.insert(Type, "type"); m_roleNames.insert(Status, "status"); m_roleNames.insert(Name, "name"); @@ -122,12 +122,7 @@ QVariant QNetworkSettingsInterfaceModel::data(const QModelIndex & index, int rol */ void QNetworkSettingsInterfaceModel::append(QNetworkSettingsInterface* item) { - item->setParent(this); - connectStateChanges(item); - - beginInsertRows(QModelIndex(), rowCount(), rowCount()); - m_items.append(item); - endInsertRows(); + insert(rowCount(), item); } /*! @@ -155,7 +150,7 @@ void QNetworkSettingsInterfaceModel::connectStateChanges(QNetworkSettingsInterfa void QNetworkSettingsInterfaceModel::remove(int row) { beginRemoveRows(QModelIndex(), row, row); - m_items.removeFirst(); + m_items.takeAt(row)->deleteLater(); endRemoveRows(); } @@ -196,7 +191,7 @@ void QNetworkSettingsInterfaceModel::connectionStatusChanged() QNetworkSettingsInterface *s = qobject_cast<QNetworkSettingsInterface*>(sender()); int row = 0; - foreach (QNetworkSettingsInterface* item, m_items) { + for (QNetworkSettingsInterface* item : m_items) { if (item == s) { updated(row); break; @@ -210,7 +205,7 @@ void QNetworkSettingsInterfaceModel::poweredChanged() { QNetworkSettingsInterface *s = qobject_cast<QNetworkSettingsInterface*>(sender()); int row = 0; - foreach (QNetworkSettingsInterface* item, m_items) { + for (QNetworkSettingsInterface* item : m_items) { if (item == s) { updated(row); break; diff --git a/src/networksettings/qnetworksettingsinterfacemodel.h b/src/networksettings/qnetworksettingsinterfacemodel.h index 6dd1f2a..aa6aa69 100644 --- a/src/networksettings/qnetworksettingsinterfacemodel.h +++ b/src/networksettings/qnetworksettingsinterfacemodel.h @@ -29,23 +29,22 @@ #ifndef QNETWORKSETTINGSINTERFACEMODEL_H #define QNETWORKSETTINGSINTERFACEMODEL_H -#include <QAbstractListModel> -#include <QtNetworkSettings/qnetworksettings.h> +#include <QtCore/QAbstractListModel> +#include <QtNetworkSettings/qnetworksettingsglobal.h> QT_BEGIN_NAMESPACE class QNetworkSettingsInterface; - -class Q_DECL_EXPORT QNetworkSettingsInterfaceModel : public QAbstractListModel +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsInterfaceModel : public QAbstractListModel { Q_OBJECT public: - explicit QNetworkSettingsInterfaceModel(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsInterfaceModel(QObject *parent = nullptr); // from QAbstractItemModel - int rowCount(const QModelIndex & parent = QModelIndex()) const; - QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - QHash<int, QByteArray> roleNames() const; + int rowCount(const QModelIndex & parent = QModelIndex()) const override; + QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; + QHash<int, QByteArray> roleNames() const override; void append(QNetworkSettingsInterface* networkInterface); void insert(int row, QNetworkSettingsInterface* networkInterface); diff --git a/src/networksettings/qnetworksettingsmanager.cpp b/src/networksettings/qnetworksettingsmanager.cpp index 667004f..7ec82fa 100644 --- a/src/networksettings/qnetworksettingsmanager.cpp +++ b/src/networksettings/qnetworksettingsmanager.cpp @@ -26,6 +26,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#include "qnetworksettings.h" #include "qnetworksettingsmanager.h" #include "qnetworksettingsservice.h" #include "qnetworksettingsservicemodel.h" @@ -33,7 +34,6 @@ #include "qnetworksettingsinterfacemodel.h" #include "qnetworksettingsmanager_p.h" #include "qnetworksettingsuseragent.h" -#include <QStringListModel> QT_BEGIN_NAMESPACE @@ -82,7 +82,7 @@ QT_BEGIN_NAMESPACE { QList<QNetworkSettingsInterface*> interfaces = manager->interfaces()->getModel(); for (const auto &interface : interfaces) { - if (interface->type() == QNetworkSettingsType::Types::Wifi) { + if (interface->type() == QNetworkSettingsType::Type::Wifi) { if (interface->powered()) { interface->scanServices(); } else { @@ -167,7 +167,7 @@ QNetworkSettingsManager::QNetworkSettingsManager(QObject *parent) : /*! Returns the service model. - \l QNetworkSettingsType::Types + \l QNetworkSettingsType::Type */ QNetworkSettingsServiceFilter *QNetworkSettingsManager::services() { @@ -191,7 +191,7 @@ QNetworkSettingsService* QNetworkSettingsManager::service(const QString& name, i { Q_D(QNetworkSettingsManager); - foreach (QNetworkSettingsService* service, d->serviceModel()->getModel()) { + for (QNetworkSettingsService* service : d->serviceModel()->getModel()) { if (service->name() == name && service->type() == type) { return service; } @@ -299,7 +299,7 @@ QNetworkSettingsInterface* QNetworkSettingsManager::interface(int type, int inst Q_D(QNetworkSettingsManager); int matchingInstance = 0; - foreach (QNetworkSettingsInterface* interface, d->m_interfaceModel.getModel()) { + for (QNetworkSettingsInterface* interface : d->m_interfaceModel.getModel()) { if (interface->type() == type) { if (matchingInstance == instance) { return interface; diff --git a/src/networksettings/qnetworksettingsmanager.h b/src/networksettings/qnetworksettingsmanager.h index 17a3082..9f562d3 100644 --- a/src/networksettings/qnetworksettingsmanager.h +++ b/src/networksettings/qnetworksettingsmanager.h @@ -29,32 +29,30 @@ #ifndef QNETWORKSETTINGSMANAGER_H #define QNETWORKSETTINGSMANAGER_H -#include <QtNetworkSettings/qnetworksettings.h> -#include <QObject> -#include <QStringListModel> - -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsManagerPrivate) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsService) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsServiceModel) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsUserAgent) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsServiceFilter) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsInterface) -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsInterfaceModel) +#include <QtCore/qobject.h> +#include <QtNetworkSettings/qnetworksettingsglobal.h> QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsManager : public QObject +class QNetworkSettingsService; +class QNetworkSettingsInterface; +class QNetworkSettingsUserAgent; +class QNetworkSettingsServiceFilter; +class QNetworkSettingsInterfaceModel; +class QNetworkSettingsManagerPrivate; +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsManager : public QObject { Q_OBJECT - Q_ENUMS(StateTypes NetworkTypeTypes) Q_PROPERTY(QNetworkSettingsServiceFilter* services READ services NOTIFY servicesChanged) Q_PROPERTY(QNetworkSettingsInterfaceModel* interfaces READ interfaces NOTIFY interfacesChanged) Q_PROPERTY(QNetworkSettingsUserAgent* userAgent READ userAgent CONSTANT) Q_PROPERTY(QNetworkSettingsService* currentWifiConnection READ currentWifiConnection NOTIFY currentWifiConnectionChanged) Q_PROPERTY(QNetworkSettingsService* currentWiredConnection READ currentWiredConnection NOTIFY currentWiredConnectionChanged) + Q_MOC_INCLUDE("qnetworksettingsservicemodel.h") + Q_MOC_INCLUDE("qnetworksettingsuseragent.h") public: - explicit QNetworkSettingsManager(QObject* parent = Q_NULLPTR); + explicit QNetworkSettingsManager(QObject* parent = nullptr); QNetworkSettingsServiceFilter* services(); QNetworkSettingsInterfaceModel* interfaces(); void setUserAgent(QNetworkSettingsUserAgent *agent); @@ -75,6 +73,7 @@ Q_SIGNALS: void interfacesChanged(); void currentWifiConnectionChanged(); void currentWiredConnectionChanged(); + protected: QNetworkSettingsManagerPrivate *d_ptr; diff --git a/src/networksettings/qnetworksettingsservice.cpp b/src/networksettings/qnetworksettingsservice.cpp index 0983c0d..ef0773c 100644 --- a/src/networksettings/qnetworksettingsservice.cpp +++ b/src/networksettings/qnetworksettingsservice.cpp @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE \readonly \brief Holds the state of this service. - \sa QNetworkSettingsState::States + \sa QNetworkSettingsState::State */ /*! @@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE \readonly \brief Holds the type of this service. - \sa QNetworkSettingsType::Types + \sa QNetworkSettingsType::Type */ /*! @@ -195,6 +195,8 @@ QString QNetworkSettingsService::name() const } /*! + \fn void QNetworkSettingsService::setAutoConnect(bool autoconnect) + Sets automatic connections to the network service to \a autoconnect. */ void QNetworkSettingsService::setAutoConnect(const bool autoconnect) @@ -224,9 +226,9 @@ bool QNetworkSettingsService::autoConnect() const /*! Returns the network service state. - \sa QNetworkSettingsState::States + \sa QNetworkSettingsState::State */ -QNetworkSettingsState::States QNetworkSettingsService::state() +QNetworkSettingsState::State QNetworkSettingsService::state() { Q_D(QNetworkSettingsService); return d->m_state.state(); @@ -244,9 +246,9 @@ QNetworkSettingsState::States QNetworkSettingsService::state() /*! Returns the network service type. - \sa QNetworkSettingsType::Types + \sa QNetworkSettingsType::Type */ -QNetworkSettingsType::Types QNetworkSettingsService::type() +QNetworkSettingsType::Type QNetworkSettingsService::type() { Q_D(QNetworkSettingsService); return d->m_type.type(); diff --git a/src/networksettings/qnetworksettingsservice.h b/src/networksettings/qnetworksettingsservice.h index dd9d52a..0b71d50 100644 --- a/src/networksettings/qnetworksettingsservice.h +++ b/src/networksettings/qnetworksettingsservice.h @@ -29,21 +29,19 @@ #ifndef QNETWORKSETTINGSSERVICE_H #define QNETWORKSETTINGSSERVICE_H -#include <QObject> +#include <QtCore/qobject.h> #include <QtNetworkSettings/qnetworksettings.h> -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsServicePrivate) - QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsService : public QObject +class QNetworkSettingsServicePrivate; +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsService : public QObject { Q_OBJECT - Q_ENUMS(StateTypes) Q_PROPERTY(QString id READ id CONSTANT) Q_PROPERTY(QString name READ name NOTIFY nameChanged) - Q_PROPERTY(QNetworkSettingsState::States state READ state NOTIFY stateChanged) - Q_PROPERTY(QNetworkSettingsType::Types type READ type NOTIFY typeChanged) + Q_PROPERTY(QNetworkSettingsState::State state READ state NOTIFY stateChanged) + Q_PROPERTY(QNetworkSettingsType::Type type READ type NOTIFY typeChanged) Q_PROPERTY(QNetworkSettingsIPv4* ipv4 READ ipv4 NOTIFY ipv4Changed) Q_PROPERTY(QNetworkSettingsIPv6* ipv6 READ ipv6 NOTIFY ipv6Changed) Q_PROPERTY(QNetworkSettingsProxy* proxy READ proxy NOTIFY proxyChanged) @@ -52,12 +50,12 @@ class Q_DECL_EXPORT QNetworkSettingsService : public QObject Q_PROPERTY(QAbstractItemModel* nameservers READ nameservers NOTIFY nameserversChanged) Q_PROPERTY(bool autoConnect READ autoConnect WRITE setAutoConnect NOTIFY autoConnectChanged) public: - explicit QNetworkSettingsService(const QString& aServiceId, QObject* parent = Q_NULLPTR); + explicit QNetworkSettingsService(const QString& aServiceId, QObject* parent = nullptr); QString id() const; QString name() const; - QNetworkSettingsState::States state(); - QNetworkSettingsType::Types type(); + QNetworkSettingsState::State state(); + QNetworkSettingsType::Type type(); QNetworkSettingsIPv4* ipv4(); QNetworkSettingsIPv6* ipv6(); QNetworkSettingsProxy* proxy(); diff --git a/src/networksettings/qnetworksettingsservicemodel.cpp b/src/networksettings/qnetworksettingsservicemodel.cpp index 115fe35..0927bcc 100644 --- a/src/networksettings/qnetworksettingsservicemodel.cpp +++ b/src/networksettings/qnetworksettingsservicemodel.cpp @@ -27,6 +27,7 @@ ** ****************************************************************************/ #include "qnetworksettingsservicemodel.h" +#include "qnetworksettingsservice.h" #include "qnetworksettings.h" QT_BEGIN_NAMESPACE @@ -49,7 +50,7 @@ QT_BEGIN_NAMESPACE This enum type holds information about the network connection. \value Type - Network \l{QNetworkSettingsType::Types}{type}. + Network \l{QNetworkSettingsType::Type}{type}. \value Name The service set identifier (SSID) of the network. \value SignalStrength @@ -64,7 +65,8 @@ QT_BEGIN_NAMESPACE QNetworkSettingsServiceModel::QNetworkSettingsServiceModel(QObject *parent) : QAbstractListModel(parent) { - m_roleNames.insert(Qt::UserRole, "modelData"); + m_roleNames.insert(Qt::UserRole, "entry"); + m_roleNames.insert(Type, "type"); m_roleNames.insert(Name, "name"); m_roleNames.insert(SignalStrength, "signalStrength"); m_roleNames.insert(Connected, "connected"); @@ -107,6 +109,9 @@ QVariant QNetworkSettingsServiceModel::data(const QModelIndex & index, int role) if (role == Qt::UserRole) { return QVariant::fromValue(static_cast<QObject*>(item)); } + else if (role == Type) { + return item->type(); + } else if (role == Name) { return item->name(); } @@ -229,7 +234,7 @@ void QNetworkSettingsServiceModel::updated(int row) QNetworkSettingsService* QNetworkSettingsServiceModel::getByName(const QString& name) { QNetworkSettingsService* ret = nullptr; - foreach (QNetworkSettingsService* item, m_items) { + for (QNetworkSettingsService* item : m_items) { if (item->name() == name) { ret = item; break; @@ -254,7 +259,7 @@ void QNetworkSettingsServiceModel::connectionStatusChanged() QNetworkSettingsService *s = qobject_cast<QNetworkSettingsService*>(sender()); int row = 0; - foreach (QNetworkSettingsService* item, m_items) { + for (QNetworkSettingsService* item : m_items) { if (item == s) { updated(row); break; @@ -271,7 +276,7 @@ void QNetworkSettingsServiceModel::signalStrengthChanged() { QNetworkSettingsWireless *s = qobject_cast<QNetworkSettingsWireless*>(sender()); int row = 0; - foreach (QNetworkSettingsService* item, m_items) { + for (QNetworkSettingsService* item : m_items) { if (item->wirelessConfig() == s) { updated(row); break; @@ -296,7 +301,7 @@ void QNetworkSettingsServiceModel::signalStrengthChanged() \property QNetworkSettingsServiceFilter::type \brief The type of the network. - \l QNetworkSettingsType::Types + \l QNetworkSettingsType::Type */ /*! @@ -318,7 +323,7 @@ void QNetworkSettingsServiceModel::signalStrengthChanged() /*! \qmltype NetworkSettingsServiceFilter - \inqmlmodule QtDeviceutilities.NetworkSettings + \inqmlmodule QtDeviceUtilities.NetworkSettings \abstract */ @@ -351,19 +356,19 @@ QNetworkSettingsServiceFilter::~QNetworkSettingsServiceFilter() /*! Returns the service model. - \l QNetworkSettingsType::Types + \l QNetworkSettingsType::Type */ -QNetworkSettingsType::Types QNetworkSettingsServiceFilter::type() const +QNetworkSettingsType::Type QNetworkSettingsServiceFilter::type() const { return m_type; } /*! - \fn void QNetworkSettingsServiceFilter::setType(QNetworkSettingsType::Types type) + \fn void QNetworkSettingsServiceFilter::setType(QNetworkSettingsType::Type type) Sets the service model to \a type. */ -void QNetworkSettingsServiceFilter::setType(const QNetworkSettingsType::Types type) +void QNetworkSettingsServiceFilter::setType(const QNetworkSettingsType::Type type) { m_type = type; emit typeChanged(); @@ -429,7 +434,7 @@ int QNetworkSettingsServiceFilter::activeRow() const QNetworkSettingsServiceModel* model = qobject_cast<QNetworkSettingsServiceModel*>(sourceModel()); QList<QNetworkSettingsService*> data = model->getModel(); int row = 0; - foreach (QNetworkSettingsService* item, data) { + for (QNetworkSettingsService* item : data) { if (item->type() == m_type && (item->state() == QNetworkSettingsState::Ready || item->state() == QNetworkSettingsState::Online)) { diff --git a/src/networksettings/qnetworksettingsservicemodel.h b/src/networksettings/qnetworksettingsservicemodel.h index 8c34e89..b4392d2 100644 --- a/src/networksettings/qnetworksettingsservicemodel.h +++ b/src/networksettings/qnetworksettingsservicemodel.h @@ -29,22 +29,22 @@ #ifndef QNETWORKSETTINGSSERVICEMODEL_H #define QNETWORKSETTINGSSERVICEMODEL_H -#include <QSortFilterProxyModel> +#include <QtCore/qsortfilterproxymodel.h> #include <QtNetworkSettings/qnetworksettings.h> -#include <QtNetworkSettings/qnetworksettingsservice.h> QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsServiceModel : public QAbstractListModel +class QNetworkSettingsService; +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsServiceModel : public QAbstractListModel { Q_OBJECT public: - explicit QNetworkSettingsServiceModel(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsServiceModel(QObject *parent = nullptr); virtual ~QNetworkSettingsServiceModel(); // from QAbstractItemModel - int rowCount(const QModelIndex & parent = QModelIndex()) const; - QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - QHash<int, QByteArray> roleNames() const; + int rowCount(const QModelIndex & parent = QModelIndex()) const override; + QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const override; + QHash<int, QByteArray> roleNames() const override; bool replacePlaceholder(QNetworkSettingsService* networkService); void append(QNetworkSettingsService* networkService); @@ -74,17 +74,17 @@ private: QHash<int, QByteArray> m_roleNames; }; -class Q_DECL_EXPORT QNetworkSettingsServiceFilter : public QSortFilterProxyModel +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsServiceFilter : public QSortFilterProxyModel { Q_OBJECT - Q_PROPERTY(QNetworkSettingsType::Types type READ type WRITE setType NOTIFY typeChanged) + Q_PROPERTY(QNetworkSettingsType::Type type READ type WRITE setType NOTIFY typeChanged) Q_PROPERTY(bool wiredNetworksAvailable MEMBER m_wiredNetworksAvailable WRITE setWiredNetworksAvailable NOTIFY wiredNetworksAvailableChanged) public: - explicit QNetworkSettingsServiceFilter(QObject* parent = Q_NULLPTR); + explicit QNetworkSettingsServiceFilter(QObject* parent = nullptr); virtual ~QNetworkSettingsServiceFilter(); bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const override; - QNetworkSettingsType::Types type() const; - void setType(QNetworkSettingsType::Types type); + QNetworkSettingsType::Type type() const; + void setType(QNetworkSettingsType::Type type); Q_INVOKABLE QVariant itemFromRow(const int row) const; Q_INVOKABLE int activeRow() const; void setWiredNetworksAvailable(bool); @@ -92,7 +92,7 @@ Q_SIGNALS: void typeChanged(); void wiredNetworksAvailableChanged(); private: - QNetworkSettingsType::Types m_type; + QNetworkSettingsType::Type m_type; bool m_wiredNetworksAvailable; }; diff --git a/src/networksettings/qnetworksettingsuseragent.h b/src/networksettings/qnetworksettingsuseragent.h index 7b76c15..63964b6 100644 --- a/src/networksettings/qnetworksettingsuseragent.h +++ b/src/networksettings/qnetworksettingsuseragent.h @@ -29,17 +29,17 @@ #ifndef QNETWORKSETTINGSUSERAGENT_H #define QNETWORKSETTINGSUSERAGENT_H -#include <QObject> - -QT_FORWARD_DECLARE_CLASS(QNetworkSettingsUserAgentPrivate) +#include <QtCore/qobject.h> +#include <QtNetworkSettings/qnetworksettingsglobal.h> QT_BEGIN_NAMESPACE -class Q_DECL_EXPORT QNetworkSettingsUserAgent : public QObject +class QNetworkSettingsUserAgentPrivate; +class Q_NETWORKSETTINGS_EXPORT QNetworkSettingsUserAgent : public QObject { Q_OBJECT public: - explicit QNetworkSettingsUserAgent(QObject *parent = Q_NULLPTR); + explicit QNetworkSettingsUserAgent(QObject *parent = nullptr); Q_INVOKABLE void setPassphrase(const QString &passphrase); Q_INVOKABLE void cancelInput(); QString passphrase() const; diff --git a/src/networksettingsqml/CMakeLists.txt b/src/networksettingsqml/CMakeLists.txt new file mode 100644 index 0000000..db3f58c --- /dev/null +++ b/src/networksettingsqml/CMakeLists.txt @@ -0,0 +1,14 @@ +qt_internal_add_qml_module(networksettingsqml + URI "QtDeviceUtilities.NetworkSettings" + VERSION "${CMAKE_PROJECT_VERSION}" + PAST_MAJOR_VERSIONS 1 + PLUGIN_TARGET networksettingsqml + DEPENDENCIES + QtQml + SOURCES + qnetworksettingsforeign.h qnetworksettingsforeign.cpp + LIBRARIES + Qt::Core + Qt::Qml + Qt::NetworkSettings +) diff --git a/src/imports/networksettings/plugin.cpp b/src/networksettingsqml/qnetworksettingsforeign.cpp index 56bece7..e0d73c0 100644 --- a/src/imports/networksettings/plugin.cpp +++ b/src/networksettingsqml/qnetworksettingsforeign.cpp @@ -26,21 +26,10 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "plugin.h" -#include <qnetworksettings.h> -#include <qnetworksettingsmanager.h> -#include <qnetworksettingsservice.h> -#include <qnetworksettingsuseragent.h> -#include <qnetworksettingsservicemodel.h> -#include <qnetworksettingsinterface.h> -#include <qnetworksettingsinterfacemodel.h> - -#include <qqml.h> -#include <QQmlEngine> -#include <QQmlContext> +#include "qnetworksettingsforeign.h" /*! - \qmlmodule QtDeviceUtilities.NetworkSettings 1.0 + \qmlmodule QtDeviceUtilities.NetworkSettings \ingroup qtdevice-utilities-qml-modules \ingroup qmlmodules \title Qt Network Settings QML Types @@ -53,7 +42,7 @@ To import and use the module's QML types, use the following statement: \badcode - import QtDeviceUtilities.NetworkSettings 1.0 + import QtDeviceUtilities.NetworkSettings \endcode \l{Qt Device Utilities WiFi Tutorial} demonstrates how you can use @@ -80,7 +69,9 @@ \qmlproperty model NetworkSettingsManager::services \readonly - Holds the service model. + Holds the service model. A delegate in a view that uses + the \e services model can access the NetworkService + item with the \e entry role. The services list in the model can be controlled with the \c type property, and NetworkService items can be retrieved @@ -110,7 +101,7 @@ Holds the interface model. A delegate in a view that uses the \e interfaces model can access the NetworkInterface - item with the \e dataModel role. + item with the \e entry role. \sa NetworkInterface */ @@ -160,32 +151,3 @@ This signal is emitted when the connection failed due to invalid user credentials. */ - -QT_BEGIN_NAMESPACE - -template <typename T> -QObject *instance(QQmlEngine *engine, QJSEngine *) { - T *t = new T(engine); - t->setObjectName(T::staticMetaObject.className()); - return t; -} - -void NetworkSettingsQmlPlugin::registerTypes(const char *uri) -{ - Q_ASSERT(QLatin1String(uri) == QLatin1String("QtDeviceUtilities.NetworkSettings")); - qmlRegisterUncreatableType<QNetworkSettingsService>(uri, 1, 0, "NetworkService", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsInterface>(uri, 1, 0, "NetworkInterface", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsIPv4>(uri, 1, 0, "NetworkSettingsIPv4", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsIPv6>(uri, 1, 0, "NetworkSettingsIPv6", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsProxy>(uri, 1, 0, "NetworkSettingsProxy", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsType>(uri, 1, 0, "NetworkSettingsType", "Cannot be instantiated directly."); - qmlRegisterUncreatableType<QNetworkSettingsState>(uri, 1, 0, "NetworkSettingsState", "Cannot be instantiated directly."); - - qRegisterMetaType<QNetworkSettingsUserAgent*>("QNetworkSettingsUserAgent*"); - qRegisterMetaType<QNetworkSettingsServiceFilter*>("QNetworkSettingsServiceFilter*"); - qRegisterMetaType<QNetworkSettingsInterfaceModel*>("QNetworkSettingsInterfaceModel*"); - - qmlRegisterSingletonType<QNetworkSettingsManager>(uri, 1, 0, "NetworkSettingsManager", &instance<QNetworkSettingsManager>); -} - -QT_END_NAMESPACE diff --git a/src/networksettingsqml/qnetworksettingsforeign.h b/src/networksettingsqml/qnetworksettingsforeign.h new file mode 100644 index 0000000..ff9ec57 --- /dev/null +++ b/src/networksettingsqml/qnetworksettingsforeign.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Device Utilities module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef NETWORKSETTINGSPLUGIN_PLUGIN_H +#define NETWORKSETTINGSPLUGIN_PLUGIN_H + +#include <QtQml/qqml.h> +#include <QtNetworkSettings/QtNetworkSettings> + +QT_BEGIN_NAMESPACE + +struct NetworkSettingsServiceForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsService) + QML_NAMED_ELEMENT(NetworkService) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsInterfaceForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsInterface) + QML_NAMED_ELEMENT(NetworkInterface) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsIPv4Foreign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsIPv4) + QML_NAMED_ELEMENT(NetworkSettingsIPv4) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsIPv6Foreign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsIPv6) + QML_NAMED_ELEMENT(NetworkSettingsIPv6) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsProxyForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsProxy) + QML_NAMED_ELEMENT(NetworkSettingsProxy) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsWirelessForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsWireless) + QML_NAMED_ELEMENT(NetworkSettingsWireless) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsTypeForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsType) + QML_NAMED_ELEMENT(NetworkSettingsType) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +struct NetworkSettingsStateForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsState) + QML_NAMED_ELEMENT(NetworkSettingsState) + QML_UNCREATABLE("Cannot be instantiated directly.") + QML_ADDED_IN_VERSION(1, 0) +}; + +class QNetworkSettingsManagerForeign +{ + Q_GADGET + QML_FOREIGN(QNetworkSettingsManager) + QML_NAMED_ELEMENT(NetworkSettingsManager) + QML_SINGLETON + QML_ADDED_IN_VERSION(2, 0) +}; + +QT_END_NAMESPACE + +#endif // NETWORKSETTINGSPLUGIN_PLUGIN_H + diff --git a/src/settingsui/AutoScroller.qml b/src/settingsui/AutoScroller.qml deleted file mode 100644 index daebb25..0000000 --- a/src/settingsui/AutoScroller.qml +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.VirtualKeyboard 2.0 - -Item { - - property var innerFlickable - property var outerFlickable - property var inputItem: InputContext.inputItem - - onInputItemChanged: { - innerFlickable = null - outerFlickable = null - if (inputItem !== null) { - var parent_ = inputItem.parent - while (parent_) { - if (parent_.maximumFlickVelocity) { - if (innerFlickable) { - outerFlickable = parent_ - break - } else { - innerFlickable = parent_ - } - } - parent_ = parent_.parent - } - delayedLoading.triggered() - } - } - - function ensureVisible(flickable) { - if (Qt.inputMethod.visible && inputItem && flickable && flickable.visible && flickable.interactive) { - - var verticallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.VerticalFlick - || (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentHeight > flickable.height)) - var horizontallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.HorizontalFlick - || (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentWidth > flickable.width)) - - if ((!verticallyFlickable && !horizontallyFlickable) || !inputItem.hasOwnProperty("cursorRectangle")) - return - - var cursorRectangle = flickable.contentItem.mapFromItem(inputItem, inputItem.cursorRectangle.x, inputItem.cursorRectangle.y) - - var oldContentY = flickable.contentY - if (verticallyFlickable) { - var scrollMarginVertical = (flickable && flickable.scrollMarginVertical) ? flickable.scrollMarginVertical : 10 - if (flickable.contentY >= cursorRectangle.y - scrollMarginVertical) - flickable.contentY = Math.max(0, cursorRectangle.y - scrollMarginVertical) - else if (flickable.contentY + flickable.height <= cursorRectangle.y + inputItem.cursorRectangle.height + scrollMarginVertical) - flickable.contentY = Math.min(flickable.contentHeight - flickable.height, cursorRectangle.y + inputItem.cursorRectangle.height - flickable.height + scrollMarginVertical) - } - if (horizontallyFlickable) { - var scrollMarginHorizontal = (flickable && flickable.scrollMarginHorizontal) ? flickable.scrollMarginHorizontal : 10 - if (flickable.contentX >= cursorRectangle.x - scrollMarginHorizontal) - flickable.contentX = Math.max(0, cursorRectangle.x - scrollMarginHorizontal) - else if (flickable.contentX + flickable.width <= cursorRectangle.x + inputItem.cursorRectangle.width + scrollMarginHorizontal) - flickable.contentX = Math.min(flickable.contentWidth - flickable.width, cursorRectangle.x + inputItem.cursorRectangle.width - flickable.width + scrollMarginHorizontal) - } - } - } - Timer { - id: delayedLoading - interval: 10 - onTriggered: { - ensureVisible(innerFlickable) - ensureVisible(outerFlickable) - } - } - Connections { - ignoreUnknownSignals: true - target: inputItem && !Qt.inputMethod.animating ? Qt.inputMethod : null - function onKeyboardRectangleChanged() { delayedLoading.triggered() } - } - Connections { - ignoreUnknownSignals: true - target: inputItem && inputItem.activeFocus ? inputItem : null - function onCursorRectangleChanged() { delayedLoading.triggered() } - } -} diff --git a/src/settingsui/ViewSettings.qml b/src/settingsui/ViewSettings.qml deleted file mode 100644 index 9bbbc10..0000000 --- a/src/settingsui/ViewSettings.qml +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt for Device Creation. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Item { - id: viewSettings - - property real pageMargin: 0.03 * Math.min(window.width, window.height) - property real spacing: pageMargin * 0.5 - property string appFont: "TitilliumWeb" - property string backgroundColor: "#09102b" - property string borderColor: "#9d9faa" - property string buttonGreenColor: "#41cd52" - property string buttonGrayColor: "#9d9faa" - property string buttonActiveColor: "#216729" - property string scrollBarColor: "#41cd52" -} diff --git a/src/settingsui/bluetooth/Bluetooth.qml b/src/settingsui/bluetooth/Bluetooth.qml deleted file mode 100644 index d4cec78..0000000 --- a/src/settingsui/bluetooth/Bluetooth.qml +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.BluetoothSettings 1.0 -import "../common" - -Item { - id: root - - Row { - id: bluetoothRow - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - spacing: parent.width * 0.025 - - Text { - id: bluetoothSwitchText - anchors.verticalCenter: parent.verticalCenter - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: "white" - text: qsTr("Bluetooth") - } - CustomSwitch { - anchors.verticalCenter: parent.verticalCenter - indicatorWidth: root.width * 0.15 - indicatorHeight: root.height * 0.06 - - enabled: BtDevice.available - checked: BtDevice.powered - onCheckedChanged: BtDevice.powered = checked - } - - Text { - id: scanningText - anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - color: "white" - text: "Scanning" - font.family: appFont - opacity: (BtDevice.scanning && BtDevice.powered) ? 1.0 : 0.0 - visible: opacity > 0 - Behavior on opacity { - NumberAnimation {duration: 150} - } - - Timer { - id: scanningTimer - interval: 1000 - repeat: true - running: BtDevice.scanning - - onTriggered: { - if (scanningText.text.indexOf("...") !== -1) - scanningText.text = "Scanning" - else - scanningText.text += "." - } - } - } - - Connections { - target: BtDevice - function onPoweredChanged() { - if (BtDevice.powered) - BtDevice.scanning = true - } - } - } - - Discovery { - id: discovery - anchors.top: bluetoothRow.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.bottomMargin: parent.height * 0.085 - visible: BtDevice.powered - } -} diff --git a/src/settingsui/bluetooth/Discovery.qml b/src/settingsui/bluetooth/Discovery.qml deleted file mode 100644 index 515d37a..0000000 --- a/src/settingsui/bluetooth/Discovery.qml +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.BluetoothSettings 1.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Item { - id: top - - ListView { - id: mainList - anchors.fill: parent - opacity: BtDevice.scanning ? .5 : 1.0 - interactive: !BtDevice.scanning - clip: true - model: BtDevice.deviceModel - - function getIcon(deviceType) { - switch (deviceType) { - case BtDeviceItem.Computer: - return "../icons/Laptop_qt_1x.png" - case BtDeviceItem.Headphones: - return "../icons/Headphones_qt_1x.png" - case BtDeviceItem.Microphone: - return "../icons/Microphone_qt_1x.png" - case BtDeviceItem.Mouse: - return "../icons/Mouse_qt_1x.png" - case BtDeviceItem.Keyboard: - return "../icons/Keyboard_qt_1x.png" - default: - return "../icons/Bluetooth_qt_1x.png" - } - } - - delegate: Item { - id: btDelegate - width: parent.width - height: expanded || connected ? mainList.height * 0.175 + mainList.height * 0.05 : mainList.height * 0.175 - property bool expanded: false - MouseArea { - anchors.fill: parent - onClicked: { - if (!connected){ - btDelegate.expanded = !btDelegate.expanded - } - } - } - Image { - id: bticon - sourceSize.width: parent.width - sourceSize.height: parent.height - height: parent.height * 0.5 - width: height - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - source: mainList.getIcon(type) - } - Column { - anchors.left: bticon.right - anchors.leftMargin: parent.width * 0.025 - anchors.right: connectButton.left - anchors.verticalCenter: parent.verticalCenter - Label { - id: bttext - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - font.pixelSize: mainList.height * 0.06 - text: name - color: connected ? viewSettings.buttonGreenColor : "white" - font.family: appFont - font.styleName: connected ? "SemiBold" : "Regular" - } - Label { - id: details - height: btDelegate.height * 0.275 * opacity - opacity: btDelegate.expanded || connected ? 1 : 0.0 - visible: opacity > 0 - text: address - color: connected ? viewSettings.buttonGreenColor : "white" - font.family: appFont - Behavior on opacity { NumberAnimation { duration: 200} } - } - } - QtButton { - id: connectButton - height: mainList.height * 0.125 - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - opacity: (expanded || connected) && !BtDevice.scanning ? 1.0 : 0.0 - visible: opacity > 0 - fillColor: connected ? viewSettings.buttonGrayColor : viewSettings.buttonGreenColor - borderColor: "transparent" - text: connected ? qsTr("Disconnect") : qsTr("Connect") - onClicked : connected ? BtDevice.requestDisconnect(address) : BtDevice.requestPairing(address); - Behavior on opacity { NumberAnimation { duration: 200 } } - } - Behavior on height { NumberAnimation { duration: 200} } - - Rectangle { - id: delegateBottom - width: btDelegate.width - color: viewSettings.borderColor - height: 2 - anchors.bottom: btDelegate.bottom - anchors.horizontalCenter: btDelegate.horizontalCenter - } - } - focus: true - } -} diff --git a/src/settingsui/common/CustomSwitch.qml b/src/settingsui/common/CustomSwitch.qml deleted file mode 100644 index fa9f9aa..0000000 --- a/src/settingsui/common/CustomSwitch.qml +++ /dev/null @@ -1,120 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 -import QtQuick.Controls 2.1 - -Switch { - id: control - - property alias indicatorWidth: indicatorImg.width - property alias indicatorHeight: indicatorImg.height - - indicator: Image { - id: indicatorImg - width: 200 - height: 75 - sourceSize: Qt.size(width, height) - anchors.horizontalCenter: control.horizontalCenter - y: parent.height / 2 - height / 2 - source: "image://QtButton/10/#848895/transparent" - Text { - id: offText - anchors.left: parent.left - anchors.leftMargin: parent.width * 0.075 - anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - fontSizeMode: Text.Fit - minimumPixelSize: 1 - font.pixelSize: parent.height * 0.55 - color: "#3b4155" - text: "OFF" - font.family: appFont - } - Text { - id: onText - anchors.right: parent.right - anchors.rightMargin: parent.width * 0.1 - anchors.verticalCenter: parent.verticalCenter - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - fontSizeMode: Text.Fit - minimumPixelSize: 1 - font.pixelSize: parent.height * 0.55 - color: "#3b4155" - text: "ON" - font.family: appFont - } - - Binding { - target: qtHandle - property: "x" - value: control.checked ? indicatorImg.width - qtHandle.width - indicatorImg.width * 0.025 : indicatorImg.width * 0.025 - when: !mousearea.drag.active - } - - MouseArea { - anchors.fill: parent - onClicked: control.checked = !control.checked - } - - QtButton { - id: qtHandle - anchors.verticalCenter: parent.verticalCenter - width: parent.width * 0.475 - height: parent.height * 0.9 - fillColor: control.checked ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor - text: control.checked ? "ON" : "OFF" - borderColor: "transparent" - Behavior on x { - NumberAnimation { duration: 50 } - } - - MouseArea { - id: mousearea - anchors.fill: parent - drag.target: qtHandle - drag.axis: Drag.XAxis - drag.minimumX: indicatorImg.width * 0.005 - drag.maximumX: indicatorImg.width - width - indicatorImg.width * 0.005 - - onClicked: control.checked = !control.checked - - onReleased: { - if (qtHandle.x > indicatorImg.width / 5 ) { - control.checked = true - } else { - control.checked = false - } - } - } - } - } -} diff --git a/src/settingsui/common/CustomTableView.qml b/src/settingsui/common/CustomTableView.qml deleted file mode 100644 index 2eb42e4..0000000 --- a/src/settingsui/common/CustomTableView.qml +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 - -ColumnLayout { - id: root - - Layout.fillHeight: true - Layout.fillWidth: true - - property var headerTexts: [] - property var roleNames: [] - property alias model: listView.model - property alias localeIndex: listView.currentIndex - signal clicked(int index) - - Timer { //A workaround to position the listView.. - interval: 250 - running: true - onTriggered: listView.positionViewAtIndex(listView.currentIndex, ListView.Beginning) - } - - ListView { - id: listView - Layout.fillHeight: true - Layout.fillWidth: true - clip: true - - onCurrentIndexChanged: { - if (listView.model) { - positionViewAtIndex(listView.currentIndex, ListView.beginning) - } - } - - ScrollBar.vertical: ScrollBar { - contentItem: Rectangle { - implicitWidth: listView.width * 0.0175 - implicitHeight: listView.height * 0.5 - color: viewSettings.scrollBarColor - } - } - - delegate: Item { - id: delegateRectangle - width: parent.width - height: listView.height * 0.1 - property var delegateData: modelData - - Row { - anchors.fill: parent - anchors.leftMargin: 10 - spacing: 10 - - Repeater { - model: root.roleNames.length - - Text { - width: parent.width / root.roleNames.length - text: delegateData[root.roleNames[index]] - anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: delegateRectangle.height * 0.5 - antialiasing: false - smooth: false - renderType: listView.moving ? Text.NativeRendering : Text.QtRendering - color: listView.currentIndex == delegateRectangle.index ? viewSettings.buttonGreenColor : "white" - font.family: appFont - } - } - } - MouseArea { - anchors.fill: parent - onClicked: root.clicked(index) - } - } - } -} diff --git a/src/settingsui/common/HandwritingModeButton.qml b/src/settingsui/common/HandwritingModeButton.qml deleted file mode 100644 index 411892e..0000000 --- a/src/settingsui/common/HandwritingModeButton.qml +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 - -Item { - id: handwritingModeButton - state: "unavailable" - property bool floating - property bool flipable - readonly property real __minWidthHeight: Math.min(width, height) - - signal clicked() - signal doubleClicked() - - Flipable { - id: flipableImage - anchors.fill: parent - - property bool flipped - - front: Image { - sourceSize.width: handwritingModeButton.__minWidthHeight - sourceSize.height: handwritingModeButton.__minWidthHeight - smooth: false - source: "qrc:/icons/FloatingButton_Unavailable.png" - } - - back: Image { - id: buttonImage - sourceSize.width: handwritingModeButton.__minWidthHeight - sourceSize.height: handwritingModeButton.__minWidthHeight - smooth: false - source: "qrc:/icons/FloatingButton_Available.png" - } - - states: State { - PropertyChanges { target: rotation; angle: 180 } - when: flipableImage.flipped - } - - transform: Rotation { - id: rotation - origin.x: flipableImage.width / 2 - origin.y: flipableImage.height / 2 - axis { x: 0; y: 1; z: 0 } - angle: 0 - } - - transitions: Transition { - enabled: handwritingModeButton.flipable - NumberAnimation { target: rotation; property: "angle"; duration: 400 } - } - } - - states: [ - State { - name: "available" - PropertyChanges { target: flipableImage; flipped: true } - }, - State { - name: "active" - PropertyChanges { target: flipableImage; flipped: true } - PropertyChanges { target: buttonImage; source: "qrc:/icons/FloatingButton_Active.png" } - } - ] - - function snapHorizontal() { - if (!floating) - return - if (mouseArea.drag.maximumX > mouseArea.drag.minimumX) { - if (x + 20 >= mouseArea.drag.maximumX) { - anchors.left = undefined - anchors.right = parent.right - } else if (x - 20 <= mouseArea.drag.minimumX) { - anchors.right = undefined - anchors.left = parent.left - } - } - } - - function snapVertical() { - if (!floating) - return - if (mouseArea.drag.maximumY > mouseArea.drag.minimumY) { - if (y + 20 >= mouseArea.drag.maximumY) { - anchors.top = undefined - anchors.bottom = parent.bottom - } else if (y - 20 <= mouseArea.drag.minimumY) { - anchors.bottom = undefined - anchors.top = parent.top - } - } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - drag { - target: handwritingModeButton.floating ? handwritingModeButton : undefined - axis: Drag.XAxis | Drag.YAxis - minimumX: 0 - maximumX: handwritingModeButton.parent.width - handwritingModeButton.width - onMaximumXChanged: !mouseArea.drag.active && handwritingModeButton.snapHorizontal() - minimumY: 0 - maximumY: handwritingModeButton.parent.height - handwritingModeButton.height - onMaximumYChanged: !mouseArea.drag.active && handwritingModeButton.snapVertical() - } - onPressed: { - if (!handwritingModeButton.floating) - return - handwritingModeButton.anchors.left = undefined - handwritingModeButton.anchors.top = undefined - handwritingModeButton.anchors.right = undefined - handwritingModeButton.anchors.bottom = undefined - } - onReleased: { - handwritingModeButton.snapHorizontal() - handwritingModeButton.snapVertical() - } - onClicked: { - handwritingModeButton.snapHorizontal() - handwritingModeButton.snapVertical() - clickTimer.restart() - } - onDoubleClicked: { - clickTimer.stop() - handwritingModeButton.snapHorizontal() - handwritingModeButton.snapVertical() - handwritingModeButton.doubleClicked() - } - Timer { - id: clickTimer - interval: Qt.styleHints ? Qt.styleHints.mouseDoubleClickInterval / 3 : 0 - repeat: false - onTriggered: handwritingModeButton.clicked() - } - } -} diff --git a/src/settingsui/deployment.pri b/src/settingsui/deployment.pri deleted file mode 100644 index 696c6f5..0000000 --- a/src/settingsui/deployment.pri +++ /dev/null @@ -1,27 +0,0 @@ -android-no-sdk { - target.path = /data/user/qt - export(target.path) - INSTALLS += target -} else:android { - x86 { - target.path = /libs/x86 - } else: armeabi-v7a { - target.path = /libs/armeabi-v7a - } else { - target.path = /libs/armeabi - } - export(target.path) - INSTALLS += target -} else:unix { - isEmpty(target.path) { - qnx { - target.path = /tmp/$${TARGET}/bin - } else { - target.path = $$[QT_INSTALL_BINS] - } - export(target.path) - } - INSTALLS += target -} - -export(INSTALLS) diff --git a/src/settingsui/display/Display.qml b/src/settingsui/display/Display.qml deleted file mode 100644 index 97d05a2..0000000 --- a/src/settingsui/display/Display.qml +++ /dev/null @@ -1,193 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.DisplaySettings 1.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Item { - id: root - anchors.fill: parent - - Column { - spacing: pluginMain.spacing - anchors.top: parent.top - - Text { - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - text: qsTr("Brightness ") + (brightnessSlider.value / 255 * 100).toFixed(1) + "%" - color: "white" - height: pluginMain.fieldTextHeight - } - - Slider { - id: brightnessSlider - width: root.width - height: pluginMain.buttonHeight - Layout.alignment: Qt.AlignVCenter - Layout.fillWidth: true - from: 0 - to: 255 - onValueChanged: DisplaySettings.setDisplayBrightness(value) - - background: Rectangle { - id: sliderBackground - x: brightnessSlider.leftPadding - y: brightnessSlider.topPadding + brightnessSlider.availableHeight / 2 - height / 2 - implicitWidth: root.width - implicitHeight: root.height * 0.01 - width: brightnessSlider.availableWidth - height: implicitHeight - radius: 2 - color: viewSettings.buttonGrayColor - Rectangle { - width: brightnessSlider.visualPosition * parent.width - height: parent.height - color: "white" - radius: 2 - } - } - handle: Rectangle { - x: brightnessSlider.leftPadding + brightnessSlider.visualPosition * (brightnessSlider.availableWidth - width) - y: brightnessSlider.topPadding + brightnessSlider.availableHeight / 2 - height / 2 - height: sliderBackground.height * 7 - width: height - radius: width * 0.5 - antialiasing: true - color: viewSettings.buttonGreenColor - } - - Component.onCompleted: brightnessSlider.value = DisplaySettings.displayBrightness - } - - Text { - verticalAlignment: Text.AlignVCenter - height: pluginMain.fieldTextHeight - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - text: qsTr("Physical screen size in millimeters") - Layout.preferredWidth: root.width * 0.3 - Layout.alignment: Qt.AlignVCenter - wrapMode: Label.WordWrap - color: "white" - } - - Column { - leftPadding: pluginMain.margin - spacing: pluginMain.spacing - - Row { - spacing: pluginMain.spacing - - Text { - id: widthText - height: pluginMain.buttonHeight - text: qsTr("Width") - color: "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - verticalAlignment: Text.AlignVCenter - } - TextField { - id: widthField - leftPadding: pluginMain.margin - rightPadding: pluginMain.margin - bottomPadding: 6 - topPadding: 6 - height: pluginMain.buttonHeight - width: root.width * 0.13 - color: "black" - font.pixelSize: pluginMain.valueFontSize - text: DisplaySettings.physicalScreenWidthMm - horizontalAlignment: Text.AlignHCenter - inputMethodHints: Qt.ImhDigitsOnly - background: Rectangle { - border.color: widthField.focus ? viewSettings.buttonGreenColor : "transparent" - border.width: parent.width * 0.05 - } - } - Text { - id: heightText - height: pluginMain.buttonHeight - text: qsTr("Height") - color: "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - verticalAlignment: Text.AlignVCenter - } - TextField { - id: heightField - leftPadding: pluginMain.margin - rightPadding: pluginMain.margin - bottomPadding: 6 - topPadding: 6 - width: widthField.width - height: pluginMain.buttonHeight - color: "black" - font.pixelSize: pluginMain.valueFontSize - text: DisplaySettings.physicalScreenHeightMm - horizontalAlignment: Text.AlignHCenter - inputMethodHints: Qt.ImhDigitsOnly - background: Rectangle { - border.color: heightField.focus ? viewSettings.buttonGreenColor : "transparent" - border.width: parent.width * 0.05 - } - } - } - - Row { - spacing: pluginMain.margin - - QtButton { - id: setButton - height: pluginMain.buttonHeight - text: qsTr("SET") - onClicked: { - DisplaySettings.physicalScreenHeightMm = parseInt(heightField.text) - DisplaySettings.physicalScreenWidthMm = parseInt(widthField.text) - } - } - QtButton { - id: resetButton - height: pluginMain.buttonHeight - borderColor: "transparent" - fillColor: viewSettings.buttonGrayColor - text: qsTr("RESET TO DEFAULT") - onClicked: { - DisplaySettings.physicalScreenHeightMm = 90 - DisplaySettings.physicalScreenWidthMm = 154 - } - } - } - } - } -} diff --git a/src/settingsui/locale/Language.qml b/src/settingsui/locale/Language.qml deleted file mode 100644 index 23d1b64..0000000 --- a/src/settingsui/locale/Language.qml +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.LocaleSettings 1.0 -import QtQml 2.2 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Item { - id: root - property var currentRegion: Qt.locale(LocaleManager.locale) - - Column { - spacing: pluginMain.spacing - - Text { - color: "white" - text: qsTr("Region") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - Row { - leftPadding: pluginMain.margin - spacing: pluginMain.spacing - Text { - color: "white" - text: root.currentRegion.nativeCountryName == "" ? "Default" : root.currentRegion.nativeCountryName - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - verticalAlignment: Text.AlignVCenter - height: parent.height - } - QtButton { - id: regionButton - height: pluginMain.buttonHeight - text: qsTr("CHANGE") - onClicked: settingsLoader.source = "qrc:/locale/RegionSelect.qml" - } - } - - Text { - color: "white" - text: qsTr("Format") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - Grid { - columns: 2 - leftPadding: pluginMain.margin - spacing: pluginMain.spacing - - TableKey { - text: qsTr("Region") - } - TableValue { - text: root.currentRegion.nativeCountryName - } - - TableKey { - text: qsTr("Short date:") - } - TableValue { - text: root.currentRegion.dateFormat(1) - } - TableKey { - text: qsTr("Short time:") - } - TableValue { - text: root.currentRegion.timeFormat(1) - } - TableKey { - text: qsTr("Currency:") - } - TableValue { - text: root.currentRegion.currencySymbol(1) - } - TableKey { - text: qsTr("First day of week:") - } - TableValue { - text: root.currentRegion.firstDayOfWeek - } - } - } -} diff --git a/src/settingsui/locale/RegionSelect.qml b/src/settingsui/locale/RegionSelect.qml deleted file mode 100644 index b811a77..0000000 --- a/src/settingsui/locale/RegionSelect.qml +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.LocaleSettings 1.0 -import "../common" -import QtGraphicalEffects 1.0 - -Item { - id: root - property var currentRegion: Qt.locale(LocaleManager.locale) - - Row { - id: backRow - anchors.top: parent.top - anchors.left: parent.left - width: parent.width * 0.2 - height: parent.height * 0.04 - Image { - id: languageBackIcon - anchors.verticalCenter: parent.verticalCenter - height: parent.height * 0.8 - width: height - fillMode: Image.PreserveAspectFit - source: "../newIcons/back_icon.svg" - - ColorOverlay { - source: languageBackIcon - anchors.fill: languageBackIcon - color: viewSettings.buttonGreenColor - visible: true - } - MouseArea { - anchors.fill: parent - onClicked: settingsLoader.source = "qrc:/locale/Language.qml" - } - } - Text { - anchors.top: parent.top - height: parent.height - anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.subTitleFontSize - color: viewSettings.buttonGreenColor - text: "Back" - font.family: appFont - MouseArea { - anchors.fill: parent - onClicked: settingsLoader.source = "qrc:/locale/Language.qml" - } - } - } - - Text { - id: changeLanguageText - anchors.top: backRow.bottom - anchors.topMargin: parent.height * 0.05 - anchors.left: parent.left - font.pixelSize: pluginMain.subTitleFontSize - color: "white" - text: qsTr("Change Language") - font.family: appFont - font.styleName: "Bold" - } - Rectangle { - id: btmLine - anchors.top: changeLanguageText.bottom - anchors.topMargin: parent.height * 0.025 - anchors.left: changeLanguageText.left - width: parent.width * 0.275 - height: parent.height * 0.005 - } - - ColumnLayout { - id: content - anchors.top: btmLine.bottom - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.topMargin: parent.height * 0.025 - TextField { - id: country - Layout.preferredWidth: root.width * 0.5 - font.pixelSize: pluginMain.valueFontSize - leftPadding: pluginMain.margin - rightPadding: pluginMain.margin - bottomPadding: 6 - topPadding: 6 - color: "white" - text: "" - placeholderText: "Search..." - placeholderTextColor: "white" - font.family: appFont - font.styleName: "Regular" - onTextChanged: LocaleFilter.filter = country.text - Layout.alignment: Qt.AlignVCenter - background: Rectangle { - color: "transparent" - border.color: viewSettings.borderColor - border.width: 1 - } - } - - CustomTableView { - id: localeTableView - headerTexts: [qsTr("Language"), qsTr("Country")] - roleNames: ["language", "country"] - model: LocaleFilter - onClicked: { - var val = model.itemFromRow(index); - if (val !== "") { - LocaleManager.locale = val; - settingsLoader.source = "qrc:/locale/Language.qml" - } - } - } - } - Component.onCompleted: { - country.text = LocaleFilter.filter - var n = LocaleFilter.indexForCountry(root.currentRegion.nativeCountryName) - localeTableView.localeIndex = n - } - - Connections { - target: LocaleFilter.sourceModel - function onReady() { - var n = LocaleFilter.indexForCountry(root.currentRegion.nativeCountryName) - localeTableView.localeIndex = n - } - } -} diff --git a/src/settingsui/locale/TableKey.qml b/src/settingsui/locale/TableKey.qml deleted file mode 100644 index 523f0dd..0000000 --- a/src/settingsui/locale/TableKey.qml +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Text { - color: "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont -} diff --git a/src/settingsui/main.cpp b/src/settingsui/main.cpp deleted file mode 100644 index 40e4428..0000000 --- a/src/settingsui/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QGuiApplication> -#include <QQmlApplicationEngine> - -int main(int argc, char *argv[]) -{ - qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - - return app.exec(); -} diff --git a/src/settingsui/main.qml b/src/settingsui/main.qml deleted file mode 100644 index 8c97811..0000000 --- a/src/settingsui/main.qml +++ /dev/null @@ -1,142 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Window 2.2 -import QtDeviceUtilities.SettingsUI 1.0 -import QtQuick.VirtualKeyboard 2.0 -import "common" - -Window { - id: window - visible: true - - property alias appFont: viewSettings.appFont - - ViewSettings { - id: viewSettings - } - - Item { - id: root - anchors.fill: parent - - SettingsUI { - id: settingsUI - anchors.fill: parent - anchors.bottomMargin: parent.height - inputPanel.y - } - - /* Handwriting input panel for full screen handwriting input. - - This component is an optional add-on for the InputPanel component, that - is, its use does not affect the operation of the InputPanel component, - but it also can not be used as a standalone component. - - The handwriting input panel is positioned to cover the entire area of - application. The panel itself is transparent, but once it is active the - user can draw handwriting on it. - */ - - HandwritingInputPanel { - z: 79 - id: handwritingInputPanel - anchors.fill: parent - inputPanel: inputPanel - Rectangle { - z: -1 - anchors.fill: parent - color: "black" - opacity: 0.10 - } - } - - /* Container area for the handwriting mode button. - - Handwriting mode button can be moved freely within the container area. - In this example, a single click changes the handwriting mode and a - double-click changes the availability of the full screen handwriting input. - */ - Item { - z: 89 - visible: handwritingInputPanel.enabled && Qt.inputMethod.visible - anchors { left: parent.left; top: parent.top; right: parent.right; bottom: inputPanel.top; } - HandwritingModeButton { - id: handwritingModeButton - anchors.top: parent.top - anchors.right: parent.right - anchors.margins: 10 - floating: true - flipable: true - width: 76 - height: width - state: handwritingInputPanel.state - onClicked: handwritingInputPanel.active = !handwritingInputPanel.active - onDoubleClicked: handwritingInputPanel.available = !handwritingInputPanel.available - } - } - - /* Keyboard input panel. - The keyboard is anchored to the bottom of the application. - */ - InputPanel { - id: inputPanel - z: 99 - y: root.height - anchors.left: root.left - anchors.right: root.right - - states: State { - name: "visible" - /* The visibility of the InputPanel can be bound to the Qt.inputMethod.visible property, - but then the handwriting input panel and the keyboard input panel can be visible - at the same time. Here the visibility is bound to InputPanel.active property instead, - which allows the handwriting panel to control the visibility when necessary. - */ - when: inputPanel.active - PropertyChanges { - target: inputPanel - y: root.height - inputPanel.height - } - } - transitions: Transition { - from: "" - to: "visible" - reversible: true - ParallelAnimation { - NumberAnimation { - properties: "y" - duration: 250 - easing.type: Easing.InOutQuad - } - } - } - AutoScroller {} - } - } -} diff --git a/src/settingsui/network/AddressListEntry.qml b/src/settingsui/network/AddressListEntry.qml deleted file mode 100644 index 9612778..0000000 --- a/src/settingsui/network/AddressListEntry.qml +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 - -RowLayout { - id: root - spacing: 10 - property alias model: repeater.model - property bool modified: false - property alias title: label.text - - Label { - id: label - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - Layout.alignment: Qt.AlignTop - Layout.topMargin: 10 - } - ColumnLayout { - spacing: 10 - Layout.fillWidth: true - - Repeater { - id: repeater - visible: count > 0 - RowLayout { - spacing: 10 - TextField { - text: edit - Layout.fillWidth: true - onEditingFinished: { - root.modified = true; - edit = text; - } - } - Button { - Layout.preferredWidth: height - text: "-" - visible: repeater.count > 0 - onClicked: { - root.modified = true; - root.model.remove(index); - } - } - Button { - Layout.preferredWidth: height - visible: index === repeater.count - 1 - text: "+" - onClicked: root.model.append("") - - Layout.alignment: Qt.AlignRight - } - } - } - RowLayout { - visible: repeater.count === 0 - spacing: 10 - TextField { - id: nameServerEntryItem - Layout.fillWidth: true - text: "" - onAccepted: root.model.append(text) - } - Button { - Layout.preferredWidth: height - text: "+" - onClicked: nameServerEntryItem.accepted() - } - } - } -} diff --git a/src/settingsui/network/ComboBoxEntry.qml b/src/settingsui/network/ComboBoxEntry.qml deleted file mode 100644 index 1d4858a..0000000 --- a/src/settingsui/network/ComboBoxEntry.qml +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 - -RowLayout { - id: root - spacing: 10 - width: parent.width - - property alias title: label.text - property alias currentIndex: cb.currentIndex - property alias delegate: cb.delegate - property alias textRole: cb.textRole - property alias model: cb.model - property alias count: cb.count - property int titleWidth: -1 - signal activated(var index) - signal highlighted(var index) - - Label { - id: label - Layout.preferredWidth: root.titleWidth - horizontalAlignment: Text.AlignRight - Layout.alignment: Qt.AlignVCenter - } - ComboBox { - id: cb - textRole: "text" - Layout.fillWidth: true - onActivated: root.activated(currentIndex) - onHighlightedIndexChanged: root.highlighted(currentIndex) - } -} diff --git a/src/settingsui/network/EditWiredSettings.qml b/src/settingsui/network/EditWiredSettings.qml deleted file mode 100644 index 857c8e9..0000000 --- a/src/settingsui/network/EditWiredSettings.qml +++ /dev/null @@ -1,366 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -Item { - id: root - property string title: qsTr("Ethernet Settings") - property var service: undefined - property bool ipv4Changed: false - property bool ipv6Changed: false - property bool nameserversChanged: false - property bool domainsChanged: false - property bool proxyChanged: false - - Component.onDestruction: { - //Clear all unsaved changes from models - service.proxy.excludes.resetChanges(); - service.nameservers.resetChanges(); - service.domains.resetChanges(); - } - - Component.onCompleted: titlebar.title = service.name; - - Flickable { - anchors.fill: parent - anchors.top: saveButton.bottom - anchors.margins: 20 - contentHeight: content.height - contentWidth: width - - Column { - id: content - width: parent.width - spacing: 10 - property int titleWidth: width * 0.382 - property int groupWidth: width - saveButton.width - 10 - - //IPv4 Config - GroupBox { - width: content.groupWidth - Layout.fillWidth: true - title: qsTr("IPv4") - - ColumnLayout { - anchors.fill: parent - - ComboBoxEntry { - id: ipv4Method - title: qsTr("Connection method:") - titleWidth: content.titleWidth - model: ListModel { - id: methodsModel - - ListElement { - text: "DHCP" - method: NetworkSettingsIPv4.Dhcp - } - ListElement { - text: "Manual" - method: NetworkSettingsIPv4.Manual - } - ListElement { - text: "Off" - method: NetworkSettingsIPv4.Off - } - } - onCurrentIndexChanged: { - ipv4Changed = true; - service.ipv4.method = model.get(currentIndex).method; - } - } - - GridLayout { - columnSpacing: 10 - rows: 3 - columns: 2 - visible: service.ipv4.method !== NetworkSettingsIPv4.Off - width: parent.width - - Label { - text: qsTr("Address:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - IpAddressTextField { - id: ipv4Address - text: service.ipv4.address - onTextChanged: ipv4Changed = true; - onAccepted: if (text.length > 0) service.ipv4.address = text - enabled: service.ipv4.method === NetworkSettingsIPv4.Manual - } - Label { - text: qsTr("Mask:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - IpAddressTextField { - id: ipv4Mask - text: service.ipv4.mask - onTextChanged: ipv4Changed = true; - onAccepted: if (text.length > 0) service.ipv4.mask = text - enabled: service.ipv4.method === NetworkSettingsIPv4.Manual - } - Label { - text: qsTr("Router:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - IpAddressTextField { - id: ipv4Gateway - text: service.ipv4.gateway - onTextChanged: ipv4Changed = true - onAccepted: if (text.length > 0) service.ipv4.gateway = text - enabled: service.ipv4.method === NetworkSettingsIPv4.Manual - } - } - } - } - - //IPv6 Config - GroupBox { - width: content.groupWidth - Layout.fillWidth: true - title: qsTr("IPv6") - - ColumnLayout { - anchors.fill: parent - - ComboBoxEntry { - id: ipv6Method - title: qsTr("Connection method:") - titleWidth: content.titleWidth - model: ListModel { - id: ipv6methodsmodel - - ListElement { - text: qsTr("Auto") - method: NetworkSettingsIPv6.Auto - } - ListElement { - text: qsTr("Manual") - method: NetworkSettingsIPv6.Manual - } - ListElement { - text: qsTr("Off") - method: NetworkSettingsIPv6.Off - } - } - - onCurrentIndexChanged: { - ipv6Changed = true; - service.ipv6.method = model.get(currentIndex).method; - } - } - GridLayout { - columnSpacing: 10 - rows: 3 - columns: 2 - visible: service.ipv6.method !== NetworkSettingsIPv6.Off - - Label { - text: qsTr("Address:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - TextField { - id: ipv6Address - text: service.ipv6.address - Layout.fillWidth: true - onTextChanged: ipv6Changed = true; - onAccepted: if (text.length > 0) service.ipv6.address = text - enabled: service.ipv6.method === NetworkSettingsIPv6.Manual - } - Label { - text: qsTr("Router:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - TextField { - id: ipv6Gateway - text: service.ipv6.gateway - Layout.fillWidth: true - onTextChanged: ipv6Changed = true; - onAccepted: if (text.length > 0) service.ipv4.gateway = text - enabled: service.ipv6.method === NetworkSettingsIPv6.Manual - } - Label { - text: qsTr("Prefix length:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - } - TextField { - id: ipv6PrefixLength - text: service.ipv6.prefixLength - Layout.fillWidth: true - validator: IntValidator { bottom: 0; top: 255 } - onTextChanged: ipv6Changed = true - onAccepted: if (text.length > 0) service.ipv6.prefixLength = parseInt(text) - enabled: service.ipv6.method === NetworkSettingsIPv6.Manual - } - } - } - } - GroupBox { - width: content.groupWidth - Layout.fillWidth: true - title: qsTr("Name servers") - - ColumnLayout { - anchors.fill: parent - AddressListEntry { - title: qsTr("Address:") - model: service.nameservers - modified: nameserversChanged - } - } - } - GroupBox { - width: content.groupWidth - Layout.fillWidth: true - title: qsTr("Domains") - - ColumnLayout { - anchors.fill: parent - AddressListEntry { - title: qsTr("Address:") - model: service.domains - modified: domainsChanged - } - } - } - GroupBox { - width: content.groupWidth - Layout.fillWidth: true - title: qsTr("Proxy Settings") - - ColumnLayout { - id: proxyLayout - width: parent.width - - ComboBoxEntry { - title: qsTr("Configuration:") - titleWidth: content.titleWidth - model: ListModel { - id: proxyMethodModel - - ListElement { - text: qsTr("Direct") - method: NetworkSettingsProxy.Direct - } - ListElement { - text: qsTr("Auto") - method: NetworkSettingsProxy.Auto - } - ListElement { - text: qsTr("Manual") - method: NetworkSettingsProxy.Manual - } - } - Component.onCompleted: currentIndex = service.proxy.method - - onCurrentIndexChanged: { - proxyChanged = true; - service.proxy.method = model.get(currentIndex).method; - } - } - RowLayout { - spacing: 10 - visible: service.proxy.method !== NetworkSettingsProxy.Direct - - Label { - text: service.proxy.method === NetworkSettingsProxy.Manual ? qsTr("Proxy address:") : qsTr("Configuration URL:") - Layout.preferredWidth: content.titleWidth - horizontalAlignment: Text.AlignRight - Layout.alignment: Qt.AlignVCenter - elide: Label.ElideRight - } - TextField { - id: proxyUrl - text: service.proxy.url - Layout.fillWidth: true - onTextChanged: proxyChanged = true; - onAccepted: service.proxy.url = text; - } - } - AddressListEntry { - model: service.proxy.excludes - modified: proxyChanged - title: qsTr("No proxy for:") - visible: service.proxy.method === NetworkSettingsProxy.Manual - } - } - } - } - } - Button { - id: saveButton - anchors.right: parent.right - anchors.top: parent.top - anchors.margins: 20 - text: qsTr("Save") - - onClicked: { - if (ipv4Changed) { - ipv4Address.accepted(); - ipv4Mask.accepted(); - ipv4Gateway.accepted(); - service.setupIpv4Config(); - } - - if (ipv6Changed) { - ipv6Address.accepted(); - ipv6Gateway.accepted(); - ipv6PrefixLength.accepted(); - service.setupIpv6Config(); - } - - if (nameserversChanged) { - service.setupNameserversConfig(); - } - - if (domainsChanged) { - service.setupDomainsConfig(); - } - - if (proxyChanged) { - proxyUrl.accepted(); - service.setupNetworkSettingsProxy(); - } - stackView.pop(); - } - } - onServiceChanged: { - ipv4Method.currentIndex = service.ipv4.method - ipv6Method.currentIndex = service.ipv6.method - } -} diff --git a/src/settingsui/network/IpAddressTextField.qml b/src/settingsui/network/IpAddressTextField.qml deleted file mode 100644 index dcf8771..0000000 --- a/src/settingsui/network/IpAddressTextField.qml +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 - -TextField { - Layout.fillWidth: true - validator: RegExpValidator { regExp: /^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/ } -} diff --git a/src/settingsui/network/NetworkDetails.qml b/src/settingsui/network/NetworkDetails.qml deleted file mode 100644 index 6e9ee4c..0000000 --- a/src/settingsui/network/NetworkDetails.qml +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 - -Loader { - id: root - property var selectedInterface:undefined - anchors.fill: parent -} diff --git a/src/settingsui/network/NetworkListView.qml b/src/settingsui/network/NetworkListView.qml deleted file mode 100644 index 3b75412..0000000 --- a/src/settingsui/network/NetworkListView.qml +++ /dev/null @@ -1,171 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtQml 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 -import QtQuick.Controls 2.1 - -ListView { - id: list - clip: true - property var connectingService: null - property bool retryConnectAfterIdle: false - function connectBySsid() { - passphraseEnter.showSsid = true - passphraseEnter.visible = true - } - - Component.onCompleted: { - NetworkSettingsManager.services.type = NetworkSettingsType.Unknown; - } - model: NetworkSettingsManager.services - - delegate: Item { - id: networkDelegate - width: list.width - height: list.height * 0.15 - Column { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - width: parent.width * 0.5 - Text { - id: networkName - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: connected ? viewSettings.buttonGreenColor : "white" - text: name - } - Row { - id: ipRow - height: networkDelegate.height * 0.275 * opacity - spacing: networkDelegate.width * 0.0075 - Item { - width: pluginMain.margin - height: 1 - } - Text { - id: ipAddressLabel - height: parent.height - anchors.verticalCenter: parent.verticalCenter - text: qsTr("IP Address:") - color: connected ? viewSettings.buttonGreenColor : "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - } - Text { - id: ipAddress - width: root.width * 0.15 - height: parent.height - anchors.verticalCenter: parent.verticalCenter - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - color: connected ? viewSettings.buttonGreenColor : "white" - text: connected ? NetworkSettingsManager.services.itemFromRow(index).ipv4.address - : (NetworkSettingsManager.services.itemFromRow(index).state === NetworkSettingsState.Idle) ? - qsTr("Not connected") : qsTr("Connecting") - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: connected ? "SemiBold" : "Regular" - } - } - } - QtButton { - id: connectButton - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - fillColor: connected ? viewSettings.buttonGrayColor : viewSettings.buttonGreenColor - borderColor: "transparent" - text: connected ? qsTr("DISCONNECT") : qsTr("CONNECT") - height: pluginMain.buttonHeight - onClicked: { - if (connected) { - NetworkSettingsManager.services.itemFromRow(index).disconnectService(); - } else { - list.connectingService = NetworkSettingsManager.services.itemFromRow(index) - if (list.connectingService) { - passphraseEnter.extraInfo = ""; - list.connectingService.connectService(); - list.connectingService.stateChanged.connect(connectingServiceStateChange); - } - } - } - } - Rectangle { - id: delegateBottom - width: networkDelegate.width - color: viewSettings.borderColor - height: 2 - anchors.bottom: networkDelegate.bottom - anchors.horizontalCenter: networkDelegate.horizontalCenter - } - Behavior on height { NumberAnimation { duration: 200} } - - } - - Connections { - target: NetworkSettingsManager.userAgent - function onShowUserCredentialsInput() { - passphraseEnter.visible = true; - } - } - - // Popup for entering passphrase - PassphraseEnter { - id: passphraseEnter - parent: root - visible: false - } - - function connectingServiceStateChange() { - if (connectingService !== null) { - if (connectingService.state === NetworkSettingsState.Failure) { - // If authentication failed, request connection again. That will - // initiate new passphrase request. - retryConnectAfterIdle = true - } else if (connectingService.state === NetworkSettingsState.Ready) { - // If connection succeeded, we no longer have service connecting - connectingService = null; - retryConnectAfterIdle = false; - } else if (connectingService.state === NetworkSettingsState.Idle) { - if (retryConnectAfterIdle) { - passphraseEnter.extraInfo = qsTr("Invalid passphrase"); - connectingService.connectService(); - } - retryConnectAfterIdle = false; - } - } - } - - focus: true -} diff --git a/src/settingsui/network/NetworkSettings.qml b/src/settingsui/network/NetworkSettings.qml deleted file mode 100644 index 982a858..0000000 --- a/src/settingsui/network/NetworkSettings.qml +++ /dev/null @@ -1,134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.2 -import QtDeviceUtilities.NetworkSettings 1.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 -import "../common" - -Item { - id: root - property string title: qsTr("Network Settings") - - Column { - id: networkSettingsColumn - spacing: pluginMain.spacing - anchors.margins: viewSettings.pageMargin - - Row { - spacing: root.width * 0.025 - leftPadding: pluginMain.margin - Text { - text: qsTr("Wi-Fi") - anchors.verticalCenter: parent.verticalCenter - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: "white" - } - - CustomSwitch { - id: wifiSwitch - indicatorWidth: root.width * 0.15 - indicatorHeight: root.height * 0.06 - property bool wiFiAvailable: NetworkSettingsManager.interface(NetworkSettingsType.Wifi, 0) !== null - enabled: wiFiAvailable && !wifiSwitchTimer.running - onCheckedChanged: { - // Power on/off all WiFi interfaces - for (var i = 0; NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i) !== null; i++) { - NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i).powered = checked - wifiSwitchTimer.start() - } - } - Component.onCompleted: { - // If any of the WiFi interfaces is powered on, switch is checked - var checkedStatus = false; - for (var i = 0; NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i) !== null; i++) { - if (NetworkSettingsManager.interface(NetworkSettingsType.Wifi, i).powered) { - checkedStatus = true; - break; - } - } - checked = checkedStatus; - } - - // At least 1s between switching on/off - Timer { - id: wifiSwitchTimer - interval: 1000 - running: false - } - } - QtButton { - id: manualConnect - visible: true - enabled: wifiSwitch.checked - fillColor: enabled ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor - borderColor: "transparent" - height: pluginMain.buttonHeight - text: qsTr("Connect manually") - onClicked: { - networkList.connectBySsid() - } - } - QtButton { - id: manualDisconnect - visible: true - enabled: NetworkSettingsManager.currentWifiConnection - fillColor: enabled ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor - borderColor: "transparent" - height: pluginMain.buttonHeight - text: qsTr("Disconnect wireless") - onClicked: { - if (NetworkSettingsManager.currentWifiConnection) { - NetworkSettingsManager.currentWifiConnection.disconnectService(); - } - } - } - } - - Text { - text: qsTr("Network list:") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - font.styleName: "SemiBold" - color: "white" - } - - Row { - id: listViewRow - leftPadding: pluginMain.margin - NetworkListView { - id: networkList - width: root.width - listViewRow.leftPadding - height: root.height - listViewRow.y - networkSettingsColumn.anchors.margins - } - } - } -} diff --git a/src/settingsui/network/PassphraseEnter.qml b/src/settingsui/network/PassphraseEnter.qml deleted file mode 100644 index 1ed8d92..0000000 --- a/src/settingsui/network/PassphraseEnter.qml +++ /dev/null @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -Rectangle { - id: passphrasePopup - width: root.width - height: root.height - color: viewSettings.backgroundColor - opacity: 0.9 - property string extraInfo: "" - property bool showSsid: false - - Rectangle { - id: frame - color: viewSettings.backgroundColor - border.color: viewSettings.borderColor - border.width: 3 - anchors.centerIn: parent - width: passphraseColumn.width * 1.1 - height: passphraseColumn.height * 1.1 - - Column { - id: passphraseColumn - anchors.centerIn: parent - spacing: viewSettings.spacing - - Text { - visible: showSsid - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: "white" - text: qsTr("Enter SSID") - } - - TextField { - id: ssidField - visible: showSsid - width: root.width * 0.4 - height: root.height * 0.075 - color: "white" - background: Rectangle{ - color: "transparent" - border.color: ssidField.focus ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor - border.width: ssidField.focus ? width * 0.01 : 2 - } - } - - Text { - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - color: "white" - text: qsTr("Enter Passphrase") - } - - Text { - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - color: "red" - text: extraInfo - visible: (extraInfo !== "") - } - - TextField { - id: passField - width: root.width * 0.4 - height: root.height * 0.075 - color: "white" - echoMode: TextInput.Password - background: Rectangle{ - color: "transparent" - border.color: passField.focus ? viewSettings.buttonGreenColor : viewSettings.buttonGrayColor - border.width: passField.focus ? width * 0.01 : 2 - } - } - - Row { - spacing: parent.width * 0.025 - QtButton{ - id: setButton - text: qsTr("SET") - onClicked: { - if (showSsid) { - NetworkSettingsManager.connectBySsid(ssidField.text, passField.text) - showSsid = false - } else { - NetworkSettingsManager.userAgent.setPassphrase(passField.text) - } - passphrasePopup.visible = false; - } - } - QtButton { - id: cancelButton - text: qsTr("CANCEL") - borderColor: "transparent" - fillColor: viewSettings.buttonGrayColor - onClicked: { - if (!showSsid) { - NetworkSettingsManager.userAgent.cancelInput() - } - showSsid = false - passphrasePopup.visible = false; - } - } - } - } - } -} diff --git a/src/settingsui/network/WifiSelectorDelegate.qml b/src/settingsui/network/WifiSelectorDelegate.qml deleted file mode 100644 index ea044f6..0000000 --- a/src/settingsui/network/WifiSelectorDelegate.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -ItemDelegate { - id: root - autoExclusive: true - property bool connect: connected - contentItem: Item { - width: root.width - - Label { - id: text - leftPadding: root.spacing - anchors.left: parent.left - anchors.top:parent.top - anchors.right: signalMonitor.left - anchors.bottom:parent.bottom - elide: Text.ElideRight - horizontalAlignment: Text.AlignLeft - verticalAlignment: Text.AlignVCenter - text: modelData["name"] - } - WifiSignalMonitor { - id: signalMonitor - anchors.right: parent.right - height: parent.height - width: height - signalStrength: modelData.wirelessConfig["signalStrength"] - connected: connected - } - } -} diff --git a/src/settingsui/network/WifiSettings.qml b/src/settingsui/network/WifiSettings.qml deleted file mode 100644 index a6130ac..0000000 --- a/src/settingsui/network/WifiSettings.qml +++ /dev/null @@ -1,251 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -Item { - id: root - anchors.fill: parent - Component.onCompleted: NetworkSettingsManager.services.type = NetworkSettingsType.Wifi; - property bool connecting: false - - Flickable { - anchors.fill: parent - contentHeight: content.height - contentWidth: width - - GroupBox { - title: qsTr("Wireless Settings") - width: parent.width - - ColumnLayout { - id: content - spacing: 20 - width: parent.width - - RowLayout { - spacing: 10 - id: enableSwitch - width: parent.width - - Label { - Layout.preferredWidth: root.width * 0.382 - Layout.alignment: Qt.AlignVCenter - horizontalAlignment: Text.AlignRight - text: selectedInterface.powered ? qsTr("Wi-Fi ON") : qsTr("Wi-Fi OFF") - } - Switch { - checked: selectedInterface.powered - onCheckedChanged: { - selectedInterface.powered = checked - root.connecting = false - connectView.visible = false - } - } - } - RowLayout { - spacing: 10 - width: parent.width - - visible: selectedInterface.powered && networkSelection.count > 0 - Label { - Layout.preferredWidth: root.width * 0.382 - text: qsTr("Current network") - horizontalAlignment: Text.AlignRight - Layout.alignment: Qt.AlignVCenter - - } - ComboBoxEntry { - id: networkSelection - model: NetworkSettingsManager.services - - textRole: "name" - Layout.fillWidth: true - onActivated: { - if (index >= 0) { - connectView.visible = false - - var service = model.itemFromRow(index) - if (service) { - root.connecting = true - service.connectService(); - } - } - } - - onCountChanged: { - if (count === 0) { - root.connecting = false - connectView.visible = false - } - } - - Component.onCompleted: { - networkSelection.currentIndex = model.activeRow() - } - - delegate: WifiSelectorDelegate { - width: networkSelection.width - onConnectChanged: if (connect) networkSelection.currentIndex = index - } - } - } - - Row { - id: infoRow - spacing: 10 - width: parent.width - visible: selectedInterface.powered && selectedInterface.state !== NetworkSettingsState.Online - Label { - id: scanningText - text: { - if (networkSelection.count == 0) - return qsTr("Searching for Wi-Fi networks...") - else if (root.connecting) - return qsTr("Connecting to the network...") - else - return "" - } - horizontalAlignment: Text.AlignLeft - } - WifiSignalMonitor { - id: scanningIcon - scanning: true - visible: scanningText.text !== "" - height: scanningText.height - width: height - } - } - - GroupBox { - id: connectView - title: qsTr("Enter a passphrase") - visible: false - Layout.fillWidth: true - ColumnLayout { - width: parent.width - - RowLayout { - id: errorView - visible: text.text !== "" - spacing: 10 - property alias text: text.text - - Image { - source: "../icons/Alert_yellow_1x.png" - Layout.alignment: Qt.AlignVCenter - } - Text { - id: text - color: "#face20" - text: "" - Layout.alignment: Qt.AlignVCenter - } - } - RowLayout { - spacing: 10 - width: parent.width - - Label { - text: qsTr("Passphrase:") - horizontalAlignment: Text.AlignRight - Layout.preferredWidth: root.width * 0.382 - Layout.alignment: Qt.AlignVCenter - } - TextField { - id: passphrase - text: "" - echoMode: TextInput.Password - inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData - Layout.alignment: Qt.AlignVCenter - Layout.fillWidth: true - } - } - RowLayout { - spacing: 10 - - Button { - text: qsTr("Connect") - onClicked: { - connectView.visible = false - NetworkSettingsManager.userAgent.setPassphrase(passphrase.text) - if (networkSelection.currentIndex != -1) { - NetworkSettingsManager.services.itemFromRow(networkSelection.currentIndex).connectService(); - } - } - } - Button { - text: qsTr("Cancel") - onClicked: { - networkSelection.currentIndex = -1 - connectView.visible = false - } - } - } - } - } - ColumnLayout { - spacing: parent.spacing - width: parent.width - visible: selectedInterface.state === NetworkSettingsState.Online || - selectedInterface.state === NetworkSettingsState.Ready - Label { - text: qsTr("IP Address: ") + NetworkSettingsManager.services.itemFromRow(networkSelection.currentIndex).ipv4.address - } - Button { - id: disconnect - text: qsTr("Disconnect") - onClicked: { - NetworkSettingsManager.services.itemFromRow(networkSelection.currentIndex).disconnectService(); - networkSelection.currentIndex = -1; - root.connecting = false - } - } - } - } - Connections { - target: NetworkSettingsManager.userAgent - function onShowUserCredentialsInput() { - connectView.visible = true - root.connecting = false - } - function onError() { - errorView.visible = true - connectView.visible = true - root.connecting = false - if (networkSelection.currentIndex != -1) { - NetworkSettingsManager.services.itemFromRow(networkSelection.currentIndex).removeService(); - } - } - } - } - } -} diff --git a/src/settingsui/network/WifiSignalMonitor.qml b/src/settingsui/network/WifiSignalMonitor.qml deleted file mode 100644 index 06afca4..0000000 --- a/src/settingsui/network/WifiSignalMonitor.qml +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 - -Item { - id: root - property bool scanning: false - property int signalStrength: 100 - property bool connected: false - - onSignalStrengthChanged: { - sprite.visible = true; - - if (signalStrength < 10) { - sprite.visible = false; - } - else if (signalStrength < 30) { - sprite.currentFrame = 0; - } - else if (signalStrength < 60) { - sprite.currentFrame = 1; - } - else if (signalStrength < 80) { - sprite.currentFrame = 2; - } - else if (signalStrength <= 100) { - sprite.currentFrame = 3; - } - } - - Image { - id: sprite - property int currentFrame: 0 - anchors.fill: parent - source: "../icons/Wifi_lightgray_2x.png" - clip: true - - Timer { - id: scanningTimer - running: scanning - interval: 250 - repeat: true - onTriggered: { - if (sprite.currentFrame < 4) - sprite.currentFrame++ - else - sprite.currentFrame = 0 - } - } - - Image { - height: parent.height - width: parent.width * 4 - source: "../icons/WifiAnim_black_2x.png" - x: -parent.currentFrame * width / 4 - } - } -} diff --git a/src/settingsui/network/WiredSettings.qml b/src/settingsui/network/WiredSettings.qml deleted file mode 100644 index 11c6c24..0000000 --- a/src/settingsui/network/WiredSettings.qml +++ /dev/null @@ -1,191 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -Item { - id: root - anchors.fill: parent - property bool editMode: false - property var service: null - property string title: qsTr("Network"); - - Component.onCompleted: { - NetworkSettingsManager.services.type = NetworkSettingsType.Wired; - root.service = NetworkSettingsManager.services.itemFromRow(0); - ipv4Method.currentIndex = service.ipv4.method - } - - onServiceChanged: { - NetworkSettingsManager.services.type = NetworkSettingsType.Wired; - if (!root.service) { - root.service = NetworkSettingsManager.services.itemFromRow(0); - } - } - - GroupBox { - title: qsTr("Ethernet Connection") - anchors.fill: parent - - Column { - spacing: 10 - width: parent.width - - ComboBoxEntry { - id: ipv4Method - title: qsTr("Connection method:") - model: ListModel { - id: methodsModel - - ListElement { - text: "DHCP" - method: NetworkSettingsIPv4.Dhcp - } - ListElement { - text: "Manual" - method: NetworkSettingsIPv4.Manual - } - ListElement { - text: "Off" - method: NetworkSettingsIPv4.Off - } - } - - Component.onCompleted: currentIndex = service.ipv4.method - onCurrentIndexChanged: { - if (model.get(currentIndex).method !== NetworkSettingsIPv4.Dhcp) { - service.ipv4.method = model.get(currentIndex).method; - editMode = true; - } - else if (service){ - //Enable DHCP - if (service.ipv4.method !== model.get(currentIndex).method) { - service.ipv4.method = model.get(currentIndex).method; - service.setupIpv4Config(); - } - editMode = false; - } - } - } - Item { - width: parent.width - height: gridLayout.implicitHeight - GridLayout { - id: gridLayout - columns: 2 - rows: 4 - width: parent.width - visible: service.ipv4.method !== NetworkSettingsIPv4.Off - - Label { - text: qsTr("IP Address: ") - width: parent.width * .3 - } - IpAddressTextField { - id: ipv4Address - text: service.ipv4.address - enabled: editMode - onAccepted: if (text.length > 0) service.ipv4.address = text - } - Label { - text: qsTr("Mask: ") - } - IpAddressTextField { - id: ipv4Mask - text: service.ipv4.mask - enabled: editMode - onAccepted: if (text.length > 0) service.ipv4.mask = text - } - Label { - text: qsTr("Router: ") - } - IpAddressTextField { - id: ipv4Gateway - text: service.ipv4.gateway - enabled: editMode - onAccepted: if (text.length > 0) service.ipv4.gateway = text - } - Label { - Layout.alignment: Qt.AlignTop - text: qsTr("DNS server: ") - } - Column { - spacing: 10 - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop - - Repeater { - model: service.nameservers - - Label { - text: display - } - } - } - } - MouseArea { - anchors.fill: parent - enabled: !editMode - && methodsModel.get(ipv4Method.currentIndex).method === NetworkSettingsIPv4.Manual - onClicked: editMode = true - } - } - Row { - spacing: 10 - Button { - text: qsTr("Save") - visible: editMode - - onClicked: { - ipv4Address.accepted(); - ipv4Mask.accepted(); - ipv4Gateway.accepted(); - service.setupIpv4Config(); - editMode = false; - } - } - Button { - text: qsTr("Cancel") - visible: editMode - onClicked: { - editMode = false; - ipv4Method.currentIndex = service.ipv4.method - } - } - } - Button { - text: qsTr("Edit") - visible: !editMode - onClicked: stackView.push(Qt.resolvedUrl("EditWiredSettings.qml"), {service: root.service}); - } - } - } -} diff --git a/src/settingsui/power/Power.qml b/src/settingsui/power/Power.qml deleted file mode 100644 index 1bcc658..0000000 --- a/src/settingsui/power/Power.qml +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.1 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Item { - id: root - - Column { - anchors.top: parent.top - spacing: pluginMain.margin - - QtButton { - id: shutdownButton - width: root.width * 0.4 - height: pluginMain.fieldHeight - text: qsTr("SHUTDOWN") - onClicked: shutdownPopup.open(true) - } - QtButton { - id: rebootButton - width: root.width * 0.4 - height: pluginMain.fieldHeight - text: qsTr("REBOOT") - onClicked: shutdownPopup.open(false) - } - } -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml b/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml deleted file mode 100644 index 6fb61f4..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/QtButton.qml +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Image { - id: root - source: "image://QtButton/" + cutSize + "/" + fillColor + "/" + borderColor - sourceSize: Qt.size(width, height) - property string state: "enabled" - property int cutSize: 10 - property color fillColor: viewSettings.buttonGreenColor - property color borderColor: mouseArea.pressed ? viewSettings.buttonActiveColor : viewSettings.buttonGreenColor - property alias text: buttonText.text - signal clicked() - - width: buttonText.contentWidth + cutSize * 4 - - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: root.clicked() - } - Text { - id: buttonText - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - font.pixelSize: parent.height * 0.65 - font.family: appFont - color: "white" - } -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp b/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp deleted file mode 100644 index 7245feb..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugin.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QQmlExtensionPlugin> -#include <QQmlEngine> - -#include "qtbuttonimageprovider.h" - -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtDeviceUtilities_QtButtonImageProvider); -#endif - Q_INIT_RESOURCE(qtbuttonimageprovider); -} - -QT_BEGIN_NAMESPACE - -class QtButtonImageProviderQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QtButtonImageProviderQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); } - - void registerTypes(const char *uri) - { - Q_UNUSED(uri) - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.QtButtonImageProvider")); - qmlRegisterType(QUrl("qrc:/QtButton.qml"), uri, 1, 0, "QtButton"); - } - - void initializeEngine(QQmlEngine *engine, const char *uri) - { - Q_UNUSED(uri); - QtButtonImageProvider *provider = new QtButtonImageProvider(); - engine->addImageProvider("QtButton", provider); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes b/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes deleted file mode 100644 index 76ae3f9..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/plugins.qmltypes +++ /dev/null @@ -1,210 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.QtButtonImageProvider 1.0' - -Module { - dependencies: [] - Component { - prototype: "QObject" - name: "QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0" - exports: ["QtDeviceUtilities.QtButtonImageProvider/QtButton 1.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "state"; type: "string" } - Property { name: "cutSize"; type: "int" } - Property { name: "fillColor"; type: "QColor" } - Property { name: "borderColor"; type: "QColor" } - Property { name: "text"; type: "string" } - Signal { name: "clicked" } - Property { name: "fillMode"; type: "FillMode" } - Property { name: "paintedWidth"; type: "double"; isReadonly: true } - Property { name: "paintedHeight"; type: "double"; isReadonly: true } - Property { name: "horizontalAlignment"; type: "HAlignment" } - Property { name: "verticalAlignment"; type: "VAlignment" } - Property { name: "mipmap"; revision: 1; type: "bool" } - Property { name: "autoTransform"; revision: 2; type: "bool" } - Signal { name: "paintedGeometryChanged" } - Signal { - name: "horizontalAlignmentChanged" - Parameter { name: "alignment"; type: "HAlignment" } - } - Signal { - name: "verticalAlignmentChanged" - Parameter { name: "alignment"; type: "VAlignment" } - } - Signal { - name: "mipmapChanged" - revision: 1 - Parameter { type: "bool" } - } - Property { name: "status"; type: "Status"; isReadonly: true } - Property { name: "source"; type: "QUrl" } - Property { name: "progress"; type: "double"; isReadonly: true } - Property { name: "asynchronous"; type: "bool" } - Property { name: "cache"; type: "bool" } - Property { name: "sourceSize"; type: "QSize" } - Property { name: "mirror"; type: "bool" } - Signal { - name: "sourceChanged" - Parameter { type: "QUrl" } - } - Signal { - name: "statusChanged" - Parameter { type: "QQuickImageBase::Status" } - } - Signal { - name: "progressChanged" - Parameter { name: "progress"; type: "double" } - } - Property { name: "implicitWidth"; type: "double"; isReadonly: true } - Property { name: "implicitHeight"; type: "double"; isReadonly: true } - Property { name: "parent"; type: "QQuickItem"; isPointer: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "x"; type: "double" } - Property { name: "y"; type: "double" } - Property { name: "z"; type: "double" } - Property { name: "width"; type: "double" } - Property { name: "height"; type: "double" } - Property { name: "opacity"; type: "double" } - Property { name: "enabled"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true } - Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true } - Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true } - Property { name: "childrenRect"; type: "QRectF"; isReadonly: true } - Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true } - Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true } - Property { name: "baselineOffset"; type: "double" } - Property { name: "clip"; type: "bool" } - Property { name: "focus"; type: "bool" } - Property { name: "activeFocus"; type: "bool"; isReadonly: true } - Property { name: "activeFocusOnTab"; revision: 1; type: "bool" } - Property { name: "rotation"; type: "double" } - Property { name: "scale"; type: "double" } - Property { name: "transformOrigin"; type: "TransformOrigin" } - Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true } - Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true } - Property { name: "smooth"; type: "bool" } - Property { name: "antialiasing"; type: "bool" } - Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true } - Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true } - Signal { - name: "childrenRectChanged" - Parameter { type: "QRectF" } - } - Signal { - name: "baselineOffsetChanged" - Parameter { type: "double" } - } - Signal { - name: "stateChanged" - Parameter { type: "string" } - } - Signal { - name: "focusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusChanged" - Parameter { type: "bool" } - } - Signal { - name: "activeFocusOnTabChanged" - revision: 1 - Parameter { type: "bool" } - } - Signal { - name: "parentChanged" - Parameter { type: "QQuickItem"; isPointer: true } - } - Signal { - name: "transformOriginChanged" - Parameter { type: "TransformOrigin" } - } - Signal { - name: "smoothChanged" - Parameter { type: "bool" } - } - Signal { - name: "antialiasingChanged" - Parameter { type: "bool" } - } - Signal { - name: "clipChanged" - Parameter { type: "bool" } - } - Signal { - name: "windowChanged" - revision: 1 - Parameter { name: "window"; type: "QQuickWindow"; isPointer: true } - } - Method { name: "update" } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - Parameter { name: "targetSize"; type: "QSize" } - } - Method { - name: "grabToImage" - revision: 2 - type: "bool" - Parameter { name: "callback"; type: "QJSValue" } - } - Method { - name: "contains" - type: "bool" - Parameter { name: "point"; type: "QPointF" } - } - Method { - name: "mapFromItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToItem" - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapFromGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { - name: "mapToGlobal" - revision: 7 - Parameter { type: "QQmlV4Function"; isPointer: true } - } - Method { name: "forceActiveFocus" } - Method { - name: "forceActiveFocus" - Parameter { name: "reason"; type: "Qt::FocusReason" } - } - Method { - name: "nextItemInFocusChain" - revision: 1 - type: "QQuickItem*" - Parameter { name: "forward"; type: "bool" } - } - Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" } - Method { - name: "childAt" - type: "QQuickItem*" - Parameter { name: "x"; type: "double" } - Parameter { name: "y"; type: "double" } - } - } -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/qmldir b/src/settingsui/qtbuttonimageproviderplugin/qmldir deleted file mode 100644 index 4107ed2..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module QtDeviceUtilities.QtButtonImageProvider -plugin qtbuttonimageproviderplugin -classname QtButtonImageProviderQmlPlugin diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp deleted file mode 100644 index 5bf162b..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QQuickImageProvider> -#include <QImage> -#include <QPainter> -#include <QPainterPath> - -#include "qtbuttonimageprovider.h" - -QtButtonImageProvider::QtButtonImageProvider() - : QQuickImageProvider(QQuickImageProvider::Pixmap) -{ -} - -QPixmap QtButtonImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) -{ - bool ok = false; - - QStringList params = id.split("/"); - - int cutSize = params.at(0).toInt(&ok); - - if (!ok) - cutSize = 10; - - QColor fillColor; - QColor borderColor; - - if (params.length() > 1) { - fillColor = QColor(params.at(1)); - } - - if (params.length() > 2) - borderColor = QColor(params.at(2)); - - if (!fillColor.isValid()) - fillColor = "#00eb00"; - - if (!borderColor.isValid()) - borderColor ="white"; - - int width = 100; - int height = 50; - - if (size) - *size = QSize(requestedSize.width(), requestedSize.height()); - - QPixmap pixmap(requestedSize.width() > 0 ? requestedSize.width() : width, - requestedSize.height() > 0 ? requestedSize.height() : height); - pixmap.fill(Qt::transparent); - - QPainter painter(&pixmap); - const qreal borderPenWidth = 2; - QPen borderPen(QBrush(borderColor), borderPenWidth); - borderPen.setJoinStyle(Qt::MiterJoin); - painter.setRenderHint(QPainter::Antialiasing, true); - painter.setPen(borderPen); - painter.setBrush(fillColor); - - QPainterPath path; - qreal top = borderPenWidth - 1; - qreal left = borderPenWidth - 1; - qreal bottom = pixmap.height() - borderPenWidth; - qreal right = pixmap.width() - borderPenWidth; - path.moveTo(left + cutSize, top); - path.lineTo(right, top); - path.lineTo(right, bottom - cutSize); - path.lineTo(right - cutSize, bottom); - path.lineTo(left, bottom); - path.lineTo(left, top + cutSize); - path.lineTo(left + cutSize, top); - painter.drawPath(path); - - return pixmap; -} diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h deleted file mode 100644 index 8fe7cdc..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.h +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef QTBUTTONIMAGEPROVIDER_H -#define QTBUTTONIMAGEPROVIDER_H - -#include <QQuickImageProvider> -#include <QPixmap> - -class QtButtonImageProvider : public QQuickImageProvider -{ -public: - QtButtonImageProvider(); - - QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize); - - void setCutSize(int size) { m_cutSize = size; } -private: - int m_cutSize; -}; - -#endif // QTBUTTONIMAGEPROVIDER_H diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc deleted file mode 100644 index b3b680c..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageprovider.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>QtButton.qml</file> - </qresource> -</RCC> diff --git a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro b/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro deleted file mode 100644 index 2cba61b..0000000 --- a/src/settingsui/qtbuttonimageproviderplugin/qtbuttonimageproviderplugin.pro +++ /dev/null @@ -1,17 +0,0 @@ -QT += qml quick -CONFIG += no_cxx_module - -TARGET = qtbuttonimageproviderplugin -TARGETPATH = QtDeviceUtilities/QtButtonImageProvider - -SOURCES += \ - qtbuttonimageprovider.cpp \ - plugin.cpp - -HEADERS += \ - qtbuttonimageprovider.h - -RESOURCES += \ - qtbuttonimageprovider.qrc - -load(qml_plugin) diff --git a/src/settingsui/settingsui.pro b/src/settingsui/settingsui.pro deleted file mode 100644 index b20b548..0000000 --- a/src/settingsui/settingsui.pro +++ /dev/null @@ -1,18 +0,0 @@ -TEMPLATE = app - -QT += qml quick -SOURCES += main.cpp - -RESOURCES += \ - settingsuiapp.qrc - -# Additional import path used to resolve QML modules in Qt Creator's code model -QML_IMPORT_PATH = - -# Default rules for deployment. -include(deployment.pri) - -static { - QTPLUGIN += qtvirtualkeyboardplugin - QT += svg -} diff --git a/src/settingsui/settingsuiapp.qrc b/src/settingsui/settingsuiapp.qrc deleted file mode 100644 index 110cf83..0000000 --- a/src/settingsui/settingsuiapp.qrc +++ /dev/null @@ -1,36 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>common/HandwritingModeButton.qml</file> - <file>AutoScroller.qml</file> - <file>power/Power.qml</file> - <file>timedate/ManualTime.qml</file> - <file>timedate/CustomComboBox.qml</file> - <file>common/CustomSwitch.qml</file> - <file>network/PassphraseEnter.qml</file> - <file>locale/TableKey.qml</file> - <file>locale/TableValue.qml</file> - <file>display/Display.qml</file> - <file>locale/Language.qml</file> - <file>locale/RegionSelect.qml</file> - <file>network/AddressListEntry.qml</file> - <file>network/ComboBoxEntry.qml</file> - <file>network/EditWiredSettings.qml</file> - <file>network/IpAddressTextField.qml</file> - <file>network/NetworkDetails.qml</file> - <file>network/NetworkListView.qml</file> - <file>network/NetworkSettings.qml</file> - <file>network/WifiSelectorDelegate.qml</file> - <file>network/WifiSettings.qml</file> - <file>network/WifiSignalMonitor.qml</file> - <file>network/WiredSettings.qml</file> - <file>settingsuiplugin/pluginMain.qml</file> - <file>settingsuiplugin/SettingsDelegate.qml</file> - <file>settingsuiplugin/SettingsHeader.qml</file> - <file>settingsuiplugin/SettingsTitleItem.qml</file> - <file>settingsuiplugin/ShutdownPopup.qml</file> - <file>bluetooth/Bluetooth.qml</file> - <file>bluetooth/Discovery.qml</file> - <file>ViewSettings.qml</file> - </qresource> -</RCC> diff --git a/src/settingsui/settingsuiplugin/SettingsDelegate.qml b/src/settingsui/settingsuiplugin/SettingsDelegate.qml deleted file mode 100644 index 91f4ca4..0000000 --- a/src/settingsui/settingsuiplugin/SettingsDelegate.qml +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtGraphicalEffects 1.0 - -Item { - width: settingsList.width - height: settingsList.height * 0.08 - - property bool isSelected: settingsList.currentIndex == index - - Image { - id: img - sourceSize.width: parent.width - sourceSize.height: parent.height - source: icon - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: parent.width * 0.075 - height: Math.min(parent.width * 0.5, parent.height * 0.6) - width: height - fillMode: Image.PreserveAspectFit - visible: parent.isSelected ? false : true - } - ColorOverlay { - source: img - anchors.fill: img - visible: parent.isSelected ? true : false - color: viewSettings.buttonGreenColor - } - - Text { - text: title - height: parent.height * 0.75 - anchors.right: parent.right - anchors.left: img.right - anchors.leftMargin: parent.width * 0.025 - anchors.verticalCenter: parent.verticalCenter - fontSizeMode: Text.Fit - minimumPixelSize: 1 - font.pixelSize: Math.min(parent.width * 0.25, parent.height) - color: parent.isSelected ? viewSettings.buttonGreenColor : "white" - wrapMode: Text.WordWrap - verticalAlignment: Text.AlignVCenter - font.family: appFont - font.styleName: parent.isSelected ? "Bold" : "Regular" - } - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - settingsList.currentIndex = index - settingsLoader.source = path + '/' + view + '.qml' - titleItem.title = title - } - } - - Component.onCompleted: pluginMain.init() -} diff --git a/src/settingsui/settingsuiplugin/SettingsHeader.qml b/src/settingsui/settingsuiplugin/SettingsHeader.qml deleted file mode 100644 index c9ba7cf..0000000 --- a/src/settingsui/settingsuiplugin/SettingsHeader.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtDeviceUtilities.NetworkSettings 1.0 - -Item { - id: header - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.margins: pluginMain.margin - height: pluginMain.margin * 4 - - signal clicked() - - Image { - id: backButton - objectName: "settingsBackButton" - anchors.left: parent.left - anchors.top: parent.top - source: "../newIcons/back_icon.svg" - height: parent.height * 0.5 - width: height / sourceSize.height * sourceSize.width - MouseArea { - anchors.fill: parent - anchors.margins: -parent.height * 0.2 - onClicked: header.clicked() - } - } - - Text { - id: settingsText - anchors.left: backButton.right - anchors.verticalCenter: backButton.verticalCenter - font.pixelSize: parent.height * 0.45 - text: qsTr("Settings") - color: "white" - font.family: appFont - font.styleName: "SemiBold" - MouseArea { - anchors.fill: parent - anchors.margins: -parent.height * 0.2 - onClicked: header.clicked() - } - } - - Text { - id: ipItem - width: parent.width * 0.25 - height: parent.height/2 - anchors.top: settingsText.top - anchors.right: parent.right - anchors.rightMargin: pluginMain.margin - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.3 - color: "white" - font.family: appFont - font.styleName: "SemiBold" - text: NetworkSettingsManager.currentWiredConnection ? - qsTr("Wired IP: ") + - NetworkSettingsManager.currentWiredConnection.ipv4.address : "" - } - - Text { - id: wifiIpItem - width: parent.width * 0.25 - height: parent.height/2 - anchors.top: ipItem.bottom - anchors.right: parent.right - anchors.rightMargin: pluginMain.margin - horizontalAlignment: Text.AlignRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: parent.height * 0.3 - color: "white" - font.family: appFont - font.styleName: "SemiBold" - text: NetworkSettingsManager.currentWifiConnection ? - qsTr("Wireless IP: ") + - NetworkSettingsManager.currentWifiConnection.ipv4.address : "" - } -} diff --git a/src/settingsui/settingsuiplugin/SettingsTitleItem.qml b/src/settingsui/settingsuiplugin/SettingsTitleItem.qml deleted file mode 100644 index 0ead0c6..0000000 --- a/src/settingsui/settingsuiplugin/SettingsTitleItem.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 - -Column { - id: page - spacing: pluginMain.spacing - - property alias title: displayText.text - - Text { - id: displayText - font.pixelSize: pluginMain.titleFontSize - color: "white" - fontSizeMode: Text.Fit - minimumPixelSize: 1 - font.family: appFont - font.styleName: "Bold" - } - - Rectangle { - id: btmLine - width: page.parent.width * 0.3 - height: 3 - } - - Item { - height: pluginMain.margin - width: 1 - } -} diff --git a/src/settingsui/settingsuiplugin/ShutdownPopup.qml b/src/settingsui/settingsuiplugin/ShutdownPopup.qml deleted file mode 100644 index 4ae9480..0000000 --- a/src/settingsui/settingsuiplugin/ShutdownPopup.qml +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Rectangle { - id: shutdownPopup - width: parent.width - height: parent.height - color: viewSettings.backgroundColor - opacity: 0.9 - - signal accepted() - property bool shutdown: false - - function open(sd) - { - shutdown = sd - if (sd) { - shutDownConfirmText.text = qsTr("Shut down the system?") - shutDownConfirm.text = qsTr("SHUT DOWN") - } - else { - shutDownConfirmText.text = qsTr("Reboot the system?") - shutDownConfirm.text = qsTr("REBOOT") - } - - visible = true; - } - - function close() - { - visible = false; - } - - Rectangle { - id: frame - color: viewSettings.backgroundColor - border.color: viewSettings.borderColor - border.width: 3 - anchors.centerIn: parent - width: parent.width * 0.35 - height: parent.height * 0.4 - - Column { - anchors.centerIn: parent - spacing: viewSettings.pageMargin - - Text { - id: shutDownConfirmText - width: frame.width * 0.75 - height: frame.height * 0.25 - horizontalAlignment: Text.AlignHCenter - anchors.horizontalCenter: parent.horizontalCenter - fontSizeMode: Text.Fit - minimumPixelSize: 1 - font.pixelSize: frame.width * 0.3 - color: "white" - font.family: viewSettings.appFont - font.styleName: "SemiBold" - text: "" - } - QtButton { - id: shutDownConfirm - height: frame.height * 0.15 - width: frame.width * 0.45 - anchors.horizontalCenter: parent.horizontalCenter - text: "" - onClicked: shutdownPopup.accepted() - } - QtButton { - height: frame.height * 0.15 - width: frame.width * 0.45 - anchors.horizontalCenter: parent.horizontalCenter - borderColor: "transparent" - fillColor: viewSettings.buttonGrayColor - text: qsTr("CANCEL") - onClicked: shutdownPopup.close() - } - } - } -} diff --git a/src/settingsui/settingsuiplugin/icons.qrc b/src/settingsui/settingsuiplugin/icons.qrc deleted file mode 100644 index 91c3a76..0000000 --- a/src/settingsui/settingsuiplugin/icons.qrc +++ /dev/null @@ -1,56 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>icons/Alert_yellow_1x.png</file> - <file>icons/Audio_qt_6x.png</file> - <file>icons/Bluetooth_qt_1x.png</file> - <file>icons/Bluetooth_qt_6x.png</file> - <file>icons/Camcorder_qt_1x.png</file> - <file>icons/Camera_qt_1x.png</file> - <file>icons/Clock_qt_1x.png</file> - <file>icons/Clock_qt_6x.png</file> - <file>icons/Display_qt_6x.png</file> - <file>icons/Flag_qt_6x.png</file> - <file>icons/FloatingButton_Active.png</file> - <file>icons/FloatingButton_Available.png</file> - <file>icons/FloatingButton_Unavailable.png</file> - <file>icons/Headphones_qt_1x.png</file> - <file>icons/Heartbeat_qt_1x.png</file> - <file>icons/Keyboard_qt_1x.png</file> - <file>icons/Laptop_qt_1x.png</file> - <file>icons/Microphone_qt_1x.png</file> - <file>icons/MobilePhone_qt_1x.png</file> - <file>icons/Mouse_qt_1x.png</file> - <file>icons/Tablet_qt_1x.png</file> - <file>icons/Volume_down_qt_1x.png</file> - <file>icons/Volume_mute_qt_1x.png</file> - <file>icons/Volume_up_qt_1x.png</file> - <file>icons/WifiAnim_black_2x.png</file> - <file>icons/Wifi_lightgray_2x.png</file> - <file>icons/World_qt_6x.png</file> - <file>icons/Chevron-left_black_6x.png</file> - <file>icons/Chevron-left_black.png</file> - <file>icons/Power_black_6x.png</file> - <file>newIcons/back_icon.svg</file> - <file>newIcons/bluetooth_icon.svg</file> - <file>newIcons/close_icon.svg</file> - <file>newIcons/date-time_icon.svg</file> - <file>newIcons/detail_icon.svg</file> - <file>newIcons/display_icon.svg</file> - <file>newIcons/grid_icon.svg</file> - <file>newIcons/header_toggle_icon.svg</file> - <file>newIcons/info_icon.svg</file> - <file>newIcons/language_icon.svg</file> - <file>newIcons/mouse_icon.svg</file> - <file>newIcons/mute_icon.svg</file> - <file>newIcons/network_icon.svg</file> - <file>newIcons/pause_icon.svg</file> - <file>newIcons/play_icon.svg</file> - <file>newIcons/power_icon.svg</file> - <file>newIcons/settings_icon.svg</file> - <file>newIcons/settingsmenu_launcher_icon.svg</file> - <file>newIcons/stop_icon.svg</file> - <file>newIcons/touch_icon.svg</file> - <file>newIcons/volume_icon.svg</file> - <file>newIcons/qt_logo_green_rgb.svg</file> - </qresource> -</RCC> diff --git a/src/settingsui/settingsuiplugin/icons/Alert_yellow_1x.png b/src/settingsui/settingsuiplugin/icons/Alert_yellow_1x.png Binary files differdeleted file mode 100644 index 6fd25cb..0000000 --- a/src/settingsui/settingsuiplugin/icons/Alert_yellow_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Audio_qt_6x.png b/src/settingsui/settingsuiplugin/icons/Audio_qt_6x.png Binary files differdeleted file mode 100644 index a33b286..0000000 --- a/src/settingsui/settingsuiplugin/icons/Audio_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_1x.png Binary files differdeleted file mode 100644 index d9378b4..0000000 --- a/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_6x.png b/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_6x.png Binary files differdeleted file mode 100644 index 87d80cd..0000000 --- a/src/settingsui/settingsuiplugin/icons/Bluetooth_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Camcorder_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Camcorder_qt_1x.png Binary files differdeleted file mode 100644 index 79db562..0000000 --- a/src/settingsui/settingsuiplugin/icons/Camcorder_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Camera_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Camera_qt_1x.png Binary files differdeleted file mode 100644 index 0b831c5..0000000 --- a/src/settingsui/settingsuiplugin/icons/Camera_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Chevron-left_black.png b/src/settingsui/settingsuiplugin/icons/Chevron-left_black.png Binary files differdeleted file mode 100644 index 0ebc3f4..0000000 --- a/src/settingsui/settingsuiplugin/icons/Chevron-left_black.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Chevron-left_black_6x.png b/src/settingsui/settingsuiplugin/icons/Chevron-left_black_6x.png Binary files differdeleted file mode 100644 index c1a8cff..0000000 --- a/src/settingsui/settingsuiplugin/icons/Chevron-left_black_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Clock_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Clock_qt_1x.png Binary files differdeleted file mode 100644 index d4b220d..0000000 --- a/src/settingsui/settingsuiplugin/icons/Clock_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Clock_qt_6x.png b/src/settingsui/settingsuiplugin/icons/Clock_qt_6x.png Binary files differdeleted file mode 100644 index b351887..0000000 --- a/src/settingsui/settingsuiplugin/icons/Clock_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Display_qt_6x.png b/src/settingsui/settingsuiplugin/icons/Display_qt_6x.png Binary files differdeleted file mode 100644 index 89d1845..0000000 --- a/src/settingsui/settingsuiplugin/icons/Display_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Flag_qt_6x.png b/src/settingsui/settingsuiplugin/icons/Flag_qt_6x.png Binary files differdeleted file mode 100644 index 32212da..0000000 --- a/src/settingsui/settingsuiplugin/icons/Flag_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Active.png b/src/settingsui/settingsuiplugin/icons/FloatingButton_Active.png Binary files differdeleted file mode 100755 index 9b55146..0000000 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Active.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Available.png b/src/settingsui/settingsuiplugin/icons/FloatingButton_Available.png Binary files differdeleted file mode 100755 index 1479881..0000000 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Available.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/FloatingButton_Unavailable.png b/src/settingsui/settingsuiplugin/icons/FloatingButton_Unavailable.png Binary files differdeleted file mode 100755 index 33aa87d..0000000 --- a/src/settingsui/settingsuiplugin/icons/FloatingButton_Unavailable.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Headphones_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Headphones_qt_1x.png Binary files differdeleted file mode 100644 index da86427..0000000 --- a/src/settingsui/settingsuiplugin/icons/Headphones_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Heartbeat_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Heartbeat_qt_1x.png Binary files differdeleted file mode 100644 index 9599158..0000000 --- a/src/settingsui/settingsuiplugin/icons/Heartbeat_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Keyboard_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Keyboard_qt_1x.png Binary files differdeleted file mode 100644 index 5911e06..0000000 --- a/src/settingsui/settingsuiplugin/icons/Keyboard_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Laptop_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Laptop_qt_1x.png Binary files differdeleted file mode 100644 index 4708259..0000000 --- a/src/settingsui/settingsuiplugin/icons/Laptop_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Microphone_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Microphone_qt_1x.png Binary files differdeleted file mode 100644 index 9182212..0000000 --- a/src/settingsui/settingsuiplugin/icons/Microphone_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/MobilePhone_qt_1x.png b/src/settingsui/settingsuiplugin/icons/MobilePhone_qt_1x.png Binary files differdeleted file mode 100644 index 50fcc0a..0000000 --- a/src/settingsui/settingsuiplugin/icons/MobilePhone_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Mouse_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Mouse_qt_1x.png Binary files differdeleted file mode 100644 index a1eefe5..0000000 --- a/src/settingsui/settingsuiplugin/icons/Mouse_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Power_black_6x.png b/src/settingsui/settingsuiplugin/icons/Power_black_6x.png Binary files differdeleted file mode 100644 index d6add07..0000000 --- a/src/settingsui/settingsuiplugin/icons/Power_black_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Tablet_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Tablet_qt_1x.png Binary files differdeleted file mode 100644 index 1d0bc4f..0000000 --- a/src/settingsui/settingsuiplugin/icons/Tablet_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Volume_down_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Volume_down_qt_1x.png Binary files differdeleted file mode 100644 index 05c2ce4..0000000 --- a/src/settingsui/settingsuiplugin/icons/Volume_down_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Volume_mute_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Volume_mute_qt_1x.png Binary files differdeleted file mode 100644 index ca14213..0000000 --- a/src/settingsui/settingsuiplugin/icons/Volume_mute_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Volume_up_qt_1x.png b/src/settingsui/settingsuiplugin/icons/Volume_up_qt_1x.png Binary files differdeleted file mode 100644 index 08f6221..0000000 --- a/src/settingsui/settingsuiplugin/icons/Volume_up_qt_1x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/WifiAnim_black_2x.png b/src/settingsui/settingsuiplugin/icons/WifiAnim_black_2x.png Binary files differdeleted file mode 100644 index c2dc8c5..0000000 --- a/src/settingsui/settingsuiplugin/icons/WifiAnim_black_2x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/Wifi_lightgray_2x.png b/src/settingsui/settingsuiplugin/icons/Wifi_lightgray_2x.png Binary files differdeleted file mode 100644 index b71b22e..0000000 --- a/src/settingsui/settingsuiplugin/icons/Wifi_lightgray_2x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/World_qt_6x.png b/src/settingsui/settingsuiplugin/icons/World_qt_6x.png Binary files differdeleted file mode 100644 index 2aee655..0000000 --- a/src/settingsui/settingsuiplugin/icons/World_qt_6x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/generate_icons.sh b/src/settingsui/settingsuiplugin/icons/generate_icons.sh deleted file mode 100755 index 7218df0..0000000 --- a/src/settingsui/settingsuiplugin/icons/generate_icons.sh +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################ -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Device Utilities module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# -#!/bin/bash -# -# This script resizes and sets correct brand colors for the icons in ref folder -# - -./scripts/cimages.sh ./ref/*.png -./scripts/cimage.sh ./ref/extra/Alert.png red -./scripts/cimage.sh ./ref/extra/Alert.png yellow -./scripts/rimages.sh *.png diff --git a/src/settingsui/settingsuiplugin/icons/ref/Audio.png b/src/settingsui/settingsuiplugin/icons/ref/Audio.png Binary files differdeleted file mode 100644 index 8434f0a..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Audio.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Back.png b/src/settingsui/settingsuiplugin/icons/ref/Back.png Binary files differdeleted file mode 100644 index 9029fd0..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Back.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Bluetooth.png b/src/settingsui/settingsuiplugin/icons/ref/Bluetooth.png Binary files differdeleted file mode 100644 index e7c80a9..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Bluetooth.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Camcorder.png b/src/settingsui/settingsuiplugin/icons/ref/Camcorder.png Binary files differdeleted file mode 100644 index 8c317a2..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Camcorder.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Camera.png b/src/settingsui/settingsuiplugin/icons/ref/Camera.png Binary files differdeleted file mode 100644 index c71ab25..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Camera.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Chevron-left.png b/src/settingsui/settingsuiplugin/icons/ref/Chevron-left.png Binary files differdeleted file mode 100644 index 95006f4..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Chevron-left.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Chevron-right.png b/src/settingsui/settingsuiplugin/icons/ref/Chevron-right.png Binary files differdeleted file mode 100644 index 2860e9a..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Chevron-right.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Circle-x.png b/src/settingsui/settingsuiplugin/icons/ref/Circle-x.png Binary files differdeleted file mode 100644 index 2bbfa97..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Circle-x.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Clock.png b/src/settingsui/settingsuiplugin/icons/ref/Clock.png Binary files differdeleted file mode 100644 index 1dae63e..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Clock.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Cogs.png b/src/settingsui/settingsuiplugin/icons/ref/Cogs.png Binary files differdeleted file mode 100644 index feaae50..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Cogs.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Connections.png b/src/settingsui/settingsuiplugin/icons/ref/Connections.png Binary files differdeleted file mode 100644 index b042d3c..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Connections.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Display.png b/src/settingsui/settingsuiplugin/icons/ref/Display.png Binary files differdeleted file mode 100644 index cf1251a..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Display.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Flag.png b/src/settingsui/settingsuiplugin/icons/ref/Flag.png Binary files differdeleted file mode 100644 index 485ed48..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Flag.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Headphones.png b/src/settingsui/settingsuiplugin/icons/ref/Headphones.png Binary files differdeleted file mode 100644 index 9e5c483..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Headphones.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Heartbeat.png b/src/settingsui/settingsuiplugin/icons/ref/Heartbeat.png Binary files differdeleted file mode 100644 index 168135e..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Heartbeat.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Keyboard.png b/src/settingsui/settingsuiplugin/icons/ref/Keyboard.png Binary files differdeleted file mode 100644 index c814e8e..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Keyboard.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Laptop.png b/src/settingsui/settingsuiplugin/icons/ref/Laptop.png Binary files differdeleted file mode 100644 index 465bb54..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Laptop.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Lock.png b/src/settingsui/settingsuiplugin/icons/ref/Lock.png Binary files differdeleted file mode 100644 index 6afb6ac..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Lock.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Microphone.png b/src/settingsui/settingsuiplugin/icons/ref/Microphone.png Binary files differdeleted file mode 100644 index 63cb500..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Microphone.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/MobilePhone.png b/src/settingsui/settingsuiplugin/icons/ref/MobilePhone.png Binary files differdeleted file mode 100644 index b186c09..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/MobilePhone.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Mouse.png b/src/settingsui/settingsuiplugin/icons/ref/Mouse.png Binary files differdeleted file mode 100644 index 146305b..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Mouse.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Plus.png b/src/settingsui/settingsuiplugin/icons/ref/Plus.png Binary files differdeleted file mode 100644 index 391fe94..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Plus.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Power.png b/src/settingsui/settingsuiplugin/icons/ref/Power.png Binary files differdeleted file mode 100644 index b54a084..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Power.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Settings.png b/src/settingsui/settingsuiplugin/icons/ref/Settings.png Binary files differdeleted file mode 100644 index d8b255c..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Settings.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Tablet.png b/src/settingsui/settingsuiplugin/icons/ref/Tablet.png Binary files differdeleted file mode 100644 index 71b0065..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Tablet.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Volume_down.png b/src/settingsui/settingsuiplugin/icons/ref/Volume_down.png Binary files differdeleted file mode 100644 index 0773b1d..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Volume_down.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Volume_mute.png b/src/settingsui/settingsuiplugin/icons/ref/Volume_mute.png Binary files differdeleted file mode 100644 index 36ab384..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Volume_mute.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Volume_up.png b/src/settingsui/settingsuiplugin/icons/ref/Volume_up.png Binary files differdeleted file mode 100644 index 61eebbd..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Volume_up.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wifi.png b/src/settingsui/settingsuiplugin/icons/ref/Wifi.png Binary files differdeleted file mode 100644 index 5d1e0d9..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wifi.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wifi1.png b/src/settingsui/settingsuiplugin/icons/ref/Wifi1.png Binary files differdeleted file mode 100644 index f1b1489..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wifi1.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wifi2.png b/src/settingsui/settingsuiplugin/icons/ref/Wifi2.png Binary files differdeleted file mode 100644 index a22b472..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wifi2.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wifi3.png b/src/settingsui/settingsuiplugin/icons/ref/Wifi3.png Binary files differdeleted file mode 100644 index 76d412b..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wifi3.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wifi4.png b/src/settingsui/settingsuiplugin/icons/ref/Wifi4.png Binary files differdeleted file mode 100644 index 5d1e0d9..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wifi4.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/WifiAnim.png b/src/settingsui/settingsuiplugin/icons/ref/WifiAnim.png Binary files differdeleted file mode 100644 index 0694f63..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/WifiAnim.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/World.png b/src/settingsui/settingsuiplugin/icons/ref/World.png Binary files differdeleted file mode 100644 index cf6eaf0..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/World.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/Wrench.png b/src/settingsui/settingsuiplugin/icons/ref/Wrench.png Binary files differdeleted file mode 100644 index 5b6e1c6..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/Wrench.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/ref/extra/Alert.png b/src/settingsui/settingsuiplugin/icons/ref/extra/Alert.png Binary files differdeleted file mode 100644 index 80914fc..0000000 --- a/src/settingsui/settingsuiplugin/icons/ref/extra/Alert.png +++ /dev/null diff --git a/src/settingsui/settingsuiplugin/icons/scripts/cimage.sh b/src/settingsui/settingsuiplugin/icons/scripts/cimage.sh deleted file mode 100755 index adbbb7f..0000000 --- a/src/settingsui/settingsuiplugin/icons/scripts/cimage.sh +++ /dev/null @@ -1,55 +0,0 @@ -############################################################################ -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Device Utilities module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# -#!/bin/bash - -fullfile=$1 -filename=$(basename "$fullfile") -extension="${filename##*.}" -filename="${filename%.*}" - -color=$2 -if [ "$color" = "qt" ]; then - fill='rgb(128,195,66)' -elif [ "$color" = "black" ]; then - fill='rgb(32,40,42)' -elif [ "$color" = "white" ]; then - fill='rgb(255,255,255)' -elif [ "$color" = "lightgray" ]; then - fill='rgb(214,214,214)' -elif [ "$color" = "red" ]; then - fill='rgb(228,30,37)' -elif [ "$color" = "yellow" ]; then - fill='rgb(250,206,32)' -else - fill="black" -fi - -separator="_" - -convert $fullfile -fuzz 100% -fill $fill -opaque black $filename$separator$color.$extension diff --git a/src/settingsui/settingsuiplugin/icons/scripts/cimages.sh b/src/settingsui/settingsuiplugin/icons/scripts/cimages.sh deleted file mode 100755 index db1ad04..0000000 --- a/src/settingsui/settingsuiplugin/icons/scripts/cimages.sh +++ /dev/null @@ -1,38 +0,0 @@ -############################################################################ -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Device Utilities module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# -#!/bin/bash - -for dir in "$@" -do - echo "$dir" - scripts/cimage.sh $dir qt - scripts/cimage.sh $dir black - scripts/cimage.sh $dir white - scripts/cimage.sh $dir lightgray -done diff --git a/src/settingsui/settingsuiplugin/icons/scripts/rimage.sh b/src/settingsui/settingsuiplugin/icons/scripts/rimage.sh deleted file mode 100755 index 69b65a3..0000000 --- a/src/settingsui/settingsuiplugin/icons/scripts/rimage.sh +++ /dev/null @@ -1,47 +0,0 @@ -############################################################################ -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Device Utilities module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# -#!/bin/bash -fullfile=$1 -filename=$(basename "$fullfile") -extension="${filename##*.}" -filename="${filename%.*}" - -postix="_1x" -convert $fullfile -resize x16 $filename$postix.$extension -postix="_2x" -convert $fullfile -resize x32 $filename$postix.$extension -postix="_3x" -convert $fullfile -resize x48 $filename$postix.$extension -postix="_4x" -convert $fullfile -resize x64 $filename$postix.$extension -postix="_5x" -convert $fullfile -resize x80 $filename$postix.$extension -postix="_6x" -convert $fullfile -resize x96 $filename$postix.$extension - diff --git a/src/settingsui/settingsuiplugin/icons/scripts/rimages.sh b/src/settingsui/settingsuiplugin/icons/scripts/rimages.sh deleted file mode 100755 index e9e01b0..0000000 --- a/src/settingsui/settingsuiplugin/icons/scripts/rimages.sh +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################ -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the Device Utilities module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 or (at your option) any later version -## approved by the KDE Free Qt Foundation. The licenses are as published by -## the Free Software Foundation and appearing in the file LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# -#!/bin/bash - -for dir in "$@" -do - echo "$dir" - scripts/rimage.sh $dir -done diff --git a/src/settingsui/settingsuiplugin/newIcons/back_icon.svg b/src/settingsui/settingsuiplugin/newIcons/back_icon.svg deleted file mode 100644 index 6034bd7..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/back_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="back" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>back_icon</title><path d="M26.57,43.5a2.61,2.61,0,0,1-2.1-1.06L10.74,24a2.62,2.62,0,0,1,0-3.12L25.06,1.56a2.62,2.62,0,1,1,4.2,3.12L16.1,22.4,28.67,39.32a2.62,2.62,0,0,1-2.1,4.18Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/bluetooth_icon.svg b/src/settingsui/settingsuiplugin/newIcons/bluetooth_icon.svg deleted file mode 100644 index 5dfaa97..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/bluetooth_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="bluetooth" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>bluetooth_icon</title><path d="M22.38,43.5a1.79,1.79,0,0,1-1.79-1.79V25.82l-9.08,7.86A1.79,1.79,0,1,1,9.18,31l10.37-9L9.1,13a1.79,1.79,0,0,1,2.34-2.7l9.16,7.92V2.29a1.79,1.79,0,0,1,3-1.35l11.34,9.81a1.79,1.79,0,0,1,0,2.7L25,22l9.88,8.55a1.79,1.79,0,0,1,0,2.7L23.55,43.06A1.79,1.79,0,0,1,22.38,43.5ZM24.17,26V37.81L31,31.9Zm0-19.8V18L31,12.1Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/close_icon.svg b/src/settingsui/settingsuiplugin/newIcons/close_icon.svg deleted file mode 100644 index c98fe51..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/close_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>close_icon</title><path d="M25.5,22,42.09,4.78a2.52,2.52,0,1,0-3.64-3.5L22,18.36,5.55,1.27a2.53,2.53,0,0,0-3.64,3.5L18.49,22,1.91,39.22a2.53,2.53,0,0,0,3.64,3.5L22,25.64,38.45,42.73a2.52,2.52,0,1,0,3.64-3.5Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/date-time_icon.svg b/src/settingsui/settingsuiplugin/newIcons/date-time_icon.svg deleted file mode 100644 index 2b86128..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/date-time_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="date_time" data-name="date time" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>date-time_icon</title><polygon points="9.98 20.74 6.69 20.74 6.69 24.03 9.98 24.03 9.98 20.74 9.98 20.74" style="fill:#fff"/><polygon points="15.68 20.74 12.39 20.74 12.39 24.03 15.68 24.03 15.68 20.74 15.68 20.74" style="fill:#fff"/><polygon points="21.39 20.74 18.09 20.74 18.09 24.03 21.39 24.03 21.39 20.74 21.39 20.74" style="fill:#fff"/><polygon points="9.98 26.03 6.69 26.03 6.69 29.32 9.98 29.32 9.98 26.03 9.98 26.03" style="fill:#fff"/><polygon points="15.68 26.03 12.39 26.03 12.39 29.32 15.68 29.32 15.68 26.03 15.68 26.03" style="fill:#fff"/><polygon points="21.39 26.03 18.09 26.03 18.09 29.32 21.39 29.32 21.39 26.03 21.39 26.03" style="fill:#fff"/><path d="M38.59,21.72V7.28a1.7,1.7,0,0,0-1.7-1.7H32.08V4.45a1.7,1.7,0,1,0-3.4,0V5.58H10.44V4.45a1.7,1.7,0,1,0-3.4,0V5.58H2a1.7,1.7,0,0,0-1.7,1.7V35A1.7,1.7,0,0,0,2,36.69H24.43v0a10.53,10.53,0,1,0,14.16-15ZM3.74,9H7V10.1a1.7,1.7,0,0,0,3.4,0V9H28.68V10.1a1.7,1.7,0,0,0,3.4,0V9h3.11V15.6H3.74Zm0,24.33v-16H35.19v3.08a11,11,0,0,0-2.08-.2,10.43,10.43,0,0,0-6,1.9V20.74h-3.3V24H25A10.53,10.53,0,0,0,22.9,33.3Zm29.37,6.25A8.84,8.84,0,1,1,42,30.71,8.85,8.85,0,0,1,33.11,39.55Z" style="fill:#fff"/><path d="M39.47,30.71a.87.87,0,0,1-.88.88H33.11a.89.89,0,0,1-.88-.88V25.24a.88.88,0,1,1,1.76,0v4.59h4.6A.88.88,0,0,1,39.47,30.71Z" style="fill:#fff"/><path d="M33.2,31.59h-.09a.81.81,0,0,1-.62-.27.84.84,0,0,0,.62.26Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/detail_icon.svg b/src/settingsui/settingsuiplugin/newIcons/detail_icon.svg deleted file mode 100644 index f0dc4ec..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/detail_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="detail" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>detail</title><path d="M42.31,5.08H1.69A1.69,1.69,0,0,0,0,6.77V37.23a1.69,1.69,0,0,0,1.69,1.69H42.31A1.69,1.69,0,0,0,44,37.23V6.77A1.69,1.69,0,0,0,42.31,5.08ZM40.61,26.71H24V8.46H40.61Zm-7.16,8.82H24V28.29h9.43Zm-12.57,0H14.59V28.29h6.29Zm0-27.08V26.71H3.38V8.46ZM3.38,28.29h8.07v7.25H3.38ZM35,35.54V28.29h5.59v7.25Z" style="fill:#fff"/><rect x="6.74" y="11" width="12.57" height="1.57" style="fill:#fff"/><rect x="6.74" y="18.86" width="12.57" height="1.57" style="fill:#fff"/><rect x="6.74" y="14.14" width="12.57" height="1.57" style="fill:#fff"/><rect x="6.74" y="22" width="12.57" height="1.57" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/display_icon.svg b/src/settingsui/settingsuiplugin/newIcons/display_icon.svg deleted file mode 100644 index 598d2ee..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/display_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="display" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>display_icon</title><path d="M42.16,32.5H1.83A1.83,1.83,0,0,1,0,30.67V5A1.83,1.83,0,0,1,1.83,3.17H42.16A1.83,1.83,0,0,1,44,5V30.67a1.83,1.83,0,0,1-1.84,1.83ZM3.67,28.84H40.33v-22H3.67v22Z" style="fill:#fff"/><path d="M28.76,40.83H15.24a1.83,1.83,0,1,1,0-3.67H28.76a1.83,1.83,0,1,1,0,3.67Z" style="fill:#fff"/><path d="M17.34,40.29a1.83,1.83,0,0,1-1.83-1.83V31.05a1.83,1.83,0,1,1,3.67,0v7.41a1.83,1.83,0,0,1-1.83,1.83Z" style="fill:#fff"/><path d="M26.66,40.29a1.83,1.83,0,0,1-1.83-1.83V31.05a1.83,1.83,0,1,1,3.67,0v7.41a1.83,1.83,0,0,1-1.83,1.83Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/grid_icon.svg b/src/settingsui/settingsuiplugin/newIcons/grid_icon.svg deleted file mode 100644 index decd8e2..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/grid_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="grid" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>grid_icon</title><path d="M42.31,5.08H1.69A1.69,1.69,0,0,0,0,6.77V37.23a1.69,1.69,0,0,0,1.69,1.69H42.31A1.69,1.69,0,0,0,44,37.23V6.77A1.69,1.69,0,0,0,42.31,5.08ZM40.62,21.26H29.19V8.46H40.62Zm-23.79,0V8.46H27.24v12.8Zm10.41,1.3v13H16.83v-13ZM14.88,8.46v12.8H3.39V8.46ZM3.39,22.56H14.88v13H3.39Zm25.81,13v-13H40.62v13Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/header_toggle_icon.svg b/src/settingsui/settingsuiplugin/newIcons/header_toggle_icon.svg deleted file mode 100644 index 06d0b6a..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/header_toggle_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>header_toggle_icon</title><g style="isolation:isolate"><g id="toggle"><g style="opacity:0.35000000000000003;mix-blend-mode:multiply"><polygon points="3.36 15 23.27 33 42.64 15 3.36 15" style="fill:none;stroke:#09102b;stroke-linejoin:round;stroke-width:2px"/></g><polygon points="2.36 13 22.27 31 41.64 13 2.36 13" style="fill:none;stroke:#fff;stroke-linejoin:round;stroke-width:2px"/></g></g></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/info_icon.svg b/src/settingsui/settingsuiplugin/newIcons/info_icon.svg deleted file mode 100644 index 64d24c0..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/info_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="info" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>info_icon</title><path d="M21.86,15.59a2,2,0,0,1-1.33-.48A1.69,1.69,0,0,1,20,13.77a1.68,1.68,0,0,1,.56-1.3A1.91,1.91,0,0,1,21.86,12a1.93,1.93,0,0,1,1.28.46,1.65,1.65,0,0,1,.56,1.35,1.7,1.7,0,0,1-.54,1.34,1.88,1.88,0,0,1-1.29.48m1.83,3.83V30.14a2.39,2.39,0,0,1-.53,1.68,1.76,1.76,0,0,1-1.35.57,1.67,1.67,0,0,1-1.32-.58A2.47,2.47,0,0,1,20,30.14V19.53a2.38,2.38,0,0,1,.51-1.66,1.71,1.71,0,0,1,1.32-.56,1.78,1.78,0,0,1,1.35.56,2.16,2.16,0,0,1,.53,1.55" style="fill:#fff"/><path d="M21.89,43.5A21.5,21.5,0,0,1,6.7,6.8,21.5,21.5,0,0,1,37.11,37.2a21.38,21.38,0,0,1-15.21,6.3m0-39.35A17.85,17.85,0,0,0,9.28,34.62,17.85,17.85,0,1,0,34.52,9.38,17.73,17.73,0,0,0,21.9,4.15" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/language_icon.svg b/src/settingsui/settingsuiplugin/newIcons/language_icon.svg deleted file mode 100644 index f1235c5..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/language_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="language" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>language_icon</title><path d="M22,43.5A21.5,21.5,0,1,1,43.5,22,21.52,21.52,0,0,1,22,43.5ZM22,4.12A17.88,17.88,0,1,0,39.88,22,17.9,17.9,0,0,0,22,4.12Z" style="fill:#fff"/><path d="M22,42.6C15.22,42.6,9.7,33.36,9.7,22S15.22,1.41,22,1.41,34.29,10.64,34.29,22,28.78,42.6,22,42.6ZM22,3.22c-5.78,0-10.48,8.43-10.48,18.78S16.22,40.78,22,40.78,32.48,32.36,32.48,22,27.78,3.22,22,3.22Z" style="fill:#fff"/><path d="M22,42.6a.9.9,0,0,1-.91-.91V2.31A.9.9,0,0,1,22,1.41,20.59,20.59,0,0,1,22,42.6ZM22.9,3.24V40.76a18.78,18.78,0,0,0,0-37.53Z" style="fill:#fff"/><path d="M40.41,29.85H3.59a.91.91,0,0,1-.85-.59,20.37,20.37,0,0,1,0-14.52.91.91,0,0,1,.85-.59H40.41a.91.91,0,0,1,.85.59,20.34,20.34,0,0,1,0,14.52.91.91,0,0,1-.85.59ZM4.23,28H39.77a18.45,18.45,0,0,0,0-12.07H4.23A18.49,18.49,0,0,0,4.23,28Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/mouse_icon.svg b/src/settingsui/settingsuiplugin/newIcons/mouse_icon.svg deleted file mode 100644 index 5843fe1..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/mouse_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="mouse" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 44 44"><defs><clipPath id="clip-path"><polygon points="26.94 20.62 29.12 14.45 30.87 5.33 28.23 5.83 22.8 4.3 18.92 7.24 9.96 3.31 29 -5.98 42.56 8.54 26.94 20.62" style="fill:none"/></clipPath></defs><title>mouse_icon</title><path d="M5,22.1a1.06,1.06,0,0,1,0-1.5l4.23-4.25a1.06,1.06,0,0,1,1.5,0l8.48,8.46h0a1.06,1.06,0,0,1,0,1.5L15,30.56a1.06,1.06,0,0,1-1.5,0L5,22.1Zm5-3.5L7.24,21.35l7,7,2.73-2.74-7-7Z" style="fill:#fff"/><path d="M24.18,5.35a1,1,0,0,1,0,1.36l-4.41,4.41a3.68,3.68,0,0,1,.77.48l4.33-4.44a1,1,0,0,1,1.36,1.36l-4.31,4.42.62.62,4.12-4.23A1,1,0,1,1,28,10.68l-4.15,4.26a6,6,0,0,1,.5.81l4-4a.86.86,0,0,1,1.27,0,1,1,0,0,1,0,1.36L24,18.8,22.73,20,19.5,23.26a2.38,2.38,0,0,1-1.39.66l-6.57-6.56a2.59,2.59,0,0,1,.22-.76l1.38-5a1,1,0,0,1,.26-.44l3.05-3.05a.91.91,0,1,1,1.29,1.29L16.5,10.62l-.22,1.26,6.54-6.54a1,1,0,0,1,1.36,0m1.5-1.5a3.09,3.09,0,0,0-4.36,0l-2.4,2.4a3.07,3.07,0,0,0-4,.34L11.9,9.64A3.12,3.12,0,0,0,11.09,11L9.76,15.89a4.74,4.74,0,0,0-.32,1.19,2.12,2.12,0,0,0,.6,1.79h0l6.56,6.56a2.12,2.12,0,0,0,1.78.6A4.48,4.48,0,0,0,21,24.76l3.23-3.23,1.23-1.23,5.41-5.49a3.09,3.09,0,0,0,0-4.36,3,3,0,0,0-.7-.52,3.08,3.08,0,0,0-1.85-2.51,3.08,3.08,0,0,0-.64-1.31,2.33,2.33,0,0,0-1.14-.53,3.07,3.07,0,0,0-.87-1.74Z" style="fill:#fff"/><g style="clip-path:url(#clip-path)"><path d="M18.34,16.84A9,9,0,0,1,16.4,14c-1.14-2.88,1-6.75,2.41-8.18l4.11-4.11a4.79,4.79,0,0,1,6.63,0l4,4a4.8,4.8,0,0,1,0,6.66l-4.1,4.1c-1.44,1.41-5.3,3.56-8.17,2.42a9,9,0,0,1-2.9-1.95Zm14-10.08L28.4,2.85a3.14,3.14,0,0,0-4.28,0L20,7c-1.32,1.35-2.78,4.51-2,6.37a7.43,7.43,0,0,0,3.92,3.91c1.84.73,5-.73,6.36-2.06l4.1-4.1a3.15,3.15,0,0,0,0-4.32Z" style="fill:#fff"/></g><path d="M37,25.09a1.16,1.16,0,0,1-.51-.12,5.58,5.58,0,0,1-3.22-3.78,7.76,7.76,0,0,1,1.65-6.1c.68-.86,1.4-1.67,2.1-2.44,2.18-2.42,4.06-4.51,3.51-7.11a3.24,3.24,0,0,0-2.21-2.48c-1.87-.62-4.3.1-6.35,1.88a1.16,1.16,0,1,1-1.53-1.76C33.1.82,36.32-.06,39,.84A5.56,5.56,0,0,1,42.76,5c.81,3.76-1.66,6.51-4.05,9.16-.67.75-1.37,1.53-2,2.33a5.5,5.5,0,0,0-1.21,4.14,3.31,3.31,0,0,0,2,2.21A1.17,1.17,0,0,1,37,25.09Z" style="fill:#fff"/><path d="M1.08,35.78h2l1.59,5.57,1.59-5.57h2v7.13H7.13V37.06H7L5.29,42.62H4.08L2.39,37.06H2.24v5.85H1.08Z" style="fill:#fff"/><path d="M9.62,39.38c0-2.38.68-3.71,2.9-3.71s2.89,1.32,2.89,3.71S14.75,43,12.52,43,9.62,41.78,9.62,39.38Zm4.6,0c0-1.77-.32-2.7-1.7-2.7s-1.71.94-1.71,2.7S11.14,42,12.52,42,14.22,41.19,14.22,39.38Z" style="fill:#fff"/><path d="M19.31,42c1,0,1.47-.43,1.47-1.38V35.78h1.17v4.83c0,1.72-.93,2.41-2.63,2.41s-2.61-.7-2.61-2.41V35.78h1.17v4.85C17.86,41.6,18.36,42,19.31,42Z" style="fill:#fff"/><path d="M27.68,36.84s-1.46-.17-2.06-.17c-.87,0-1.32.31-1.32.93s.37.82,1.59,1.15c1.5.42,2,.81,2,2A2.09,2.09,0,0,1,25.54,43a15.19,15.19,0,0,1-2.33-.28l.11-.93s1.41.19,2.14.19,1.29-.4,1.29-1.14-.32-.81-1.41-1.07c-1.54-.4-2.21-.86-2.21-2.1,0-1.44.95-2,2.37-2a15.76,15.76,0,0,1,2.26.25Z" style="fill:#fff"/><path d="M29.18,35.78h4.49v1H30.33v2H33v1H30.33v2.08h3.34v1H29.18Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/mute_icon.svg b/src/settingsui/settingsuiplugin/newIcons/mute_icon.svg deleted file mode 100644 index 2ffd61f..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/mute_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="mute" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>mute_icon</title><path d="M17.92,40.48A2,2,0,0,1,16.68,40L7.59,32.77H2a2,2,0,0,1-2-2V13.22a2,2,0,0,1,2-2h5.6L16.68,4A2,2,0,0,1,19.9,5.5v33a2,2,0,0,1-2,2ZM4,28.8H8.29a2,2,0,0,1,1.24.44l6.41,5.13V9.64L9.52,14.77a2,2,0,0,1-1.24.44H4V28.8Z" style="fill:#fff"/><path d="M42,32.41a2,2,0,0,1-1.4-.58L23.77,15a2,2,0,0,1,2.81-2.81L43.42,29A2,2,0,0,1,42,32.41Z" style="fill:#fff"/><path d="M25.29,32.52a2,2,0,0,1-1.42-3.37L40.48,12.08a2,2,0,0,1,2.85,2.77L26.71,31.92a2,2,0,0,1-1.42.6Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/network_icon.svg b/src/settingsui/settingsuiplugin/newIcons/network_icon.svg deleted file mode 100644 index 6280828..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/network_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="network" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>network_icon</title><path d="M8.22,28.71A6.71,6.71,0,1,1,14.93,22a6.72,6.72,0,0,1-6.71,6.71Zm0-10A3.25,3.25,0,1,0,11.47,22a3.25,3.25,0,0,0-3.25-3.25Z" style="fill:#fff"/><path d="M35.78,13.92a6.71,6.71,0,1,1,6.71-6.71,6.72,6.72,0,0,1-6.71,6.71Zm0-10A3.25,3.25,0,1,0,39,7.21,3.25,3.25,0,0,0,35.78,4Z" style="fill:#fff"/><path d="M35.78,43.5a6.71,6.71,0,1,1,6.71-6.71,6.72,6.72,0,0,1-6.71,6.71Zm0-10A3.25,3.25,0,1,0,39,36.79a3.25,3.25,0,0,0-3.25-3.25Z" style="fill:#fff"/><path d="M30.66,35.89a1.73,1.73,0,0,1-.86-.23L12.12,25.46a1.73,1.73,0,0,1,1.73-3L31.52,32.66a1.73,1.73,0,0,1-.87,3.23Z" style="fill:#fff"/><path d="M13,21.77a1.73,1.73,0,0,1-.87-3.23L29.79,8.34a1.73,1.73,0,1,1,1.73,3L13.85,21.54a1.71,1.71,0,0,1-.86.23Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/pause_icon.svg b/src/settingsui/settingsuiplugin/newIcons/pause_icon.svg deleted file mode 100644 index 04000f9..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/pause_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="pause" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>pause_icon</title><path d="M15.51,43.5H9.76a4.65,4.65,0,0,1-4.64-4.64V5.14A4.65,4.65,0,0,1,9.76.5h5.75a4.65,4.65,0,0,1,4.64,4.64V38.86a4.65,4.65,0,0,1-4.64,4.64ZM9.76,4.55a.6.6,0,0,0-.59.59V38.86a.6.6,0,0,0,.59.59h5.75a.6.6,0,0,0,.59-.59V5.14a.6.6,0,0,0-.59-.59Z" style="fill:#fff"/><path d="M34.24,43.5H28.49a4.65,4.65,0,0,1-4.64-4.64V5.14A4.65,4.65,0,0,1,28.49.5h5.75a4.65,4.65,0,0,1,4.64,4.64V38.86a4.65,4.65,0,0,1-4.64,4.64ZM28.49,4.55a.6.6,0,0,0-.59.59V38.86a.6.6,0,0,0,.59.59h5.75a.6.6,0,0,0,.59-.59V5.14a.6.6,0,0,0-.59-.59Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/play_icon.svg b/src/settingsui/settingsuiplugin/newIcons/play_icon.svg deleted file mode 100644 index ab27771..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/play_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="play" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>play_icon</title><path d="M6.58,43.82c-2.4,0-4.08-1.91-4.08-4.65V4.83C2.5,2.09,4.18.18,6.58.18A5.29,5.29,0,0,1,9.22.95L39,18.12A4.56,4.56,0,0,1,41.5,22,4.56,4.56,0,0,1,39,25.88L9.22,43.05a5.28,5.28,0,0,1-2.65.77ZM6.64,4.28a5.24,5.24,0,0,0,0,.55V39.17a1.56,1.56,0,0,0,.08.55,1.74,1.74,0,0,0,.51-.21L36.92,22.33a1.61,1.61,0,0,0,.46-.36c-.06,0-.19-.16-.46-.31L7.18,4.49a1.6,1.6,0,0,0-.54-.22Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/power_icon.svg b/src/settingsui/settingsuiplugin/newIcons/power_icon.svg deleted file mode 100644 index b922c0e..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/power_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="power" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>power_icon</title><path d="M22,17.4a1.82,1.82,0,0,1-1.82-1.82V2.3a1.82,1.82,0,0,1,3.65,0V15.57A1.82,1.82,0,0,1,22,17.4Z" style="fill:#fff"/><path d="M22,43.48A19.15,19.15,0,0,1,15.7,6.25,1.82,1.82,0,0,1,16.9,9.7a15.51,15.51,0,1,0,10.19,0,1.82,1.82,0,0,1,1.2-3.45A19.15,19.15,0,0,1,22,43.48Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/qt_logo_green_rgb.svg b/src/settingsui/settingsuiplugin/newIcons/qt_logo_green_rgb.svg deleted file mode 100644 index bdb07d1..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/qt_logo_green_rgb.svg +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Generator: Adobe Illustrator 20.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> -<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" - viewBox="0 0 293.4 216.1" style="enable-background:new 0 0 293.4 216.1;" xml:space="preserve"> -<style type="text/css"> - .st0{fill:#41CD52;} - .st1{fill:#FFFFFF;} -</style> -<g> - <polygon class="st0" points="265.2,0 255,0 40.7,0 40.7,0 0,40.7 0,176.8 0,187.9 0,216.1 28.2,216.1 38.4,216.1 252.7,216.1 - 252.7,216.1 293.4,175.4 293.4,39.3 293.4,28.2 293.4,0 "/> - <path class="st1" d="M109.2,169.2c-19.3,0-32.8-5.2-40.4-15.6c-7.6-10.4-11.4-26.9-11.4-49.3c0-22.5,3.9-39.2,11.6-50.1 - c7.7-10.9,21.2-16.4,40.2-16.4c19.1,0,32.5,5.4,40.1,16.3c7.7,10.8,11.5,27.5,11.5,50.1c0,14.9-1.6,26.9-4.7,36 - c-3.2,9.2-8.3,16.2-15.5,21l15.6,25.1l-19.1,8.9l-16.5-27.1C118.2,168.9,114.4,169.2,109.2,169.2z M85.1,140.3 - c4.2,7.2,12.3,10.9,24.2,10.9s19.9-3.6,24.1-10.7c4.1-7.1,6.2-19.2,6.2-36.1c0-17-2.1-29.3-6.4-37S121,55.9,109.3,55.9 - c-11.6,0-19.6,3.8-24,11.5c-4.3,7.7-6.5,19.9-6.5,36.8C78.8,121,80.9,133.1,85.1,140.3z"/> - <path class="st1" d="M232.4,89.2h-25.6v40.9c0,7.6,0.6,12.6,1.7,15.1s4,3.7,8.5,3.7l15.2-0.6l0.9,16.2c-8.3,1.6-14.6,2.4-19,2.4 - c-10.5,0-17.7-2.4-21.6-7.2c-3.9-4.8-5.9-13.9-5.9-27.3V89.3h-14.1V72h14.2V45.1h20.1V72h25.6V89.2z"/> -</g> -</svg> diff --git a/src/settingsui/settingsuiplugin/newIcons/settings_icon.svg b/src/settingsui/settingsuiplugin/newIcons/settings_icon.svg deleted file mode 100644 index 7f5dbde..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/settings_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="settings" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>settings_icon</title><path d="M41,17.82H35a14.73,14.73,0,0,0-1.47-3.24l4-4a2.38,2.38,0,0,0,0-3.38L35.83,5.53a2.39,2.39,0,0,0-3.38,0l-4,4a14.34,14.34,0,0,0-3.53-1.43V2.89A2.39,2.39,0,0,0,22.49.5H20.1a2.39,2.39,0,0,0-2.39,2.39V8.14a14,14,0,0,0-3.84,1.61L10.49,6.37a2.4,2.4,0,0,0-3.38,0L5.42,8.06a2.4,2.4,0,0,0,0,3.38l3.44,3.44A14.24,14.24,0,0,0,7.28,19H2.79A2.39,2.39,0,0,0,.39,21.4v2.39a2.39,2.39,0,0,0,2.39,2.38h4.8a14,14,0,0,0,1.93,4L6.27,33.4a2.4,2.4,0,0,0,0,3.38L8,38.47a2.4,2.4,0,0,0,3.38,0L15,34.84a13.89,13.89,0,0,0,3.94,1.27v5A2.4,2.4,0,0,0,21.3,43.5h2.39a2.4,2.4,0,0,0,2.39-2.39V35.5a14,14,0,0,0,3.38-1.72l3.85,3.85a2.4,2.4,0,0,0,3.38,0l1.69-1.69a2.38,2.38,0,0,0,0-3.38l-4.21-4.22A14.15,14.15,0,0,0,35.31,25H41a2.39,2.39,0,0,0,2.39-2.39V20.21A2.4,2.4,0,0,0,41,17.82ZM21.3,31.5A9.5,9.5,0,1,1,30.8,22,9.5,9.5,0,0,1,21.3,31.5Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/settingsmenu_launcher_icon.svg b/src/settingsui/settingsuiplugin/newIcons/settingsmenu_launcher_icon.svg deleted file mode 100644 index 479a79f..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/settingsmenu_launcher_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="settings_menu_launcher" data-name="settings menu launcher" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>settingsmenu_launcher_icon</title><rect y="1.86" width="44" height="9.43" style="fill:#9d9faa"/><rect y="17.57" width="44" height="9.43" style="fill:#9d9faa"/><rect y="33.29" width="44" height="7.86" style="fill:#9d9faa"/><rect y="1.86" width="44" height="9.43" style="fill:#9ca0aa"/><rect y="17.57" width="44" height="9.43" style="fill:#9ca0aa"/><rect y="33.29" width="44" height="7.86" style="fill:#9ca0aa"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/stop_icon.svg b/src/settingsui/settingsuiplugin/newIcons/stop_icon.svg deleted file mode 100644 index 2eeff5f..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/stop_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="stop" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>stop_icon</title><path d="M37.66,44H6.34A6.35,6.35,0,0,1,0,37.66V6.34A6.35,6.35,0,0,1,6.34,0H37.66A6.35,6.35,0,0,1,44,6.34V37.66A6.35,6.35,0,0,1,37.66,44ZM6.34,4.14a2.2,2.2,0,0,0-2.2,2.2V37.66a2.2,2.2,0,0,0,2.2,2.2H37.66a2.2,2.2,0,0,0,2.2-2.2V6.34a2.2,2.2,0,0,0-2.2-2.2Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/touch_icon.svg b/src/settingsui/settingsuiplugin/newIcons/touch_icon.svg deleted file mode 100644 index 40ce016..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/touch_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="touch" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>touch_icon</title><path d="M10.64,21.23a1.06,1.06,0,0,1,0-1.5l4.23-4.25a1.06,1.06,0,0,1,1.5,0l8.48,8.46h0a1.06,1.06,0,0,1,0,1.5l-4.24,4.25a1.06,1.06,0,0,1-1.5,0l-8.47-8.45Zm5-3.5-2.74,2.74,7,7,2.73-2.74-7-7Z" style="fill:#fff"/><path d="M29.83,4.48a1,1,0,0,1,0,1.36l-4.41,4.41a3.68,3.68,0,0,1,.77.48l.44-.44A1,1,0,0,1,28,11.64l-.42.42.62.62.23-.23a1,1,0,1,1,1.36,1.36l-.25.25a3.68,3.68,0,0,1,.48.76,1,1,0,0,1,1.36,1.36l-1.74,1.74-1.23,1.23-3.23,3.23a2.38,2.38,0,0,1-1.39.66L17.2,16.49a2.52,2.52,0,0,1,.22-.76l1.37-5a1,1,0,0,1,.26-.44l3.05-3.05A.91.91,0,1,1,23.4,8.51L22.15,9.75,21.93,11l6.54-6.54a1,1,0,0,1,1.36,0M31.33,3A3.09,3.09,0,0,0,27,3l-2.4,2.4a3.08,3.08,0,0,0-4,.34L17.55,8.77a3.13,3.13,0,0,0-.81,1.39L15.42,15a4.74,4.74,0,0,0-.32,1.19A2.12,2.12,0,0,0,15.7,18h0l6.57,6.56a2.11,2.11,0,0,0,1.78.6,4.49,4.49,0,0,0,2.61-1.27l3.23-3.23,1.23-1.23,1.74-1.74a3.09,3.09,0,0,0,0-4.36,3,3,0,0,0-.7-.52,3.08,3.08,0,0,0-1.85-2.51A3.09,3.09,0,0,0,29.68,9l1.65-1.65a3.09,3.09,0,0,0,0-4.36Z" style="fill:#fff"/><path d="M6.65,34.69h5.2v1h-2v6.1H8.68v-6.1h-2Z" style="fill:#fff"/><path d="M12.38,38.29c0-2.38.68-3.71,2.9-3.71s2.89,1.32,2.89,3.71-.67,3.64-2.89,3.64S12.38,40.69,12.38,38.29Zm4.6,0c0-1.77-.32-2.7-1.7-2.7s-1.71.94-1.71,2.7.32,2.63,1.71,2.63S17,40.1,17,38.29Z" style="fill:#fff"/><path d="M22.07,40.92c1,0,1.47-.43,1.47-1.38V34.69H24.7v4.83c0,1.72-.93,2.41-2.63,2.41s-2.61-.7-2.61-2.41V34.69h1.17v4.85C20.62,40.5,21.12,40.92,22.07,40.92Z" style="fill:#fff"/><path d="M30.71,41.7a11.23,11.23,0,0,1-2,.23c-2.17,0-2.67-1.24-2.67-3.67s.54-3.68,2.67-3.68a10,10,0,0,1,2,.26l0,.94a13.25,13.25,0,0,0-1.84-.17c-1.31,0-1.63.64-1.63,2.65s.26,2.64,1.66,2.64a13.87,13.87,0,0,0,1.81-.16Z" style="fill:#fff"/><path d="M36.18,38.73H33.1v3.08H31.95V34.69H33.1v3h3.08v-3h1.17v7.13H36.18Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/newIcons/volume_icon.svg b/src/settingsui/settingsuiplugin/newIcons/volume_icon.svg deleted file mode 100644 index 12f944e..0000000 --- a/src/settingsui/settingsuiplugin/newIcons/volume_icon.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="volume" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44 44"><title>volume_icon</title><path d="M33.13,40.13a2,2,0,0,1-1.4-3.39,20.87,20.87,0,0,0,0-29.48,2,2,0,1,1,2.81-2.81,24.85,24.85,0,0,1,0,35.09,2,2,0,0,1-1.4.58Z" style="fill:#fff"/><path d="M27.38,34.38A2,2,0,0,1,26,31a12.72,12.72,0,0,0,0-18,2,2,0,0,1,2.81-2.81,16.69,16.69,0,0,1,0,23.59,2,2,0,0,1-1.4.58Z" style="fill:#fff"/><path d="M20.13,40.48A2,2,0,0,1,18.89,40L9.8,32.77H4.19a2,2,0,0,1-2-2V13.22a2,2,0,0,1,2-2h5.6L18.89,4A2,2,0,0,1,22.12,5.5v33a2,2,0,0,1-2,2ZM6.18,28.8h4.32a2,2,0,0,1,1.24.44l6.41,5.13V9.64l-6.42,5.14a2,2,0,0,1-1.24.44H6.18V28.8Z" style="fill:#fff"/></svg>
\ No newline at end of file diff --git a/src/settingsui/settingsuiplugin/plugin.cpp b/src/settingsui/settingsuiplugin/plugin.cpp deleted file mode 100644 index 3e9a274..0000000 --- a/src/settingsui/settingsuiplugin/plugin.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtQml/qqmlextensionplugin.h> -#include <QtQml/qqml.h> - -static void initResources() -{ -#ifdef QT_STATIC - Q_INIT_RESOURCE(qmake_QtDeviceUtilities_SettingsUI); -#endif - Q_INIT_RESOURCE(settingsui); -} - -/*! - \qmlmodule QtDeviceUtilities.SettingsUI 1.0 - \title Qt Device Utilities: Settings UI - \ingroup qtdevice-utilities-qml-modules - \ingroup qmlmodules - \brief Provides a system-wide settings UI. - - The \c DeviceUtilities.SettingsUI module provides a single QML type, - SettingsUI, that allows applications to integrate a standard, system-wide - settings view into their user interface. - - To import and use the module's QML types, use the following statement: - - \badcode - import QtDeviceUtilities.SettingsUI 1.0 - \endcode - - \section1 QML Types -*/ - -/*! - \qmltype SettingsUI - \inqmlmodule QtDeviceUtilities.SettingsUI - \brief Provides a QML type for displaying a system-wide settings UI. - - With the SettingsUI type, applications can easily integrate a standard, - system-wide settings view into their user interface. - - For example: - - \qml - import QtQuick 2.6 - import QtDeviceUtilities.SettingsUI 1.0 - - SettingsUI { - id: settingsUI - anchors.fill: parent - } - \endqml - - There is no need to import the various \c {DeviceUtilities.*} modules and - to declare a custom settings UI, unless specifically required. -*/ - -QT_BEGIN_NAMESPACE - -class SettingsUIQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") - -public: - SettingsUIQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { initResources(); } - void registerTypes(const char *uri) override - { - // @uri QtDeviceUtilities.SettingsUI - Q_ASSERT(uri == QLatin1String("QtDeviceUtilities.SettingsUI")); - qmlRegisterType(QUrl("qrc:/pluginMain.qml"), uri, 1, 0, "SettingsUI"); - } - -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/settingsui/settingsuiplugin/pluginMain.qml b/src/settingsui/settingsuiplugin/pluginMain.qml deleted file mode 100644 index 28e2464..0000000 --- a/src/settingsui/settingsuiplugin/pluginMain.qml +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.5 -import QtQuick.Layouts 1.2 -import QtQuick.Controls 2.0 -import Qt.labs.settings 1.0 -import QtQuick.XmlListModel 2.0 -import QtDeviceUtilities.LocalDeviceSettings 1.0 -import QtDeviceUtilities.NetworkSettings 1.0 -import QtGraphicalEffects 1.0 - -Rectangle { - id: pluginMain - anchors.fill: parent - visible: true - color: "#09102b" - opacity: 0.97 - - property bool __initialized: false - property var service - property int margin: (pluginMain.width / 3 * 2) * 0.05 - property int spacing: margin * 0.5 - property int titleFontSize: height * 0.04 - property int subTitleFontSize: height * 0.035 - property int valueFontSize: height * 0.025 - property int fieldHeight: height * 0.07 - property int fieldTextHeight: height * 0.05 - property int buttonHeight: height * 0.05 - - property alias model: xmlModel.source - - function init() - { - if (!__initialized) { - __initialized = true; - settingsList.currentIndex = 0 - if (xmlModel.count >= 1) { - settingsLoader.source = xmlModel.get(0).path + '/' + - xmlModel.get(0).view + '.qml' - titleItem.title = xmlModel.get(0).title - } else { - titleItem.title = qsTr("No settings") - } - } - } - - signal closed() - - XmlListModel { - id: xmlModel - source: "settingsview.xml" - query: "/xml/settings/item" - XmlRole { name: "title"; query: "title/string()"} - XmlRole { name: "icon"; query: "icon/string()"} - XmlRole { name: "view"; query: "view/string()"} - XmlRole { name: "path"; query: "path/string()"} - } - - SettingsHeader { - id: settingsHeader - onClicked: pluginMain.closed() - } - - ListView { - id: settingsList - objectName: "settingsList" - anchors.top: settingsHeader.bottom - anchors.left: parent.left - anchors.bottom: parent.bottom - width: parent.width / 3 - model: xmlModel - - delegate: SettingsDelegate {} - } - - Rectangle { - id: rightLine - width: 3 - height: parent.height * 0.8 - anchors.left: settingsList.right - anchors.top: settingsHeader.bottom - color: "#9d9faa" - } - - SettingsTitleItem { - id: titleItem - anchors.left: rightLine.right - anchors.right: parent.right - anchors.top: settingsHeader.bottom - anchors.leftMargin: pluginMain.margin * 2 - } - - Loader { - id: settingsLoader - anchors.top: titleItem.bottom - anchors.left: rightLine.right - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.leftMargin: pluginMain.margin * 2 - anchors.rightMargin: pluginMain.margin * 2 - } - - ShutdownPopup { - id: shutdownPopup - visible: false - - onAccepted: { - if (shutdown) { - console.log("Powering off!") - LocalDevice.powerOff() - } - else { - console.log("Rebooting!") - LocalDevice.reboot() - } - } - } -} diff --git a/src/settingsui/settingsuiplugin/plugins.qmltypes b/src/settingsui/settingsuiplugin/plugins.qmltypes deleted file mode 100644 index a3bdbd9..0000000 --- a/src/settingsui/settingsuiplugin/plugins.qmltypes +++ /dev/null @@ -1,32 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtDeviceUtilities.SettingsUI 1.0' - -Module { - dependencies: ["QtQuick 2.8"] - Component { - prototype: "QQuickRectangle" - name: "QtDeviceUtilities.SettingsUI/SettingsUI 1.0" - exports: ["QtDeviceUtilities.SettingsUI/SettingsUI 1.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "__initialized"; type: "bool" } - Property { name: "service"; type: "QVariant" } - Property { name: "margin"; type: "int" } - Property { name: "spacing"; type: "int" } - Property { name: "titleFontSize"; type: "int" } - Property { name: "subTitleFontSize"; type: "int" } - Property { name: "valueFontSize"; type: "int" } - Property { name: "fieldHeight"; type: "int" } - Property { name: "fieldTextHeight"; type: "int" } - Property { name: "buttonHeight"; type: "int" } - Property { name: "model"; type: "QUrl" } - Signal { name: "closed" } - Method { name: "init"; type: "QVariant" } - } -} diff --git a/src/settingsui/settingsuiplugin/qmldir b/src/settingsui/settingsuiplugin/qmldir deleted file mode 100644 index 88d0e45..0000000 --- a/src/settingsui/settingsuiplugin/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtDeviceUtilities.SettingsUI -plugin settingsuiplugin -classname SettingsUIQmlPlugin -typeinfo plugins.qmltypes diff --git a/src/settingsui/settingsuiplugin/settingsui.qrc b/src/settingsui/settingsuiplugin/settingsui.qrc deleted file mode 100644 index ad2a9b6..0000000 --- a/src/settingsui/settingsuiplugin/settingsui.qrc +++ /dev/null @@ -1,92 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>pluginMain.qml</file> - <file>../bluetooth/Bluetooth.qml</file> - <file>../bluetooth/Discovery.qml</file> - <file>../common/CustomTableView.qml</file> - <file>../common/HandwritingModeButton.qml</file> - <file>../display/Display.qml</file> - <file>../locale/Language.qml</file> - <file>../locale/RegionSelect.qml</file> - <file>../network/AddressListEntry.qml</file> - <file>../network/ComboBoxEntry.qml</file> - <file>../network/EditWiredSettings.qml</file> - <file>../network/IpAddressTextField.qml</file> - <file>../network/NetworkDetails.qml</file> - <file>../network/NetworkSettings.qml</file> - <file>../network/WifiSelectorDelegate.qml</file> - <file>../network/WifiSettings.qml</file> - <file>../network/WifiSignalMonitor.qml</file> - <file>../network/WiredSettings.qml</file> - <file>../timedate/AnalogClock.qml</file> - <file>../timedate/ClockHand.qml</file> - <file>../timedate/CustomCalendar.qml</file> - <file>../timedate/TimeDate.qml</file> - <file>../timedate/TimezonesView.qml</file> - <file>settingsview.xml</file> - <file>../power/Power.qml</file> - <file>../timedate/ManualTime.qml</file> - <file>../timedate/CustomComboBox.qml</file> - <file>../common/CustomSwitch.qml</file> - <file>../network/NetworkListView.qml</file> - <file>../network/PassphraseEnter.qml</file> - <file>../locale/TableKey.qml</file> - <file>../locale/TableValue.qml</file> - <file>SettingsHeader.qml</file> - <file>SettingsDelegate.qml</file> - <file>SettingsTitleItem.qml</file> - <file>ShutdownPopup.qml</file> - <file>icons/Alert_yellow_1x.png</file> - <file>icons/Audio_qt_6x.png</file> - <file>icons/Bluetooth_qt_1x.png</file> - <file>icons/Bluetooth_qt_6x.png</file> - <file>icons/Camcorder_qt_1x.png</file> - <file>icons/Camera_qt_1x.png</file> - <file>icons/Clock_qt_1x.png</file> - <file>icons/Clock_qt_6x.png</file> - <file>icons/Display_qt_6x.png</file> - <file>icons/Flag_qt_6x.png</file> - <file>icons/FloatingButton_Active.png</file> - <file>icons/FloatingButton_Available.png</file> - <file>icons/FloatingButton_Unavailable.png</file> - <file>icons/Headphones_qt_1x.png</file> - <file>icons/Heartbeat_qt_1x.png</file> - <file>icons/Keyboard_qt_1x.png</file> - <file>icons/Laptop_qt_1x.png</file> - <file>icons/Microphone_qt_1x.png</file> - <file>icons/MobilePhone_qt_1x.png</file> - <file>icons/Mouse_qt_1x.png</file> - <file>icons/Tablet_qt_1x.png</file> - <file>icons/Volume_down_qt_1x.png</file> - <file>icons/Volume_mute_qt_1x.png</file> - <file>icons/Volume_up_qt_1x.png</file> - <file>icons/WifiAnim_black_2x.png</file> - <file>icons/Wifi_lightgray_2x.png</file> - <file>icons/World_qt_6x.png</file> - <file>icons/Chevron-left_black_6x.png</file> - <file>icons/Chevron-left_black.png</file> - <file>icons/Power_black_6x.png</file> - <file>newIcons/back_icon.svg</file> - <file>newIcons/bluetooth_icon.svg</file> - <file>newIcons/close_icon.svg</file> - <file>newIcons/date-time_icon.svg</file> - <file>newIcons/detail_icon.svg</file> - <file>newIcons/display_icon.svg</file> - <file>newIcons/grid_icon.svg</file> - <file>newIcons/header_toggle_icon.svg</file> - <file>newIcons/info_icon.svg</file> - <file>newIcons/language_icon.svg</file> - <file>newIcons/mouse_icon.svg</file> - <file>newIcons/mute_icon.svg</file> - <file>newIcons/network_icon.svg</file> - <file>newIcons/pause_icon.svg</file> - <file>newIcons/play_icon.svg</file> - <file>newIcons/power_icon.svg</file> - <file>newIcons/settings_icon.svg</file> - <file>newIcons/settingsmenu_launcher_icon.svg</file> - <file>newIcons/stop_icon.svg</file> - <file>newIcons/touch_icon.svg</file> - <file>newIcons/volume_icon.svg</file> - <file>newIcons/qt_logo_green_rgb.svg</file> - </qresource> -</RCC> diff --git a/src/settingsui/settingsuiplugin/settingsuiplugin.pro b/src/settingsui/settingsuiplugin/settingsuiplugin.pro deleted file mode 100644 index 6b8a3af..0000000 --- a/src/settingsui/settingsuiplugin/settingsuiplugin.pro +++ /dev/null @@ -1,16 +0,0 @@ -QT += qml quick -CONFIG += no_cxx_module - -TARGET = settingsuiplugin -TARGETPATH = QtDeviceUtilities/SettingsUI - -SOURCES += \ - plugin.cpp - -DISTFILES += \ - qmldir - -RESOURCES += \ - settingsui.qrc - -load(qml_plugin) diff --git a/src/settingsui/settingsuiplugin/settingsview.xml b/src/settingsui/settingsuiplugin/settingsview.xml deleted file mode 100644 index 2749cb8..0000000 --- a/src/settingsui/settingsuiplugin/settingsview.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<xml> - <settings> - <item> - <title>Network</title> - <view>NetworkSettings</view> - <path>network</path> - <icon>newIcons/network_icon.svg</icon> - </item> - <item> - <title>Display</title> - <view>Display</view> - <path>display</path> - <icon>newIcons/display_icon.svg</icon> - </item> - <item> - <title>Date & Time</title> - <view>TimeDate</view> - <path>timedate</path> - <icon>newIcons/date-time_icon.svg</icon> - </item> - <item> - <title>Language & Region</title> - <view>Language</view> - <path>locale</path> - <icon>newIcons/language_icon.svg</icon> - </item> - <item> - <title>Bluetooth</title> - <view>Bluetooth</view> - <path>bluetooth</path> - <icon>newIcons/bluetooth_icon.svg</icon> - </item> - <item> - <title>Power</title> - <view>Power</view> - <path>power</path> - <icon>newIcons/power_icon.svg</icon> - </item> - </settings> -</xml> diff --git a/src/settingsui/timedate/AnalogClock.qml b/src/settingsui/timedate/AnalogClock.qml deleted file mode 100644 index e9c655e..0000000 --- a/src/settingsui/timedate/AnalogClock.qml +++ /dev/null @@ -1,172 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.TimeDateSettings 1.0 - -Item { - property var currentTime: TimeManager.time - property var newTime: new Date - property bool editMode: false - property alias handPressed: mouseArea.pressed - - onEditModeChanged: if (editMode) newTime = new Date - - Rectangle { - border.color: "#bdbebf" - border.width: 1 - color: "white" - anchors.fill: parent - - Connections { - target: TimeManager - function onTimeChanged() { if (!mouseArea.pressed) newTime.setSeconds(currentTime.getSeconds()) } - function onTimeZoneChanged() { Date.timeZoneUpdated() } - } - Label { - id: timeLabel - anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: 10 - anchors.top: parent.top - text: currentTime.toTimeString() - } - Rectangle { - id: root - anchors.fill: parent - anchors.margins: 40 - color: "white" - border.color: editMode ? "#d6d6d6" : "#5caa15" - border.width: Math.round(root.width * 0.120) - radius: parent.width / 2 - property int handOffset: Math.round(root.width * 0.040) - antialiasing: true - - MouseArea { - id: mouseArea - anchors.fill: parent - enabled: editMode - property var handleItem: undefined - - function findHandle(item, point) { - if (item.objectName === "handle") { - var mapped = mouseArea.mapToItem(item, point.x, point.y) - if (item.contains(mapped)) { - return item.parent; - } - } - - for (var i=0; i < item.children.length; i++) { - var ret = findHandle(item.children[i], point) - if (ret) - return ret; - } - return undefined; - } - - onPressed: { - handleItem = findHandle(root, Qt.point(mouse.x, mouse.y)) - currentTime.setSeconds(0); - currentTime.setMilliseconds(0); - newTime.setSeconds(0); - newTime.setMilliseconds(0); - } - - onReleased: { - handleItem = undefined - } - - onPositionChanged: { - if (!handleItem) - return; - - var angle = (90 + Math.atan2((mouse.y-mouseArea.height/2), (mouse.x-mouseArea.width/2))*180/Math.PI) - - if (handleItem.angle < 60 && handleItem.angle > 0 && angle <= 0) { - - if (handleItem === hours) { - hours.pm = !hours.pm - } else { - var a = hours.angle - 30 - if (a > 360) a -= 360 - hours.angle = a - } - - } else if (handleItem.angle > 300 && handleItem.angle < 360 && angle >= 0) { - - if (handleItem === hours) { - hours.pm = !hours.pm - } else { - var a = hours.angle + 30 - if (a < 0) a += 360 - hours.angle = a - } - } - - if (angle < 0) { - angle += 360 - } else if (angle > 360) { - angle -= 360 - } - - handleItem.angle = angle - - var newhours = Math.floor(hours.angle / 30); - if (hours.pm) - newhours += 12 - - newTime.setHours(newhours); - newTime.setMinutes(Math.round(minutes.angle / 6)); - - newTime.setSeconds(0); - newTime.setMilliseconds(0); - - TimeManager.time = newTime; - } - } - ClockHand { - id: minutes - value: currentTime.getMinutes() * 6 - } - ClockHand { - id: hours - height: root.height / 2 * 0.4 + root.handOffset - value: (currentTime.getHours() * 30) + (currentTime.getMinutes() * 0.5) - property bool pm: false - } - ClockHand { - id: seconds - visible: !editMode - color: "#46a2da" - width: root.width * 0.0128 - height: root.height / 2 * 0.74 - value: currentTime.getSeconds() * 6 - } - } - } -} diff --git a/src/settingsui/timedate/ClockHand.qml b/src/settingsui/timedate/ClockHand.qml deleted file mode 100644 index 56fa314..0000000 --- a/src/settingsui/timedate/ClockHand.qml +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 - -Rectangle { - id: hand - objectName: "hand" - x: root.height / 2 - width / 2 - y: root.height / 2 - height + root.handOffset - color: editMode ? "#d6d6d6" : "#5caa15" - width: root.width * 0.080 - height: root.height / 2 * 0.65 + root.handOffset - antialiasing: true - property alias angle: handRotation.angle - property alias value: angleBinding.value - transform: Rotation { - id: handRotation - origin.x: Math.round(hand.width / 2) - origin.y: Math.round(hand.height - root.handOffset) - Behavior on angle { - enabled: !mouseArea.pressed - SpringAnimation { spring: 2; damping: 0.2; modulus: 360 } - } - - Binding on angle { - id: angleBinding - when: !mouseArea.pressed - } - } - Item { - objectName: "handle" - anchors.verticalCenter: parent.top - anchors.horizontalCenter: parent.horizontalCenter - height: parent.width * 3 - width: parent.width * 3 - visible: editMode - Rectangle { - anchors.fill: parent - anchors.margins: parent.width * .1 - radius: width / 2 - color: "#5caa15" - } - } -} diff --git a/src/settingsui/timedate/CustomCalendar.qml b/src/settingsui/timedate/CustomCalendar.qml deleted file mode 100644 index a1deff0..0000000 --- a/src/settingsui/timedate/CustomCalendar.qml +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import Qt.labs.calendar 1.0 -import QtQml 2.2 -import QtDeviceUtilities.TimeDateSettings 1.0 - -Rectangle { - id: root - border.color: "#bdbebf" - border.width: 1 - color: "white" - height: cal.height - - function updateDate() { - var date = new Date() - grid.month = date.getMonth() - grid.date = date.getDate() - grid.year = date.getFullYear() - } - - ColumnLayout { - id: cal - width: root.width - spacing: 10 - enabled: !automatic.checked - - RowLayout { - spacing: 0 - Layout.alignment: Qt.AlignTop - - Button { - id: previousMonth - Layout.preferredWidth: height - visible: enabled - contentItem: Rectangle { - anchors.fill: parent - color: "#d6d6d6" - - Image { - anchors.fill: parent - anchors.margins: parent.height * .2 - source: "../icons/Chevron-left_black.png" - fillMode: Image.PreserveAspectFit - } - } - onClicked: { - if (grid.month === Calendar.January) { - grid.year-- - grid.month = Calendar.December - return; - } - grid.month-- - } - } - Rectangle { - Layout.fillWidth: true - color: enabled ? "#d6d6d6" : "#80c342" - height: previousMonth.height - - Label { - id: title - text: Qt.locale().monthName(grid.month, Locale.LongFormat) + " " + grid.year - anchors.fill: parent - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - Button { - id: nextMonth - Layout.preferredWidth: height - visible: enabled - contentItem: Rectangle { - anchors.fill: parent - color: "#d6d6d6" - - Image { - anchors.fill: parent - anchors.margins: parent.height * .2 - source: "../icons/Chevron-left_black.png" - mirror: true - fillMode: Image.PreserveAspectFit - } - } - onClicked: { - if (grid.month === Calendar.December) { - grid.year++ - grid.month = Calendar.January - } - grid.month++ - } - } - } - DayOfWeekRow { - locale: grid.locale - Layout.column: 1 - Layout.fillWidth: true - Layout.alignment: Qt.AlignTop - delegate: Text { - text: model.narrowName.charAt(0) - font.bold: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } - MonthGrid { - id: grid - Layout.alignment: Qt.AlignTop - Layout.fillWidth: true - property int date: -1 - property Item currentItem: null - delegate: Label { - id: gridDelegate - objectName: "gridDelegate" - text: delegateDay - opacity: model.month === grid.month ? 1 : .2 - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - font.bold: delegateDay === grid.date && delegateMonth === grid.month - color: delegateDay === grid.date && delegateMonth === grid.month && enabled ? "white" : "black" - property int delegateDay: model.day - property int delegateMonth: model.month - } - Component.onCompleted: updateDate() - - Rectangle { - z: -1 - id: highlight - x: grid.currentItem ? grid.currentItem.x + grid.currentItem.width / 2 - width / 2: 0 - y: grid.currentItem ? grid.currentItem.y + grid.currentItem.height / 2- height / 2: 0 - width: grid.currentItem ? grid.currentItem.width : 0 - visible: grid.currentItem - height: width - color: enabled? "#80c342" : "#d6d6d6" - radius: width / 2 - } - - onMonthChanged: updateHighlightPosition() - onYearChanged: updateHighlightPosition() - onDateChanged: updateHighlightPosition() - - function updateHighlightPosition() { - var date = new Date() - - date.setFullYear(grid.year) - date.setMonth(grid.month) - date.setDate(grid.date) - - var index = grid.source.indexOf(date) - var delegate = grid.contentItem.children[index] - - if (delegate) - grid.currentItem = delegate - } - - MouseArea { - anchors.fill: parent - - onClicked: { - var item = grid.contentItem.childAt(mouse.x, mouse.y) - - if (item) { - if (item.objectName !== "gridDelegate") - item = grid.contentItem.children[0] - - if (!item) - return; - - grid.currentItem = item - grid.date = item.delegateDay - grid.month = item.delegateMonth - - var currentTime = TimeManager.time; - var newDate = new Date(); - - newDate.setFullYear(grid.year) - newDate.setMonth(grid.month) - newDate.setDate(grid.date) - newDate.setHours(currentTime.getHours()); - newDate.setMinutes(currentTime.getMinutes()); - newDate.setSeconds(currentTime.getSeconds()); - TimeManager.time = newDate; - } - } - } - } - } -} diff --git a/src/settingsui/timedate/CustomComboBox.qml b/src/settingsui/timedate/CustomComboBox.qml deleted file mode 100644 index 66c3559..0000000 --- a/src/settingsui/timedate/CustomComboBox.qml +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.0 -import QtQuick.Controls 2.0 -import QtGraphicalEffects 1.0 - -ComboBox { - id: comboBox - property int itemsVisible: 5 - indicator: Image { - id: indicatorImage - height: comboBox.height * 0.4 - anchors.right: comboBox.right - anchors.rightMargin: pluginMain.margin - anchors.verticalCenter: comboBox.verticalCenter - fillMode: Image.PreserveAspectFit - rotation: -90 - source: "../newIcons/back_icon.svg" - } - ColorOverlay { - id: indicatorOverlay - source: indicatorImage - anchors.fill: indicatorImage - color: viewSettings.buttonGreenColor - visible: false - rotation: -90 - } - contentItem: Text { - anchors.left: comboBox.left - anchors.leftMargin: pluginMain.margin - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "SemiBold" - color: "white" - elide: Text.ElideRight - text: comboBox.displayText - } - background: Rectangle { - color: "transparent" - border.color: viewSettings.borderColor - border.width: comboBox.visualFocus ? 2 : 1 - } - popup: Popup { - y: comboBox.height -1 - width: comboBox.width - height: comboBox.height * comboBox.itemsVisible - padding: 1 - - contentItem: ListView { - id: listView - clip: true - model: comboBox.popup.visible ? comboBox.delegateModel : null - currentIndex: comboBox.currentIndex - onCurrentIndexChanged: positionViewAtIndex(listView.currentIndex, ListView.beginning) - } - onOpened: { - listView.currentIndex = comboBox.currentIndex - indicatorImage.visible = false - indicatorOverlay.visible = true - } - onClosed: { - indicatorImage.visible = true - indicatorOverlay.visible = false - } - background: Rectangle { - border.color: viewSettings.borderColor - color: viewSettings.backgroundColor - opacity: 0.95 - } - } -} diff --git a/src/settingsui/timedate/ManualTime.qml b/src/settingsui/timedate/ManualTime.qml deleted file mode 100644 index 87e0f7e..0000000 --- a/src/settingsui/timedate/ManualTime.qml +++ /dev/null @@ -1,248 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 -import QtDeviceUtilities.TimeDateSettings 1.0 - -Item { - id: root - property int margin: root.width * 0.05 - property var selectedDate: new Date() - property int firstYear: 2017 - - function zeroPadTime(timeToPad) { - return timeToPad < 10 ? "0" + timeToPad : timeToPad - } - - Column { - spacing: pluginMain.spacing - - Text { - color: "white" - text: qsTr("Set Date") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - // Row of date comboboxes - Row { - spacing: pluginMain.spacing - leftPadding: pluginMain.margin - - CustomComboBox { - id: dayBox - width: root.width * 0.15 - height: pluginMain.buttonHeight - displayText: currentIndex + 1 - - model: 31 - itemsVisible: 10 - currentIndex: selectedDate.getDate() - 1 - - delegate: ItemDelegate { - id: dayDelegate - height: dayBox.height - width: dayBox.width - contentItem: Text { - anchors.left: dayDelegate.left - anchors.leftMargin: pluginMain.margin - text: modelData + 1 - color: dayBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - } - } - - onCurrentIndexChanged: selectedDate.setDate(currentIndex + 1) - } - - CustomComboBox { - id: monthBox - width: root.width * 0.35 - height: pluginMain.buttonHeight - model: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"] - currentIndex: selectedDate.getMonth() - - itemsVisible: 12 - delegate: ItemDelegate { - id: monthDelegate - height: monthBox.height - width: monthBox.width - contentItem: Text { - anchors.left: monthDelegate.left - anchors.leftMargin: pluginMain.margin - color: monthBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - text: modelData - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - - } - } - onCurrentIndexChanged: selectedDate.setMonth(currentIndex) - } - - CustomComboBox { - id: yearBox - width: root.width * 0.2 - height: pluginMain.buttonHeight - displayText: currentIndex + firstYear - - model: 50 - itemsVisible: 8 - currentIndex: (selectedDate.getFullYear() >= firstYear) ? - selectedDate.getFullYear() - firstYear : 0 - - delegate: ItemDelegate { - id: yearDelegate - height: yearBox.height - width: yearBox.width - contentItem: Text { - anchors.left: yearDelegate.left - anchors.leftMargin: pluginMain.margin - text: index + firstYear - color: yearBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - } - } - onCurrentIndexChanged: selectedDate.setFullYear(currentIndex + firstYear) - } - } // Row of date comboboxes - - Text { - color: "white" - text: qsTr("Set Time") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - // Row of time comboboxes - Row { - spacing: pluginMain.spacing - leftPadding: pluginMain.margin - - CustomComboBox { - id: hourBox - width: root.width * 0.15 - height: pluginMain.buttonHeight - displayText: zeroPadTime(currentIndex) - - model: 24 - itemsVisible: 8 - currentIndex: selectedDate.getHours() - - delegate: ItemDelegate { - id: hourDelegate - height: hourBox.height - width: hourBox.width - contentItem: Text { - anchors.left: hourDelegate.left - anchors.leftMargin: pluginMain.margin - text: zeroPadTime(parseInt(modelData)) - color: hourBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - } - } - onCurrentIndexChanged: selectedDate.setHours(currentIndex) - } - CustomComboBox { - id: minuteBox - width: root.width * 0.15 - height: pluginMain.buttonHeight - displayText: zeroPadTime(currentIndex) - - model: 60 - itemsVisible: 8 - currentIndex: selectedDate.getMinutes() - - delegate: ItemDelegate { - id: minuteDelegate - height: minuteBox.height - width: minuteBox.width - contentItem: Text { - anchors.left: minuteDelegate.left - anchors.leftMargin: pluginMain.margin - text: zeroPadTime(parseInt(modelData)) - color: minuteBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - } - } - onCurrentIndexChanged: selectedDate.setMinutes(currentIndex) - } - } // Row of time comboboxes - - // Row of set/cancel buttons - Row { - spacing: pluginMain.spacing - - QtButton { - id: dateSetButton - height: pluginMain.buttonHeight - text: qsTr("SET") - - onClicked: { - selectedDate.setSeconds(0); - TimeManager.ntp = false - TimeManager.time = selectedDate; - console.log("Set date to: " + selectedDate) - console.log("TimeManager.time: " + TimeManager.time) - settingsLoader.source = "qrc:/timedate/TimeDate.qml" - } - } - QtButton { - id: dateCancelButton - height: pluginMain.buttonHeight - fillColor: viewSettings.buttonGrayColor - borderColor: "transparent" - text: qsTr("CANCEL") - onClicked: { - settingsLoader.source = "qrc:/timedate/TimeDate.qml" - } - } - } // Row of set/cancel buttons - } // Main column -} diff --git a/src/settingsui/timedate/TimeDate.qml b/src/settingsui/timedate/TimeDate.qml deleted file mode 100644 index f6f75f1..0000000 --- a/src/settingsui/timedate/TimeDate.qml +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.TimeDateSettings 1.0 -import QtDeviceUtilities.LocaleSettings 1.0 -import QtDeviceUtilities.QtButtonImageProvider 1.0 - -Item { - id: root - property int margin: root.width * 0.05 - - Column { - spacing: pluginMain.spacing - anchors.top: parent.top - - // Display current date - Text { - color: "white" - text: qsTr("Current date") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - Text { - id: dateText - leftPadding: pluginMain.margin - color: "white" - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - Timer { - id: dateTimer - interval: 1000 - running: true - repeat: true - triggeredOnStart: true - onTriggered: { - var date = new Date(); - dateText.text = date.toLocaleString(Qt.locale(LocaleManager.locale), Locale.LongFormat) - } - } - } - - // Set date automatically / manually - Text { - color: "white" - text: qsTr("Set Date & Time") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - Row { - spacing: pluginMain.spacing - leftPadding: pluginMain.margin - QtButton { - id: automaticButton - height: pluginMain.buttonHeight - text: qsTr("AUTOMATICALLY") - onClicked: TimeManager.ntp = true - } - QtButton { - id: manualButton - height: pluginMain.buttonHeight - fillColor: viewSettings.buttonGrayColor - borderColor: "transparent" - text: qsTr("MANUALLY") - onClicked: { - settingsLoader.source = "qrc:/timedate/ManualTime.qml" - } - } - } - - // Select timezone - Text { - color: "white" - text: qsTr("Time Zone") - font.pixelSize: pluginMain.subTitleFontSize - font.family: appFont - } - - Row { - leftPadding: pluginMain.margin - CustomComboBox { - id: timeZoneBox - width: automaticButton.width + manualButton.width + pluginMain.spacing - height: pluginMain.buttonHeight - textRole: "id" - itemsVisible: 7 - currentIndex: -1 - model: TimezonesFilter - delegate: ItemDelegate { - id: timeZoneDelegate - height: timeZoneBox.height - width: timeZoneBox.width - contentItem: Text { - anchors.left: timeZoneDelegate.left - anchors.leftMargin: pluginMain.margin - text: modelData["id"] - color: timeZoneBox.currentIndex == index ? viewSettings.buttonGreenColor : "white" - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - font.pixelSize: pluginMain.valueFontSize - font.family: appFont - font.styleName: "Regular" - } - } - - Component.onCompleted: { - var n = TimezonesFilter.indexForTimezone(TimeManager.timeZone) - timeZoneBox.currentIndex = n - } - - Connections { - target: TimezonesFilter.sourceModel - function onReady() { - var n = TimezonesFilter.indexForTimezone(TimeManager.timeZone) - timeZoneBox.currentIndex = n - } - } - - onCurrentIndexChanged: { - var val = TimezonesFilter.itemFromRow(currentIndex); - if (val && val !== "") { - TimeManager.timeZone = val - } - } - } - } - - Component { - id: zoneselect - TimezonesView {} - } - } -} diff --git a/src/settingsui/timedate/TimezonesView.qml b/src/settingsui/timedate/TimezonesView.qml deleted file mode 100644 index bbcffe4..0000000 --- a/src/settingsui/timedate/TimezonesView.qml +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.6 -import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 -import QtDeviceUtilities.TimeDateSettings 1.0 -import "../common" -Item { - id: root - property string title: qsTr("Timezone settings") - Component.onCompleted: timezone.text = TimezonesFilter.filter - - ColumnLayout { - id: content - anchors.fill: parent - anchors.margins: 20 - spacing: 10 - - RowLayout { - spacing: 10 - - Label { - text: qsTr("Search area: ") - Layout.alignment: Qt.AlignVCenter - } - TextField { - id: timezone - text: "" - onTextChanged: TimezonesFilter.filter = timezone.text - Layout.alignment: Qt.AlignVCenter - } - } - CustomTableView { - headerTexts: [qsTr("Timezone"), qsTr("Country")] - roleNames: ["id", "country"] - model: TimezonesFilter - onClicked: { - var val = model.itemFromRow(index); - if (val !== "") { - TimeManager.timeZone = val; - stackView.pop(); - } - } - } - } -} diff --git a/src/src.pro b/src/src.pro deleted file mode 100644 index 014e517..0000000 --- a/src/src.pro +++ /dev/null @@ -1,20 +0,0 @@ -TEMPLATE = subdirs -CONFIG += ordered - -qtHaveModule(dbus) { - SUBDIRS += \ - networksettings \ - localesettings \ - timedatesettings \ - - qtHaveModule(bluetooth): SUBDIRS += bluetoothsettings -} - -SUBDIRS += \ - displaysettings \ - localdevice \ - settingsui/settingsuiplugin \ - settingsui/qtbuttonimageproviderplugin \ - settingsui \ - imports \ - doc \ diff --git a/src/timedatesettings/systemtime.cpp b/src/timedatesettings/systemtime.cpp deleted file mode 100644 index 9382fd9..0000000 --- a/src/timedatesettings/systemtime.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "systemtime.h" -#include "systemtime_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \module QtTimeDateSettings - \qtvariable timedatesettings - \ingroup qtdevice-utilities-cpp-modules - \ingroup modules - \title Qt Time and Date Settings C++ Classes - \brief Provides functionality for controlling time and date settings. - - To use classes from this module, add this directive into the C++ files: - - \code - #include <QtTimeDateSettings> - \endcode - - To link against the corresponding C++ libraries, add the following to your - qmake project file: - - \code - QT += timedatesettings - \endcode -*/ - -/*! - \class SystemTime - \inmodule QtTimeDateSettings - \inheaderfile systemtime.h - \brief The SystemTime class manages the system date and time. -*/ - -/*! - \property SystemTime::timeZone - \brief Holds the current time zone string. -*/ - -/*! - \property SystemTime::ntp - - Holds whether the system time is synchronized using NTP (Network - Time Protocol). -*/ - -/*! - \property SystemTime::time - \brief Holds the current date and time. -*/ - -SystemTime::SystemTime(QObject *parent) : - QObject(parent) - ,d_ptr(new SystemTimePrivate(this)) -{ - QTimer *secTimer = new QTimer(this); - connect(secTimer, &QTimer::timeout, this, &SystemTime::timeChanged); - secTimer->setInterval(1001); - secTimer->setSingleShot(false); - secTimer->start(); -} - -bool SystemTime::ntp() const -{ - const Q_D(SystemTime); - return d->ntp(); -} - -void SystemTime::setNtp(const bool aNtp) -{ - Q_D(SystemTime); - d->setNtp(aNtp); -} - -void SystemTime::setTime(const QDateTime& aTime) -{ - Q_D(SystemTime); - d->setTime(aTime.toMSecsSinceEpoch()*1000); - emit timeChanged(); -} - -QString SystemTime::timeZone() const -{ - Q_D(const SystemTime); - return d->timeZone(); -} - -void SystemTime::setTimeZone(const QString& aTimeZone) -{ - Q_D(SystemTime); - d->setTimeZone(aTimeZone); - emit timeZoneChanged(); -} - -QDateTime SystemTime::time() const -{ - return QDateTime::currentDateTime(); -} - -QT_END_NAMESPACE diff --git a/src/timedatesettings/systemtime.h b/src/timedatesettings/systemtime.h deleted file mode 100644 index bcb46df..0000000 --- a/src/timedatesettings/systemtime.h +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SYSTEMTIME_H -#define SYSTEMTIME_H - -#include <QObject> -#include <QTime> - -QT_BEGIN_NAMESPACE - -class SystemTimePrivate; - -class Q_DECL_EXPORT SystemTime : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString timeZone READ timeZone WRITE setTimeZone NOTIFY timeZoneChanged) - Q_PROPERTY(bool ntp READ ntp WRITE setNtp NOTIFY ntpChanged) - Q_PROPERTY(QDateTime time READ time WRITE setTime NOTIFY timeChanged) -public: - explicit SystemTime(QObject *parent = Q_NULLPTR); - bool ntp() const; - void setNtp(const bool aNtp); - void setTime(const QDateTime& aTime); - QString timeZone() const; - QDateTime time() const; - void setTimeZone(const QString& aTimeZone); - -Q_SIGNALS: - void timeZoneChanged(); - void ntpChanged(); - void timeChanged(); - -public Q_SLOTS: - -protected: - SystemTimePrivate *d_ptr; - - Q_DISABLE_COPY(SystemTime) - Q_DECLARE_PRIVATE(SystemTime) -}; - -QT_END_NAMESPACE - -#endif // SYSTEMTIME_H diff --git a/src/timedatesettings/systemtime_p.h b/src/timedatesettings/systemtime_p.h deleted file mode 100644 index b294598..0000000 --- a/src/timedatesettings/systemtime_p.h +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SYSTEMTIME_P_H -#define SYSTEMTIME_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "systemtime.h" -#include "timedated_interface.h" - -QT_BEGIN_NAMESPACE - -class SystemTimePrivate -{ - Q_DECLARE_PUBLIC(SystemTime) -public: - SystemTimePrivate(SystemTime *qq) - :q_ptr(qq) - { - m_timeInterface = new OrgFreedesktopTimedate1Interface(QStringLiteral("org.freedesktop.timedate1"), - QStringLiteral("/org/freedesktop/timedate1"), - QDBusConnection::systemBus(), qq); - - } - - bool ntp() const { - if (m_timeInterface) - return m_timeInterface->nTP(); - return false; - } - - void setNtp(bool val) { - if (m_timeInterface) - m_timeInterface->SetNTP(val, true).waitForFinished(); - } - - QString timeZone() const { - if (m_timeInterface) - return m_timeInterface->timezone(); - return QString(); - } - - void setTimeZone(const QString& aTimeZone) { - if (m_timeInterface) - m_timeInterface->SetTimezone(aTimeZone, true); - } - - void setTime(qlonglong usecsSinceEpoch) { - if (m_timeInterface) - m_timeInterface->SetTime(usecsSinceEpoch, false, true); - } - -private: - OrgFreedesktopTimedate1Interface *m_timeInterface; - SystemTime *q_ptr; -}; - -QT_END_NAMESPACE - -#endif // SYSTEMTIME_P_H diff --git a/src/timedatesettings/timedated.xml b/src/timedatesettings/timedated.xml deleted file mode 100644 index 95bafb8..0000000 --- a/src/timedatesettings/timedated.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<node name="/Service" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> -<node> - <interface name="org.freedesktop.timedate1"> - <property name="Timezone" type="s" access="read"/> - <property name="LocalRTC" type="b" access="read"/> - <property name="CanNTP" type="b" access="read"/> - <property name="NTP" type="b" access="read"/> - <method name="SetTime"> - <arg name="usec_utc" type="x" direction="in"/> - <arg name="relative" type="b" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - <method name="SetTimezone"> - <arg name="timezone" type="s" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - <method name="SetLocalRTC"> - <arg name="local_rtc" type="b" direction="in"/> - <arg name="fix_system" type="b" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - <method name="SetNTP"> - <arg name="use_ntp" type="b" direction="in"/> - <arg name="user_interaction" type="b" direction="in"/> - </method> - </interface> -</node> - - diff --git a/src/timedatesettings/timedatesettings.pro b/src/timedatesettings/timedatesettings.pro deleted file mode 100644 index 6c35777..0000000 --- a/src/timedatesettings/timedatesettings.pro +++ /dev/null @@ -1,22 +0,0 @@ -load(qt_build_config) - -TARGET = QtTimeDateSettings -VERSION = 1.0 - -QT = core dbus - -MODULE = timedatesettings -load(qt_module) - -DBUS_INTERFACES = timedated.xml - -SOURCES += systemtime.cpp \ - timezonemodel.cpp \ - timezonefiltermodel.cpp - -HEADERS += \ - systemtime.h \ - systemtime_p.h \ - timezonemodel.h \ - timezonefiltermodel.h - diff --git a/src/timedatesettings/timezonefiltermodel.cpp b/src/timedatesettings/timezonefiltermodel.cpp deleted file mode 100644 index b566624..0000000 --- a/src/timedatesettings/timezonefiltermodel.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "timezonemodel.h" -#include "timezonefiltermodel.h" - -QT_BEGIN_NAMESPACE - -TimezoneFilterModel::TimezoneFilterModel(QObject* parent) - :QSortFilterProxyModel(parent) -{ - connect(this, &TimezoneFilterModel::filterChanged, this, &TimezoneFilterModel::invalidate); - TimezoneModel* timezoneModel = new TimezoneModel(this); - setSourceModel(timezoneModel); -} - -TimezoneFilterModel::~TimezoneFilterModel() -{ - -} - -QString TimezoneFilterModel::filter() const -{ - return m_filter; -} - -void TimezoneFilterModel::setFilter(const QString& aFilter) -{ - m_filter = aFilter; - emit filterChanged(); -} - -bool TimezoneFilterModel::filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const -{ - bool ret = false; - if (this->sourceModel()) - { - QModelIndex index = this->sourceModel()->index( source_row, 0, source_parent ); - if (index.isValid()) - { - QVariant nameRole = index.data(TimezoneModel::Name); - if (nameRole.isValid()) - { - QString name = nameRole.toString(); - if (name.contains(m_filter, Qt::CaseInsensitive)) { - ret = true; - } - } - QVariant countryRole = index.data(TimezoneModel::Country); - if (ret == false && countryRole.isValid()) - { - QString country = countryRole.toString(); - if (country.contains(m_filter, Qt::CaseInsensitive)) { - ret = true; - } - } - } - } - return ret; -} - -QVariant TimezoneFilterModel::itemFromRow(const int row) const -{ - QModelIndex idx = index(row, 0); - QModelIndex mapped = mapToSource(idx); - if (mapped.isValid()) - { - QVariant nameRole = mapped.data(TimezoneModel::Name); - if (nameRole.isValid()) - { - return nameRole; - } - } - return QVariant(); -} - -int TimezoneFilterModel::indexForTimezone(const QString &timezone) const -{ - TimezoneModel *model = qobject_cast<TimezoneModel *>(sourceModel()); - QList<TimezoneItem *> data = model->getModel(); - int row = 0; - foreach (TimezoneItem *item, data) { - if (item->id() == timezone) { - QModelIndex mapped = mapFromSource(model->index(row)); - return mapped.row(); - } - row++; - } - - return -1; -} - -QT_END_NAMESPACE diff --git a/src/timedatesettings/timezonefiltermodel.h b/src/timedatesettings/timezonefiltermodel.h deleted file mode 100644 index ead5eb0..0000000 --- a/src/timedatesettings/timezonefiltermodel.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef TIMEZONEFILTERMODEL_H -#define TIMEZONEFILTERMODEL_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QSortFilterProxyModel> - -QT_BEGIN_NAMESPACE - -class Q_DECL_EXPORT TimezoneFilterModel : public QSortFilterProxyModel -{ - Q_OBJECT - Q_PROPERTY(QString filter READ filter WRITE setFilter NOTIFY filterChanged) -public: - explicit TimezoneFilterModel(QObject* parent); - virtual ~TimezoneFilterModel(); - bool filterAcceptsRow( int source_row, const QModelIndex& source_parent ) const override; - QString filter() const; - void setFilter(const QString& aFilter); - Q_INVOKABLE QVariant itemFromRow(const int row) const; - Q_INVOKABLE int indexForTimezone(const QString &timezone) const; -Q_SIGNALS: - void filterChanged(); - void selectedIndexChanged(); -private: - QString m_filter; - -}; - -QT_END_NAMESPACE - -#endif // TIMEZONEFILTERMODEL_H diff --git a/src/timedatesettings/timezonemodel.cpp b/src/timedatesettings/timezonemodel.cpp deleted file mode 100644 index d30f22e..0000000 --- a/src/timedatesettings/timezonemodel.cpp +++ /dev/null @@ -1,244 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QLocale> -#include <QFuture> -#include <QFutureWatcher> -#include <QThread> -#include <QtConcurrent/QtConcurrentRun> -#include "timezonemodel.h" - -QT_BEGIN_NAMESPACE - -/*! - \class TimezoneItem - \inmodule QtTimeDateSettings - \inheaderfile timezonemodel.h - \brief The TimezoneItem class represents a time zone. -*/ - -/*! - \property TimezoneItem::id - \brief Holds the IANA time zone ID. - - \sa QTimeZone::id(), {IANA Time Zone IDs} -*/ - -/*! - \property TimezoneItem::name - \brief Holds the localized display name of the time zone. - - \sa QTimeZone::displayName() -*/ - -/*! - \property TimezoneItem::country - \brief Holds the name of the country for the time zone. - - \sa QTimeZone::country() -*/ - -/*! - Creates a time zone item with the IANA time zone ID \a id and parent - \a parent. -*/ -TimezoneItem::TimezoneItem(const QByteArray& id, QObject *parent) - :QObject(parent) -{ - QTimeZone tz = QTimeZone(id); - m_name = tz.displayName(QTimeZone::StandardTime); - m_country = QLocale::countryToString(tz.country()); - m_id = QString::fromUtf8(id); -} - -/*! - Returns the localized display name of the time zone. - - \sa QTimeZone::displayName() -*/ -QString TimezoneItem::name() const -{ - return m_name; -} - -/*! - Returns the name of the country for the time zone. - - \sa QTimeZone::country() -*/ -QString TimezoneItem::country() const -{ - return m_country; -} - -/*! - Returns the IANA time zone ID. - - \sa QTimeZone::id(), {IANA Time Zone IDs} -*/ -QString TimezoneItem::id() const -{ - return m_id; -} - -/*! - \class TimezoneModel - \inmodule QtTimeDateSettings - \inheaderfile timezonemodel.h - \brief The TimezoneModel class provides a model for the available time - zones. - - This class can be used as the model in a view that lists the available time - zones. -*/ - -/*! - \enum TimezoneModel::Roles - - This enum type holds information about a time zone. - - \value Name - Localized display name of the time zone - \value Country - Name of the country for the time zone - \value Id - IANA time zone ID -*/ - -/*! - \fn QList<TimezoneItem *> TimezoneModel::getModel() const - - Returns the time zone model for a time zone item. -*/ - -/*! - \fn TimezoneModel::ready() - - This signal is emitted when the model is ready. -*/ - -/*! - Creates a new time zone model with the parent \a parent. -*/ -TimezoneModel::TimezoneModel(QObject *parent) - : QAbstractListModel(parent) -{ - m_roleNames.insert(Qt::UserRole, "modelData"); - m_roleNames.insert(Country, "country"); - m_roleNames.insert(Name, "name"); - m_roleNames.insert(Id, "id"); - - - QFutureWatcher<void> *watcher = new QFutureWatcher<void>(this); - QFuture<void> future = QtConcurrent::run(TimezoneModel::generateModel, this); - watcher->setFuture(future); - connect(watcher, SIGNAL(finished()), this, SIGNAL(ready())); -} - -/*! - Creates the time zone model \a model. -*/ -void TimezoneModel::generateModel(TimezoneModel* model) -{ - QList<QByteArray> ids = QTimeZone::availableTimeZoneIds(); - foreach (QByteArray id, ids) { - TimezoneItem *zone = new TimezoneItem(id); - zone->moveToThread(model->thread()); - QMetaObject::invokeMethod(model, "addNewItem", Q_ARG( QObject*, qobject_cast<QObject*>(zone))); - } -} - -/*! - Adds the time zone item \a item to the time zone model. -*/ -void TimezoneModel::addNewItem(QObject* item) -{ - beginInsertRows(QModelIndex(), m_items.count(), m_items.count()); - TimezoneItem* newItem = qobject_cast<TimezoneItem*>(item); - if (newItem) - m_items.append(newItem); - endInsertRows(); -} - -/*! - Deletes the time zone model. -*/ -TimezoneModel::~TimezoneModel() -{ - qDeleteAll(m_items); -} - -/*! - Returns an array of the names of the roles in the model. -*/ -QHash<int, QByteArray> TimezoneModel::roleNames() const -{ - return m_roleNames; -} - -/*! - Returns the number of rows in the model with the parent \a parent. -*/ -int TimezoneModel::rowCount(const QModelIndex & parent) const -{ - Q_UNUSED(parent); - return m_items.count(); -} - -/*! - Returns the data at the index \a index in the model for the type of data - specified by \a role. -*/ -QVariant TimezoneModel::data(const QModelIndex & index, int role) const -{ - if (!index.isValid()) return QVariant(); - - TimezoneItem *item = m_items[index.row()]; - - switch (role) { - case Qt::UserRole: - return QVariant::fromValue(static_cast<QObject*>(item)); - break; - case Name: - return item->id(); - break; - case Country: - return item->country(); - break; - case Id: - return item->id(); - break; - case Qt::DisplayRole: - return item->id(); - break; - default: - return QVariant(); - } -} - -QT_END_NAMESPACE diff --git a/src/timedatesettings/timezonemodel.h b/src/timedatesettings/timezonemodel.h deleted file mode 100644 index 6684472..0000000 --- a/src/timedatesettings/timezonemodel.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Device Utilities module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef TIMEZONEMODEL_H -#define TIMEZONEMODEL_H - -#include <QObject> -#include <QAbstractListModel> -#include <QTimeZone> -#include <QMutex> - -QT_BEGIN_NAMESPACE - -class TimezoneItem : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString id READ id CONSTANT) - Q_PROPERTY(QString name READ name CONSTANT) - Q_PROPERTY(QString country READ country CONSTANT) -public: - explicit TimezoneItem(const QByteArray& id, QObject *parent = Q_NULLPTR); - QString name() const; - QString country() const; - QString id() const; - -private: - QString m_name; - QString m_country; - QString m_id; -}; - -class Q_DECL_EXPORT TimezoneModel : public QAbstractListModel -{ - Q_OBJECT - -public: - explicit TimezoneModel(QObject *parent = Q_NULLPTR); - virtual ~TimezoneModel(); - // from QAbstractItemModel - int rowCount(const QModelIndex & parent = QModelIndex()) const; - QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; - QHash<int, QByteArray> roleNames() const; - QList<TimezoneItem *> getModel() const - { - return m_items; - } - - enum Roles { - Name = Qt::UserRole + 1, - Country, - Id - }; - - static void generateModel(TimezoneModel* model); - -Q_SIGNALS: - void ready(); - -private Q_SLOTS: - void addNewItem(QObject* item); - -private: - QList<TimezoneItem*> m_items; - QHash<int, QByteArray> m_roleNames; -}; - -QT_END_NAMESPACE - -#endif // TIMEZONEMODEL_H |