Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 03a0e485 authored by Martin Kacej's avatar Martin Kacej

basic interface for mobile networks

parent e98c601a
......@@ -37,4 +37,15 @@ CelluralSettings::~CelluralSettings()
{
}
bool CelluralSettings::mobileDataActive()
{
return m_mobileDataActive;
}
void CelluralSettings::setMobileDataActive(bool active)
{
m_mobileDataActive = active;
emit mobileDataActiveChanged(m_mobileDataActive);
}
#include "celluralsettings.moc"
......@@ -24,9 +24,18 @@
class CelluralSettings : public KQuickAddons::ConfigModule
{
Q_OBJECT
Q_PROPERTY(bool mobileDataActive READ mobileDataActive WRITE setMobileDataActive NOTIFY mobileDataActiveChanged)
public:
CelluralSettings(QObject *parent, const QVariantList &args);
virtual ~CelluralSettings();
bool mobileDataActive();
void setMobileDataActive(bool active);
Q_SIGNAL void mobileDataActiveChanged(bool active);
private:
bool m_mobileDataActive;
};
#endif // CELLURALSETTINGS_H
import QtQuick 2.6
import QtQuick.Controls 2.2 as Controls
import QtQuick.Layouts 1.3
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
import org.kde.kirigami 2.2 as Kirigami
Kirigami.Page {
ColumnLayout {
width: parent.width
spacing: Kirigami.Units.gridUnit * 1.5
RowLayout {
width: parent.width
Controls.Label {
text: i18n("Enable mobile data network")
font.weight: Font.Bold
Layout.fillWidth: true
}
Controls.CheckBox {
id: mobileDataCheckbox
// enabled: enabledConnections.wwanHwEnabled && availableDevices.modemDeviceAvailable
anchors.rightMargin: Kirigami.Units.gridUnit
}
}
RowLayout {
width: parent.width
enabled: mobileDataCheckbox.checked
Controls.Label {
text: i18n("Enable data roaming")
font.weight: Font.Bold
color: parent.enabled ? Kirigami.Theme.textColor : Kirigami.Theme.disabledTextColor
Layout.fillWidth: true
}
Controls.CheckBox {
enabled: parent.enabled
checked: false
anchors.rightMargin: Kirigami.Units.gridUnit
onEnabledChanged: {
if (!enabled)
checked = false
}
}
}
}
}
......@@ -8,13 +8,28 @@ Kirigami.ApplicationItem {
objectName: "mobileDataMain"
pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25
//pageStack.initialPage:
pageStack.initialPage: MobileSettings {}
Kirigami.Theme.colorSet: Kirigami.Theme.Window
anchors.fill: parent
Controls.Label {
text: i18n("Mobile data settings")
font.weight: Font.Bold
PlasmaNM.Handler {
id: handler
}
PlasmaNM.AvailableDevices {
id: availableDevices
}
PlasmaNM.EnabledConnections {
id: enabledConnections
onWwanEnabledChanged: {
//mobileDataCheckbox.checked = mobileDataCheckbox.enabled && enabled
}
onWwanHwEnabledChanged: {
//mobileDataCheckbox.enabled = enabled && availableDevices.modemDeviceAvailable
}
}
}
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