diff --git a/briar-gtk/briar_gtk/actions/window.py b/briar-gtk/briar_gtk/actions/window.py index 5edf1cda32bfa987de4582b9273b1bbaee8ad7b6..e853349762d92c750b887b95ba848fa52ef2136a 100644 --- a/briar-gtk/briar_gtk/actions/window.py +++ b/briar-gtk/briar_gtk/actions/window.py @@ -31,7 +31,6 @@ class WindowActions(Actions): self._setup_open_emoji_menu_action() self._setup_open_main_window_action() self._setup_open_private_chat_action() - self._setup_send_message_action() def _setup_back_to_sidebar_action(self): self._setup_action("back-to-sidebar", None, self._back_to_sidebar) @@ -67,9 +66,6 @@ class WindowActions(Actions): self._setup_action("open-private-chat", GLib.VariantType.new("i"), self._open_private_chat) - def _setup_send_message_action(self): - self._setup_action("send-message", None, self._send_message) - # pylint: disable=unused-argument def _back_to_sidebar(self, action, parameter): if not isinstance(self.widget.current_view, MainWindowView): @@ -122,9 +118,3 @@ class WindowActions(Actions): "Should open private chat only from MainWindowView") self.widget.current_view.presenter.open_private_chat( contact_id.get_int32()) - - # pylint: disable=unused-argument - def _send_message(self, action, parameter): - if not isinstance(self.widget.current_view, MainWindowView): - raise Exception("Should send message only from MainWindowView") - self.widget.current_view.presenter.send_message() diff --git a/briar-gtk/briar_gtk/presenters/main_window.py b/briar-gtk/briar_gtk/presenters/main_window.py index 511b1e746fc6c7c09cc62c59b4bef9a3de5712e5..59a0e3ff4c6e7f2a2201d29af6bc5374f5605141 100644 --- a/briar-gtk/briar_gtk/presenters/main_window.py +++ b/briar-gtk/briar_gtk/presenters/main_window.py @@ -53,10 +53,6 @@ class MainWindowPresenter: self._view.builder, contact_id, self._sidebar_presenter) self._private_chat_presenter = private_chat_view.presenter - def send_message(self): - if isinstance(self._private_chat_presenter, PrivateChatPresenter): - self._private_chat_presenter.send_message() - def _setup_destroy_listener(self): self._view.connect("destroy", self._on_destroy) diff --git a/briar-gtk/briar_gtk/presenters/private_chat.py b/briar-gtk/briar_gtk/presenters/private_chat.py index d6b916a9897a72ec026028409b27a10797a5703b..57f43fbf6c3fc361ff0509dccf60c1c4d3d9df38 100644 --- a/briar-gtk/briar_gtk/presenters/private_chat.py +++ b/briar-gtk/briar_gtk/presenters/private_chat.py @@ -103,15 +103,6 @@ class PrivateChatPresenter: self._hide_chat_menu_button() self._disconnect_chat_entry_signals() - def send_message(self): - chat_entry = self._view.builder.get_object("chat_entry") - # Text does not only contain whitespace - if len(self._get_text_from_text_view(chat_entry).strip()) == 0: - return False - self._send_message(chat_entry) - self._sidebar_presenter.refresh_contacts() - return True - def disconnect_signals(self): for signal in self._signals: APP().api.socket_listener.disconnect(signal) diff --git a/briar-gtk/data/ui/main_window.ui b/briar-gtk/data/ui/main_window.ui index e7c8b386f348f6d71a80e24b051bd03dda91fab6..f9e59aacaafb1a6825f2cfb8570d08e3771f4aaa 100644 --- a/briar-gtk/data/ui/main_window.ui +++ b/briar-gtk/data/ui/main_window.ui @@ -125,39 +125,10 @@ <child> <object class="GtkBox"> <property name="visible">True</property> - <child> - <object class="GtkButton" id="entry_emoji_button"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin-top">3</property> - <property name="margin-bottom">3</property> - <property name="vexpand">False</property> - <property name="valign">start</property> - <property name="relief">none</property> - <property name="action_name">win.open-emoji-menu</property> - <child> - <object class="GtkImage"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="icon_name">face-smile-symbolic</property> - </object> - </child> - <accessibility> - - </accessibility> - <child internal-child="accessible"> - <object class="AtkObject" id="a11y-entry_emoji_button"> - <property name="AtkObject::accessible_name" translatable="yes">Show emojis</property> - </object> - </child> - <style> - <class name="message-input-button" /> - </style> - </object> - </child> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> + <property name="margin">6</property> <property name="propagate_natural_height">True</property> <property name="max_content_height">300</property> <child> @@ -175,7 +146,7 @@ </object> </child> <child> - <object class="GtkButton" id="entry_send_button"> + <object class="GtkButton" id="entry_emoji_button"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin-top">3</property> @@ -183,20 +154,20 @@ <property name="vexpand">False</property> <property name="valign">start</property> <property name="relief">none</property> - <property name="action_name">win.send-message</property> + <property name="action_name">win.open-emoji-menu</property> <child> <object class="GtkImage"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="icon_name">media-playback-start</property> + <property name="icon_name">face-smile-symbolic</property> </object> </child> <accessibility> </accessibility> <child internal-child="accessible"> - <object class="AtkObject" id="a11y-entry_send_button"> - <property name="AtkObject::accessible_name" translatable="yes">Send</property> + <object class="AtkObject" id="a11y-entry_emoji_button"> + <property name="AtkObject::accessible_name" translatable="yes">Show emojis</property> </object> </child> <style>