diff --git a/briar-gtk/briar_gtk/actions/window.py b/briar-gtk/briar_gtk/actions/window.py index 2a3acd977197c3dffc621063cff9aa093091ed25..bb79c2f162709cca0f28b7b05992c60bc74e2f33 100644 --- a/briar-gtk/briar_gtk/actions/window.py +++ b/briar-gtk/briar_gtk/actions/window.py @@ -23,6 +23,7 @@ class WindowActions(Actions): def _setup_actions(self): self._setup_back_to_sidebar_action() + self._setup_delete_contact_action() self._setup_open_about_page_action() self._setup_open_add_contact_action() self._setup_open_main_window_action() @@ -34,6 +35,9 @@ class WindowActions(Actions): f"{WINDOW_PREFIX}.back-to-sidebar", ["<Ctrl>w"] ) + def _setup_delete_contact_action(self): + self._setup_action("delete-contact", None, self._delete_contact) + def _setup_open_about_page_action(self): self._setup_action("open-about-dialog", None, self._open_about_page) @@ -52,6 +56,10 @@ class WindowActions(Actions): if isinstance(self.widget.current_container, MainWindowContainer): self.widget.current_container.show_sidebar() + # pylint: disable=unused-argument + def _delete_contact(self, action, parameter): + print("I should delete that contact now...") + # pylint: disable=unused-argument def _open_about_page(self, action, parameter): self.widget.current_container.open_about_page() diff --git a/briar-gtk/briar_gtk/containers/main_window.py b/briar-gtk/briar_gtk/containers/main_window.py index d96b4f1e93f02a578aa4f0a926ab958860f85af0..a42187ceb8c3a94785b909f49a35f571fd951517 100644 --- a/briar-gtk/briar_gtk/containers/main_window.py +++ b/briar-gtk/briar_gtk/containers/main_window.py @@ -19,7 +19,8 @@ from briar_gtk.widgets.contact_row import ContactRowWidget class MainWindowContainer(Container): CONTAINER_UI = "main_window.ui" - MENU_UI = "main_menu.ui" + MAIN_MENU_UI = "main_menu.ui" + CHAT_MENU_UI = "chat_menu.ui" def __init__(self): super().__init__() @@ -131,7 +132,8 @@ class MainWindowContainer(Container): del self._selected_contact def _setup_view(self): - self._add_from_resource(self.MENU_UI) + self._add_from_resource(self.MAIN_MENU_UI) + self._add_from_resource(self.CHAT_MENU_UI) self._add_from_resource(self.CONTAINER_UI) self.builder.connect_signals(self) diff --git a/briar-gtk/data/ui/app.briar.gtk.gresource.xml b/briar-gtk/data/ui/app.briar.gtk.gresource.xml index ad294a08778673a120adeef609c14814187d78b8..6767e4c02d9983d6c1dd3acf90a61f01e5eec70f 100644 --- a/briar-gtk/data/ui/app.briar.gtk.gresource.xml +++ b/briar-gtk/data/ui/app.briar.gtk.gresource.xml @@ -3,6 +3,7 @@ <gresource prefix="/app/briar/gtk"> <file compressed="true">application.css</file> <file compressed="true" preprocess="xml-stripblanks">add_contact.ui</file> + <file compressed="true" preprocess="xml-stripblanks">chat_menu.ui</file> <file compressed="true" preprocess="xml-stripblanks">login.ui</file> <file compressed="true" preprocess="xml-stripblanks">main_menu.ui</file> <file compressed="true" preprocess="xml-stripblanks">main_window.ui</file> diff --git a/briar-gtk/data/ui/chat_menu.ui b/briar-gtk/data/ui/chat_menu.ui new file mode 100644 index 0000000000000000000000000000000000000000..619ecbcd4b6813111cc83cf99178f8c642729c83 --- /dev/null +++ b/briar-gtk/data/ui/chat_menu.ui @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (c) 2020 Nico Alt + SPDX-License-Identifier: AGPL-3.0-only + License-Filename: LICENSE.md + + Based on parts of GNOME Fractal + https://gitlab.gnome.org/GNOME/fractal/-/blob/4.2.2/fractal-gtk/res/ui/main_menu.ui +--> +<interface> + <requires lib="gtk+" version="3.20"/> + <object class="GtkPopoverMenu" id="chat_menu_popover"> + <property name="can_focus">False</property> + <child> + <object class="GtkBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">6</property> + <property name="margin_right">6</property> + <property name="margin_top">6</property> + <property name="margin_bottom">6</property> + <property name="orientation">vertical</property> + <property name="width_request">200</property> + <child> + <object class="GtkModelButton" id="delete-menu-entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="action_name">win.delete-contact</property> + <property name="text" translatable="yes">Delete contact</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + </object> + <packing> + <property name="submenu">main</property> + <property name="position">1</property> + </packing> + </child> + </object> +</interface> + diff --git a/briar-gtk/data/ui/main_window.ui b/briar-gtk/data/ui/main_window.ui index 7392d68dc061a04dc4905709ff614672e054d725..b69c5d35298c9844b616efbb772f7a84cc768b4f 100644 --- a/briar-gtk/data/ui/main_window.ui +++ b/briar-gtk/data/ui/main_window.ui @@ -362,6 +362,33 @@ </child> </object> </child> + <child> + <object class="GtkMenuButton" id="chat_menu_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="popover">chat_menu_popover</property> + <child> + <object class="GtkImage"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="icon_name">open-menu-symbolic</property> + </object> + </child> + <accessibility> + + </accessibility> + <child internal-child="accessible"> + <object class="AtkObject" id="a11y-chat_menu_button"> + <property name="AtkObject::accessible_name" translatable="yes">Chat menu</property> + </object> + </child> + </object> + <packing> + <property name="pack_type">end</property> + <property name="position">0</property> + </packing> + </child> </object> <packing> <property name="name">main_content</property> diff --git a/briar-gtk/po/ar.po b/briar-gtk/po/ar.po index 782ad2553cecfc5e02222f879149e27efff3ded5..404053f46fc789dc1e8c8147926a4cd5c65014c8 100644 --- a/briar-gtk/po/ar.po +++ b/briar-gtk/po/ar.po @@ -91,6 +91,9 @@ msgstr "Ø¥Ø¶Ø§ÙØ© جهة إتصال" msgid "Next" msgstr "التالي" +msgid "Delete contact" +msgstr "" + msgid "Password" msgstr "كلمة السّر" @@ -122,6 +125,9 @@ msgstr "" msgid "Back" msgstr "" +msgid "Chat menu" +msgstr "" + msgid "Welcome to Briar" msgstr "Ù…Ø±ØØ¨Ù‹Ø§ بك ÙÙŠ Briar (براير)" diff --git a/briar-gtk/po/briar-gtk.pot b/briar-gtk/po/briar-gtk.pot index b2cd6d963fabfd5f147e98f9a17358f6090616c1..58e3a745df3e2c189e9e8819f50b13a8536b7eae 100644 --- a/briar-gtk/po/briar-gtk.pot +++ b/briar-gtk/po/briar-gtk.pot @@ -101,6 +101,9 @@ msgstr "" msgid "Next" msgstr "" +msgid "Delete contact" +msgstr "" + msgid "Password" msgstr "" @@ -132,6 +135,9 @@ msgstr "" msgid "Back" msgstr "" +msgid "Chat menu" +msgstr "" + msgid "Welcome to Briar" msgstr "" diff --git a/briar-gtk/po/de.po b/briar-gtk/po/de.po index 7f86571e88486bcfb3ff2124748cb148a13abedc..94f88a8f0f021706f4516134d1fddc01f0ac95f8 100644 --- a/briar-gtk/po/de.po +++ b/briar-gtk/po/de.po @@ -91,6 +91,9 @@ msgstr "Kontak hinzufügen" msgid "Next" msgstr "Weiter" +msgid "Delete contact" +msgstr "Kontakt entfernen" + msgid "Password" msgstr "Passwort" @@ -122,6 +125,9 @@ msgstr "Hauptmenü" msgid "Back" msgstr "Zurück" +msgid "Chat menu" +msgstr "Chat-Menü" + msgid "Welcome to Briar" msgstr "Willkommen bei Briar" diff --git a/briar-gtk/po/es.po b/briar-gtk/po/es.po index a03539e880deeb97870588877c89081bd3e9ae73..f39535b1feda8bec2a8f43dc51c09f7567cbc79e 100644 --- a/briar-gtk/po/es.po +++ b/briar-gtk/po/es.po @@ -91,6 +91,9 @@ msgstr "Añadir el contacto" msgid "Next" msgstr "Seguir" +msgid "Delete contact" +msgstr "Eliminar contacto" + msgid "Password" msgstr "Contraseña" @@ -122,6 +125,9 @@ msgstr "Menú principal" msgid "Back" msgstr "Regresar" +msgid "Chat menu" +msgstr "Menú chat" + msgid "Welcome to Briar" msgstr "Bienvenida a Briar" diff --git a/briar-wrapper b/briar-wrapper index e851a46c77350ddce4d21d1112c931438579f131..df60279f98a3d954ebcaaca92192c5078304b666 160000 --- a/briar-wrapper +++ b/briar-wrapper @@ -1 +1 @@ -Subproject commit e851a46c77350ddce4d21d1112c931438579f131 +Subproject commit df60279f98a3d954ebcaaca92192c5078304b666