github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

marianoguerra / emesene forked from dequis/emesene

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 24
    • 9
  • Source
  • Commits
  • Network (9)
  • Issues (7)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: 2c49ddd

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Click here to lend your support to: emesene and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A windows live messenger network client written in python — Read more

  cancel

http://www.emesene.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

status combo extension+plugin finished 
marianoguerra (author)
Sun Aug 30 15:51:50 -0700 2009
commit  2c49ddd0d3c525763ed8bc0b95824e25b183ad31
tree    9fd4c2a666a8e1a2384ed0569380545a2238ed99
parent  f01040503f907373cf9067a5f44bacc5ced77232
emesene / mesinyer / plugins / ye_old_status_combo / StatusCombo.py mesinyer/plugins/ye_old_status_combo/StatusCombo.py
100644 83 lines (65 sloc) 2.823 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
'''module to define the StatusCombo class, used by plugin.py'''
import gtk
import gobject
 
import gui
import utils
import protocol
 
class StatusCombo(gtk.ComboBox):
    """a widget to select the status like the one in emesene 1.0"""
    NAME = 'Status Combo'
    DESCRIPTION = 'A combo to select the status like emesene 1.0'
    AUTHOR = 'Mariano Guerra'
    WEBSITE = 'www.emesene.org'
 
    def __init__(self, main_window):
        """constructor"""
        self.model = gtk.ListStore(gtk.gdk.Pixbuf, \
                      gobject.TYPE_INT, gobject.TYPE_STRING)
 
        gtk.ComboBox.__init__(self, self.model)
        self.main_window = main_window
        self.status = None
 
        status_pixbuf_cell = gtk.CellRendererPixbuf()
        status_text_cell = gtk.CellRendererText()
        self.pack_start(status_pixbuf_cell, False)
        self.pack_start(status_text_cell, False)
        status_pixbuf_cell.set_property('xalign', 0.0)
        status_pixbuf_cell.set_property('xpad', 5)
        status_text_cell.set_property('xalign', 0.0)
        status_text_cell.set_property('xpad', 5)
        status_text_cell.set_property('width', 158)
        self.add_attribute(status_pixbuf_cell, 'pixbuf', 0)
        self.add_attribute(status_text_cell, 'text', 2)
        self.set_resize_mode(0)
        self.set_wrap_width(1)
 
        current_status = main_window.session.account.status
 
        active = 0
        count = 0
 
        for stat in protocol.status.ORDERED:
            status_name = protocol.status.STATUS[stat]
 
            if stat == current_status:
                active = count
 
            pixbuf = utils.safe_gtk_pixbuf_load(gui.theme.status_icons[stat])
            pixbuf.scale_simple(20, 20, gtk.gdk.INTERP_BILINEAR)
            self.model.append([pixbuf, stat, status_name]) # re-gettext-it
 
            count += 1
 
        self.set_active(active)
 
        self.connect('scroll-event', self.on_scroll_event)
        self.connect('changed', self.on_status_changed)
        main_window.session.signals.status_change_succeed.subscribe(
                self.on_status_change_succeed)
        print 'constructor'
 
    def on_status_changed(self , *args):
        """called when a status is selected"""
        stat = self.model.get(self.get_active_iter(), 1)[0]
 
        if self.status != stat:
            self.status = stat
            self.main_window.session.set_status(stat)
 
    def on_status_change_succeed(self, stat):
        """called when the status was changed on another place"""
        if stat in protocol.status.ORDERED:
            self.status = stat
            index = protocol.status.ORDERED.index(stat)
            self.set_active(index)
 
    def on_scroll_event(self, button, event):
        """called when a scroll is made over the combo"""
        self.popup()
        return True
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server