Exemplo n.º 1
0
    def __init__(self, text, on_tab_menu, on_close_clicked, conversation,
                 mozilla_like):
        '''constructor'''
        gtk.HBox.__init__(self)
        self.set_border_width(0)
        self.set_spacing(4)

        self.mozilla_like = mozilla_like
        self.image = gtk.Image()
        self.label = Renderers.SmileyLabel()
        self.label.set_ellipsize(True)
        self.label.set_text(text)
        self.close = TinyButton.TinyButton(gtk.STOCK_CLOSE)
        self.close.set_tooltip_text(_('Close Tab (Ctrl+W)'))
        self.close.connect('clicked', on_close_clicked, conversation)

        if CLOSE_ON_LEFT:
            self.pack_start(self.close, False, False, 0)
            self.pack_start(self.image, False, False, 0)
            self.pack_start(self.label, True, True, 0)
        else:
            self.pack_start(self.image, False, False, 0)
            self.pack_start(self.label, True, True, 0)
            self.pack_start(self.close, False, False, 0)

        self.image.show()
        self.label.show()
        self.close.show()
Exemplo n.º 2
0
    def __init__(self, text, empty_text, allow_empty):
        '''class constructor, text is the text to show, empty_text is the
        text to display when no text is entered, allow_empty is a boolean
        that indicates if the user can enter an empty string'''
        gtk.VBox.__init__(self)

        self.entry = gtk.Entry()
        self.label = Renderers.SmileyLabel()
        #self.label.set_ellipsize(pango.ELLIPSIZE_END)
        self.button = gtk.Button()
        self.button.set_alignment(0.0, 0.5)
        self.button.set_relief(gtk.RELIEF_NONE)

        self._enabled = True

        self._text = text
        self.empty_text = empty_text
        self.allow_empty = allow_empty

        self.pack_start(self.button, True, True)
        self.pack_start(self.entry, True, True)

        self.button.add(self.label)
        self.text = self._text or self.empty_text

        self.button.connect('clicked', self.on_button_clicked)
        self.entry.connect('activate', self.on_entry_activate)
        self.entry.connect('focus-out-event', self._on_focus_out)
        self.entry.connect('key-press-event', self._on_key_press)
Exemplo n.º 3
0
    def __init__(self, session, members):
        '''constructor'''
        gtk.HBox.__init__(self)
        self.set_border_width(2)
        self._information = Renderers.SmileyLabel()

        self.eventBox = gtk.EventBox()
        self.eventBox.set_visible_window(False)
        self.eventBox.add(self._information)
        self.eventBox.connect('button-press-event', self.on_clicked)

        self.pack_start(self.eventBox, True, True)

        self.session = session
        self.members = members

        self.menu = gtk.Menu()
        copynick = gtk.ImageMenuItem(_('Copy nick to clipboard'))
        copynick.set_image(gtk.image_new_from_stock(gtk.STOCK_COPY, gtk.ICON_SIZE_MENU))
        copypm = gtk.ImageMenuItem(_('Copy personal message to clipboard'))
        copypm.set_image(gtk.image_new_from_stock(gtk.STOCK_COPY, gtk.ICON_SIZE_MENU))
        copymail = gtk.ImageMenuItem(_('Copy mail to clipboard'))
        copymail.set_image(gtk.image_new_from_stock(gtk.STOCK_COPY, gtk.ICON_SIZE_MENU))
        self.menu.append(copynick)
        self.menu.append(copypm)
        self.menu.append(copymail)
        copynick.connect('activate', self.copy_nick)
        copypm.connect('activate', self.copy_pm)
        copymail.connect('activate', self.copy_mail)
        copynick.show()
        copypm.show()
        copymail.show()
