Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions/cpsection/network/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/cpsection/network/model.py')
-rw-r--r--extensions/cpsection/network/model.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/extensions/cpsection/network/model.py b/extensions/cpsection/network/model.py
index d22bf69..1db7832 100644
--- a/extensions/cpsection/network/model.py
+++ b/extensions/cpsection/network/model.py
@@ -18,6 +18,7 @@
import logging
import dbus
from gettext import gettext as _
+from jarabe.model import network
import gconf
import os
@@ -75,7 +76,7 @@ def get_radio_nm():
bus = dbus.SystemBus()
try:
obj = bus.get_object(_NM_SERVICE, _NM_PATH)
- nm_props = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
+ nm_props = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
except dbus.DBusException:
raise ReadError('%s service not available' % _NM_SERVICE)
@@ -98,7 +99,7 @@ def set_radio_nm(state):
bus = dbus.SystemBus()
try:
obj = bus.get_object(_NM_SERVICE, _NM_PATH)
- nm_props = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
+ nm_props = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
except dbus.DBusException:
raise ReadError('%s service not available' % _NM_SERVICE)
nm_props.Set(_NM_IFACE, 'WirelessEnabled', True)
@@ -106,7 +107,7 @@ def set_radio_nm(state):
bus = dbus.SystemBus()
try:
obj = bus.get_object(_NM_SERVICE, _NM_PATH)
- nm_props = dbus.Interface(obj, 'org.freedesktop.DBus.Properties')
+ nm_props = dbus.Interface(obj, dbus.PROPERTIES_IFACE)
except dbus.DBusException:
raise ReadError('%s service not available' % _NM_SERVICE)
nm_props.Set(_NM_IFACE, 'WirelessEnabled', False)
@@ -172,7 +173,10 @@ def clear_registration():
def clear_networks():
"""Clear saved passwords and network configurations.
"""
- pass
+ network.clear_connections()
+
+def count_networks():
+ return network.count_connections()
def get_publish_information():
client = gconf.client_get_default()