Use icons from IconTheme in TransformChatToMUC
This commit is contained in:
parent
4f92142d09
commit
e19f7ef9b6
|
@ -1,7 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.18.3 -->
|
||||
<!-- Generated with glade 3.20.0 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.12"/>
|
||||
<object class="GtkListStore" id="guests_store">
|
||||
<columns>
|
||||
<!-- column-name icon -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name name -->
|
||||
<column type="gchararray"/>
|
||||
<!-- column-name jid -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
|
@ -47,15 +57,38 @@ Select the contacts you want to invite</property>
|
|||
<property name="height_request">300</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="model">guests_store</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection1"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf"/>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn">
|
||||
<property name="title" translatable="yes">column</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">4</property>
|
||||
<property name="position">1</property>
|
||||
|
|
|
@ -5025,7 +5025,7 @@ class TransformChatToMUC:
|
|||
self.window = self.xml.get_object('chat_to_muc_window')
|
||||
|
||||
for widget_to_add in ('invite_button', 'cancel_button',
|
||||
'server_list_comboboxentry', 'guests_treeview',
|
||||
'server_list_comboboxentry', 'guests_treeview', 'guests_store',
|
||||
'server_and_guests_hseparator', 'server_select_label'):
|
||||
self.__dict__[widget_to_add] = self.xml.get_object(widget_to_add)
|
||||
|
||||
|
@ -5056,17 +5056,8 @@ class TransformChatToMUC:
|
|||
|
||||
# set treeview
|
||||
# name, jid
|
||||
self.store = Gtk.ListStore(GdkPixbuf.Pixbuf, str, str)
|
||||
self.store.set_sort_column_id(1, Gtk.SortType.ASCENDING)
|
||||
self.guests_treeview.set_model(self.store)
|
||||
|
||||
renderer1 = Gtk.CellRendererText()
|
||||
renderer2 = Gtk.CellRendererPixbuf()
|
||||
column = Gtk.TreeViewColumn('Status', renderer2, pixbuf=0)
|
||||
self.guests_treeview.append_column(column)
|
||||
column = Gtk.TreeViewColumn('Name', renderer1, text=1)
|
||||
self.guests_treeview.append_column(column)
|
||||
|
||||
self.guests_store.set_sort_column_id(1, Gtk.SortType.ASCENDING)
|
||||
self.guests_treeview.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE)
|
||||
|
||||
# All contacts beside the following can be invited:
|
||||
|
@ -5089,14 +5080,14 @@ class TransformChatToMUC:
|
|||
# Add contact if it can be invited
|
||||
if invitable(contact, contact_transport) and \
|
||||
contact.show not in ('offline', 'error'):
|
||||
img = app.interface.jabber_state_images['16'][contact.show]
|
||||
icon_name = gtkgui_helpers.get_iconset_name_for(contact.show)
|
||||
name = contact.name
|
||||
if name == '':
|
||||
name = jid.split('@')[0]
|
||||
iter_ = self.store.append([img.get_pixbuf(), name, jid])
|
||||
iter_ = self.guests_store.append([icon_name, name, jid])
|
||||
# preselect treeview rows
|
||||
if self.preselected_jids and jid in self.preselected_jids:
|
||||
path = self.store.get_path(iter_)
|
||||
path = self.guests_store.get_path(iter_)
|
||||
self.guests_treeview.get_selection().select_path(path)
|
||||
|
||||
app.ged.register_event_handler('unique-room-id-supported', ged.GUI1,
|
||||
|
@ -5134,8 +5125,8 @@ class TransformChatToMUC:
|
|||
guest_list = []
|
||||
guests = self.guests_treeview.get_selection().get_selected_rows()
|
||||
for guest in guests[1]:
|
||||
iter_ = self.store.get_iter(guest)
|
||||
guest_list.append(self.store[iter_][2])
|
||||
iter_ = self.guests_store.get_iter(guest)
|
||||
guest_list.append(self.guests_store[iter_][2])
|
||||
for guest in self.auto_jids:
|
||||
guest_list.append(guest)
|
||||
room_jid = obj.room_id + '@' + obj.server
|
||||
|
|
Loading…
Reference in New Issue