Exemplo n.º 4
0
    def __init__(self, text, on_tab_menu, on_close_clicked, conversation,
                 mozilla_like):
        '''constructor'''
        gtk.HBox.__init__(self)
        self.set_border_width(0)
        self.set_spacing(4)

        self.session = conversation.session
        self.mozilla_like = mozilla_like
        self.image = gtk.Image()
        self.label = Renderers.SmileyLabel()
        self.label.set_ellipsize(True)
        self.label.set_text(text)
        self.close = TinyButton.TinyButton(gtk.STOCK_CLOSE)
        self.close.set_tooltip_text(_('Close Tab (Ctrl+W)'))
        self.close.connect('clicked', on_close_clicked, conversation)

        if CLOSE_ON_LEFT:
            self.pack_start(self.close, False, False, 0)
            self.pack_start(self.image, False, False, 0)
            self.pack_start(self.label, True, True, 0)
        else:
            self.pack_start(self.image, False, False, 0)
            self.pack_start(self.label, True, True, 0)
            self.pack_start(self.close, False, False, 0)

        if self.session.config.i_tab_position > 1:
            self.set_orientation(gtk.ORIENTATION_VERTICAL)
            self.label.set_angle(90)
        else:
            self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
            self.label.set_angle(0)

        self.session.config.subscribe(self.on_tab_position_change,
                                      'i_tab_position')

        self.image.show()
        self.label.show()
Exemplo n.º 5
0
    def __init__(self, session, account):
        '''constructor'''
        gtk.VBox.__init__(self)
        self.set_border_width(2)

        self.session = session
        if self.session:
            self.contact = self.session.contacts.get(account)
        else:
            self.contact = None

        self.nick = Renderers.SmileyLabel()
        self.nick.set_alignment(0.0, 0.5)
        self.nick.set_ellipsize(pango.ELLIPSIZE_END)
        self.mail = gtk.Label()
        self.mail.set_alignment(0.0, 0.5)
        self.mail.set_ellipsize(pango.ELLIPSIZE_END)
        self.message = Renderers.SmileyLabel()
        self.message.set_ellipsize(pango.ELLIPSIZE_END)
        self.message.set_alignment(0.0, 0.5)
        self.status = gtk.Image()
        self.status.set_alignment(0.0, 0.5)
        self.image = gtk.Image()
        image_align = gtk.Alignment(0.5, 0.5)
        image_align.add(self.image)
        self.blocked = gtk.Label()
        self.blocked.set_alignment(0.0, 0.5)
        self.blocked.set_ellipsize(pango.ELLIPSIZE_END)

        table = gtk.Table(4, 2, False)
        table.set_border_width(20)
        table.set_row_spacings(10)
        table.set_col_spacings(10)

        l_image = gtk.Label(_('Image'))
        l_image.set_alignment(0.0, 0.5)
        l_nick = gtk.Label(_('Nick'))
        l_nick.set_alignment(0.0, 0.5)
        l_mail = gtk.Label(_('E-Mail'))
        l_mail.set_alignment(0.0, 0.5)
        l_status = gtk.Label(_('Status'))
        l_status.set_alignment(0.0, 0.5)
        l_message = gtk.Label(_('Message'))
        l_message.set_alignment(0.0, 0.5)
        l_blocked = gtk.Label(_('Blocked'))
        l_blocked.set_alignment(0.0, 0.5)

        table.attach(l_nick, 0, 1, 0, 1, 0)
        table.attach(self.nick, 1, 2, 0, 1)
        table.attach(l_mail, 0, 1, 1, 2, 0)
        table.attach(self.mail, 1, 2, 1, 2)
        table.attach(l_status, 0, 1, 2, 3, 0)
        table.attach(self.status, 1, 2, 2, 3)
        table.attach(l_message, 0, 1, 3, 4, 0)
        table.attach(self.message, 1, 2, 3, 4)
        table.attach(l_blocked, 0, 1, 4, 5, 0)
        table.attach(self.blocked, 1, 2, 4, 5)

        hbox = gtk.HBox(False, 0)
        self.set_border_width(15)
        hbox.pack_start(image_align, False, False)
        hbox.pack_start(table, True, True)

        self.pack_start(hbox, False, False)

        self.update_information()