GuiForMePlugin. available in py3
This commit is contained in:
@@ -1 +1 @@
|
|||||||
from gui_for_me import GuiForMe
|
from .gui_for_me import GuiForMe
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import gtk
|
from gi.repository import Gtk
|
||||||
|
from gi.repository import GdkPixbuf
|
||||||
|
|
||||||
from common import gajim
|
from common import gajim
|
||||||
from plugins import GajimPlugin
|
from plugins import GajimPlugin
|
||||||
@@ -57,25 +58,24 @@ class Base(object):
|
|||||||
def create_buttons(self):
|
def create_buttons(self):
|
||||||
# create juick button
|
# create juick button
|
||||||
actions_hbox = self.chat_control.xml.get_object('actions_hbox')
|
actions_hbox = self.chat_control.xml.get_object('actions_hbox')
|
||||||
self.button = gtk.Button(label=None, stock=None, use_underline=True)
|
self.button = Gtk.Button(label=None, stock=None, use_underline=True)
|
||||||
self.button.set_property('relief', gtk.RELIEF_NONE)
|
self.button.set_property('relief', Gtk.ReliefStyle.NONE)
|
||||||
self.button.set_property('can-focus', False)
|
self.button.set_property('can-focus', False)
|
||||||
img = gtk.Image()
|
img = Gtk.Image()
|
||||||
img_path = self.plugin.local_file_path('gui_for_me.png')
|
img_path = self.plugin.local_file_path('gui_for_me.png')
|
||||||
pixbuf = gtk.gdk.pixbuf_new_from_file(img_path)
|
pixbuf = GdkPixbuf.Pixbuf.new_from_file(img_path)
|
||||||
iconset = gtk.IconSet(pixbuf=pixbuf)
|
iconset = Gtk.IconSet(pixbuf=pixbuf)
|
||||||
factory = gtk.IconFactory()
|
factory = Gtk.IconFactory()
|
||||||
factory.add('gui_for_me', iconset)
|
factory.add('gui_for_me', iconset)
|
||||||
factory.add_default()
|
factory.add_default()
|
||||||
img.set_from_stock('gui_for_me', gtk.ICON_SIZE_MENU)
|
img.set_from_stock('gui_for_me', Gtk.IconSize.MENU)
|
||||||
self.button.set_image(img)
|
self.button.set_image(img)
|
||||||
self.button.set_tooltip_text(_('Insert /me to conversation input box,'
|
self.button.set_tooltip_text(_('Insert /me to conversation input box,'
|
||||||
' at cursor position'))
|
' at cursor position'))
|
||||||
send_button = self.chat_control.xml.get_object('send_button')
|
send_button = self.chat_control.xml.get_object('send_button')
|
||||||
send_button_pos = actions_hbox.child_get_property(send_button,
|
actions_hbox.pack_start(self.button, False, False , 0)
|
||||||
'position')
|
actions_hbox.reorder_child(self.button,
|
||||||
actions_hbox.add_with_properties(self.button, 'position',
|
len(actions_hbox.get_children()) - 3)
|
||||||
send_button_pos - 1, 'expand', False)
|
|
||||||
id_ = self.button.connect('clicked', self.on_me_button_clicked)
|
id_ = self.button.connect('clicked', self.on_me_button_clicked)
|
||||||
self.chat_control.handlers[id_] = self.button
|
self.chat_control.handlers[id_] = self.button
|
||||||
self.button.show()
|
self.button.show()
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ authors: BomberMan
|
|||||||
copper
|
copper
|
||||||
Denis Fomin <fominde@gmail.com>
|
Denis Fomin <fominde@gmail.com>
|
||||||
homepage: http://trac-plugins.gajim.org/wiki/GUIForMePlugin
|
homepage: http://trac-plugins.gajim.org/wiki/GUIForMePlugin
|
||||||
max_gajim_version: 0.15.9
|
min_gajim_version: 0.16.10
|
||||||
|
|||||||
Reference in New Issue
Block a user