From d814a4234542794f878f82ac49b1101d3d6623e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Thu, 30 Nov 2017 17:53:13 +0100 Subject: [PATCH] Remove old JoinGroupchat dialog --- gajim/data/gui/join_groupchat_window.ui | 302 ------------------------ gajim/dialogs.py | 87 ------- 2 files changed, 389 deletions(-) delete mode 100644 gajim/data/gui/join_groupchat_window.ui diff --git a/gajim/data/gui/join_groupchat_window.ui b/gajim/data/gui/join_groupchat_window.ui deleted file mode 100644 index 9ba120367..000000000 --- a/gajim/data/gui/join_groupchat_window.ui +++ /dev/null @@ -1,302 +0,0 @@ - - - - - - True - False - gtk-find - - - True - False - gtk-apply - - - False - 6 - Join Group Chat - False - dialog - - - - - True - False - vertical - 12 - - - True - False - 6 - 12 - - - True - True - True - - - - 1 - 3 - - - - - False - True - Account - 0 - - - 0 - 0 - - - - - False - True - - - - 1 - 0 - - - - - True - False - Recently: - 0 - - - 0 - 1 - - - - - True - False - - - - 1 - 1 - - - - - True - False - Nickname: - 0 - - - 0 - 2 - - - - - True - True - True - - - - 1 - 2 - - - - - True - False - Room: - 0 - - - 0 - 3 - - - - - True - False - Server: - 0 - - - 0 - 4 - - - - - True - False - Password: - 0 - - - 0 - 5 - - - - - True - True - False - True - - - 1 - 5 - - - - - _Bookmark this room - True - True - False - True - 0 - True - - - - 0 - 6 - 2 - - - - - Join this room _automatically when I connect - True - False - True - False - True - 0 - True - - - 0 - 7 - 2 - - - - - True - False - 6 - - - True - False - True - - - True - - - - - - True - True - 0 - - - - - Bro_wse Rooms - True - True - True - image1 - True - - - - False - True - end - 1 - - - - - 1 - 4 - - - - - False - True - 0 - - - - - True - False - 12 - end - - - gtk-cancel - True - True - True - False - True - - - - False - False - 0 - - - - - _Join - True - True - True - True - False - image2 - True - - - - False - False - 1 - - - - - False - True - 1 - - - - - - diff --git a/gajim/dialogs.py b/gajim/dialogs.py index 6f6968389..5a9cd867c 100644 --- a/gajim/dialogs.py +++ b/gajim/dialogs.py @@ -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