add account combobox to join groupchat dialog when we try to join a groupchat from another chat / groupchat. Fixes #3344

This commit is contained in:
Yann Leboulanger 2009-09-02 23:45:16 +02:00
parent a2ca911d80
commit 682d6f838a
4 changed files with 318 additions and 397 deletions

View File

@ -1,348 +1,239 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> <?xml version="1.0"?>
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface> <glade-interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="GtkWindow" id="join_groupchat_window"> <widget class="GtkWindow" id="join_groupchat_window">
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Join Group Chat</property> <property name="title" translatable="yes">Join Group Chat</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <signal name="destroy" handler="on_join_groupchat_window_destroy"/>
<property name="window_position">GTK_WIN_POS_NONE</property> <signal name="key_press_event" handler="on_join_groupchat_window_key_press_event"/>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<signal name="destroy" handler="on_join_groupchat_window_destroy" last_modification_time="Wed, 02 Mar 2005 12:20:14 GMT"/>
<signal name="key_press_event" handler="on_join_groupchat_window_key_press_event" last_modification_time="Tue, 05 Apr 2005 13:13:40 GMT"/>
<child> <child>
<widget class="GtkVBox" id="vbox28"> <widget class="GtkVBox" id="vbox28">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<widget class="GtkTable" id="table15"> <widget class="GtkTable" id="table15">
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">5</property> <property name="n_rows">6</property>
<property name="n_columns">2</property> <property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<property name="row_spacing">6</property>
<child> <child>
<widget class="GtkEntry" id="room_jid_entry"> <widget class="GtkEntry" id="room_jid_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<signal name="changed" handler="on_required_entry_changed" last_modification_time="Sat, 14 Jan 2006 21:51:39 GMT"/> <signal name="changed" handler="on_required_entry_changed"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">2</property> <property name="top_attach">3</property>
<property name="bottom_attach">3</property> <property name="bottom_attach">4</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="nickname_entry"> <widget class="GtkEntry" id="nickname_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
<signal name="changed" handler="on_required_entry_changed" last_modification_time="Sat, 14 Jan 2006 21:51:24 GMT"/> <signal name="changed" handler="on_required_entry_changed"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">1</property> <property name="top_attach">2</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">3</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label143"> <widget class="GtkLabel" id="label143">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Room:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="yalign">0.5</property> <property name="label" translatable="yes">Room:</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="top_attach">3</property>
<property name="right_attach">1</property> <property name="bottom_attach">4</property>
<property name="top_attach">2</property> <property name="x_options">GTK_FILL</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label142"> <widget class="GtkLabel" id="label142">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Nickname:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="yalign">0.5</property> <property name="label" translatable="yes">Nickname:</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="top_attach">2</property>
<property name="right_attach">1</property> <property name="bottom_attach">3</property>
<property name="top_attach">1</property> <property name="x_options">GTK_FILL</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label225"> <widget class="GtkLabel" id="label225">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Recently:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="yalign">0.5</property> <property name="label" translatable="yes">Recently:</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="top_attach">1</property>
<property name="right_attach">1</property> <property name="bottom_attach">2</property>
<property name="top_attach">0</property> <property name="x_options">GTK_FILL</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkComboBox" id="recently_combobox"> <widget class="GtkComboBox" id="recently_combobox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="add_tearoffs">False</property> <signal name="changed" handler="on_recently_combobox_changed"/>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_recently_combobox_changed" last_modification_time="Wed, 06 Apr 2005 22:25:35 GMT"/>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">0</property> <property name="top_attach">1</property>
<property name="bottom_attach">1</property> <property name="bottom_attach">2</property>
<property name="x_options">fill</property> <property name="x_options">GTK_FILL</property>
<property name="y_options">fill</property> <property name="y_options">GTK_FILL</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label145"> <widget class="GtkLabel" id="label145">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Password:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property> <property name="xalign">0</property>
<property name="yalign">0.5</property> <property name="label" translatable="yes">Password:</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="top_attach">4</property>
<property name="right_attach">1</property> <property name="bottom_attach">5</property>
<property name="top_attach">3</property> <property name="x_options">GTK_FILL</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkEntry" id="password_entry"> <widget class="GtkEntry" id="password_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">False</property> <property name="visibility">False</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="activates_default">True</property> <property name="activates_default">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">3</property> <property name="top_attach">4</property>
<property name="bottom_attach">4</property> <property name="bottom_attach">5</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkCheckButton" id="auto_join_checkbutton"> <widget class="GtkCheckButton" id="auto_join_checkbutton">
<property name="label" translatable="yes">Join this room automatically when I connect</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="label" translatable="yes">Join this room automatically when I connect</property> <property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property>
<property name="right_attach">2</property> <property name="right_attach">2</property>
<property name="top_attach">4</property> <property name="top_attach">5</property>
<property name="bottom_attach">5</property> <property name="bottom_attach">6</property>
<property name="x_options">fill</property> <property name="x_options">GTK_FILL</property>
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkLabel" id="account_label">
<property name="no_show_all">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Account</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="account_combobox">
<property name="no_show_all">True</property>
<signal name="changed" handler="on_account_combobox_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="position">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHButtonBox" id="hbuttonbox12"> <widget class="GtkHButtonBox" id="hbuttonbox12">
<property name="visible">True</property> <property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<property name="layout_style">end</property>
<child> <child>
<widget class="GtkButton" id="cancel_button"> <widget class="GtkButton" id="cancel_button">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <signal name="clicked" handler="on_cancel_button_clicked"/>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_cancel_button_clicked" last_modification_time="Fri, 04 Mar 2005 13:40:16 GMT"/>
</widget> </widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child> </child>
<child> <child>
<widget class="GtkButton" id="join_button"> <widget class="GtkButton" id="join_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property> <property name="can_default">True</property>
<property name="has_default">True</property> <property name="has_default">True</property>
<property name="can_focus">True</property> <property name="receives_default">False</property>
<property name="relief">GTK_RELIEF_NORMAL</property> <signal name="clicked" handler="on_join_button_clicked"/>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_join_button_clicked" last_modification_time="Wed, 02 Mar 2005 12:19:22 GMT"/>
<child> <child>
<widget class="GtkAlignment" id="alignment25"> <widget class="GtkAlignment" id="alignment25">
<property name="visible">True</property> <property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property> <property name="xscale">0</property>
<property name="yscale">0</property> <property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child> <child>
<widget class="GtkHBox" id="hbox37"> <widget class="GtkHBox" id="hbox37">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property> <property name="spacing">2</property>
<child> <child>
<widget class="GtkImage" id="image148"> <widget class="GtkImage" id="image148">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-apply</property> <property name="stock">gtk-apply</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkLabel" id="label146"> <widget class="GtkLabel" id="label146">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">_Join</property> <property name="label" translatable="yes">_Join</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<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="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">False</property> <property name="fill">False</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </widget>
@ -350,16 +241,19 @@
</widget> </widget>
</child> </child>
</widget> </widget>
</child>
</widget>
<packing> <packing>
<property name="padding">0</property>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</widget> </widget>
</child> </child>
</widget> </widget>
</glade-interface> </glade-interface>

