Commit 24f7dead authored by Raine Makelainen's avatar Raine Makelainen

Merge branch 'jb41708' into 'master'

Change developermode enabling on top PackageKit-Qt

See merge request mer-core/nemo-qml-plugin-systemsettings!54
parents 1a2074e7 7a76f212
......@@ -27,6 +27,7 @@ BuildRequires: pkgconfig(nemomodels-qt5)
BuildRequires: pkgconfig(libsailfishkeyprovider) >= 0.0.14
BuildRequires: pkgconfig(connman-qt5) >= 1.2.7
BuildRequires: pkgconfig(ssu-sysinfo) >= 1.1.0
BuildRequires: pkgconfig(packagekitqt5)
%description
%{summary}.
......
This diff is collapsed.
......@@ -35,9 +35,10 @@
#include <QObject>
#include <QDBusInterface>
#include <QDBusObjectPath>
#include <systemsettingsglobal.h>
#include <daemon.h>
QT_BEGIN_NAMESPACE
class QDBusPendingCallWatcher;
......@@ -48,37 +49,14 @@ class SYSTEMSETTINGS_EXPORT DeveloperModeSettings : public QObject
Q_OBJECT
Q_ENUMS(Status)
Q_PROPERTY(QString wlanIpAddress
READ wlanIpAddress
NOTIFY wlanIpAddressChanged)
Q_PROPERTY(QString usbIpAddress
READ usbIpAddress
NOTIFY usbIpAddressChanged)
Q_PROPERTY(QString username
READ username
CONSTANT)
Q_PROPERTY(bool developerModeAvailable
READ developerModeAvailable
NOTIFY developerModeAvailableChanged)
Q_PROPERTY(bool developerModeEnabled
READ developerModeEnabled
NOTIFY developerModeEnabledChanged)
Q_PROPERTY(bool remoteLoginEnabled
READ remoteLoginEnabled
NOTIFY remoteLoginEnabledChanged)
Q_PROPERTY(enum DeveloperModeSettings::Status workerStatus
READ workerStatus
NOTIFY workerStatusChanged)
Q_PROPERTY(int workerProgress
READ workerProgress
NOTIFY workerProgressChanged)
Q_PROPERTY(QString wlanIpAddress READ wlanIpAddress NOTIFY wlanIpAddressChanged)
Q_PROPERTY(QString usbIpAddress READ usbIpAddress NOTIFY usbIpAddressChanged)
Q_PROPERTY(QString username READ username CONSTANT)
Q_PROPERTY(bool developerModeAvailable READ developerModeAvailable NOTIFY developerModeAvailableChanged)
Q_PROPERTY(bool developerModeEnabled READ developerModeEnabled NOTIFY developerModeEnabledChanged)
Q_PROPERTY(bool remoteLoginEnabled READ remoteLoginEnabled NOTIFY remoteLoginEnabledChanged)
Q_PROPERTY(enum DeveloperModeSettings::Status workerStatus READ workerStatus NOTIFY workerStatusChanged)
Q_PROPERTY(int workerProgress READ workerProgress NOTIFY workerProgressChanged)
public:
explicit DeveloperModeSettings(QObject *parent = NULL);
......@@ -86,6 +64,7 @@ public:
enum Status {
Idle = 0,
InitialCheckingStatus,
CheckingStatus,
Preparing,
DownloadingPackages,
......@@ -106,6 +85,7 @@ public:
Q_INVOKABLE void setRemoteLogin(bool enabled);
Q_INVOKABLE void setUsbIpAddress(const QString &usbIpAddress);
Q_INVOKABLE void refresh();
Q_INVOKABLE void checkDeveloperModeStatus();
signals:
void wlanIpAddressChanged();
......@@ -116,31 +96,27 @@ signals:
void workerWorkingChanged();
void workerStatusChanged();
void workerProgressChanged();
void packageCacheUpdated();
private slots:
void transactionPackage(uint info, const QString &packageId);
void transactionErrorCode(uint code, const QString &message);
void transactionFinished(uint exit, uint runtime);
void transactionPropertiesChanged(const QString &interface, const QVariantMap &changed, const QStringList &invalidated);
void transactionPackage(PackageKit::Transaction::Info info, const QString &packageId, const QString &summary);
void transactionErrorCode(PackageKit::Transaction::Error code, const QString &details);
void transactionFinished(PackageKit::Transaction::Exit status, uint runtime);
void updateState(int percentage, PackageKit::Transaction::Status status, PackageKit::Transaction::Role role);
private:
QDBusPendingCallWatcher *resolvePackageId(const QString &packageName);
QDBusPendingCallWatcher *installPackage(const QString &packageId);
QDBusPendingCallWatcher *removePackage(const QString &packageId);
void connectTransactionSignal(const QString &name, const char *slot);
void connectPropertiesChanged();
enum Command {
NoCommand,
InstallCommand,
RemoveCommand
};
void executePackageKitCommand(
QDBusPendingCallWatcher *(DeveloperModeSettings::*command)(const QString &),
const QString &argument);
void refreshPackageCache();
void resolveDeveloperModePackageId(Command command);
void connectCommandSignals(PackageKit::Transaction *transaction);
void checkDeveloperModeStatus(bool initial);
QDBusInterface m_usbModeDaemon;
QDBusObjectPath m_packageKitTransaction;
QDBusPendingCallWatcher *m_pendingPackageKitCall;
QDBusPendingCallWatcher *(DeveloperModeSettings::*m_packageKitCommand)(const QString &packageId);
QList<int> m_statusChanges;
QString m_wlanIpAddress;
QString m_usbInterface;
QString m_usbIpAddress;
......@@ -150,9 +126,9 @@ private:
bool m_remoteLoginEnabled;
DeveloperModeSettings::Status m_workerStatus;
int m_workerProgress;
int m_transactionRole;
int m_transactionStatus;
PackageKit::Transaction::Role m_transactionRole;
PackageKit::Transaction::Status m_transactionStatus;
bool m_cacheUpdated;
};
Q_DECLARE_METATYPE(DeveloperModeSettings::Status);
......
......@@ -32,3 +32,4 @@
#include "logging_p.h"
Q_LOGGING_CATEGORY(lcVpnLog, "org.sailfishos.settings.vpn", QtWarningMsg)
Q_LOGGING_CATEGORY(lcDeveloperModeLog, "org.sailfishos.settings.developermode", QtWarningMsg)
......@@ -35,5 +35,6 @@
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(lcVpnLog)
Q_DECLARE_LOGGING_CATEGORY(lcDeveloperModeLog)
#endif
......@@ -6,7 +6,7 @@ CONFIG += qt plugin c++11 hide_symbols link_pkgconfig
QT += qml dbus network
QT -= gui
PKGCONFIG += profile usb-moded-qt5 nemomodels-qt5 libsailfishkeyprovider connman-qt5
PKGCONFIG += profile usb-moded-qt5 nemomodels-qt5 libsailfishkeyprovider connman-qt5 packagekitqt5
target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
INSTALLS += target
......
......@@ -7,7 +7,7 @@ QT -= gui
CONFIG += c++11 hide_symbols link_pkgconfig
PKGCONFIG += profile mlite5 mce timed-qt5 libshadowutils blkid libcrypto nemomodels-qt5 libsailfishkeyprovider connman-qt5
PKGCONFIG += ssu-sysinfo nemodbus
PKGCONFIG += ssu-sysinfo nemodbus packagekitqt5
system(qdbusxml2cpp -p mceiface.h:mceiface.cpp mce.xml)
system(qdbusxml2cpp -c ConnmanVpnProxy -p connmanvpnproxy ../dbus/net.connman.vpn.xml -i qdbusxml2cpp_dbus_types.h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment