This commit is contained in:
tmolitor 2016-04-19 23:48:10 +02:00
commit 453fd46427
10 changed files with 219 additions and 208 deletions

View File

@ -1,50 +1,52 @@
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['B-)', '(H)'],
'wink.gif': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.gif': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.gif': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ''],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'pussy.png': ['(@)'],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'cigarette.gif': ['(ci)'],
'cake.gif': ['(^)'],
'dontknow.gif': [':^)'],
'eyeroll.gif': ['8-)'],
'lightning.gif': ['(li)'],
'party.gif': ['<:o)'],
'sleepy.gif': ['|-)'],
'think.gif': ['*-)'],
'puke.gif': [':-!'],
}
from collections import OrderedDict
emoticons = OrderedDict((
('smile.png', [':-)', ':)']),
('coolglasses.png', ['B-)', '(H)']),
('wink.gif', [';-)', ';)']),
('biggrin.png', [':-D', ':D']),
('unhappy.png', [':-(', ':(']),
('cry.gif', [":'-(", ":'(", ';-(', ';(', ";'-("]),
('frowning.png', [':-/', ':/', ':-\\', ':\\', ':-S', ':S']),
('blush.png', [':-$', ':$']),
('angry.png', [':-@', ':@']),
('bat.gif', [':-[', ':[']),
('kiss.png', [':-{}', ':-*', ':*', '(K)']),
('stare.png', [':-|', ':|']),
('devil.png', [']:->', '>:-)', '>:)', '(6)']),
('tongue.png', [':-P', ':P', ':-þ', '']),
('oh.png', ['=-O', ':-O', ':O']),
('heart.png', ['<3', '(L)', '*IN LOVE*']),
('pussy.png', ['(@)']),
('cuffs.png', ['(%)']),
('moon.png', ['(S)']),
('lamp.png', ['(I)']),
('music.png', ['(8)']),
('beer.png', ['(B)', '*DRINK*']),
('brflower.png', ['(W)']),
('boy.png', ['(Z)']),
('girl.png', ['(X)']),
('mail.png', ['(E)']),
('thumbdown.png', ['(N)']),
('photo.png', ['(P)']),
('thumbup.png', ['(Y)', '*THUMBS UP*']),
('hugleft.png', ['(})']),
('brheart.png', ['</3', '(U)']),
('flower.png', ['@}->--', '(F)']),
('drink.png', ['(D)']),
('phone.png', ['(T)']),
('coffee.png', ['(C)']),
('hugright.png', ['({)']),
('star.png', ['(*)']),
('rainbow.png', ['(R)']),
('cigarette.gif', ['(ci)']),
('cake.gif', ['(^)']),
('dontknow.gif', [':^)']),
('eyeroll.gif', ['8-)']),
('lightning.gif', ['(li)']),
('party.gif', ['<:o)']),
('sleepy.gif', ['|-)']),
('think.gif', ['*-)']),
('puke.gif', [':-!']),
))

View File

@ -1,43 +1,45 @@
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ''],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
}
from collections import OrderedDict
emoticons = OrderedDict((
('smile.png', [':-)', ':)']),
('coolglasses.png', ['8-)', 'B-)', '(H)']),
('wink.png', [';-)', ';)']),
('biggrin.png', [':-D', ':D']),
('unhappy.png', [':-(', ':(']),
('cry.png', [":'-(", ":'(", ';-(', ';(', ";'-("]),
('frowning.png', [':-/', ':/', ':-\\', ':\\', ':-S', ':S']),
('blush.png', [':-$', ':$']),
('angry.png', [':-@', ':@']),
('bat.png', [':-[', ':[']),
('kiss.png', [':-{}', ':-*', ':*', '(K)']),
('stare.png', [':-|', ':|']),
('devil.png', [']:->', '>:-)', '>:)', '(6)']),
('tongue.png', [':-P', ':P', ':-þ', '']),
('oh.png', ['=-O', ':-O', ':O']),
('heart.png', ['<3', '(L)', '*IN LOVE*']),
('lion.png', [':3', '>:3']),
('pussy.png', ['(@)', '=^.^=']),
('cuffs.png', ['(%)']),
('moon.png', ['(S)']),
('lamp.png', ['(I)']),
('music.png', ['(8)']),
('beer.png', ['(B)', '*DRINK*']),
('brflower.png', ['(W)']),
('boy.png', ['(Z)']),
('girl.png', ['(X)']),
('mail.png', ['(E)']),
('thumbdown.png', ['(N)']),
('photo.png', ['(P)']),
('thumbup.png', ['(Y)', '*THUMBS UP*']),
('hugleft.png', ['(})']),
('brheart.png', ['</3', '(U)']),
('flower.png', ['@}->--', '(F)']),
('drink.png', ['(D)']),
('phone.png', ['(T)']),
('coffee.png', ['(C)']),
('hugright.png', ['({)']),
('star.png', ['(*)']),
('rainbow.png', ['(R)']),
('puke.png', [':-!']),
))

