Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gajim/gajim-plugins
  • lovetox/gajim-plugins
  • ag/gajim-plugins
  • FlorianMuenchbach/gajim-plugins
  • rom1dep/gajim-plugins
  • pitchum/gajim-plugins
  • wurstsalat/gajim-plugins
  • Dicson/gajim-plugins
  • andre/gajim-plugins
  • link2xt/gajim-plugins
  • marmistrz/gajim-plugins
  • Jens/gajim-plugins
  • muelli/gajim-plugins
  • asterix/gajim-plugins
  • orhideous/gajim-plugins
  • ngvelprz/gajim-plugins
  • appleorange1/gajim-plugins
  • Martin/gajim-plugins
  • maltel/gajim-plugins
  • Seve/gajim-plugins
  • evert-mouw/gajim-plugins
  • Yuki/gajim-plugins
  • mxre/gajim-plugins
  • ValdikSS/gajim-plugins
  • SaltyBones/gajim-plugins
  • comradekingu/gajim-plugins
  • ritzmann/gajim-plugins
  • genofire/gajim-plugins
  • jjrh/gajim-plugins
  • yarmak/gajim-plugins
  • PapaTutuWawa/gajim-plugins
  • weblate/gajim-plugins
  • XutaxKamay/gajim-plugins
  • nekk/gajim-plugins
  • principis/gajim-plugins
  • cbix/gajim-plugins
  • bodqhrohro/gajim-plugins
  • airtower-luna/gajim-plugins
  • toms/gajim-plugins
  • mesonium/gajim-plugins
  • lissine/gajim-plugins
  • anviar/gajim-plugins
