Remove old JoinGroupchat dialog
This commit is contained in:
parent
553ba9e59f
commit
d814a42345
|
@ -1,302 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.18.3 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.12"/>
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-find</property>
|
||||
</object>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-apply</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="join_groupchat_window">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="border_width">6</property>
|
||||
<property name="title" translatable="yes">Join Group Chat</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<signal name="destroy" handler="on_join_groupchat_window_destroy" swapped="no"/>
|
||||
<signal name="key-press-event" handler="on_join_groupchat_window_key_press_event" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkBox" id="box1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<property name="column_spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="room_jid_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
<signal name="changed" handler="on_required_entry_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="account_label">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<property name="label" translatable="yes">Account</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="account_combobox">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="no_show_all">True</property>
|
||||
<signal name="changed" handler="on_account_combobox_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label225">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Recently:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="recently_combobox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="changed" handler="on_recently_combobox_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label142">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Nickname:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="nickname_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="activates_default">True</property>
|
||||
<signal name="changed" handler="on_required_entry_changed" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label143">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Room:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Server:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label145">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">Password:</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="password_entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="visibility">False</property>
|
||||
<property name="activates_default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="bookmark_checkbutton">
|
||||
<property name="label" translatable="yes">_Bookmark this room</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_bookmark_checkbutton_toggled" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">6</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object 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="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">7</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="box2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="server_comboboxtext">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="has_entry">True</property>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry" id="comboboxtext-entry">
|
||||
<property name="can_focus">True</property>
|
||||
<signal name="changed" handler="on_server_entry_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="browse_rooms_button">
|
||||
<property name="label" translatable="yes">Bro_wse Rooms</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="image">image1</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="on_browse_rooms_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButtonBox" id="buttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<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>
|
||||
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="join_button">
|
||||
<property name="label" translatable="yes">_Join</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="image">image2</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="clicked" handler="on_join_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -2350,7 +2350,6 @@ class SubscriptionRequestWindow:
|
|||
gtkgui_helpers.popup_emoticons_under_button(menu, widget,
|
||||
self.window.get_window())
|
||||
|
||||
|
||||
class JoinGroupchatWindow:
|
||||
def __init__(self, account=None, room_jid='', nick='', password='',
|
||||
automatic=False):
|
||||
|
@ -2580,92 +2579,6 @@ class JoinGroupchatWindow:
|
|||
except GajimGeneralException:
|
||||
pass
|
||||
|
||||
def on_server_entry_changed(self, widget):
|
||||
if not widget.get_text():
|
||||
self.browse_button.set_sensitive(False)
|
||||
else:
|
||||
self.browse_button.set_sensitive(True)
|
||||
|
||||
def on_cancel_button_clicked(self, widget):
|
||||
"""
|
||||
When Cancel button is clicked
|
||||
"""
|
||||
self.window.destroy()
|
||||
|
||||
def on_bookmark_checkbutton_toggled(self, widget):
|
||||
auto_join_checkbutton = self.xml.get_object('auto_join_checkbutton')
|
||||
if widget.get_active():
|
||||
auto_join_checkbutton.set_sensitive(True)
|
||||
else:
|
||||
auto_join_checkbutton.set_sensitive(False)
|
||||
|
||||
def on_join_button_clicked(self, widget):
|
||||
"""
|
||||
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()
|
||||
server = self.server_comboboxtext.get_child().get_text()
|
||||
room = self._room_jid_entry.get_text().strip()
|
||||
room_jid = room + '@' + server
|
||||
password = self._password_entry.get_text()
|
||||
try:
|
||||
nickname = helpers.parse_resource(nickname)
|
||||
except Exception:
|
||||
ErrorDialog(_('Invalid Nickname'),
|
||||
_('The nickname contains invalid characters.'))
|
||||
return
|
||||
user, server, resource = helpers.decompose_jid(room_jid)
|
||||
if not user or not server or resource:
|
||||
ErrorDialog(_('Invalid group chat JID'),
|
||||
_('Please enter the group chat JID as room@server.'))
|
||||
return
|
||||
try:
|
||||
room_jid = helpers.parse_jid(room_jid)
|
||||
except Exception:
|
||||
ErrorDialog(_('Invalid group chat JID'),
|
||||
_('The group chat JID contains invalid characters.'))
|
||||
return
|
||||
|
||||
if app.contacts.get_contact(self.account, room_jid) and \
|
||||
not app.contacts.get_contact(self.account, room_jid).is_groupchat():
|
||||
ErrorDialog(_('This is not a group chat'),
|
||||
_('%(room_jid)s is already in your roster. Please check if '
|
||||
'%(room_jid)s is a correct group chat name. If it is, delete '
|
||||
'it from your roster and try joining the group chat again.') % \
|
||||
{'room_jid': room_jid, 'room_jid': room_jid})
|
||||
return
|
||||
|
||||
full_jid = room_jid + '/' + nickname
|
||||
if full_jid in self.recently_groupchat:
|
||||
self.recently_groupchat.remove(full_jid)
|
||||
self.recently_groupchat.insert(0, full_jid)
|
||||
if len(self.recently_groupchat) > 10:
|
||||
self.recently_groupchat = self.recently_groupchat[0:10]
|
||||
app.config.set('recently_groupchat',
|
||||
' '.join(self.recently_groupchat))
|
||||
|
||||
if self.xml.get_object('bookmark_checkbutton').get_active():
|
||||
if self.xml.get_object('auto_join_checkbutton').get_active():
|
||||
autojoin = '1'
|
||||
else:
|
||||
autojoin = '0'
|
||||
# Add as bookmark, with autojoin and not minimized
|
||||
name = app.get_nick_from_jid(room_jid)
|
||||
app.interface.add_gc_bookmark(self.account, name, room_jid,
|
||||
autojoin, autojoin, password, nickname)
|
||||
|
||||
if self.automatic:
|
||||
app.automatic_rooms[self.account][room_jid] = self.automatic
|
||||
|
||||
app.interface.join_gc_room(self.account, room_jid, nickname, password)
|
||||
|
||||
self.window.destroy()
|
||||
|
||||
class SynchroniseSelectAccountDialog:
|
||||
def __init__(self, account):
|
||||
# 'account' can be None if we are about to create our first one
|
||||
|
|
Loading…
Reference in New Issue