View File

@ -1,43 +1,45 @@
# coding=utf-8
emoticons = {
'smile.png': [':-)', ':)'],
'coolglasses.png': ['8-)', 'B-)', '(H)'],
'wink.png': [';-)', ';)'],
'biggrin.png': [':-D', ':D'],
'unhappy.png': [':-(', ':('],
'cry.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'frowning.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'blush.png': [':-$', ':$'],
'angry.png': [':-@', ':@'],
'bat.png': [':-[', ':['],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'stare.png': [':-|', ':|'],
'devil.png': [']:->', '>:-)', '>:)', '(6)'],
'tongue.png': [':-P', ':P', ':-þ', ''],
'oh.png': ['=-O', ':-O', ':O'],
'heart.png': ['<3', '(L)', '*IN LOVE*'],
'lion.png': [':3', '>:3'],
'pussy.png': ['(@)', '=^.^='],
'cuffs.png': ['(%)'],
'moon.png': ['(S)'],
'lamp.png': ['(I)'],
'music.png': ['(8)'],
'beer.png': ['(B)', '*DRINK*'],
'brflower.png': ['(W)'],
'boy.png': ['(Z)'],
'girl.png': ['(X)'],
'mail.png': ['(E)'],
'thumbdown.png': ['(N)'],
'photo.png': ['(P)'],
'thumbup.png': ['(Y)', '*THUMBS UP*'],
'hugleft.png': ['(})'],
'brheart.png': ['</3', '(U)'],
'flower.png': ['@}->--', '(F)'],
'drink.png': ['(D)'],
'phone.png': ['(T)'],
'coffee.png': ['(C)'],
'hugright.png': ['({)'],
'star.png': ['(*)'],
'rainbow.png': ['(R)'],
'puke.png': [':-!'],
}
from collections import OrderedDict
emoticons = OrderedDict((
('smile.png', [':-)', ':)']),
('coolglasses.png', ['8-)', 'B-)', '(H)']),
('wink.png', [';-)', ';)']),
('biggrin.png', [':-D', ':D']),
('unhappy.png', [':-(', ':(']),
('cry.png', [":'-(", ":'(", ';-(', ';(', ";'-("]),
('frowning.png', [':-/', ':/', ':-\\', ':\\', ':-S', ':S']),
('blush.png', [':-$', ':$']),
('angry.png', [':-@', ':@']),
('bat.png', [':-[', ':[']),
('kiss.png', [':-{}', ':-*', ':*', '(K)']),
('stare.png', [':-|', ':|']),
('devil.png', [']:->', '>:-)', '>:)', '(6)']),
('tongue.png', [':-P', ':P', ':-þ', '']),
('oh.png', ['=-O', ':-O', ':O']),
('heart.png', ['<3', '(L)', '*IN LOVE*']),
('lion.png', [':3', '>:3']),
('pussy.png', ['(@)', '=^.^=']),
('cuffs.png', ['(%)']),
('moon.png', ['(S)']),
('lamp.png', ['(I)']),
('music.png', ['(8)']),
('beer.png', ['(B)', '*DRINK*']),
('brflower.png', ['(W)']),
('boy.png', ['(Z)']),
('girl.png', ['(X)']),
('mail.png', ['(E)']),
('thumbdown.png', ['(N)']),
('photo.png', ['(P)']),
('thumbup.png', ['(Y)', '*THUMBS UP*']),
('hugleft.png', ['(})']),
('brheart.png', ['</3', '(U)']),
('flower.png', ['@}->--', '(F)']),
('drink.png', ['(D)']),
('phone.png', ['(T)']),
('coffee.png', ['(C)']),
('hugright.png', ['({)']),
('star.png', ['(*)']),
('rainbow.png', ['(R)']),
('puke.png', [':-!']),
))

