Index: paneldelegate.py
===================================================================
RCS file: /cvs/gnome/sabayon/lib/sources/paneldelegate.py,v
retrieving revision 1.26
diff -u -p -r1.26 paneldelegate.py
--- paneldelegate.py	27 Jul 2006 19:21:03 -0000	1.26
+++ paneldelegate.py	22 Dec 2006 16:39:46 -0000
@@ -19,6 +19,7 @@
 import os
 import gconf
 import gconfsource
+import bonobo
 
 try:
     import userprofile
@@ -44,8 +45,7 @@ class PanelChange (userprofile.ProfileCh
         pass
 
 #
-# FIXME: these short descriptions are lame, should be:
-#  "Battery applet added to top panel"
+# FIXME: short descriptions for PanelObjects are lame, should be:
 #  "Launcher (gnome-terminal) added to bottom panel" etc.
 #
 
@@ -65,13 +65,43 @@ class PanelAppletAddedChange (PanelChang
     def __init__ (self, source, delegate, id):
         PanelChange.__init__ (self, source, delegate, id)
     def get_short_description (self):
-        return _("Panel applet '%s' added") % self.id
+		# FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
+		panel_applet = self.delegate.PanelApplet(self.id)
+		toplevel_id = panel_applet.toplevel_id
+		name = panel_applet.name
+		
+		panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+		panel_orientation = panel_toplevel.orientation
+
+		if panel_orientation == "top":
+			return _("Applet %s added to top panel") % name
+		elif panel_orientation == "bottom":
+			return _("Applet %s added to bottom panel") % name
+		elif panel_orientation == "left":
+			return _("Applet %s added to left panel") % name
+		else:
+			return _("Applet %s added to right panel") % name
 
 class PanelAppletRemovedChange (PanelChange):
     def __init__ (self, source, delegate, id):
         PanelChange.__init__ (self, source, delegate, id)
     def get_short_description (self):
-        return _("Panel applet '%s' removed") % self.id
+		# FIXME: This only works if panel object type is bonobo-applet. Are all applets bonobo-applets ?
+		panel_applet = self.delegate.PanelApplet(self.id)
+		toplevel_id = panel_applet.toplevel_id
+		name = panel_applet.name
+
+		panel_toplevel = self.delegate.PanelToplevel(toplevel_id)
+		panel_orientation = panel_toplevel.orientation
+
+		if panel_orientation == "top":
+			return _("Applet %s removed from top panel") % name
+		elif panel_orientation == "bottom":
+			return _("Applet %s removed from bottom panel") % name
+		elif panel_orientation == "left":
+			return _("Applet %s removed from left panel") % name
+		else:
+			return _("Applet %s removed from right panel") % name
 
 class PanelObjectAddedChange (PanelChange):
     def __init__ (self, source, delegate, id):
@@ -102,23 +132,32 @@ class PanelDelegate (userprofile.SourceD
             self.id      = id
             self.added   = added
             self.removed = removed
+            self.client = gconf.client_get_default ()	
     
     class PanelToplevel (PanelThing):
         def __init__ (self, id, added = False, removed = False):
             PanelDelegate.PanelThing.__init__ (self, id, added, removed)
             
-            # FIXME: which attributes do we really need?
+            self.orientation = self.client.get_string (PANEL_KEY_BASE + "/toplevels/" + id + "/orientation")
+            
+			# FIXME: which of the following attributes do we really need?
             # self.name        = self.client.get_string (PANEL_KEY_BASE + "/toplevels/" + toplevel_id + "/name")
-            # self.orientation = self.client.get_string (PANEL_KEY_BASE + "/toplevels/" + toplevel_id + "/orientation")
             # self.expand      = self.client.get_bool   (PANEL_KEY_BASE + "/toplevels/" + toplevel_id + "/expand")
 
     class PanelApplet (PanelThing):
         def __init__ (self, id, added = False, removed = False):
-            PanelDelegate.PanelThing.__init__ (self, id, added, removed)
-            
-            # FIXME: which attributes do we really need?
-            # self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/applets/" + applet_id + "/toplevel_id")
-            # self.bonobo_iid  = self.client.get_string (PANEL_KEY_BASE + "/applets/" + applet_id + "/bonobo_iid")
+			PanelDelegate.PanelThing.__init__ (self, id, added, removed)
+			
+			self.toplevel_id = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/toplevel_id")
+			self.bonobo_iid  = self.client.get_string (PANEL_KEY_BASE + "/applets/" + id + "/bonobo_iid")
+			
+			applet = bonobo.activation.query("iid == '" + self.bonobo_iid + "'" )
+			for i in applet:
+				for prop in i.props:
+					if prop.name == "name":
+						self.name = prop.v.value_string #FIXME: This probably won't return localised names	
+
+
 
     class PanelObject (PanelThing):
         def __init__ (self, id, added = False, removed = False):
