Commit ef748c6d authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Remove send button

parent e7d1a2d5
......@@ -324,11 +324,6 @@ def unsubscribe_events(self):
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 @@ def got_connected(self):
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
......
......@@ -353,12 +353,6 @@ def __init__(self, type_id, parent_win, widget_name, contact, acct,
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 @@ def _on_banner_eventbox_button_press_event(self, widget, event):
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)
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<requires lib="gtk+" version="3.20"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">110</property>
<property name="step_increment">1</property>
......@@ -358,11 +358,6 @@
</object>
</child>
</object>
<object class="GtkImage" id="image4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-jump-to</property>
</object>
<object class="GtkBox" id="chat_control_hbox">
<property name="can_focus">True</property>
<property name="margin_left">7</property>
......@@ -1055,25 +1050,7 @@ audio-mic-volume-low</property>
</packing>
</child>
<child>
<object class="GtkButton" id="send_button">
<property name="label" translatable="yes">_Send</property>
<property name="width_request">80</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="has_tooltip">True</property>
<property name="tooltip_markup" translatable="yes">Send message</property>
<property name="tooltip_text" translatable="yes">Send message</property>
<property name="image">image4</property>
<property name="use_underline">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">15</property>
</packing>
<placeholder/>
</child>
<child>
<placeholder/>
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<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-jump-to</property>
</object>
<requires lib="gtk+" version="3.20"/>
<object class="GtkBox" id="groupchat_control_hbox">
<property name="can_focus">True</property>
<child>
......@@ -438,23 +433,7 @@
</packing>
</child>
<child>
<object class="GtkButton" id="send_button">
<property name="label" translatable="yes">_Send</property>
<property name="width_request">80</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Send message</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
<property name="always_show_image">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="pack_type">end</property>
<property name="position">11</property>
</packing>
<placeholder/>
</child>
<child>
<placeholder/>
......
......@@ -296,8 +296,6 @@ def __init__(self, parent_win, contact, acct, is_continued=False):
# 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 @@ def got_connected(self):
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 @@ def got_connected(self):
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')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment