Rearrange network device handling bits
This commit is contained in:
parent
672d06d85e
commit
85f8ef218d
@ -130,10 +130,12 @@ shell/intro/Makefile
|
||||
shell/hardware/Makefile
|
||||
shell/view/Makefile
|
||||
shell/view/devices/Makefile
|
||||
shell/view/devices/network/Makefile
|
||||
shell/view/frame/Makefile
|
||||
shell/view/home/Makefile
|
||||
shell/model/Makefile
|
||||
shell/model/devices/Makefile
|
||||
shell/model/devices/network/Makefile
|
||||
services/console/lib/Makefile
|
||||
services/console/lib/procmem/Makefile
|
||||
services/console/Makefile
|
||||
|
@ -1,8 +1,8 @@
|
||||
SUBDIRS = network
|
||||
|
||||
sugardir = $(pkgdatadir)/shell/model/devices
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
device.py \
|
||||
devicesmodel.py \
|
||||
battery.py \
|
||||
wirednetwork.py \
|
||||
wirelessnetwork.py
|
||||
battery.py
|
||||
|
@ -1,8 +1,8 @@
|
||||
import gobject
|
||||
|
||||
from model.devices import device
|
||||
from model.devices import wirednetwork
|
||||
from model.devices import wirelessnetwork
|
||||
from model.devices.network import wired
|
||||
from model.devices.network import wireless
|
||||
from model.devices import battery
|
||||
from hardware import hardwaremanager
|
||||
from hardware import nmclient
|
||||
@ -59,7 +59,7 @@ class DevicesModel(gobject.GObject):
|
||||
return self._devices[nm_device.get_op()]
|
||||
|
||||
def _add_network_device(self, nm_device):
|
||||
self.add_device(wirelessnetwork.Device(nm_device))
|
||||
self.add_device(wireless.Device(nm_device))
|
||||
nm_device.connect('state-changed',
|
||||
self._network_device_state_changed_cb)
|
||||
|
||||
|
5
shell/model/devices/network/Makefile.am
Normal file
5
shell/model/devices/network/Makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
sugardir = $(pkgdatadir)/shell/model/devices/network
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
wired.py \
|
||||
wireless.py
|
0
shell/model/devices/network/__init__.py
Normal file
0
shell/model/devices/network/__init__.py
Normal file
@ -9,4 +9,4 @@ class Device(device.Device):
|
||||
return self._nm_device.get_op()
|
||||
|
||||
def get_type(self):
|
||||
return 'wirednetwork'
|
||||
return 'network.wired'
|
@ -70,7 +70,7 @@ class Device(device.Device):
|
||||
return _nm_state_to_state[nm_state]
|
||||
|
||||
def get_type(self):
|
||||
return 'wirelessnetwork'
|
||||
return 'network.wireless'
|
||||
|
||||
def get_id(self):
|
||||
return self._nm_device.get_op()
|
@ -1,7 +1,7 @@
|
||||
SUBDIRS = network
|
||||
|
||||
sugardir = $(pkgdatadir)/shell/view/devices
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
battery.py \
|
||||
deviceview.py \
|
||||
wirednetwork.py \
|
||||
wirelessnetwork.py
|
||||
deviceview.py
|
||||
|
5
shell/view/devices/network/Makefile.am
Normal file
5
shell/view/devices/network/Makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
sugardir = $(pkgdatadir)/shell/view/devices/network
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
wired.py \
|
||||
wireless.py
|
0
shell/view/devices/network/__init__.py
Normal file
0
shell/view/devices/network/__init__.py
Normal file
@ -18,7 +18,7 @@
|
||||
from sugar.graphics import canvasicon
|
||||
from sugar.graphics import color
|
||||
from sugar.graphics import units
|
||||
from model.devices import wirelessnetwork
|
||||
from model.devices.network import wireless
|
||||
from view.pulsingicon import PulsingIcon
|
||||
|
||||
_ICON_NAME = 'device-network-wireless'
|
||||
@ -57,12 +57,12 @@ class DeviceView(PulsingIcon):
|
||||
def _update_state(self):
|
||||
# FIXME Change icon colors once we have real icons
|
||||
state = self._model.props.state
|
||||
if state == wirelessnetwork.STATE_ACTIVATING:
|
||||
if state == wireless.STATE_ACTIVATING:
|
||||
self.props.fill_color = color.ICON_FILL_INACTIVE
|
||||
self.props.stroke_color = color.ICON_STROKE_INACTIVE
|
||||
elif state == wirelessnetwork.STATE_ACTIVATED:
|
||||
elif state == wireless.STATE_ACTIVATED:
|
||||
self.props.fill_color = None
|
||||
self.props.stroke_color = None
|
||||
elif state == wirelessnetwork.STATE_INACTIVE:
|
||||
elif state == wireless.STATE_INACTIVE:
|
||||
self.props.fill_color = color.ICON_FILL_INACTIVE
|
||||
self.props.stroke_color = color.ICON_STROKE_INACTIVE
|
Loading…
Reference in New Issue
Block a user