~albyrock87/awn-extras/extras_with_pidgineer

« back to all changes in this revision

Viewing changes to applets/maintained/pidgineer/pidgineer.py

  • Committer: Alberto
  • Date: 2010-08-26 13:19:30 UTC
  • Revision ID: albyrock87+dev@gmail.com-20100826131930-mk1e7mm820k0dmn5
Don't use set_message API

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from dbus.mainloop.glib import DBusGMainLoop
29
29
 
30
30
from awn.extras import _, awnlib
 
31
from awn import OverlayText
31
32
 
32
33
STATUS_TYPES = {0 : ("pending", _("Messages to read..")), \
33
34
                1 : ("offline",_("Offline")), \
36
37
                4 : ("invisible",_("Invisible")), \
37
38
                5 : ("away",_("Away")) }
38
39
 
 
40
GRAV = gtk.gdk.GRAVITY_SOUTH
 
41
MSGSIZE = -1.0
 
42
 
39
43
def err(msg):
40
44
  print >> sys.stderr, msg
41
45
 
44
48
    # init applet
45
49
    self.a = applet # a = applet object
46
50
    self.a.connect("clicked", self.applet_clicked)
 
51
    self.overlay = OverlayText()
 
52
    self.overlay.props.gravity = gtk.gdk.GRAVITY_SOUTH
 
53
    self.overlay.props.font_sizing = 12.0
 
54
    self.a.add_overlay(self.overlay)
47
55
    # self.a.connect("middle-clicked", self.applet_middle_clicked) # for debug
48
56
    # init DBus
49
57
    self.p = None # p = Purple DBus Interface
181
189
      self.a.set_icon_name(self.applet_get_icon_path_for_status(status, 48))
182
190
    else:
183
191
      self.a.set_tooltip_text(_("Start Pidgin.."))
184
 
      self.a.set_message("")
 
192
      self.overlay.props.text = ""
185
193
      self.a.set_icon_name("pidgin")
186
194
  
187
195
  def applet_update_message_count(self):
188
196
    if self.unreaded_msgs > 0:
189
 
      self.a.set_message(str(self.unreaded_msgs))
 
197
      self.overlay.props.text = str(self.unreaded_msgs)
190
198
      self.a.get_effects().start_ex("attention", 0, 0, 1)
191
199
      self.a.set_icon_name(self.applet_get_icon_path_for_status(0, 48))
192
200
    else:
193
 
      self.a.set_message("")
 
201
      self.overlay.props.text = ""
194
202
      self.a.get_effects().stop("attention")
195
203
      self.a.set_icon_name(self.applet_get_icon_path_for_status( \
196
204
                                          self.purple_get_current_status(), 48))