View File

@ -1,52 +1,54 @@
# coding=utf-8
emoticons = {
'angel.png': ['O:-)', 'o:-)', '0:-)'],
'curl-lip.png': [':-)', ':)', '=)'],
'sarcastic.png': [';D', ';-D'],
'sad.png': [':-(', ':(', '=('],
'wink.png': [';-)', ';)'],
'tongue.png': [':-P', ':P', ':-p', ':p'],
'glasses-cool': ['8-)', 'B-)', '(H)'],
'laugh.png': [':-D', ':D'],
'embarrassed.png': [':-[', ':['],
'shout.png': ['=-O', ':-O', ':O'],
'kiss.png': [':-{}', ':-*', ':*', '(K)'],
'crying.png': [":'-(", ":'(", ';-(', ';(', ";'-("],
'shut-mouth': [':-X'],
'hypnotized.png': ['%)', '%-)'],
'freaked-out.png': [':o'],
'thinking.png': [':-|', ':|'],
'arrogant.png': [':-/', ':/', ':-\\', ':\\', ':-S', ':S'],
'devil.png': [':->', ']:->', '>:-)', '>:)', '(6)'],
'musical-note.png': ['[:-}'],
'sick.png': [':-!'],
'giggle.png': ['*JOKINGLY*'],
'cute.png': ['*KISSED*'],
'sleepy.png': ['*TIRED*'],
'terror.png': ['*STOP*'],
'handshake.png': ['*KISSING*'],
'rose.png': ['@}->--', '(F)'],
'good.png': ['(Y)', '*THUMBS UP*'],
'beer.png': ['(B)', '*DRINK*'],
'love.png': ['<3', '(L)', '*IN LOVE*'],
'bomb.png': ['@='],
'question.png': ['*HELP*'],
'cowboy.png': ['\m/'],
'fingers-crossed.png': ['*OK*'],
'alien.png': ['*WASSUP*'],
'disapointed.png': ['*SORRY*'],
'clap.png': ['*BRAVO*'],
'rotfl.png': ['*ROFL*'],
'dont-know.png': ['*PARDON*'],
'confused.png': ['*NO*'],
'silly.png': ['*CRAZY*'],
'doh.png': ['*DONT_KNOW*'],
'party.png': ['*DANCE*'],
'dance.png': ['*YAHOO*'],
'victory.png': ['*HI*'],
'go-away.png': ['*BYE*'],
'smirk.png': ['*YES*'],
'pissed-off.png': ['*WALL*'],
'mail.png': ['*WRITE*', '(E)'],
'tremble.png': ['*SCRATCH*'],
}
from collections import OrderedDict
emoticons = OrderedDict((
('angel.png', ['O:-)', 'o:-)', '0:-)']),
('curl-lip.png', [':-)', ':)', '=)']),
('sarcastic.png', [';D', ';-D']),
('sad.png', [':-(', ':(', '=(']),
('wink.png', [';-)', ';)']),
('tongue.png', [':-P', ':P', ':-p', ':p']),
('glasses-cool', ['8-)', 'B-)', '(H)']),
('laugh.png', [':-D', ':D']),
('embarrassed.png', [':-[', ':[']),
('shout.png', ['=-O', ':-O', ':O']),
('kiss.png', [':-{}', ':-*', ':*', '(K)']),
('crying.png', [":'-(", ":'(", ';-(', ';(', ";'-("]),
('shut-mouth', [':-X']),
('hypnotized.png', ['%)', '%-)']),
('freaked-out.png', [':o']),
('thinking.png', [':-|', ':|']),
('arrogant.png', [':-/', ':/', ':-\\', ':\\', ':-S', ':S']),
('devil.png', [':->', ']:->', '>:-)', '>:)', '(6)']),
('musical-note.png', ['[:-}']),
('sick.png', [':-!']),
('giggle.png', ['*JOKINGLY*']),
('cute.png', ['*KISSED*']),
('sleepy.png', ['*TIRED*']),
('terror.png', ['*STOP*']),
('handshake.png', ['*KISSING*']),
('rose.png', ['@}->--', '(F)']),
('good.png', ['(Y)', '*THUMBS UP*']),
('beer.png', ['(B)', '*DRINK*']),
('love.png', ['<3', '(L)', '*IN LOVE*']),
('bomb.png', ['@=']),
('question.png', ['*HELP*']),
('cowboy.png', ['\m/']),
('fingers-crossed.png', ['*OK*']),
('alien.png', ['*WASSUP*']),
('disapointed.png', ['*SORRY*']),
('clap.png', ['*BRAVO*']),
('rotfl.png', ['*ROFL*']),
('dont-know.png', ['*PARDON*']),
('confused.png', ['*NO*']),
('silly.png', ['*CRAZY*']),
('doh.png', ['*DONT_KNOW*']),
('party.png', ['*DANCE*']),
('dance.png', ['*YAHOO*']),
('victory.png', ['*HI*']),
('go-away.png', ['*BYE*']),
('smirk.png', ['*YES*']),
('pissed-off.png', ['*WALL*']),
('mail.png', ['*WRITE*', '(E)']),
('tremble.png', ['*SCRATCH*']),
))

View File

@ -2755,7 +2755,7 @@ class Connection(CommonConnection, ConnectionHandlers):
msg_iq = nbxmpp.Message(obj.jid, obj.message, typ='groupchat',
xhtml=obj.xhtml)
if obj.label is not None:
msg_iq.addChild(node=label)
msg_iq.addChild(node=obj.label)
obj.msg_id = self.connection.send(msg_iq)
gajim.nec.push_incoming_event(MessageSentEvent(None, conn=self,
jid=obj.jid, message=obj.message, keyID=None, chatstate=None,

View File

@ -741,8 +741,10 @@ class GPG(object):
si = STARTUPINFO()
si.dwFlags = STARTF_USESHOWWINDOW
si.wShowWindow = SW_HIDE
env = os.environ
env['LANG'] = 'C'
return Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE,
startupinfo=si)
env=env, startupinfo=si)
def _read_response(self, stream, result):
# Internal method: reads all the stderr output from GPG, taking notice

View File

@ -364,8 +364,8 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
from common.connection_handlers_events import FileRequestErrorEvent
gajim.nec.push_incoming_event(FileRequestErrorEvent(None, conn=self,
jid=receiver, file_props=file_props, error_msg=''))
self._connect_error(receiver, file_props.sid,
file_props.sid, code=406)
self._connect_error(file_props.sid, error='not-acceptable',
error_type='modify')
else:
iq = nbxmpp.Iq(to=receiver, typ='set')
file_props.request_id = 'id_' + file_props.sid
@ -557,7 +557,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
file_props.hash_ = hash_id
return
def _connect_error(self,sid, code=404):
def _connect_error(self, sid, error, error_type, msg=None):
"""
Called when there is an error establishing BS connection, or when
connection is rejected
@ -568,23 +568,17 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
if file_props is None:
log.error('can not send iq error on failed transfer')
return
msg_dict = {
404: 'Could not connect to given hosts',
405: 'Cancel',
406: 'Not acceptable',
}
msg = msg_dict[code]
if file_props.type_ == 's':
to = file_props.receiver
else:
to = file_props.sender
iq = nbxmpp.Iq(to=to, typ='error')
iq.setAttr('id', file_props.sid)
iq = nbxmpp.Iq(to=to, typ='error')
iq.setAttr('id', file_props.request_id)
err = iq.setTag('error')
err.setAttr('code', str(code))
err.setData(msg)
err.setAttr('type', error_type)
err.setTag(error, namespace=nbxmpp.NS_STANZAS)
self.connection.send(iq)
if code == 404:
if msg:
self.disconnect_transfer(file_props)
file_props.error = -3
from common.connection_handlers_events import \
@ -667,9 +661,12 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
raise nbxmpp.NodeProcessed
file_props.streamhosts = streamhosts
def _connection_error(sid):
self._connect_error(sid, 'item-not-found', 'cancel',
msg='Could not connect to given hosts')
if file_props.type_ == 'r':
gajim.socks5queue.connect_to_hosts(self.name, sid,
self.send_success_connect_reply, self._connect_error)
self.send_success_connect_reply, _connection_error)
raise nbxmpp.NodeProcessed
def _ResultCB(self, con, iq_obj):

View File

@ -153,19 +153,19 @@ class PreferencesWindow:
# user themes
if os.path.isdir(gajim.MY_EMOTS_PATH):
emoticons_list += os.listdir(gajim.MY_EMOTS_PATH)
emoticons_list.sort()
renderer_text = Gtk.CellRendererText()
emoticons_combobox.pack_start(renderer_text, True)
emoticons_combobox.add_attribute(renderer_text, 'text', 0)
model = Gtk.ListStore(str)
emoticons_combobox.set_model(model)
l = []
l = [_('Disabled')]
for dir_ in emoticons_list:
if not os.path.isdir(os.path.join(gajim.DATA_DIR, 'emoticons', dir_)) \
and not os.path.isdir(os.path.join(gajim.MY_EMOTS_PATH, dir_)) :
continue
if dir_ != '.svn':
l.append(dir_)
l.append(_('Disabled'))
for i in range(len(l)):
model.append([l[i]])
if gajim.config.get('emoticons_theme') == l[i]:

View File

@ -74,6 +74,7 @@ class HistoryWindow:
scrolledwindow.add(self.history_textview.tv)
self.history_buffer = self.history_textview.tv.get_buffer()
self.history_buffer.create_tag('highlight', background = 'yellow')
self.history_buffer.create_tag('invisible', invisible=True)
self.checkbutton = xml.get_object('log_history_checkbutton')
self.checkbutton.connect('toggled',
self.on_log_history_checkbutton_toggled)
@ -429,6 +430,12 @@ class HistoryWindow:
tim = time.strftime('%X ', time.localtime(float(tim)))
buf.insert_with_tags_by_name(end_iter, tim + '\n',
'time_sometimes')
else: # don't print time. So we print it as invisible to be able to
# search for it
timestamp_str = gajim.config.get('time_stamp')
timestamp_str = helpers.from_one_line(timestamp_str)
tim = time.strftime(timestamp_str, time.localtime(float(tim)))
buf.insert_with_tags_by_name(end_iter, tim, 'invisible')
tag_name = ''
tag_msg = ''
@ -605,8 +612,8 @@ class HistoryWindow:
timestamp_str = gajim.config.get('time_stamp')
timestamp_str = helpers.from_one_line(timestamp_str)
tim = time.strftime(timestamp_str, local_time)
result = start_iter.forward_search(tim, Gtk.TextSearchFlags.VISIBLE_ONLY,
None)
result = start_iter.forward_search(tim, Gtk.TextSearchFlags.TEXT_ONLY,
None)
if result is not None:
match_start_iter, match_end_iter = result
match_start_iter.backward_char() # include '[' or other character before time

View File

@ -2473,9 +2473,6 @@ class RosterWindow:
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
width, height = self.window.get_size()
# For the width use the size of the vbox containing the tree and
# status combo, this will cancel out any hpaned width
width = self.xml.get_object('roster_vbox2').get_allocation().width
gajim.config.set('roster_width', width)
gajim.config.set('roster_height', height)
if not self.xml.get_object('roster_vbox2').get_property('visible'):