Commit f303a4e4 authored by Nico Alt's avatar Nico Alt
Browse files

Make emoji button in chat input work

parent 5868cc0b
......@@ -28,6 +28,7 @@ class WindowActions(Actions):
self._setup_change_alias_contact_action()
self._setup_open_about_page_action()
self._setup_open_add_contact_action()
self._setup_open_emoji_menu_action()
self._setup_open_main_window_action()
self._setup_open_private_chat_action()
......@@ -55,6 +56,9 @@ class WindowActions(Actions):
def _setup_open_add_contact_action(self):
self._setup_action("open-add-contact", None, self._open_add_contact)
def _setup_open_emoji_menu_action(self):
self._setup_action("open-emoji-menu", None, self._open_emoji_menu)
def _setup_open_main_window_action(self):
self._setup_action("open-main-window", None, self._open_main_window)
......@@ -97,6 +101,12 @@ class WindowActions(Actions):
def _open_add_contact(self, action, parameter):
self.widget.show_add_contact_view()
# pylint: disable=unused-argument
def _open_emoji_menu(self, action, parameter):
if not isinstance(self.widget.current_view, MainWindowView):
raise Exception("Should open emoji menu only from MainWindowView")
self.widget.current_view.presenter.open_emoji_menu()
# pylint: disable=unused-argument
def _open_main_window(self, action, parameter):
self.widget.show_main_window_view()
......
......@@ -38,6 +38,10 @@ class MainWindowPresenter:
if isinstance(self._private_chat_presenter, PrivateChatPresenter):
self._private_chat_presenter.open_delete_contact_dialog()
def open_emoji_menu(self):
if isinstance(self._private_chat_presenter, PrivateChatPresenter):
self._private_chat_presenter.open_emoji_menu()
def close_private_chat(self):
if isinstance(self._private_chat_presenter, PrivateChatPresenter):
self._private_chat_presenter.close_private_chat()
......
......@@ -86,6 +86,10 @@ class PrivateChatPresenter:
confirmation_dialog.connect("response", self._delete_contact)
confirmation_dialog.show_all()
def open_emoji_menu(self):
chat_entry = self._view.builder.get_object("chat_entry")
chat_entry.emit("insert-emoji")
def close_private_chat(self): # formerly `show_sidebar`
main_content_stack = self._view.builder.get_object(
"main_content_stack")
......
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