~emesene-team/emesene/master

« back to all changes in this revision

Viewing changes to emesene/gui/gtkui/UserPanel.py

  • Committer: Sven (Sbte)
  • Date: 2012-09-06 22:13:17 UTC
  • Revision ID: git-v1:213f21f89b82d2974d8424b738b42ad33a89d918
emeseneĀ 2.12.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        self._enabled = True
42
42
 
43
43
        Avatar = extension.get_default('avatar')
44
 
        
 
44
 
45
45
        self.avatar = Avatar(cell_dimension=48)
46
46
 
47
47
        self.avatarBox = gtk.EventBox()
92
92
        nick_hbox.pack_start(self.mail, False)
93
93
        nick_hbox.pack_start(self.search, False)
94
94
 
95
 
        # enable this code and you'll get a nice button which fires a signal        
 
95
        # enable this code and you'll get a nice button which fires a signal
96
96
        #def do_something_weird(item):
97
97
        #    from e3.base.Event import Event
98
98
        #    session.add_event(Event.EVENT_DISCONNECTED, 'Tested disconnection', 0)
116
116
        nick_hbox.show()
117
117
        self.message_hbox.show()
118
118
        vbox.show()
119
 
 
120
119
        self._add_subscriptions()
121
120
 
122
121
    def _on_userpanel_button_changed(self, newvalue):
148
147
        self.search.show()
149
148
        if self.userpanel_button:
150
149
            self.userpanel_button.show()
151
 
        self.mail.show()
 
150
        if self.session.config.b_show_mail_inbox:
 
151
            self.mail.show()
152
152
        self.toolbar.show()
153
153
 
154
154
    def show_all(self):
221
221
        '''method called when the nick is changed'''
222
222
        self.session.set_message(new_text)
223
223
 
 
224
    def _on_show_mail_inbox_changed(self, value):
 
225
        '''callback called when config.b_show_mail_inbox changes'''
 
226
        self.mail.set_visible(value)
 
227
 
 
228
    def set_mail_count(self, count):
 
229
        self.mail.set_label("(%d)" % count)
 
230
 
224
231
    def _add_subscriptions(self):
225
232
        '''subscribe all signals'''
226
233
        self.session.signals.message_change_succeed.subscribe(
238
245
            self.on_profile_update_succeed)
239
246
        self.session.signals.profile_set_succeed.subscribe(
240
247
            self.on_profile_update_succeed)
 
248
        self.session.config.subscribe(self._on_show_mail_inbox_changed,
 
249
            'b_show_mail_inbox')
241
250
 
242
251
        extension.subscribe(
243
252
            self._on_userpanel_button_changed, "userpanel button")
259
268
            self.on_profile_update_succeed)
260
269
        self.session.signals.profile_set_succeed.unsubscribe(
261
270
            self.on_profile_update_succeed)
 
271
        self.session.config.unsubscribe(self._on_show_mail_inbox_changed,
 
272
            'b_show_mail_inbox')
262
273
 
263
274
        extension.unsubscribe(
264
275
            self._on_userpanel_button_changed, "userpanel button")