42 results
Show changes
Showing
with 154 additions and 115 deletions
......@@ -16,11 +16,6 @@ NS_XHTML_IM = 'http://jabber.org/protocol/xhtml-im' # XEP-0071
class ImagePlugin(GajimPlugin):
@log_calls('ImagePlugin')
def init(self):
self.description = _('This plugin is designed to send '
'a small(0 - 40 kb) graphic image to your contact.\n'
'Client on the other side must support XEP-0071: XHTML-IM'
' and maintain the scheme data: URI.\n'
'Psi+ and Jabbim supported this.')
self.config_dialog = None # ImagePluginConfigDialog(self)
self.controls = []
self.gui_extension_points = {
......@@ -136,8 +131,8 @@ class Base(object):
msg = 'HTML image'
extension = os.path.splitext(os.path.split(path_to_file)[1])[1] \
.lower()[1:]
xhtml = ' <img alt="img" src="data:image/%s;base64,%s"/>' % (
extension, img)
xhtml = '<body><br/> <img alt="img" src="data:image/%s;base64,%s"/> \
</body>' % (extension, img)
self.chat_control.send_message(message=msg, xhtml=xhtml)
self.chat_control.msg_textview.grab_focus()
......
[info]
name: Image
short_name: image
version: 0.5
description: This plugin is designed to send a small(0 - 40 kb) graphic image to your contact.
Client on the other side must support XEP-0071: XHTML-IM and maintain the scheme data: URI.
version: 0.5.1
description: This plugin is designed to send a small(0 - 40 kb) graphic image to your contact.<br/>
Client on the other side must support <a href="http://xmpp.org/extensions/xep-0071.html">XEP-0071: XHTML-IM</a> and maintain the scheme data: URI.<br/>
Psi+ and Jabbim supported this.
authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/ImagePlugin
max_gajim_version: 0.16.9
......@@ -6,6 +6,7 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">9</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="checkbutton">
......
[info]
name: Juick
short_name: Juick
version: 0.9.3
description: Clickable Juick links , Juick nicks, preview Juick picturs.
version: 0.9.6
description: Clickable Juick links , Juick nicks, preview Juick picturs.<br/>
The key combination alt + up in the textbox allow insert the number of last message (comment or topic).
authors: Denis Fomin <fominde@gmail.com>
evgen <drujebober@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/JuickPlugin
min_gajim_version: 0.16
max_gajim_version: 0.16.9
......@@ -9,6 +9,9 @@ from string import upper
from string import rstrip
import locale
import sqlite3
import json
import urllib2
import gobject
from common import helpers
from common import gajim
......@@ -18,26 +21,17 @@ from plugins.gui import GajimPluginConfigDialog
from conversation_textview import TextViewImage
import gtkgui_helpers
nb_xmpp = False
import common.xmpp
if not dir(common.xmpp):
import nbxmpp
nb_xmpp = True
class JuickPlugin(GajimPlugin):
@log_calls('JuickPlugin')
def init(self):
self.description = _('Clickable Juick links , Juick nicks, '
'preview Juick picturs.\nThe key combination alt + up in the '
'textbox allow insert the number of last message '
'(comment or topic).')
self.config_dialog = JuickPluginConfigDialog(self)
self.gui_extension_points = {
'chat_control_base': (self.connect_with_chat_control,
self.disconnect_from_chat_control),
'print_special_text': (self.print_special_text,
self.print_special_text1),}
self.print_special_text1),
'chat_control_base_update_toolbar': (self.update_button_state,
None)}
self.config_default_values = {'SHOW_AVATARS': (False, ''),
'AVATAR_SIZE': (20, 'Avatar size(10-32)'),
'avatars_old': (2419200, 'Update avatars '
......@@ -87,19 +81,30 @@ class JuickPlugin(GajimPlugin):
if self.conn:
self.conn.close()
def print_special_text(self, tv, special_text, other_tags, graphics=True):
def print_special_text(self, tv, special_text, other_tags, graphics=True,
iter_=None):
for control in self.controls:
if control.chat_control.conv_textview != tv:
continue
control.print_special_text(special_text, other_tags, graphics=True)
control.print_special_text(special_text, other_tags, graphics,
iter_)
def print_special_text1(self, chat_control, special_text, other_tags=None,
graphics=True):
graphics=True, iter_=None):
for control in self.controls:
if control.chat_control == chat_control:
control.disconnect_from_chat_control()
self.controls.remove(control)
def update_button_state(self, chat_control):
for base in self.controls:
if base.chat_control != chat_control:
continue
state = gajim.connections[chat_control.account].connected > 0
base.button.set_sensitive(state)
base.tag_button.set_sensitive(state)
class Base(object):
def __init__(self, plugin, chat_control):
self.last_juick_num = ''
......@@ -317,20 +322,21 @@ class Base(object):
if kind == 'juick_nick':
self.on_insert(widget, 'PM %s' % word.rstrip(':'))
def print_special_text(self, special_text, other_tags, graphics=True):
def print_special_text(self, special_text, other_tags, graphics=True,
iter__=None):
if gajim.interface.sharp_slash_re.match(special_text):
# insert post num #123456//
buffer_, iter_, tag = self.get_iter_and_tag('sharp_slash')
buffer_.insert_with_tags(iter_, special_text, tag)
buffer_.insert_with_tags(iter__, special_text, tag)
self.last_juick_num = special_text
self.textview.plugin_modified = True
return
if gajim.interface.juick_nick_re.match(special_text):
# insert juick nick @nickname////
buffer_, iter_, tag = self.get_iter_and_tag('juick_nick')
mark = buffer_.create_mark(None, iter_, True)
mark = buffer_.create_mark(None, iter__, True)
nick = special_text[1:].rstrip(':')
buffer_.insert_with_tags(iter_, special_text, tag)
buffer_.insert_with_tags(iter__, special_text, tag)
# insert avatars
if not self.plugin.config['SHOW_AVATARS']:
self.textview.plugin_modified = True
......@@ -365,45 +371,36 @@ class Base(object):
if not pixbuf:
self.textview.plugin_modified = True
return
end_iter = buffer_.get_iter_at_mark(mark)
anchor = buffer_.create_child_anchor(end_iter)
img = TextViewImage(anchor, nick)
img.set_from_pixbuf(pixbuf)
img.show()
self.textview.tv.add_child_at_anchor(img, anchor)
gobject.idle_add(self.set_avatar, mark, nick, pixbuf)
self.textview.plugin_modified = True
return
else:
# nick not in the db
id_ = conn.connection.getAnID()
to = 'juick@juick.com'
if not nb_xmpp:
iq = common.xmpp.Iq('get', to=to)
else:
iq = nbxmpp.Iq('get', to=to)
a = iq.addChild(name='query',
namespace='http://juick.com/query#users')
a.addChild(name='user', namespace='http://juick.com/user',
attrs={'uname': nick})
iq.setID(id_)
conn.connection.SendAndCallForResponse(iq, self._on_response,
{'mark': mark, 'special_text': special_text})
gobject.idle_add(self.get_new_avatar, mark, nick)
self.textview.plugin_modified = True
return
if gajim.interface.juick_pic_re.match(special_text) and \
self.plugin.config['SHOW_PREVIEW']:
# show pics preview
buffer_, iter_, tag = self.get_iter_and_tag('url')
mark = buffer_.create_mark(None, iter_, True)
buffer_.insert_with_tags(iter_, special_text, tag)
mark = buffer_.create_mark(None, buffer_.get_end_iter(), True)
uid = special_text.split('/')[-1]
url = "http://i.juick.com/photos-512/%s" % uid
gajim.thread_interface(self.insert_pic_preview, [mark, special_text,
url])
url, tag])
self.textview.plugin_modified = True
return
def insert_pic_preview(self, mark, special_text, url):
def set_avatar(self, mark, nick, pixbuf):
buffer_ = mark.get_buffer()
end_iter = buffer_.get_iter_at_mark(mark)
anchor = buffer_.create_child_anchor(end_iter)
img = TextViewImage(anchor, nick)
img.set_from_pixbuf(pixbuf)
img.show()
self.textview.tv.add_child_at_anchor(img, anchor)
def insert_pic_preview(self, mark, special_text, url, tag):
pixbuf = self.get_pixbuf_from_url( url, self.plugin.config[
'PREVIEW_SIZE'])
if pixbuf:
......@@ -415,6 +412,9 @@ class Base(object):
img.set_from_pixbuf(pixbuf)
img.show()
self.textview.tv.add_child_at_anchor(img, anchor)
buffer_ = mark.get_buffer()
end_iter = buffer_.get_iter_at_mark(mark)
buffer_.insert_with_tags(end_iter, special_text, tag)
def get_iter_and_tag(self, tag_name):
buffer_ = self.textview.tv.get_buffer()
......@@ -422,33 +422,29 @@ class Base(object):
tag = ttable.lookup(tag_name)
return buffer_, buffer_.get_end_iter(), tag
def _on_response(self, a, resp, **kwargs):
# insert avatar to text mark
mark = kwargs['mark']
def get_new_avatar(self, mark, nick):
try:
req = urllib2.Request('http://api.juick.com/users?uname=%s' % nick)
response = urllib2.urlopen(req)
j = json.load(response)
_id = str(j[0]['uid'])
except urllib2.HTTPError, e:
return
pixbuf = self.get_avatar(_id, nick)
buffer_ = mark.get_buffer()
end_iter = buffer_.get_iter_at_mark(mark)
tags = resp.getTag('query')
nick = kwargs['special_text'][1:].rstrip(':')
if tags:
user = tags.getTag('user')
if not user:
return
uid = user.getAttr('uid')
pixbuf = self.get_avatar(uid, nick)
anchor = buffer_.create_child_anchor(end_iter)
img = TextViewImage(anchor, nick)
img.set_from_pixbuf(pixbuf)
img.show()
self.textview.tv.add_child_at_anchor(img, anchor)
anchor = buffer_.create_child_anchor(end_iter)
img = TextViewImage(anchor, nick)
img.set_from_pixbuf(pixbuf)
img.show()
self.textview.tv.add_child_at_anchor(img, anchor)
def get_avatar(self, uid, nick, need_check=None):
# search avatar in cache or download from juick.com
pic = uid + '.png'
pic_path = os.path.join(self.plugin.cache_path, pic)
pic_path = pic_path.decode(locale.getpreferredencoding())
url = 'http://i.juick.com/as/%s.png' % uid
url = 'http://api.juick.com/avatar?uname=%s&size=32' % nick
if need_check and os.path.isfile(pic_path):
max_old = self.plugin.config['avatars_old']
if (time.time() - os.stat(pic_path).st_mtime) < max_old:
......
......@@ -9,6 +9,7 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">9</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
......
......@@ -281,8 +281,6 @@ class LatexPluginConfiguration(GajimPluginConfigDialog):
class LatexPlugin(GajimPlugin):
def init(self):
self.description = _('Invoke Latex to render $$foobar$$ sourrounded ' \
'Latex equations. Needs latex and dvipng or ImageMagick.')
self.config_dialog = LatexPluginConfiguration(self)
self.config_default_values = {'png_dpi': ('108', '')}
......@@ -291,6 +289,8 @@ class LatexPlugin(GajimPlugin):
self.disconnect_from_chat_control_base)
}
self.test_activatable()
self.timeout_id = None
self.last_eol_offset = -1
def test_activatable(self):
"""
......@@ -357,23 +357,47 @@ class LatexPlugin(GajimPlugin):
"""
called when conversation text widget changes
"""
def split_list(list):
def split_list(list_):
newlist = []
for i in range(0, len(list)-1, 2):
newlist.append( [ list[i], list[i+1], ] )
for i in range(0, len(list_)-1, 2):
newlist.append( [ list_[i], list_[i+1], ] )
return newlist
assert isinstance(tb, gtk.TextBuffer)
start_iter = tb.get_start_iter()
points = []
tuple_found = start_iter.forward_search('$$', gtk.TEXT_SEARCH_TEXT_ONLY)
while tuple_found != None:
points.append(tuple_found)
tuple_found = tuple_found[1].forward_search('$$',
def detect_tags(tb, start_it=None, end_it=None):
self.timeout_id = None
if not end_it:
end_it = tb.get_end_iter()
if not start_it:
eol_tag = tb.get_tag_table().lookup('eol')
start_it = end_it.copy()
start_it.backward_to_tag_toggle(eol_tag)
points = []
tuple_found = start_it.forward_search('$$',
gtk.TEXT_SEARCH_TEXT_ONLY)
for pair in split_list(points):
tb.apply_tag_by_name('latex', pair[0][1], pair[1][0])
while tuple_found != None:
points.append(tuple_found)
tuple_found = tuple_found[1].forward_search('$$',
gtk.TEXT_SEARCH_TEXT_ONLY)
for pair in split_list(points):
tb.apply_tag_by_name('latex', pair[0][1], pair[1][0])
end_iter = tb.get_end_iter()
eol_tag = tb.get_tag_table().lookup('eol')
it = end_iter.copy()
it.backward_to_tag_toggle(eol_tag)
if it.get_offset() == self.last_eol_offset:
if self.timeout_id:
gobject.source_remove(self.timeout_id)
self.timeout_id = gobject.timeout_add(100, detect_tags, tb, it, end_iter)
else:
if self.timeout_id:
gobject.source_remove(self.timeout_id)
it1 = it.copy()
it1.backward_char()
it1.backward_to_tag_toggle(eol_tag)
detect_tags(tb, it1, it)
self.last_eol_offset = it.get_offset()
def connect_with_chat_control_base(self, chat_control):
d = {}
......@@ -383,7 +407,7 @@ class LatexPlugin(GajimPlugin):
self.latex_tag = gtk.TextTag('latex')
self.latex_tag.set_property('foreground', 'blue')
self.latex_tag.set_property('underline', 'single')
d['tag_id'] = self.latex_tag.connect('event', self.textview_event_after)
self.latex_tag.connect('event', self.textview_event_after)
tb.get_tag_table().add(self.latex_tag)
d['h_id'] = tb.connect('changed', self.textbuffer_live_latex_expander)
......@@ -394,7 +418,10 @@ class LatexPlugin(GajimPlugin):
def disconnect_from_chat_control_base(self, chat_control):
d = chat_control.latexs_expander_plugin_data
tv = chat_control.conv_textview.tv
tb = tv.get_buffer()
tv.get_buffer().disconnect(d['h_id'])
self.latex_tag.disconnect(d['tag_id'])
tag_table = tb.get_tag_table()
tt = tag_table.lookup('latex')
if tt:
tag_table.remove(tt)
[info]
name: Latex
short_name: latex
version: 0.2
description: render received latex code
version: 0.2.3
description: Invoke Latex to render $$foobar$$ sourrounded Latex equations. Needs latex and dvipng or ImageMagick.
authors: Yves Fischer <yvesf@xapek.org>
Yann Leboulanger <asterix@lagaule.org>
homepage: http://trac-plugins.gajim.org/wiki/LatexPlugin
max_gajim_version: 0.16.9
......@@ -36,8 +36,6 @@ class LengthNotifierPlugin(GajimPlugin):
@log_calls('LengthNotifierPlugin')
def init(self):
self.description = _('Highlights message entry field in chat window '
'when given length of message is exceeded.')
self.config_dialog = LengthNotifierPluginConfigDialog(self)
self.gui_extension_points = {
......
[info]
name: Message Length Notifier
short_name: length_notifier
version: 0.1.2
version: 0.1.3
description: Highlights message entry field in chat window when given length of message is exceeded.
authors = Mateusz Biliński <mateusz@bilinski.it>
homepage = http://trac-plugins.gajim.org/wiki/LengthNotifierPlugin
max_gajim_version: 0.16.9
......@@ -6,6 +6,7 @@
<child>
<object class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="border_width">9</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkVBox" id="vbox3">
......
[info]
name: Message Box Size
short_name: message_box_size
version: 0.2.1
version: 0.2.2
description: Allows you to adjust the height of the new message input field.
authors: Denis Fomin <fominde@gmail.com>
homepage: http://trac-plugins.gajim.org/wiki/MessageBoxSizePlugin
max_gajim_version: 0.16.9
......@@ -11,8 +11,6 @@ from plugins.gui import GajimPluginConfigDialog
class MsgBoxSizePlugin(GajimPlugin):
@log_calls('MsgBoxSizePlugin')
def init(self):
self.description = _('Allows you to adjust the height'
' of the new message input field.')
self.config_dialog = MsgBoxSizePluginConfigDialog(self)
self.gui_extension_points = {
'chat_control_base': (self.connect_with_chat_control,
......
0.3.3 - 26-12-2016
- Dont activate Plugin on missing dependencys
- Remove unused imports
\ No newline at end of file
[info]
name: MPRIS2 support
short_name: mpris2_support
version: 0.3
version: 0.3.3
description: MPRIS2 support. Allows to update status message according to the music you're listening via the MPRIS2 D-Bus API.
authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/MprisSupportPlugin
homepage = https://dev.gajim.org/gajim/gajim-plugins/wikis/mprissupportplugin
max_gajim_version: 0.16.9
# -*- coding: utf-8 -*-
import gtk
import gobject
import os
from common import gajim
from plugins import GajimPlugin
from plugins.helpers import log_calls
from plugins.plugin import GajimPluginException
from common import dbus_support
ERR_MSG = ''
if dbus_support.supported:
from music_track_listener import MusicTrackListener
else:
ERR_MSG = 'D-Bus Python bindings are missing'
if os.name == 'nt':
ERR_MSG = 'Plugin can\'t be run under Windows.'
class MusicTrackInfo(object):
......@@ -21,9 +25,11 @@ class MusicTrackInfo(object):
class Mpris2Plugin(GajimPlugin):
@log_calls('Mpris2Plugin')
def init(self):
self.description = _('MPRIS2 support. Allows to update status message '
'according to the music you\'re listening via the MPRIS2 D-Bus API.')
self.config_dialog = None
if ERR_MSG:
self.available_text = ERR_MSG
self.activatable = False
return
self.artist = self.title = self.source = ''
self.listener = MusicTrackListener().get()
......
[info]
name: Now Listen
short_name: now-listen
version: 0.2
version: 0.2.2
description: Copy tune info to conversation input box (alt + n) at cursor position
authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/NowListenPlugin
max_gajim_version: 0.16.9
......@@ -2,6 +2,7 @@
import gtk
import gobject
import os
from common import gajim
from plugins import GajimPlugin
......@@ -17,8 +18,6 @@ class NowListenPlugin(GajimPlugin):
@log_calls('NowListenPlugin')
def init(self):
self.description = _('Copy tune info to conversation input box '
'(alt + n) at cursor position')
self.config_dialog = NowListenPluginConfigDialog(self)
self.gui_extension_points = {'chat_control_base':
(self.connect_with_chat_control, self.disconnect_from_chat_control)}
......@@ -30,6 +29,9 @@ class NowListenPlugin(GajimPlugin):
self.controls = []
self.first_run = True
self.music_track_changed_signal = None
if os.name == 'nt':
self.available_text = _('Plugin can\'t be run under Windows.')
self.activatable = False
@log_calls('NowListenPlugin')
def connect_with_chat_control(self, chat_control):
......
......@@ -11,6 +11,7 @@
<child>
<object class="GtkVBox" id="vbox86">
<property name="visible">True</property>
<property name="border_width">9</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
......@@ -413,9 +414,6 @@
<property name="y_options"/>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkComboBox" id="import_to">
<property name="visible">True</property>
......@@ -438,6 +436,9 @@
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
[info]
name: Offline Bookmarks
short_name: offline_bookmarks
version: 0.2
description: Saving bookmarks inside the plugin configuration file. Allows the use of locally stored bookmarks if the server does not support the storage of bookmarks (eg talk.google.com).
version: 0.2.2
description: Saving bookmarks inside the plugin configuration file. Allows the use of locally stored bookmarks if the server does not support the storage of bookmarks (eg talk.google.com).<br/>
Support to import bookmarks from one account to another.
authors = Denis Fomin <fominde@gmail.com>
homepage = http://trac-plugins.gajim.org/wiki/OfflineBookmarksPlugin
max_gajim_version: 0.16.9