fix join gc dialog
This commit is contained in:
parent
f67f063769
commit
e55985b498
|
@ -33,7 +33,7 @@
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">4</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">3</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<property name="top_attach">3</property>
|
<property name="top_attach">3</property>
|
||||||
<property name="bottom_attach">4</property>
|
<property name="bottom_attach">4</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
<property name="bottom_attach">3</property>
|
<property name="bottom_attach">3</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">1</property>
|
||||||
<property name="bottom_attach">2</property>
|
<property name="bottom_attach">2</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -114,7 +114,7 @@
|
||||||
<property name="top_attach">5</property>
|
<property name="top_attach">5</property>
|
||||||
<property name="bottom_attach">6</property>
|
<property name="bottom_attach">6</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
<property name="right_attach">2</property>
|
<property name="right_attach">2</property>
|
||||||
<property name="top_attach">5</property>
|
<property name="top_attach">5</property>
|
||||||
<property name="bottom_attach">6</property>
|
<property name="bottom_attach">6</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
<property name="top_attach">7</property>
|
<property name="top_attach">7</property>
|
||||||
<property name="bottom_attach">8</property>
|
<property name="bottom_attach">8</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -188,7 +188,7 @@
|
||||||
<property name="top_attach">6</property>
|
<property name="top_attach">6</property>
|
||||||
<property name="bottom_attach">7</property>
|
<property name="bottom_attach">7</property>
|
||||||
<property name="x_options">GTK_FILL</property>
|
<property name="x_options">GTK_FILL</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"/>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
@ -207,10 +207,9 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkComboBoxEntry" id="server_comboboxentry">
|
<object class="GtkComboBox" id="server_comboboxentry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="model">liststore1</property>
|
<property name="model">liststore1</property>
|
||||||
<property name="text_column">0</property>
|
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="position">0</property>
|
<property name="position">0</property>
|
||||||
|
|
|
@ -570,7 +570,7 @@ class SingleForm(Gtk.Table, object):
|
||||||
pixbuf_l = GdkPixbuf.PixbufLoader()
|
pixbuf_l = GdkPixbuf.PixbufLoader()
|
||||||
pixbuf_l.write(img_data)
|
pixbuf_l.write(img_data)
|
||||||
pixbuf_l.close()
|
pixbuf_l.close()
|
||||||
media = Gtk.image_new_from_pixbuf(pixbuf_l.\
|
media = Gtk.Image.new_from_pixbuf(pixbuf_l.\
|
||||||
get_pixbuf())
|
get_pixbuf())
|
||||||
except Exception:
|
except Exception:
|
||||||
media = Gtk.Label(label=_('Unable to load image'))
|
media = Gtk.Label(label=_('Unable to load image'))
|
||||||
|
|
|
@ -1643,7 +1643,7 @@ class YesNoDialog(HigDialog):
|
||||||
label = Gtk.Label(label=text_label)
|
label = Gtk.Label(label=text_label)
|
||||||
self.vbox.pack_start(label, False, True, 0)
|
self.vbox.pack_start(label, False, True, 0)
|
||||||
buff = Gtk.TextBuffer()
|
buff = Gtk.TextBuffer()
|
||||||
self.textview = Gtk.TextView(buff)
|
self.textview = Gtk.TextView.new_with_buffer(buff)
|
||||||
frame = Gtk.Frame()
|
frame = Gtk.Frame()
|
||||||
frame.set_shadow_type(Gtk.ShadowType.IN)
|
frame.set_shadow_type(Gtk.ShadowType.IN)
|
||||||
frame.add(self.textview)
|
frame.add(self.textview)
|
||||||
|
@ -2341,7 +2341,7 @@ class JoinGroupchatWindow:
|
||||||
liststore = Gtk.ListStore(str)
|
liststore = Gtk.ListStore(str)
|
||||||
account_combobox.set_model(liststore)
|
account_combobox.set_model(liststore)
|
||||||
cell = Gtk.CellRendererText()
|
cell = Gtk.CellRendererText()
|
||||||
account_combobox.pack_start(cell, True, True, 0)
|
account_combobox.pack_start(cell, True)
|
||||||
account_combobox.add_attribute(cell, 'text', 0)
|
account_combobox.add_attribute(cell, 'text', 0)
|
||||||
account_combobox.set_active(-1)
|
account_combobox.set_active(-1)
|
||||||
|
|
||||||
|
@ -2350,7 +2350,7 @@ class JoinGroupchatWindow:
|
||||||
gajim.account_is_connected(a)]:
|
gajim.account_is_connected(a)]:
|
||||||
if gajim.connections[acct].is_zeroconf:
|
if gajim.connections[acct].is_zeroconf:
|
||||||
continue
|
continue
|
||||||
account_combobox.append_text(acct)
|
liststore.append([acct])
|
||||||
if account and account == acct:
|
if account and account == acct:
|
||||||
account_combobox.set_active(liststore.iter_n_children(None)-1)
|
account_combobox.set_active(liststore.iter_n_children(None)-1)
|
||||||
|
|
||||||
|
@ -2379,7 +2379,13 @@ class JoinGroupchatWindow:
|
||||||
self.window.set_title(title)
|
self.window.set_title(title)
|
||||||
|
|
||||||
self.server_comboboxentry = self.xml.get_object('server_comboboxentry')
|
self.server_comboboxentry = self.xml.get_object('server_comboboxentry')
|
||||||
self.server_model = self.server_comboboxentry.get_model()
|
liststore = Gtk.ListStore(str)
|
||||||
|
self.server_comboboxentry.set_model(liststore)
|
||||||
|
cell = Gtk.CellRendererText()
|
||||||
|
self.server_comboboxentry.pack_start(cell, True)
|
||||||
|
self.server_comboboxentry.add_attribute(cell, 'text', 0)
|
||||||
|
self.server_comboboxentry.set_active(-1)
|
||||||
|
self.server_model = liststore#self.server_comboboxentry.get_model()
|
||||||
server_list = []
|
server_list = []
|
||||||
# get the muc server of our server
|
# get the muc server of our server
|
||||||
if 'jabber' in gajim.connections[account].muc_jid:
|
if 'jabber' in gajim.connections[account].muc_jid:
|
||||||
|
@ -2389,11 +2395,11 @@ class JoinGroupchatWindow:
|
||||||
liststore = Gtk.ListStore(str)
|
liststore = Gtk.ListStore(str)
|
||||||
self.recently_combobox.set_model(liststore)
|
self.recently_combobox.set_model(liststore)
|
||||||
cell = Gtk.CellRendererText()
|
cell = Gtk.CellRendererText()
|
||||||
self.recently_combobox.pack_start(cell, True, True, 0)
|
self.recently_combobox.pack_start(cell, True)
|
||||||
self.recently_combobox.add_attribute(cell, 'text', 0)
|
self.recently_combobox.add_attribute(cell, 'text', 0)
|
||||||
self.recently_groupchat = gajim.config.get('recently_groupchat').split()
|
self.recently_groupchat = gajim.config.get('recently_groupchat').split()
|
||||||
for g in self.recently_groupchat:
|
for g in self.recently_groupchat:
|
||||||
self.recently_combobox.append_text(g)
|
liststore.append([g])
|
||||||
server = gajim.get_server_from_jid(g)
|
server = gajim.get_server_from_jid(g)
|
||||||
if server not in server_list and not server.startswith('irc'):
|
if server not in server_list and not server.startswith('irc'):
|
||||||
server_list.append(server)
|
server_list.append(server)
|
||||||
|
@ -2463,7 +2469,9 @@ class JoinGroupchatWindow:
|
||||||
def _set_room_jid(self, room_jid):
|
def _set_room_jid(self, room_jid):
|
||||||
room, server = gajim.get_name_and_server_from_jid(room_jid)
|
room, server = gajim.get_name_and_server_from_jid(room_jid)
|
||||||
self._room_jid_entry.set_text(room)
|
self._room_jid_entry.set_text(room)
|
||||||
self.server_comboboxentry.get_child().set_text(server)
|
model = self.server_comboboxentry.get_model()
|
||||||
|
model.append([server])
|
||||||
|
#self.server_comboboxentry.set_active(0)
|
||||||
|
|
||||||
def on_recently_combobox_changed(self, widget):
|
def on_recently_combobox_changed(self, widget):
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
|
@ -2509,8 +2517,9 @@ class JoinGroupchatWindow:
|
||||||
'groupchat.'))
|
'groupchat.'))
|
||||||
return
|
return
|
||||||
nickname = self._nickname_entry.get_text().decode('utf-8')
|
nickname = self._nickname_entry.get_text().decode('utf-8')
|
||||||
server = self.server_comboboxentry.get_child().get_text().decode('utf-8').\
|
row = self.server_comboboxentry.get_child().get_displayed_row()
|
||||||
strip()
|
model = self.server_comboboxentry.get_model()
|
||||||
|
server = model[row][0].decode('utf-8').strip()
|
||||||
room = self._room_jid_entry.get_text().decode('utf-8').strip()
|
room = self._room_jid_entry.get_text().decode('utf-8').strip()
|
||||||
room_jid = room + '@' + server
|
room_jid = room + '@' + server
|
||||||
password = self._password_entry.get_text().decode('utf-8')
|
password = self._password_entry.get_text().decode('utf-8')
|
||||||
|
|
|
@ -470,7 +470,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
# workaround to avoid gtk arrows to be shown
|
# workaround to avoid gtk arrows to be shown
|
||||||
column = Gtk.TreeViewColumn() # 2nd COLUMN
|
column = Gtk.TreeViewColumn() # 2nd COLUMN
|
||||||
renderer = Gtk.CellRendererPixbuf()
|
renderer = Gtk.CellRendererPixbuf()
|
||||||
column.pack_start(renderer, False, True, 0)
|
column.pack_start(renderer, False)
|
||||||
self.list_treeview.append_column(column)
|
self.list_treeview.append_column(column)
|
||||||
column.set_visible(False)
|
column.set_visible(False)
|
||||||
self.list_treeview.set_expander_column(column)
|
self.list_treeview.set_expander_column(column)
|
||||||
|
@ -508,7 +508,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
|
|
||||||
def fill_column(self, col):
|
def fill_column(self, col):
|
||||||
for rend in self.renderers_list:
|
for rend in self.renderers_list:
|
||||||
col.pack_start(rend[1], rend[2], True, 0)
|
col.pack_start(rend[1], rend[2])
|
||||||
col.add_attribute(rend[1], rend[3], rend[4])
|
col.add_attribute(rend[1], rend[3], rend[4])
|
||||||
col.set_cell_data_func(rend[1], rend[5], rend[6])
|
col.set_cell_data_func(rend[1], rend[5], rend[6])
|
||||||
# set renderers propertys
|
# set renderers propertys
|
||||||
|
@ -594,8 +594,9 @@ class GroupchatControl(ChatControlBase):
|
||||||
"""
|
"""
|
||||||
The MUC treeview has resized. Move the hpaned in all tabs to match
|
The MUC treeview has resized. Move the hpaned in all tabs to match
|
||||||
"""
|
"""
|
||||||
if gparamspec.name != 'position':
|
# print pane, dir(pane)
|
||||||
return
|
#if gparamspec.name != 'position':
|
||||||
|
#return
|
||||||
if self.resize_from_another_muc:
|
if self.resize_from_another_muc:
|
||||||
# Don't send the event to other MUC
|
# Don't send the event to other MUC
|
||||||
return
|
return
|
||||||
|
@ -1430,7 +1431,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
gc_contact.affiliation != 'none' and gajim.config.get(
|
gc_contact.affiliation != 'none' and gajim.config.get(
|
||||||
'show_affiliation_in_groupchat'):
|
'show_affiliation_in_groupchat'):
|
||||||
pixbuf1 = image.get_pixbuf().copy()
|
pixbuf1 = image.get_pixbuf().copy()
|
||||||
pixbuf2 = GdkPixbuf.Pixbuf(GdkPixbuf.Colorspace.RGB, True, 8, 4, 4)
|
pixbuf2 = GdkPixbuf.Pixbuf.new(GdkPixbuf.Colorspace.RGB, True, 8, 4, 4)
|
||||||
if gc_contact.affiliation == 'owner':
|
if gc_contact.affiliation == 'owner':
|
||||||
pixbuf2.fill(0xff0000ff) # Red
|
pixbuf2.fill(0xff0000ff) # Red
|
||||||
elif gc_contact.affiliation == 'admin':
|
elif gc_contact.affiliation == 'admin':
|
||||||
|
@ -1440,7 +1441,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
pixbuf2.composite(pixbuf1, 12, 12, pixbuf2.get_property('width'),
|
pixbuf2.composite(pixbuf1, 12, 12, pixbuf2.get_property('width'),
|
||||||
pixbuf2.get_property('height'), 0, 0, 1.0, 1.0,
|
pixbuf2.get_property('height'), 0, 0, 1.0, 1.0,
|
||||||
GdkPixbuf.InterpType.HYPER, 127)
|
GdkPixbuf.InterpType.HYPER, 127)
|
||||||
image = Gtk.image_new_from_pixbuf(pixbuf1)
|
image = Gtk.Image.new_from_pixbuf(pixbuf1)
|
||||||
self.model[iter_][C_IMG] = image
|
self.model[iter_][C_IMG] = image
|
||||||
self.model[iter_][C_TEXT] = name
|
self.model[iter_][C_TEXT] = name
|
||||||
|
|
||||||
|
@ -1453,7 +1454,7 @@ class GroupchatControl(ChatControlBase):
|
||||||
fake_jid = self.room_jid + '/' + nick
|
fake_jid = self.room_jid + '/' + nick
|
||||||
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(fake_jid)
|
pixbuf = gtkgui_helpers.get_avatar_pixbuf_from_cache(fake_jid)
|
||||||
if pixbuf in ('ask', None):
|
if pixbuf in ('ask', None):
|
||||||
scaled_pixbuf = None
|
scaled_pixbuf = ''
|
||||||
else:
|
else:
|
||||||
scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
|
scaled_pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'roster')
|
||||||
self.model[iter_][C_AVATAR] = scaled_pixbuf
|
self.model[iter_][C_AVATAR] = scaled_pixbuf
|
||||||
|
|
|
@ -1489,7 +1489,10 @@ class RosterWindow:
|
||||||
# do not change selection while DND'ing
|
# do not change selection while DND'ing
|
||||||
return
|
return
|
||||||
# Expand his parent, so this path is visible, don't expand it.
|
# Expand his parent, so this path is visible, don't expand it.
|
||||||
self.tree.expand_to_path(path[:-1])
|
path_ = str(path.get_indices()[:-1])[1:-1]
|
||||||
|
path_ = path_.replace(', ', ':')
|
||||||
|
path = path.new_from_string(path_)
|
||||||
|
self.tree.expand_to_path(path)
|
||||||
self.tree.scroll_to_cell(path)
|
self.tree.scroll_to_cell(path)
|
||||||
self.tree.set_cursor(path)
|
self.tree.set_cursor(path)
|
||||||
|
|
||||||
|
@ -2395,7 +2398,7 @@ class RosterWindow:
|
||||||
if isinstance(w, dict):
|
if isinstance(w, dict):
|
||||||
self.close_all_from_dict(w)
|
self.close_all_from_dict(w)
|
||||||
else:
|
else:
|
||||||
w.window().destroy()
|
w.window.destroy()
|
||||||
|
|
||||||
def close_all(self, account, force=False):
|
def close_all(self, account, force=False):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue