Commit eec1a69e authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Merge branch 'history-manager' into 'master'

History manager fixes

See merge request !57
parents 7814f07b 2a599d1e
......@@ -29,24 +29,6 @@
## the same can be said for
import os
if == 'nt':
import warnings
if os.path.isdir('gtk'):
# Used to create windows installer with GTK included
paths = os.environ['PATH']
list_ = paths.split(';')
new_list = []
for p in list_:
if p.find('gtk') < 0 and p.find('GTK') < 0:
new_list.insert(0, 'gtk/lib')
new_list.insert(0, 'gtk/bin')
os.environ['PATH'] = ';'.join(new_list)
os.environ['GTK_BASEPATH'] = 'gtk'
import sys
import signal
import gi
......@@ -91,11 +73,7 @@ def parseOpts():
del config_path
from common import gajim
import gtkgui_helpers
from common.logger import LOG_DB_PATH, constants
#FIXME: constants should implement 2 way mappings
status = dict((constants.__dict__[i], i[5:].lower()) for i in \
constants.__dict__.keys() if i.startswith('SHOW_'))
from common.logger import LOG_DB_PATH, JIDConstant, KindConstant
from common import helpers
import dialogs
......@@ -342,7 +320,7 @@ def _jid_is_from_pm(self, jid):
possible_room_jid = jid.split('/', 1)[0]
self.cur.execute('SELECT jid_id FROM jids WHERE jid = ? AND type = ?',
(possible_room_jid, constants.JID_ROOM_TYPE))
(possible_room_jid, JIDConstant.ROOM_TYPE))
row = self.cur.fetchone()
if row is None:
return False
......@@ -357,7 +335,7 @@ def _jid_is_room_type(self, jid):
row = self.cur.fetchone()
if row is None:
elif row[0] == constants.JID_ROOM_TYPE:
elif row[0] == JIDConstant.ROOM_TYPE:
return True
else: # normal type
return False
......@@ -399,15 +377,15 @@ def _fill_logs_listview(self, jid):
color = None
if kind in (constants.KIND_SINGLE_MSG_RECV,
constants.KIND_CHAT_MSG_RECV, constants.KIND_GC_MSG):
if kind in (KindConstant.SINGLE_MSG_RECV,
KindConstant.CHAT_MSG_RECV, KindConstant.GC_MSG):
# it is the other side
color = gajim.config.get('inmsgcolor') # so incoming color
elif kind in (constants.KIND_SINGLE_MSG_SENT,
constants.KIND_CHAT_MSG_SENT): # it is us
elif kind in (KindConstant.SINGLE_MSG_SENT,
KindConstant.CHAT_MSG_SENT): # it is us
color = gajim.config.get('outmsgcolor') # so outgoing color
elif kind in (constants.KIND_STATUS,
constants.KIND_GCSTATUS): # is is statuses
elif kind in (KindConstant.STATUS,
KindConstant.GCSTATUS): # is is statuses
# so status color
color = gajim.config.get('statusmsgcolor')
# include status into (status) message
......@@ -540,13 +518,13 @@ def _export_jids_logs_to_file(self, liststore, list_of_paths, path_to_file):
# in store: time, kind, message, contact_name FROM logs
# in text: JID or You or nickname (if it's gc_msg), time, message
time_, kind, message, nickname = row
if kind in (constants.KIND_SINGLE_MSG_RECV,
if kind in (KindConstant.SINGLE_MSG_RECV,
who = self._get_jid_from_jid_id(jid_id)
elif kind in (constants.KIND_SINGLE_MSG_SENT,
elif kind in (KindConstant.SINGLE_MSG_SENT,
who = _('You')
elif kind == constants.KIND_GC_MSG:
elif kind == KindConstant.GC_MSG:
who = nickname
else: # status or gc_status. do not save
#print kind
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment