From ef748c6d46d70a53ce8754dbce75d61e42071e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Tue, 3 Oct 2017 00:02:45 +0200 Subject: [PATCH] Remove send button --- gajim/chat_control.py | 10 ---------- gajim/chat_control_base.py | 20 -------------------- gajim/data/gui/chat_control.ui | 27 ++------------------------- gajim/data/gui/groupchat_control.ui | 25 ++----------------------- gajim/groupchat_control.py | 6 ------ 5 files changed, 4 insertions(+), 84 deletions(-) diff --git a/gajim/chat_control.py b/gajim/chat_control.py index fa4b03557..a05641c7c 100644 --- a/gajim/chat_control.py +++ b/gajim/chat_control.py @@ -324,11 +324,6 @@ class ChatControl(ChatControlBase): app.events.event_removed_unsubscribe(self.on_event_removed) def _update_toolbar(self): - if (app.connections[self.account].connected > 1 and not \ - self.TYPE_ID == 'pm') or (self.contact.show != 'offline' and \ - self.TYPE_ID == 'pm'): - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(True) # Formatting # TODO: find out what encryption allows for xhtml and which not if self.contact.supports(NS_XHTML_IM): @@ -1648,13 +1643,8 @@ class ChatControl(ChatControlBase): if contact: self.contact = contact self.draw_banner() - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(True) def got_disconnected(self): - # Emoticons button - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(False) # Add to roster self._add_to_roster_button.hide() # Audio button diff --git a/gajim/chat_control_base.py b/gajim/chat_control_base.py index c4c3cbae6..c1a0b30fa 100644 --- a/gajim/chat_control_base.py +++ b/gajim/chat_control_base.py @@ -353,12 +353,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): self.msg_textview.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT, self.dnd_list, Gdk.DragAction.COPY) - # Hook up send button - widget = self.xml.get_object('send_button') - id_ = widget.connect('clicked', self._on_send_button_clicked) - widget.set_sensitive(False) - self.handlers[id_] = widget - # the following vars are used to keep history of user's messages self.sent_history = [] self.sent_history_pos = 0 @@ -566,20 +560,6 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): if event.button == 3: # right click self.parent_win.popup_menu(event) - def _on_send_button_clicked(self, widget): - """ - When send button is pressed: send the current message - """ - message_buffer = self.msg_textview.get_buffer() - emoticons.replace_with_codepoint(message_buffer) - start_iter = message_buffer.get_start_iter() - end_iter = message_buffer.get_end_iter() - message = message_buffer.get_text(start_iter, end_iter, False) - xhtml = self.msg_textview.get_xhtml() - - # send the message - self.send_message(message, xhtml=xhtml) - def _conv_textview_key_press_event(self, widget, event): # translate any layout to latin_layout valid, entries = self.keymap.get_entries_for_keyval(event.keyval) diff --git a/gajim/data/gui/chat_control.ui b/gajim/data/gui/chat_control.ui index bab728ca0..68d69a2eb 100644 --- a/gajim/data/gui/chat_control.ui +++ b/gajim/data/gui/chat_control.ui @@ -1,7 +1,7 @@ - + 110 1 @@ -358,11 +358,6 @@ - - True - False - gtk-jump-to - True 7 @@ -1055,25 +1050,7 @@ audio-mic-volume-low - - _Send - 80 - True - True - True - True - Send message - Send message - image4 - True - True - - - False - True - end - 15 - + diff --git a/gajim/data/gui/groupchat_control.ui b/gajim/data/gui/groupchat_control.ui index d6019f4ea..4483f31d8 100644 --- a/gajim/data/gui/groupchat_control.ui +++ b/gajim/data/gui/groupchat_control.ui @@ -1,12 +1,7 @@ - - - True - False - gtk-jump-to - + True @@ -438,23 +433,7 @@ - - _Send - 80 - True - True - True - Send message - image1 - True - True - - - False - False - end - 11 - + diff --git a/gajim/groupchat_control.py b/gajim/groupchat_control.py index 39f4121bf..af20f9e8f 100644 --- a/gajim/groupchat_control.py +++ b/gajim/groupchat_control.py @@ -296,8 +296,6 @@ class GroupchatControl(ChatControlBase): # Keep error dialog instance to be sure to have only once at a time self.error_dialog = None - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(False) self.actions_button = self.xml.get_object('muc_window_actions_button') id_ = self.actions_button.connect('clicked', @@ -1439,8 +1437,6 @@ class GroupchatControl(ChatControlBase): if self.parent_win: self.parent_win.redraw_tab(self) - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(True) formattings_button = self.xml.get_object('formattings_button') formattings_button.set_sensitive(True) change_nick_button = self.xml.get_object('change_nick_button') @@ -1449,8 +1445,6 @@ class GroupchatControl(ChatControlBase): change_subject_button.set_sensitive(True) def got_disconnected(self): - send_button = self.xml.get_object('send_button') - send_button.set_sensitive(False) formattings_button = self.xml.get_object('formattings_button') formattings_button.set_sensitive(False) change_nick_button = self.xml.get_object('change_nick_button')