Commit a6195d04 authored by jpetrell's avatar jpetrell

[developermode] Show/hide developer mode from USB dialog when...

[developermode] Show/hide developer mode from USB dialog when enabling/disabling developer mode. Contributes to JB#33570
parent a2bbda00
......@@ -77,6 +77,9 @@
/* D-Bus method names */
#define USB_MODED_GET_NET_CONFIG "get_net_config"
#define USB_MODED_SET_NET_CONFIG "net_config"
#define USB_MODED_HIDE_MODE "hide_mode"
#define USB_MODED_UNHIDE_MODE "unhide_mode"
#define USB_MODED_DEVELOPER_MODE "developer_mode"
/* USB Mode Daemon network configuration properties */
#define USB_MODED_CONFIG_IP "ip"
......@@ -233,6 +236,16 @@ static inline void usb_moded_set_config(QDBusInterface &usb, QString key, QStrin
usb.call(USB_MODED_SET_NET_CONFIG, key, value);
}
static inline void usb_moded_hide_mode(QDBusInterface &usb, QString mode)
{
usb.call(USB_MODED_HIDE_MODE, mode);
}
static inline void usb_moded_unhide_mode(QDBusInterface &usb, QString mode)
{
usb.call(USB_MODED_UNHIDE_MODE, mode);
}
DeveloperModeSettings::DeveloperModeSettings(QObject *parent)
: QObject(parent)
, m_worker_thread()
......@@ -344,6 +357,11 @@ void DeveloperModeSettings::setDeveloperModeEnabled(bool enabled)
DEBUG() << Q_FUNC_INFO << "from" << oldEnabled << "to" << enabled;
if (oldEnabled != enabled) {
m_developerModeEnabled.set(enabled);
if (enabled) {
usb_moded_unhide_mode(m_usbModeDaemon, USB_MODED_DEVELOPER_MODE);
} else {
usb_moded_hide_mode(m_usbModeDaemon, USB_MODED_DEVELOPER_MODE);
}
}
}
......
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