Commit 79e35de0 authored by Pekka Vuorela's avatar Pekka Vuorela

[nemo-qml-plugin-systemsettings] Support requesting reboot after reset. Contributes to JB#33966

parent 03052e35
...@@ -111,7 +111,12 @@ void DeviceLockInterface::refresh() ...@@ -111,7 +111,12 @@ void DeviceLockInterface::refresh()
} }
} }
bool DeviceLockInterface::clearDevice(const QString &code) bool DeviceLockInterface::clearDevice(const QString &code, ResetMode mode)
{ {
return runPlugin(QStringList() << "--clear-device" << code); QStringList parameters;
parameters << "--clear-device" << code;
if (mode == DeviceLockInterface::Reboot) {
parameters << "--reboot";
}
return runPlugin(parameters);
} }
...@@ -39,9 +39,15 @@ ...@@ -39,9 +39,15 @@
class DeviceLockInterface : public QObject class DeviceLockInterface : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(ResetMode)
Q_PROPERTY(bool isSet READ isSet NOTIFY isSetChanged) Q_PROPERTY(bool isSet READ isSet NOTIFY isSetChanged)
public: public:
enum ResetMode {
Shutdown,
Reboot
};
explicit DeviceLockInterface(QObject *parent = 0); explicit DeviceLockInterface(QObject *parent = 0);
virtual ~DeviceLockInterface(); virtual ~DeviceLockInterface();
...@@ -50,7 +56,7 @@ public: ...@@ -50,7 +56,7 @@ public:
Q_INVOKABLE bool clearCode(const QString &currentCode); Q_INVOKABLE bool clearCode(const QString &currentCode);
Q_INVOKABLE bool isSet(); Q_INVOKABLE bool isSet();
Q_INVOKABLE void refresh(); Q_INVOKABLE void refresh();
Q_INVOKABLE bool clearDevice(const QString &code); Q_INVOKABLE bool clearDevice(const QString &code, ResetMode mode = Shutdown);
signals: signals:
void isSetChanged(); void isSetChanged();
......
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