[Python-apps-commits] r8282 - in packages/gmail-notify/trunk/debian (3 files)
adejong at users.alioth.debian.org
adejong at users.alioth.debian.org
Fri Mar 9 13:41:48 UTC 2012
Date: Friday, March 9, 2012 @ 13:41:46
Author: adejong
Revision: 8282
* Use gtk.StatusIcon instead of egg.trayicon (thanks Max Linke)
(Closes: #560983)
Added:
packages/gmail-notify/trunk/debian/patches/09_gtkStatusIcon.patch
Modified:
packages/gmail-notify/trunk/debian/changelog
packages/gmail-notify/trunk/debian/patches/series
Modified: packages/gmail-notify/trunk/debian/changelog
===================================================================
--- packages/gmail-notify/trunk/debian/changelog 2012-03-09 13:29:45 UTC (rev 8281)
+++ packages/gmail-notify/trunk/debian/changelog 2012-03-09 13:41:46 UTC (rev 8282)
@@ -15,8 +15,10 @@
* Update short package description.
* Update Vcs-Browser field.
* Bump standards-version to 3.9.3.
+ * Use gtk.StatusIcon instead of egg.trayicon (thanks Max Linke)
+ (Closes: #560983)
- -- Arthur de Jong <adejong at debian.org> Fri, 09 Mar 2012 13:58:00 +0100
+ -- Arthur de Jong <adejong at debian.org> Fri, 09 Mar 2012 14:37:47 +0100
gmail-notify (1.6.1.1-1) unstable; urgency=medium
Added: packages/gmail-notify/trunk/debian/patches/09_gtkStatusIcon.patch
===================================================================
--- packages/gmail-notify/trunk/debian/patches/09_gtkStatusIcon.patch (rev 0)
+++ packages/gmail-notify/trunk/debian/patches/09_gtkStatusIcon.patch 2012-03-09 13:41:46 UTC (rev 8282)
@@ -0,0 +1,115 @@
+Description: Use gtk.StatusIcon instead of egg.trayicon.
+Author: Max Linke <max_linke-debian at gmx.de>
+Bug-Debian: http://bugs.debian.org/560983
+
+--- a/notifier.py
++++ b/notifier.py
+@@ -6,7 +6,6 @@
+ import gtk
+ import time
+ import os
+-from egg.trayicon import TrayIcon
+ import sys
+ sys.path.insert (0, "/usr/lib/gmail-notify/")
+ import warnings
+@@ -86,26 +85,6 @@
+ self.maintimer=None
+ self.popuptimer=0
+ self.waittimer=0
+- # Create the tray icon object
+- self.tray = TrayIcon(self.lang.get_string(21));
+- self.eventbox = gtk.EventBox()
+- self.tray.add(self.eventbox)
+- self.eventbox.connect("button_press_event", self.tray_icon_clicked)
+- # Tray icon drag&drop options
+- self.eventbox.drag_dest_set(
+- gtk.DEST_DEFAULT_ALL,
+- [('_NETSCAPE_URL', 0, 0),('text/uri-list ', 0, 1),('x-url/http', 0, 2)],
+- gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
+- # Create the tooltip for the tray icon
+- self._tooltip = gtk.Tooltips()
+- # Set the image for the tray icon
+- self.imageicon = gtk.Image()
+- pixbuf = gtk.gdk.pixbuf_new_from_file( ICON_PATH )
+- scaled_buf = pixbuf.scale_simple(24,24,gtk.gdk.INTERP_BILINEAR)
+- self.imageicon.set_from_pixbuf(scaled_buf)
+- self.eventbox.add(self.imageicon)
+- # Show the tray icon
+- self.tray.show_all()
+ # Create the popup menu
+ self.popup_menu = GmailPopupMenu.GmailPopupMenu( self)
+ # Create the popup
+@@ -144,6 +123,14 @@
+ self.height+=self.options['voffset']
+ self.width+=self.options['hoffset']
+ self.window.move(gtk.gdk.screen_width() - self.width, gtk.gdk.screen_height() - self.height)
++ # Create the tray icon object
++ self.tray = gtk.StatusIcon()
++ self.tray.set_title(self.lang.get_string(21))
++ self.tray.connect("button_press_event",self.tray_icon_clicked)
++ # Set the image for the tray icon
++ pixbuf = gtk.gdk.pixbuf_new_from_file( ICON_PATH )
++ scaled_buf = pixbuf.scale_simple(24,24,gtk.gdk.INTERP_BILINEAR)
++ self.tray.set_from_pixbuf(scaled_buf)
+
+ self.init=1
+ while gtk.events_pending():
+@@ -162,7 +149,7 @@
+ return 0
+ self.dont_connect=1
+ print "connecting..."
+- self._tooltip.set_tip(self.tray,self.lang.get_string(13))
++ self.tray.set_tooltip(self.lang.get_string(13))
+ while gtk.events_pending():
+ gtk.main_iteration( gtk.TRUE)
+ # Attemp connection
+@@ -170,12 +157,12 @@
+ self.connection=gmailatom.GmailAtom(self.options['gmailusername'],self.options['gmailpassword'],self.options['proxy'])
+ self.connection.refreshInfo()
+ print "connection successful... continuing"
+- self._tooltip.set_tip(self.tray,self.lang.get_string(14))
++ self.tray.set_tooltip_text(self.lang.get_string(14))
+ self.dont_connect=0
+ return 1
+ except:
+ print "login failed, will retry"
+- self._tooltip.set_tip(self.tray,self.lang.get_string(15))
++ self.tray.set_tooltip_text(self.lang.get_string(15))
+ self.default_label = "<span size='large' ><u><i>"+self.lang.get_string(15)+"</i></u></span>\n\n"+self.lang.get_string(16)
+ self.label.set_markup(self.default_label)
+ self.show_popup()
+@@ -204,10 +191,6 @@
+ self.mailcheck=0
+ return gtk.TRUE
+
+- # Update tray icon
+- self.eventbox.remove(self.imageicon)
+- self.imageicon = gtk.Image()
+-
+ if attrs[1]>0:
+ print str(attrs[1])+" new messages"
+ sender = attrs[2]
+@@ -222,20 +205,18 @@
+ print str(attrs[0])+" unread messages"
+ s = ' '
+ if attrs[0]>1: s=self.lang.get_string(35)+" "
+- self._tooltip.set_tip(self.tray,(self.lang.get_string(19))%{'u':attrs[0],'s':s})
++ self.tray.set_tooltip_text((self.lang.get_string(19))%{'u':attrs[0],'s':s})
+ pixbuf = gtk.gdk.pixbuf_new_from_file( ICON2_PATH )
+ else:
+ print "no new messages"
+ self.default_label="<span size='large' ><i><u>"+self.lang.get_string(21)+"</u></i></span>\n\n\n"+self.lang.get_string(18)
+- self._tooltip.set_tip(self.tray,self.lang.get_string(18))
++ self.tray.set_tooltip_text(self.lang.get_string(18))
+ pixbuf = gtk.gdk.pixbuf_new_from_file( ICON_PATH )
+
+ p = re.compile('&')
+ self.label.set_markup(p.sub('&', self.default_label))
+ scaled_buf = pixbuf.scale_simple(24,24,gtk.gdk.INTERP_BILINEAR)
+- self.imageicon.set_from_pixbuf(scaled_buf)
+- self.eventbox.add(self.imageicon)
+- self.tray.show_all()
++ self.tray.set_from_pixbuf(scaled_buf)
+ self.unreadmsgcount=attrs[0]
+
+ self.mailcheck=0
Modified: packages/gmail-notify/trunk/debian/patches/series
===================================================================
--- packages/gmail-notify/trunk/debian/patches/series 2012-03-09 13:29:45 UTC (rev 8281)
+++ packages/gmail-notify/trunk/debian/patches/series 2012-03-09 13:41:46 UTC (rev 8282)
@@ -6,3 +6,4 @@
06_gmail_to_mail.patch
07_preferences-window.patch
08_ampersand-fix.patch
+09_gtkStatusIcon.patch
More information about the Python-apps-commits
mailing list