~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to unity/MessageBox.py

  • Committer: Jason Conti
  • Date: 2011-04-16 23:29:36 UTC
  • Revision ID: jason.conti@gmail.com-20110416232936-wqgej387mzueozir
Updated the number of translatable strings and fixed the labels so they properly rewrap when the window is resized in the experimental unity version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    self._filter = None
24
24
    self._messages = []
25
25
    self._message_limit = 20
 
26
    self._width = 400
26
27
 
27
28
    self._vbox = Gtk.VBox()
28
29
    self.add_with_viewport(self._vbox)
30
31
  def add_message(self, message):
31
32
    """Adds a message to the box"""
32
33
    item = MessageItem(message)
 
34
    item.set_width(self._width)
33
35
    self._messages.insert(0, item)
34
36
 
35
37
    if self._filter == None or self._filter == message.app_name:
68
70
      else:
69
71
        break
70
72
 
 
73
  def set_width(self, width):
 
74
    """Updates the default width and the width of all the childen message items."""
 
75
    self._width = width
 
76
    for item in self._messages:
 
77
      item.set_width(width)