[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [networkmanagement/nm09] /: add support for allowing/forbidding GSM
From:       Ilia Kats <ilia-kats () gmx ! net>
Date:       2011-08-23 16:43:32
Message-ID: 20110823164332.09879A60C6 () git ! kde ! org
[Download RAW message or body]

Git commit 5c0899107d9a2e59f549fcf6802a14d56c745288 by Ilia Kats.
Committed on 23/08/2011 at 18:16.
Pushed by iliakats into branch 'nm09'.

add support for allowing/forbidding GSM roaming

M  +15   -0    libs/internals/settings/gsm.h
M  +2    -1    libs/internals/settings/gsm.cpp
M  +9    -2    libs/ui/gsm.ui
M  +4    -0    backends/NetworkManager/settings/gsmdbus.cpp
M  +2    -0    libs/ui/gsmwidget.cpp

http://commits.kde.org/networkmanagement/5c0899107d9a2e59f549fcf6802a14d56c745288

diff --git a/backends/NetworkManager/settings/gsmdbus.cpp \
b/backends/NetworkManager/settings/gsmdbus.cpp index 51c70b3..75a9173 100644
--- a/backends/NetworkManager/settings/gsmdbus.cpp
+++ b/backends/NetworkManager/settings/gsmdbus.cpp
@@ -43,6 +43,9 @@ void GsmDbus::fromMap(const QVariantMap & map)
   if (map.contains(QLatin1String(NM_SETTING_GSM_ALLOWED_BANDS))) {
     setting->setBand(map.value(QLatin1String(NM_SETTING_GSM_ALLOWED_BANDS)).value<int>());
  }
+  if (map.contains(QLatin1String(NM_SETTING_GSM_HOME_ONLY))) {
+    setting->setHomeonly(map.value(QLatin1String(NM_SETTING_GSM_HOME_ONLY)).value<bool>());
 +  }
   // SECRET
   if (map.contains(QLatin1String(NM_SETTING_GSM_PIN))) {
       setting->setPin(map.value(QLatin1String(NM_SETTING_GSM_PIN)).value<QString>());
 @@ -65,6 +68,7 @@ QVariantMap GsmDbus::toMap()
   if (setting->networktype() != NM_SETTING_GSM_NETWORK_TYPE_ANY) {
       map.insert(QLatin1String(NM_SETTING_GSM_NETWORK_TYPE), \
setting->networktype());  }
+  insertIfTrue(map, NM_SETTING_GSM_HOME_ONLY, setting->homeonly());
 
   map.unite(toSecretsMap());
   if (!setting->password().isEmpty()) {
diff --git a/libs/internals/settings/gsm.cpp b/libs/internals/settings/gsm.cpp
index 8a0e04c..4772d23 100644
--- a/libs/internals/settings/gsm.cpp
+++ b/libs/internals/settings/gsm.cpp
@@ -5,7 +5,7 @@
 
 using namespace Knm;
 
-GsmSetting::GsmSetting() : Setting(Setting::Gsm), mNetworktype(-1), mBand(-1), \
mPasswordflags(Setting::AgentOwned), mPinflags(NotSaved) +GsmSetting::GsmSetting() : \
Setting(Setting::Gsm), mNetworktype(-1), mBand(-1), mHomeonly(false), \
mPasswordflags(Setting::AgentOwned), mPinflags(NotSaved)  {
 }
 
@@ -19,6 +19,7 @@ GsmSetting::GsmSetting(GsmSetting *setting) : Setting(setting)
     setNetworkid(setting->networkid());
     setNetworktype(setting->networktype());
     setBand(setting->band());
+    setHomeonly(setting->homeonly());
     setPin(setting->pin());
     setPinflags(setting->pinflags());
 }
diff --git a/libs/internals/settings/gsm.h b/libs/internals/settings/gsm.h
index ce5003e..89609ab 100644
--- a/libs/internals/settings/gsm.h
+++ b/libs/internals/settings/gsm.h
@@ -159,6 +159,20 @@ class KNMINTERNALS_EXPORT GsmSetting : public Setting
     }
 
     /**
+      Set home only
+    */
+    void setHomeonly( bool b ) {
+        mHomeonly = b;
+    }
+
+    /**
+      Get home only
+    */
+    bool homeonly() const {
+        return mHomeonly;
+    }
+
+    /**
       Set PIN
     */
     void setPin( const QString & v )
@@ -200,6 +214,7 @@ class KNMINTERNALS_EXPORT GsmSetting : public Setting
     QString mNetworkid;
     int mNetworktype;
     int mBand;
+    bool mHomeonly;
     QString mPin;
     QString mPuk;
     Setting::secretsTypes mPasswordflags;
diff --git a/libs/ui/gsm.ui b/libs/ui/gsm.ui
index 00a2df8..87219a4 100644
--- a/libs/ui/gsm.ui
+++ b/libs/ui/gsm.ui
@@ -205,7 +205,7 @@
         </property>
        </widget>
       </item>
-      <item row="4" column="0">
+      <item row="5" column="0">
        <widget class="QLabel" name="label_5">
         <property name="text">
          <string>&amp;PIN:</string>
@@ -218,7 +218,7 @@
         </property>
        </widget>
       </item>
-      <item row="4" column="1">
+      <item row="5" column="1">
        <layout class="QHBoxLayout" name="horizontalLayout_2">
         <item>
          <widget class="KLineEdit" name="pin"/>
@@ -244,6 +244,13 @@
         </item>
        </layout>
       </item>
+      <item row="4" column="1">
+       <widget class="QCheckBox" name="chkAllowRoaming">
+        <property name="text">
+         <string>Allow Roaming</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
diff --git a/libs/ui/gsmwidget.cpp b/libs/ui/gsmwidget.cpp
index b7a9c0d..1fcfbe3 100644
--- a/libs/ui/gsmwidget.cpp
+++ b/libs/ui/gsmwidget.cpp
@@ -61,6 +61,7 @@ void GsmWidget::readConfig()
     d->ui.network->setText(d->setting->networkid());
     d->ui.type->setCurrentIndex(qBound(0, d->setting->networktype() + 1, \
d->ui.type->count() - 1));  d->ui.band->setValue(d->setting->band());
+    d->ui.chkAllowRoaming->setChecked(!d->setting->homeonly());
     d->ui.password->setPasswordMode(true);
 }
 
@@ -83,6 +84,7 @@ void GsmWidget::writeConfig()
     d->setting->setNetworkid(d->ui.network->text());
     d->setting->setNetworktype(d->ui.type->currentIndex() - 1);
     d->setting->setBand(d->ui.band->value());
+    d->setting->setHomeonly(!d->ui.chkAllowRoaming->isChecked());
     d->setting->setPin(d->ui.pin->text());
     switch (d->ui.pinStorage->currentIndex())
     {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic