bigboard r7430 - trunk/bigboard/stocks/self
- From: otaylor svn gnome org
- To: svn-commits-list gnome org
- Subject: bigboard r7430 - trunk/bigboard/stocks/self
- Date: Wed, 3 Sep 2008 16:25:46 +0000 (UTC)
Author: otaylor
Date: Wed Sep 3 16:25:46 2008
New Revision: 7430
URL: http://svn.gnome.org/viewvc/bigboard?rev=7430&view=rev
Log:
Autodetect whether shutdown icon is called gnome-shutdown or system-shutdown
to prevent a crash when showing the self stock.
Modified:
trunk/bigboard/stocks/self/SelfStock.py
Modified: trunk/bigboard/stocks/self/SelfStock.py
==============================================================================
--- trunk/bigboard/stocks/self/SelfStock.py (original)
+++ trunk/bigboard/stocks/self/SelfStock.py Wed Sep 3 16:25:46 2008
@@ -169,14 +169,26 @@
self.__logout_controls_box = CanvasVBox()
vbox.append(self.__logout_controls_box)
+ # Older icon themes don't have the system-* names, newer icon themes don't have
+ # the gnome-* names, so check to see what is available.
+ if gtk.icon_theme_get_default().lookup_icon('system-log-out', 22, 0) != None:
+ log_out_name = 'system-log-out'
+ else:
+ log_out_name = 'gnome-logout'
+
+ if gtk.icon_theme_get_default().lookup_icon('system-shutdown', 22, 0) != None:
+ shutdown_name = 'system-shutdown'
+ else:
+ shutdown_name = 'gnome-shutdown'
+
link = IconLink(text='Logout...', img_scale_width=22, img_scale_height=22, xalign=hippo.ALIGNMENT_START)
link.link.connect("activated", self.__on_logout)
- link.img.set_property('image-name', 'gnome-logout')
+ link.img.set_property('image-name', log_out_name)
self.__logout_controls_box.append(link)
link = IconLink(text='Shutdown...', img_scale_width=22, img_scale_height=22, xalign=hippo.ALIGNMENT_START)
link.link.connect("activated", self.__on_shutdown)
- link.img.set_property('image-name', 'gnome-shutdown')
+ link.img.set_property('image-name', shutdown_name)
self.__logout_controls_box.append(link)
self.update_self(myself)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]