View File

@ -827,8 +827,7 @@ class ConversationTextview(gobject.GObject):
gajim.interface.instances[self.account]['join_gc'].window.present() gajim.interface.instances[self.account]['join_gc'].window.present()
else: else:
try: try:
gajim.interface.instances[self.account]['join_gc'] = \ dialogs.JoinGroupchatWindow(account=None, room_jid=room_jid)
dialogs.JoinGroupchatWindow(self.account, room_jid)
except GajimGeneralException: except GajimGeneralException:
pass pass

View File

@ -1893,28 +1893,42 @@ class SubscriptionRequestWindow:
class JoinGroupchatWindow: class JoinGroupchatWindow:
def __init__(self, account, room_jid='', nick='', password='', def __init__(self, account=None, room_jid='', nick='', password='',
automatic=False): automatic=False):
'''automatic is a dict like {'invities': []} '''automatic is a dict like {'invities': []}
If automatic is not empty, this means room must be automaticaly configured If automatic is not empty, this means room must be automaticaly configured
and when done, invities must be automatically invited''' and when done, invities must be automatically invited'''
if room_jid != '': self.xml = gtkgui_helpers.get_glade('join_groupchat_window.glade')
if room_jid in gajim.gc_connected[account] and\ if account:
if room_jid != '' and room_jid in gajim.gc_connected[account] and\
gajim.gc_connected[account][room_jid]: gajim.gc_connected[account][room_jid]:
ErrorDialog(_('You are already in group chat %s') % room_jid) ErrorDialog(_('You are already in group chat %s') % room_jid)
raise GajimGeneralException, 'You are already in this group chat' raise GajimGeneralException, 'You are already in this group chat'
self.account = account
self.automatic = automatic
if nick == '': if nick == '':
nick = gajim.nicks[self.account] nick = gajim.nicks[account]
if gajim.connections[account].connected < 2: if gajim.connections[account].connected < 2:
ErrorDialog(_('You are not connected to the server'), ErrorDialog(_('You are not connected to the server'),
_('You can not join a group chat unless you are connected.')) _('You can not join a group chat unless you are connected.'))
raise GajimGeneralException, 'You must be connected to join a groupchat' raise GajimGeneralException, 'You must be connected to join a groupchat'
else:
account_label = self.xml.get_widget('account_label')
account_combobox = self.xml.get_widget('account_combobox')
account_label.set_no_show_all(False)
account_combobox.set_no_show_all(False)
liststore = gtk.ListStore(str)
account_combobox.set_model(liststore)
cell = gtk.CellRendererText()
account_combobox.pack_start(cell, True)
account_combobox.add_attribute(cell, 'text', 0)
for acct in [a for a in gajim.connections if \
gajim.account_is_connected(a)]:
account_combobox.append_text(acct)
account_combobox.set_active(-1)
self.account = account
self.automatic = automatic
self._empty_required_widgets = [] self._empty_required_widgets = []
self.xml = gtkgui_helpers.get_glade('join_groupchat_window.glade')
self.window = self.xml.get_widget('join_groupchat_window') self.window = self.xml.get_widget('join_groupchat_window')
self._room_jid_entry = self.xml.get_widget('room_jid_entry') self._room_jid_entry = self.xml.get_widget('room_jid_entry')
self._nickname_entry = self.xml.get_widget('nickname_entry') self._nickname_entry = self.xml.get_widget('nickname_entry')
@ -1925,11 +1939,13 @@ class JoinGroupchatWindow:
if password: if password:
self._password_entry.set_text(password) self._password_entry.set_text(password)
self.xml.signal_autoconnect(self) self.xml.signal_autoconnect(self)
title = None
if account:
# now add us to open windows # now add us to open windows
gajim.interface.instances[account]['join_gc'] = self gajim.interface.instances[account]['join_gc'] = self
if len(gajim.connections) > 1: if len(gajim.connections) > 1:
title = _('Join Group Chat with account %s') % account title = _('Join Group Chat with account %s') % account
else: if title is None:
title = _('Join Group Chat') title = _('Join Group Chat')
self.window.set_title(title) self.window.set_title(title)
@ -1957,13 +1973,14 @@ class JoinGroupchatWindow:
if len(self._empty_required_widgets): if len(self._empty_required_widgets):
self.xml.get_widget('join_button').set_sensitive(False) self.xml.get_widget('join_button').set_sensitive(False)
if not gajim.connections[account].private_storage_supported: if account and not gajim.connections[account].private_storage_supported:
self.xml.get_widget('auto_join_checkbutton').set_sensitive(False) self.xml.get_widget('auto_join_checkbutton').set_sensitive(False)
self.window.show_all() self.window.show_all()
def on_join_groupchat_window_destroy(self, widget): def on_join_groupchat_window_destroy(self, widget):
'''close window''' '''close window'''
if self.account and 'join_gc' in gajim.interface.instances[self.account]:
# remove us from open windows # remove us from open windows
del gajim.interface.instances[self.account]['join_gc'] del gajim.interface.instances[self.account]['join_gc']
@ -1978,9 +1995,15 @@ class JoinGroupchatWindow:
else: else:
if widget in self._empty_required_widgets: if widget in self._empty_required_widgets:
self._empty_required_widgets.remove(widget) self._empty_required_widgets.remove(widget)
if len(self._empty_required_widgets) == 0: if len(self._empty_required_widgets) == 0 and self.account:
self.xml.get_widget('join_button').set_sensitive(True) self.xml.get_widget('join_button').set_sensitive(True)
def on_account_combobox_changed(self, widget):
model = widget.get_model()
iter_ = widget.get_active_iter()
self.account = model[iter_][0].decode('utf-8')
self.on_required_entry_changed(self._nickname_entry)
def on_recently_combobox_changed(self, widget): def on_recently_combobox_changed(self, widget):
model = widget.get_model() model = widget.get_model()
iter_ = widget.get_active_iter() iter_ = widget.get_active_iter()
@ -1993,6 +2016,11 @@ class JoinGroupchatWindow:
def on_join_button_clicked(self, widget): def on_join_button_clicked(self, widget):
'''When Join button is clicked''' '''When Join button is clicked'''
if not self.account:
ErrorDialog(_('Invalid Account'),
_('You have to choose an account from which you want to join the '
'groupchat.'))
return
nickname = self._nickname_entry.get_text().decode('utf-8') nickname = self._nickname_entry.get_text().decode('utf-8')
room_jid = self._room_jid_entry.get_text().decode('utf-8') room_jid = self._room_jid_entry.get_text().decode('utf-8')
password = self._password_entry.get_text().decode('utf-8') password = self._password_entry.get_text().decode('utf-8')
@ -2015,7 +2043,8 @@ class JoinGroupchatWindow:
return return
if gajim.interface.msg_win_mgr.has_window(room_jid, self.account): if gajim.interface.msg_win_mgr.has_window(room_jid, self.account):
ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid, self.account) ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid,
self.account)
if ctrl.type_id != message_control.TYPE_GC: if ctrl.type_id != message_control.TYPE_GC:
ErrorDialog(_('This is not a group chat'), ErrorDialog(_('This is not a group chat'),
_('%s is not the name of a group chat.') % room_jid) _('%s is not the name of a group chat.') % room_jid)

View File

@ -1592,9 +1592,8 @@ class GroupchatControl(ChatControlBase):
window.present() window.present()
else: else:
try: try:
gajim.interface.instances[self.account]['join_gc'] =\ dialogs.JoinGroupchatWindow(account=None, room_jid=room_jid,
dialogs.JoinGroupchatWindow(self.account, nick=nick)
room_jid = room_jid, nick=nick)
except GajimGeneralException: except GajimGeneralException:
pass pass
self.clear(self.msg_textview) self.clear(self.msg_textview)