Author: asterix
Date: 2007-09-05 16:15:20 +0200 (Wed, 05 Sep 2007)
New Revision: 8732
Modified:
branches/gajim_0.11.1/data/glade/message_window.glade
branches/gajim_0.11.1/src/config.py
branches/gajim_0.11.1/src/groupchat_control.py
branches/gajim_0.11.1/src/roster_window.py
Log:
Enable ellipsization in roster and chatwindow. Fixes #2079, #2739
Reorder occupantlist in groupchat to match roster. see #2102
Modified: branches/gajim_0.11.1/data/glade/message_window.glade
===================================================================
--- branches/gajim_0.11.1/data/glade/message_window.glade 2007-09-05 14:05:27 UTC (rev 8731)
+++ branches/gajim_0.11.1/data/glade/message_window.glade 2007-09-05 14:15:20 UTC (rev 8732)
@@ -591,7 +591,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_END</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
Modified: branches/gajim_0.11.1/src/config.py
===================================================================
--- branches/gajim_0.11.1/src/config.py 2007-09-05 14:05:27 UTC (rev 8731)
+++ branches/gajim_0.11.1/src/config.py 2007-09-05 14:15:20 UTC (rev 8732)
@@ -575,7 +575,14 @@
def on_show_avatars_in_roster_checkbutton_toggled(self, widget):
self.on_checkbutton_toggled(widget, 'show_avatars_in_roster')
gajim.interface.roster.draw_roster()
-
+ # Redraw connected groupchats (in an ugly way)
+ for account in gajim.connections:
+ if gajim.connections[account].connected:
+ for gc_control in gajim.interface.msg_win_mgr.get_controls(
+ message_control.TYPE_GC) + \
+ gajim.interface.minimized_controls[account].values():
+ gc_control.draw_roster()
+
def on_emoticons_combobox_changed(self, widget):
active = widget.get_active()
model = widget.get_model()
Modified: branches/gajim_0.11.1/src/groupchat_control.py
===================================================================
--- branches/gajim_0.11.1/src/groupchat_control.py 2007-09-05 14:05:27 UTC (rev 8731)
+++ branches/gajim_0.11.1/src/groupchat_control.py 2007-09-05 14:15:20 UTC (rev 8732)
@@ -277,14 +277,8 @@
# first one img, second one text, third is sec pixbuf
column = gtk.TreeViewColumn()
- renderer_pixbuf = gtk.CellRendererPixbuf() # avatar image
- column.pack_start(renderer_pixbuf, expand = False)
- column.add_attribute(renderer_pixbuf, 'pixbuf', C_AVATAR)
- column.set_cell_data_func(renderer_pixbuf, tree_cell_data_func,
- self.list_treeview)
- renderer_pixbuf.set_property('xalign', 1) # align pixbuf to the right
-
renderer_image = cell_renderer_image.CellRendererImage(0, 0) # status img
+ renderer_image.set_property('width', 26)
column.pack_start(renderer_image, expand = False)
column.add_attribute(renderer_image, 'image', C_IMG)
column.set_cell_data_func(renderer_image, tree_cell_data_func,
@@ -293,9 +287,17 @@
renderer_text = gtk.CellRendererText() # nickname
column.pack_start(renderer_text, expand = True)
column.add_attribute(renderer_text, 'markup', C_TEXT)
+ renderer_text.set_property("ellipsize", pango.ELLIPSIZE_END)
column.set_cell_data_func(renderer_text, tree_cell_data_func,
self.list_treeview)
+ renderer_pixbuf = gtk.CellRendererPixbuf() # avatar image
+ column.pack_start(renderer_pixbuf, expand = False)
+ column.add_attribute(renderer_pixbuf, 'pixbuf', C_AVATAR)
+ column.set_cell_data_func(renderer_pixbuf, tree_cell_data_func,
+ self.list_treeview)
+ renderer_pixbuf.set_property('xalign', 1) # align pixbuf to the right
+
self.list_treeview.append_column(column)
# workaround to avoid gtk arrows to be shown
@@ -767,6 +769,8 @@
self.add_contact_to_roster(nick, gc_contact.show, gc_contact.role,
gc_contact.affiliation, gc_contact.status,
gc_contact.jid)
+ # Recalculate column width for ellipsizin
+ self.list_treeview.columns_autosize()
def on_send_pm(self, widget = None, model = None, iter = None, nick = None,
msg = None):
Modified: branches/gajim_0.11.1/src/roster_window.py
===================================================================
--- branches/gajim_0.11.1/src/roster_window.py 2007-09-05 14:05:27 UTC (rev 8731)
+++ branches/gajim_0.11.1/src/roster_window.py 2007-09-05 14:15:20 UTC (rev 8732)
@@ -16,6 +16,7 @@
##
import gtk
+import pango
import gobject
import os
import time
@@ -1104,6 +1105,8 @@
for acct in gajim.connections:
self.add_account_to_roster(acct)
self.add_account_contacts(acct)
+ # Recalculate column width for ellipsizing
+ self.tree.columns_autosize()
def add_account_contacts(self, account):
'''adds contacts of group to roster treeview'''
@@ -4487,6 +4490,7 @@
col.set_cell_data_func(render_image, self.iconCellDataFunc, None)
render_text = gtk.CellRendererText() # contact or group or account name
+ render_text.set_property("ellipsize", pango.ELLIPSIZE_END)
col.pack_start(render_text, expand = True)
col.add_attribute(render_text, 'markup', C_NAME) # where we hold the name
col.set_cell_data_func(render_text, self.nameCellDataFunc, None)