[pkg-fso-commits] [SCM] openmoko panel plugin branch, debian, updated. debian/0.8-1-3-g6639725
ohli (none)
ohli at workuta.
Tue Feb 3 22:10:59 UTC 2009
The following commit has been merged in the debian branch:
commit 78c5952c7e56136b808f2cf428116c35161bfeba
Merge: cb75d13df4b831b4087a1de2f5d25f44155e1a26 f9eb994b15314eff29c1d31ed36b7162f5371452
Author: ohli <ohli at workuta.(none)>
Date: Tue Feb 3 22:46:51 2009 +0100
Merge commit 'upstream/0.9' into debian
diff --combined panelplugin/PanelPlugin.py
index 0269458,86dd2cd..afb32d7
--- a/panelplugin/PanelPlugin.py
+++ b/panelplugin/PanelPlugin.py
@@@ -3,10 -3,14 +3,14 @@@
import ConfigParser # for config-files
import gobject
import gtk
+ import logging
import os
import pango # for font-size
import time
+ from dbus import Interface
+ from dbus.exceptions import DBusException
+
from panelplugin.StatusIcon import StatusIcon
from panelplugin.UsageIcon import UsageIcon
from panelplugin.PowerStateIcon import PowerStateIcon
@@@ -34,6 -38,10 +38,10 @@@ class PanelPlugin()
self.panelConfig = ConfigParser.SafeConfigParser()
self.configReader()
+ self.usageIface = self.tryGetInterface('org.freesmartphone.ousaged',
+ '/org/freesmartphone/Usage',
+ 'org.freesmartphone.Usage')
+
self.starting = False
def configReader(self):
@@@ -58,31 -66,31 +66,31 @@@
def appendIcon(self, enabledIcon):
if (enabledIcon == "battery"):
from panelplugin.BatteryIcon import BatteryIcon
- self.icons.append(BatteryIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(BatteryIcon(self, self.notificationAvailable))
elif (enabledIcon == "brightness"):
from panelplugin.BrightnessIcon import BrightnessIcon
- self.icons.append(BrightnessIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(BrightnessIcon(self, self.notificationAvailable))
elif (enabledIcon == "bluetooth"):
from panelplugin.BTIcon import BTIcon
- self.icons.append(BTIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(BTIcon(self, self.notificationAvailable))
elif (enabledIcon == "buttons"):
from panelplugin.Buttons import Buttons
- self.icons.append(Buttons(self.dbus, self, self.notificationAvailable))
+ self.icons.append(Buttons(self, self.notificationAvailable))
elif (enabledIcon == "gps"):
from panelplugin.GPSIcon import GPSIcon
- self.icons.append(GPSIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(GPSIcon(self, self.notificationAvailable))
elif (enabledIcon == "gsm"):
from panelplugin.GSMIcon import GSMIcon
- self.icons.append(GSMIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(GSMIcon(self, self.notificationAvailable))
elif (enabledIcon == "keyboard"):
from panelplugin.KeyboardIcon import KeyboardIcon
- self.icons.append(KeyboardIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(KeyboardIcon(self, self.notificationAvailable))
elif (enabledIcon == "usb"):
from panelplugin.USBIcon import USBIcon
- self.icons.append(USBIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(USBIcon(self, self.notificationAvailable))
elif (enabledIcon == "wifi"):
from panelplugin.WiFiIcon import WiFiIcon
- self.icons.append(WiFiIcon(self.dbus, self, self.notificationAvailable))
+ self.icons.append(WiFiIcon(self, self.notificationAvailable))
def configWriter(self):
if (not self.panelConfig.has_section("main")):
@@@ -281,16 -289,6 +289,16 @@@
self.configWindowActiveIconsCheckBoxes[icon] = iconCheckBox
self.configWindowVBoxIcons.pack_start(iconRow, True, True, 2)
+ if (windowClose):
+ self.configWindowDestroyer(None)
+
+ def configWindowDestroyer(self, widget, data = None):
+ self.configWindow.destroy()
+ self.configWindowActive = False
+
+ def configWindowDeleter(self, widget, event, data = None):
+ return False
+
def configWindowMaker(self, name=None):
if (self.configWindowActive):
self.configWindowDestroyer(None)
@@@ -301,6 -299,7 +309,7 @@@
self.configWindow.connect("delete_event", self.configWindowDeleter)
self.configWindow.connect("destroy", self.configWindowDestroyer)
self.configWindow.maximize()
+ self.configWindow.show()
self.configWindowFrame = gtk.Frame('Config')
self.configWindow.add(self.configWindowFrame)
@@@ -332,7 -331,7 +341,7 @@@
self.configWindowVBox2.pack_start(self.configWindowVBoxIcons)
- self.configWindowChangesLabel = gtk.Label('(Changes require restart!)')
+ self.configWindowChangesLabel = gtk.Label('(De-/Activations require restart!)')
self.configWindowVBox2.pack_start(self.configWindowChangesLabel)
@@@ -384,7 -383,9 +393,9 @@@
for icon in self.icons:
icon.suspend()
- self.dbus.usage_iface.Suspend()
+ time.sleep(0.5)
+
+ self.usageIface.Suspend()
def resume(self):
gobject.threads_init()
@@@ -393,4 -394,22 +404,22 @@@
icon.resume()
def shutdown(self):
- self.dbus.usage_iface.Shutdown()
+ self.usageIface.Shutdown()
+
+ def reboot(self):
+ self.usageIface.Reboot()
+
+ def tryGetInterface(self, busName, objectName, interfaceName):
+ iface = None
+
+ try:
+ proxy = self.dbus.bus.get_object(busName, objectName)
+ except DBusException, e:
+ logging.warning("could not create proxy for %s:%s" % (busName, objectName))
+
+ try:
+ iface = Interface(proxy, interfaceName)
+ except:
+ logging.warning("could not create interface for %s:%s:%s" % (busName, objectName, interfaceName))
+
+ return iface
--
openmoko panel plugin
More information about the pkg-fso-commits
mailing list