|
|
@ -29,6 +29,7 @@ import re |
|
|
|
import urllib2 |
|
|
|
import urllib2 |
|
|
|
|
|
|
|
|
|
|
|
from mitterlib.ui.helpers.image_helpers import find_image |
|
|
|
from mitterlib.ui.helpers.image_helpers import find_image |
|
|
|
|
|
|
|
from mitterlib import htmlize |
|
|
|
|
|
|
|
|
|
|
|
from mitterlib.constants import gpl_3, version |
|
|
|
from mitterlib.constants import gpl_3, version |
|
|
|
#from mitterlib.ui.helpers.utils import str_len |
|
|
|
#from mitterlib.ui.helpers.utils import str_len |
|
|
@ -254,7 +255,7 @@ class Interface(object): |
|
|
|
# Store NetworkData objects only |
|
|
|
# Store NetworkData objects only |
|
|
|
grid_store = gtk.ListStore(object) |
|
|
|
grid_store = gtk.ListStore(object) |
|
|
|
grid_store.set_sort_column_id(0, gtk.SORT_ASCENDING) |
|
|
|
grid_store.set_sort_column_id(0, gtk.SORT_ASCENDING) |
|
|
|
grid_store.set_default_sort_func(self._order_datetime) |
|
|
|
grid_store.set_sort_func(0, self._order_datetime) |
|
|
|
|
|
|
|
|
|
|
|
self._grid = gtk.TreeView(grid_store) |
|
|
|
self._grid = gtk.TreeView(grid_store) |
|
|
|
self._grid.set_property('headers-visible', False) |
|
|
|
self._grid.set_property('headers-visible', False) |
|
|
@ -493,10 +494,13 @@ class Interface(object): |
|
|
|
message = data.message |
|
|
|
message = data.message |
|
|
|
username = data.username |
|
|
|
username = data.username |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#_log.debug('Rendering message: %s', message) |
|
|
|
|
|
|
|
|
|
|
|
time = timesince.timesince(data.message_time) |
|
|
|
time = timesince.timesince(data.message_time) |
|
|
|
|
|
|
|
|
|
|
|
# unescape escaped entities that pango is okay with |
|
|
|
# unescape escaped entities that pango is not okay with |
|
|
|
#message = re.sub(r'&(?!(amp;|gt;|lt;|quot;|apos;))', r'&', message) |
|
|
|
message = htmlize(message) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# highlight URLs |
|
|
|
# highlight URLs |
|
|
|
mask = r'<span foreground="%s">\1</span>' % ( |
|
|
|
mask = r'<span foreground="%s">\1</span>' % ( |
|
|
@ -612,12 +616,12 @@ class Interface(object): |
|
|
|
if (not message1) or \ |
|
|
|
if (not message1) or \ |
|
|
|
(not message1.message_time) or \ |
|
|
|
(not message1.message_time) or \ |
|
|
|
(message1.message_time > message2.message_time): |
|
|
|
(message1.message_time > message2.message_time): |
|
|
|
return 1 |
|
|
|
return -1 |
|
|
|
|
|
|
|
|
|
|
|
if (not message2) or \ |
|
|
|
if (not message2) or \ |
|
|
|
(not message2.message_time) or \ |
|
|
|
(not message2.message_time) or \ |
|
|
|
(message2.message_time > message1.message_time): |
|
|
|
(message2.message_time > message1.message_time): |
|
|
|
return -1 |
|
|
|
return 1 |
|
|
|
return 0 |
|
|
|
return 0 |
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------ |
|
|
|
# ------------------------------------------------------------ |
|
|
|