~andrewsomething/gm-notify/lp-597407

« back to all changes in this revision

Viewing changes to gm-notify.py

  • Committer: Alexander Hungenberg
  • Date: 2010-04-28 18:07:48 UTC
  • Revision ID: defreng@defreng-desktop-20100428180748-76mc8pbbl1h71rf8
really fix bug #571230

Show diffs side-by-side

added added

removed removed

Lines of Context:
139
139
    
140
140
    def update_count(self, count):
141
141
        for mailbox in count.iteritems():
 
142
            if mailbox[0] == "inbox" and self.ignore_inbox:
 
143
                continue
 
144
            
142
145
            i = self.indicators[mailbox[0]]
143
146
            if int(i.get_property("count")) > int(mailbox[1]):
144
147
                i.set_property("draw-attention", "false")
145
148
            i.set_property("count", unicode(mailbox[1]))
146
 
            if int(mailbox[1]) or (mailbox[0] == "inbox" and not self.ignore_inbox): i.show()
 
149
            if int(mailbox[1]) or mailbox[0] == "inbox": i.show()
147
150
            else: i.hide()
148
151
    
149
152
    def new_mail(self, mails):
155
158
            for label in mail['labels']:
156
159
                if label == u"^i": label = "inbox"
157
160
                if label in self.indicators:
158
 
                    if not label == "inbox": got_label = True
159
 
                    self.indicators[label].set_property("draw-attention", "true")
 
161
                    if not label == "inbox" or not self.ignore_inbox:
 
162
                        got_label = True
 
163
                        self.indicators[label].set_property("draw-attention", "true")
160
164
            if not got_label and self.ignore_inbox: continue
161
165
            
162
166
            if "sender_name" in mail: text += mail['sender_name'] + ":\n"
225
229
            new_indicator.label = mailbox
226
230
            new_indicator.connect("user-display", self.labelClick)
227
231
            self.indicators[mailbox] = new_indicator
228
 
        if not self.ignore_inbox: self.indicators["inbox"].show()
 
232
        self.indicators["inbox"].show()
 
233
        if self.ignore_inbox: self.indicators["inbox"].hide()
229
234
 
230
235
cm = CheckMail()