[pkg-fso-commits] [SCM] openmoko panel plugin branch, debian, updated. debian/0.7-3-1-g094181f
ohli (none)
ohli at workuta.
Mon Jan 19 20:18:13 UTC 2009
The following commit has been merged in the debian branch:
commit 094181f09b4c38959ff4b3a62dbf2e69ebc0f8ff
Author: ohli <ohli at workuta.(none)>
Date: Sat Jan 17 18:58:10 2009 +0100
ecoding stuff
diff --git a/debian/changelog b/debian/changelog
index 9b176e7..47d3169 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+openmoko-panel-plugin (0.7-4) pkg-fso; urgency=low
+
+ * encoding stuff. no more degree sign problems
+
+ -- Sebastian Ohl <sebastian at ohl.name> Sat, 17 Jan 2009 18:55:36 +0100
+
openmoko-panel-plugin (0.7-3) pkg-fso; urgency=low
* setting module python version to 2.5
diff --git a/openmoko-panel-plugin b/openmoko-panel-plugin
index c922c06..0117f58 100755
--- a/openmoko-panel-plugin
+++ b/openmoko-panel-plugin
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# vim: set fileencoding=utf-8 :
"""
Plugin for any gtk based panel type.
diff --git a/panelplugin/BTIcon.py b/panelplugin/BTIcon.py
index 413aa62..8ecb4c5 100644
--- a/panelplugin/BTIcon.py
+++ b/panelplugin/BTIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
from panelplugin.PowerStateIcon import PowerStateIcon
#----------------------------------------------------------------------------#
diff --git a/panelplugin/BatteryIcon.py b/panelplugin/BatteryIcon.py
index 7bf21d6..9718ba5 100644
--- a/panelplugin/BatteryIcon.py
+++ b/panelplugin/BatteryIcon.py
@@ -1,7 +1,10 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
import gobject
import os
import pango
+import time
from panelplugin.StatusIcon import StatusIcon
#----------------------------------------------------------------------------#
@@ -29,7 +32,7 @@ class BatteryIcon(StatusIcon):
self.sysTemp = "/sys/devices/platform/bq27000-battery.0/power_supply/bat/temp"
self.sysTimeToEmpty = "/sys/devices/platform/bq27000-battery.0/power_supply/bat/time_to_empty_now"
self.sysTimeToFull = "/sys/devices/platform/bq27000-battery.0/power_supply/bat/time_to_full_now"
- self.sysChargeFull = "/sys/devices/platform/bq27000-battery.0/power_supply/bat/charge_full"
+ self.sysChargeFull = "/sys/devices/platform/bq27000-battery.0/power_supply/bat/charge_full"
self.update()
@@ -59,9 +62,7 @@ class BatteryIcon(StatusIcon):
def windowCallback(self, widget, data = None):
if (data == 'close'):
- self.batteryWindow.destroy()
- self.batteryWindow = None
- self.batteryWindowActive = False
+ self.batteryWindowDestroyer(None)
elif (data in ['100', '500', '1000']):
if (self.doVibrationOnActivation):
@@ -212,17 +213,22 @@ class BatteryIcon(StatusIcon):
return self.batteryWindowActive
+ def batteryWindowDestroyer(self, widget, data = None):
+ self.batteryWindow.destroy()
+ self.batteryWindowActive = False
+
+ def batteryWindowDeleter(self, widget, event, data = None):
+ return False
+
def activate(self, widget, data = None):
if (self.batteryWindowActive):
- self.batteryWindow.destroy()
- self.batteryWindow = None
- self.batteryWindowActive = False
+ self.batteryWindowDestroyer(None)
else:
- self.batteryWindowActive = True
-
self.batteryWindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.batteryWindow.set_title('Battery')
self.batteryWindow.set_border_width(5)
+ self.batteryWindow.connect("delete_event", self.batteryWindowDeleter)
+ self.batteryWindow.connect("destroy" , self.batteryWindowDestroyer)
self.batteryWindow.maximize()
self.batteryWindowFrame = gtk.Frame('Battery')
@@ -304,6 +310,8 @@ class BatteryIcon(StatusIcon):
self.batteryWindow.show_all()
+ self.batteryWindowActive = True
+
def getIcon(self):
bc = self.capacity
cr = self.chargingRate
@@ -370,6 +378,7 @@ class BatteryIcon(StatusIcon):
def update(self, execute = False):
if (execute):
+ time.sleep(1)
self.updateBatteryStatus()
self.updateIcon()
else:
diff --git a/panelplugin/BrightnessIcon.py b/panelplugin/BrightnessIcon.py
index b752c4b..d8d46f1 100644
--- a/panelplugin/BrightnessIcon.py
+++ b/panelplugin/BrightnessIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
import pango
from panelplugin.StatusIcon import StatusIcon
diff --git a/panelplugin/Buttons.py b/panelplugin/Buttons.py
index 7f6a104..3c9fde6 100644
--- a/panelplugin/Buttons.py
+++ b/panelplugin/Buttons.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
from dbus import Interface
import array
import gtk
@@ -281,11 +283,11 @@ class Buttons(StatusIcon):
elif ((name == "POWER") & self.handlePower):
if (self.auxButtonWindowActive):
- if (action == "pressed"):
+ if (action == "released"):
self.auxButtonWindowButtons[self.auxWindowButton].activate()
elif (self.powerButtonWindowActive):
- if (action == "pressed"):
+ if (action == "released"):
self.powerButtonWindowButtons[self.powerWindowButton].activate()
else:
@@ -338,27 +340,37 @@ class Buttons(StatusIcon):
# self.parentObject.updateIcons()
def auxWindowCallback(self, widget, data = None):
- self.auxButtonWindowActive = False
- self.auxButtonWindow.destroy()
- self.auxButtonWindow = None
+ windowClose = False
for i in range(0, len(self.auxButtonCmds)):
if (data == "auxbutton_%s" % i):
os.system("%s >/dev/null 2>&1 &" % self.auxButtonCmds[i])
+ windowClose = True
if (data == 'close'):
- pass
+ windowClose = True
+
+ if (windowClose):
+ self.auxWindowDestroyer(None)
+
+ def auxWindowDestroyer(self, widget, data = None):
+ self.auxButtonWindow.destroy()
+ self.auxButtonWindowActive = False
+
+ def auxWindowDeleter(self, widget, event, data = None):
+ return False
def auxWindowMaker(self):
if (self.auxButtonWindowActive):
- self.auxButtonWindow.destroy()
- self.auxButtonWindow = None
+ self.auxWindowDestroyer(None)
else:
self.auxWindowButton = 0
self.auxButtonWindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.auxButtonWindow.set_title('Aux')
self.auxButtonWindow.set_border_width(5)
+ self.auxButtonWindow.connect("delete_event", self.auxWindowDeleter)
+ self.auxButtonWindow.connect("destroy", self.auxWindowDestroyer)
self.auxButtonWindow.maximize()
self.auxButtonWindowFrame = gtk.Frame('Aux')
@@ -395,7 +407,7 @@ class Buttons(StatusIcon):
self.auxButtonWindow.show_all()
- self.auxButtonWindowActive = not self.auxButtonWindowActive
+ self.auxButtonWindowActive = True
def showDowner(self):
dialog = gtk.MessageDialog(
@@ -446,7 +458,17 @@ class Buttons(StatusIcon):
def powerWindowCallback(self, widget, data = None):
windowClose = False
- if (data == 'suspend'):
+ if (data == 'togglebluetooth'):
+ power = self.parentObject.signalTo('bluetooth', togglePower = 1)
+ self.powerButtonWindowBluetoothButton.set_label(label = " turn %s\nBluetooth" % ("off" if power else "on"))
+ self.powerButtonWindowBluetoothButton.child.modify_font(pango.FontDescription("sans bold 30"))
+
+ elif (data == 'togglewifi'):
+ power = self.parentObject.signalTo('wifi', togglePower = 1)
+ self.powerButtonWindowWifiButton.set_label(label = "turn %s\n WiFi" % ("off" if power else "on"))
+ self.powerButtonWindowWifiButton.child.modify_font(pango.FontDescription("sans bold 30"))
+
+ elif (data == 'suspend'):
self.parentObject.suspend()
self.parentObject.resume()
@@ -469,31 +491,27 @@ class Buttons(StatusIcon):
elif (data == 'close'):
windowClose = True
- elif (data == 'togglebluetooth'):
- power = self.parentObject.signalTo('bluetooth', togglePower = 1)
- self.powerButtonWindowBluetoothButton.set_label(label = " turn %s\nBluetooth" % ("off" if power else "on"))
- self.powerButtonWindowBluetoothButton.child.modify_font(pango.FontDescription("sans bold 30"))
+ if (windowClose):
+ self.powerButtonWindowDestroyer(None)
- elif (data == 'togglewifi'):
- power = self.parentObject.signalTo('wifi', togglePower = 1)
- self.powerButtonWindowWifiButton.set_label(label = "turn %s\n WiFi" % ("off" if power else "on"))
- self.powerButtonWindowWifiButton.child.modify_font(pango.FontDescription("sans bold 30"))
+ def powerButtonWindowDestroyer(self, widget, data = None):
+ self.powerButtonWindow.destroy()
+ self.powerButtonWindowActive = False
- if (windowClose):
- self.powerButtonWindowActive = False
- self.powerButtonWindow.destroy()
- self.powerButtonWindow = None
+ def powerButtonWindowDeleter(self, widget, event, data = None):
+ return False
def powerButtonWindowMaker(self):
if (self.powerButtonWindowActive):
- self.powerButtonWindow.destroy()
- self.powerButtonWindow = None
+ self.powerButtonWindowDestroyer(None)
else:
self.powerWindowButton = 0
self.powerButtonWindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.powerButtonWindow.set_title('Power')
self.powerButtonWindow.set_border_width(5)
+ self.powerButtonWindow.connect("delete_event", self.powerButtonWindowDeleter)
+ self.powerButtonWindow.connect("destroy", self.powerButtonWindowDestroyer)
self.powerButtonWindow.maximize()
self.powerButtonWindowFrame = gtk.Frame('Power')
@@ -564,7 +582,7 @@ class Buttons(StatusIcon):
self.powerButtonWindow.show_all()
- self.powerButtonWindowActive = not self.powerButtonWindowActive
+ self.powerButtonWindowActive = True
def configButtonsSetSensitive(self, sensitive = False):
for i in range(0, 4):
diff --git a/panelplugin/DBusObject.py b/panelplugin/DBusObject.py
index c91d403..2936748 100644
--- a/panelplugin/DBusObject.py
+++ b/panelplugin/DBusObject.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import dbus
from dbus import Interface, SystemBus
from dbus.exceptions import DBusException
diff --git a/panelplugin/GPSIcon.py b/panelplugin/GPSIcon.py
index f54b4e9..c78490e 100644
--- a/panelplugin/GPSIcon.py
+++ b/panelplugin/GPSIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
from dbus import Interface
from panelplugin.UsageIcon import UsageIcon
diff --git a/panelplugin/GSMIcon.py b/panelplugin/GSMIcon.py
index 439d855..e6c39fa 100644
--- a/panelplugin/GSMIcon.py
+++ b/panelplugin/GSMIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
from dbus import Interface
import gobject
import gtk
diff --git a/panelplugin/KeyboardIcon.py b/panelplugin/KeyboardIcon.py
index 2b72900..f26af19 100644
--- a/panelplugin/KeyboardIcon.py
+++ b/panelplugin/KeyboardIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import os
import gtk
import signal
@@ -43,7 +45,7 @@ class KeyboardIcon(StatusIcon):
def activate(self, widget, data = None):
if (self.getKdbStatus()):
os.kill(self.keyboardPid, signal.SIGTERM)
- os.waitpid(self.keyboardPid,0)
+ os.waitpid(self.keyboardPid, 0)
self.keyboardPid = 0
else:
self.keyboardPid = subprocess.Popen(self.keyboardBin, shell = False, close_fds = True).pid
diff --git a/panelplugin/PanelPlugin.py b/panelplugin/PanelPlugin.py
index 92f6d19..32b8751 100644
--- a/panelplugin/PanelPlugin.py
+++ b/panelplugin/PanelPlugin.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import ConfigParser # for config-files
import gobject
import gtk
@@ -176,11 +178,14 @@ class PanelPlugin():
return True
def configWindowCallback(self, widget, data=None):
+ windowClose = False
+
if (data == "cancel"):
- self.configWindow.destroy()
- self.configWindow = None
- self.configWindowActive = False
+ windowClose = True
+
elif (data == "save"):
+ windowClose = True
+
self.iconpath = self.configWindowIconpathText.get_text()
for icon in self.icons:
@@ -188,21 +193,28 @@ class PanelPlugin():
self.configWriter()
- self.configWindow.destroy()
- self.configWindow = None
- self.configWindowActive = False
-
else:
pass
+ 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.configWindow.destroy()
- self.configWindow = None
+ self.configWindowDestroyer(None)
else:
self.configWindow = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.configWindow.set_title('Config')
self.configWindow.set_border_width(5)
+ self.configWindow.connect("delete_event", self.configWindowDeleter)
+ self.configWindow.connect("destroy", self.configWindowDestroyer)
self.configWindow.maximize()
self.configWindowFrame = gtk.Frame('Config')
@@ -283,7 +295,7 @@ class PanelPlugin():
self.configWindowNotebook.set_current_page(self.pageShow)
- self.configWindowActive = not self.configWindowActive
+ self.configWindowActive = True
def suspend(self):
for icon in self.icons:
diff --git a/panelplugin/PowerStateIcon.py b/panelplugin/PowerStateIcon.py
index 3035d59..124b3bd 100644
--- a/panelplugin/PowerStateIcon.py
+++ b/panelplugin/PowerStateIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
from dbus import Interface
from panelplugin.StatusIcon import StatusIcon
diff --git a/panelplugin/StatusIcon.py b/panelplugin/StatusIcon.py
index 6f3f991..c170a92 100644
--- a/panelplugin/StatusIcon.py
+++ b/panelplugin/StatusIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gobject
import gtk
import os
diff --git a/panelplugin/USBIcon.py b/panelplugin/USBIcon.py
index fb3ae23..8765b0c 100644
--- a/panelplugin/USBIcon.py
+++ b/panelplugin/USBIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
import pango
from panelplugin.PowerStateIcon import PowerStateIcon
diff --git a/panelplugin/UsageIcon.py b/panelplugin/UsageIcon.py
index 9b1fd5e..ef5e5cd 100644
--- a/panelplugin/UsageIcon.py
+++ b/panelplugin/UsageIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
from dbus import Interface
from panelplugin.StatusIcon import StatusIcon
@@ -51,4 +53,3 @@ class UsageIcon(StatusIcon):
if (self.notificationAvailable & self.doNotification):
self.commitNotification()
-
diff --git a/panelplugin/WiFiIcon.py b/panelplugin/WiFiIcon.py
index c970da7..8d5f568 100644
--- a/panelplugin/WiFiIcon.py
+++ b/panelplugin/WiFiIcon.py
@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
import gtk
from panelplugin.PowerStateIcon import PowerStateIcon
diff --git a/panelplugin/__init__.py b/panelplugin/__init__.py
index e69de29..d950bdf 100644
--- a/panelplugin/__init__.py
+++ b/panelplugin/__init__.py
@@ -0,0 +1 @@
+# vim: set fileencoding=utf-8 :
diff --git a/setup.py b/setup.py
index 88162c0..58657b8 100755
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
#!/usr/bin/python
+# vim: set fileencoding=utf-8 :
"""
* setup.py - script to install the openmoko-panel-plugin
* (C) 2008 by Sebastian Ohl <sebastian at ohl.nam>
--
openmoko panel plugin
More information about the pkg-fso-commits
mailing list