diff --git a/briar-gtk/briar_gtk/containers/main_window.py b/briar-gtk/briar_gtk/containers/main_window.py index 911181d964b7dcea1255939b2d74112501acf198..5ead622df71f7d063667f31d58135b9210ce2207 100644 --- a/briar-gtk/briar_gtk/containers/main_window.py +++ b/briar-gtk/briar_gtk/containers/main_window.py @@ -15,7 +15,6 @@ from briar_gtk.containers.private_chat import PrivateChatContainer from briar_gtk.define import APP from briar_gtk.widgets.about_dialog import AboutDialogWidget from briar_gtk.widgets.contact_row import ContactRowWidget -from briar_gtk.widgets.undo_notification import UndoNotification class MainWindowContainer(Container): @@ -93,17 +92,9 @@ class MainWindowContainer(Container): if self._current_contact_id == 0: raise Exception("Can't delete contact with ID 0") - def _timeout_action(): - Contacts(APP().api).delete(self._current_contact_id) - self._refresh_contacts() - self.show_sidebar() - - notification = UndoNotification( - _("Contact will be deleted"), - _timeout_action) - self.add_overlay(notification) - notification.show() - notification.set_reveal_child(True) + Contacts(APP().api).delete(self._current_contact_id) + self._refresh_contacts() + self.show_sidebar() def _prepare_chat_view(self, contact_name): if self._no_chat_opened(): diff --git a/briar-gtk/briar_gtk/widgets/undo_notification.py b/briar-gtk/briar_gtk/widgets/undo_notification.py deleted file mode 100644 index ce5b3ce9b807d8a0d7b7585ccc6156a853ee61e0..0000000000000000000000000000000000000000 --- a/briar-gtk/briar_gtk/widgets/undo_notification.py +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) 2020 Nico Alt -# Copyright (c) 2014-2020 Cedric Bellegarde <cedric.bellegarde@adishatz.org> -# SPDX-License-Identifier: AGPL-3.0-only -# License-Filename: LICENSE.md -# -# Initial version based on GNOME Lollypop -# https://gitlab.gnome.org/World/lollypop/-/blob/1.3.6/lollypop/app_notification.py - -from gettext import gettext as _ -from gi.repository import Gtk, GLib, Pango - - -class UndoNotification(Gtk.Revealer): - - _TIMEOUT = 5000 - - _execute_action = True - - def __init__(self, message, timeout_action): - """ - Implementation of - https://developer.gnome.org/hig/stable/in-app-notifications.html.en - - Parameters - ========== - message: str - timeout_action: callback - """ - Gtk.Revealer.__init__(self) - widget = Gtk.Grid() - widget.get_style_context().add_class("app-notification") - widget.set_column_spacing(5) - label = Gtk.Label.new(message) - label.set_line_wrap_mode(Pango.WrapMode.WORD) - label.set_line_wrap(True) - widget.add(label) - - button = Gtk.Button.new() - button.set_label(_("Undo")) - button.connect("clicked", self._on_undo_clicked) - button.set_property("valign", Gtk.Align.START) - widget.add(button) - widget.show_all() - self.add(widget) - self.set_property("halign", Gtk.Align.CENTER) - self.set_property("valign", Gtk.Align.START) - GLib.timeout_add(self._TIMEOUT, self._on_destroy, timeout_action) - - # pylint: disable=unused-argument - def _on_undo_clicked(self, button, action=None): - self._execute_action = False - self.destroy() - - # pylint: disable=unused-argument - def _on_destroy(self, action): - if self._execute_action: - action() - self.destroy() diff --git a/briar-gtk/po/ar.po b/briar-gtk/po/ar.po index cbcdc1b512fc84d1352d7df149459e0d6a6027ab..3fb8ce273a32e6d22c2d066adfe1b2bdd105e399 100644 --- a/briar-gtk/po/ar.po +++ b/briar-gtk/po/ar.po @@ -152,12 +152,6 @@ msgstr "" msgid "Myself" msgstr "" -msgid "Undo" -msgstr "" - -msgid "Contact will be deleted" -msgstr "" - msgid "Please enter a password" msgstr "" diff --git a/briar-gtk/po/briar-gtk.pot b/briar-gtk/po/briar-gtk.pot index 453ed04c8046b902e7ef0a896b7bba42eaf64da6..38b008ad94730ec3ec3ee83efc6a30038aa9f889 100644 --- a/briar-gtk/po/briar-gtk.pot +++ b/briar-gtk/po/briar-gtk.pot @@ -162,12 +162,6 @@ msgstr "" msgid "Myself" msgstr "" -msgid "Undo" -msgstr "" - -msgid "Contact will be deleted" -msgstr "" - msgid "Please enter a password" msgstr "" diff --git a/briar-gtk/po/de.po b/briar-gtk/po/de.po index eeee68b9c0b978bfad19780d9d60b6ae99991fa0..69ae0417522fab5d028571f0d6e059499e4f08ff 100644 --- a/briar-gtk/po/de.po +++ b/briar-gtk/po/de.po @@ -152,12 +152,6 @@ msgstr "Briar-Funktionalität von" msgid "Myself" msgstr "Ich" -msgid "Undo" -msgstr "Rückgängig machen" - -msgid "Contact will be deleted" -msgstr "Kontakt wird gelöscht" - msgid "Please enter a password" msgstr "Bitte gib ein Passwort ein" @@ -178,3 +172,9 @@ msgstr "Bitte gib einen Link ein" msgid "Enter your contact's link, not your own" msgstr "Gib den Link deines Kontakts ein, nicht deinen eigenen" + +#~ msgid "Undo" +#~ msgstr "Rückgängig machen" + +#~ msgid "Contact will be deleted" +#~ msgstr "Kontakt wird gelöscht" diff --git a/briar-gtk/po/es.po b/briar-gtk/po/es.po index a947760680bd134303b10f648a62a26a3df31c01..1c9cfd18a1c9c5dacdfe130e8ebcb1bdced441f1 100644 --- a/briar-gtk/po/es.po +++ b/briar-gtk/po/es.po @@ -152,12 +152,6 @@ msgstr "Funcionalidad de Briar de" msgid "Myself" msgstr "Yo" -msgid "Undo" -msgstr "Deshacer" - -msgid "Contact will be deleted" -msgstr "Contacto será eliminado" - msgid "Please enter a password" msgstr "Por favor, introduce una contraseña" @@ -178,3 +172,9 @@ msgstr "Introduce un enlace, por favor" msgid "Enter your contact's link, not your own" msgstr "Introduce el enlace del contacto, no el de ti" + +#~ msgid "Undo" +#~ msgstr "Deshacer" + +#~ msgid "Contact will be deleted" +#~ msgstr "Contacto será eliminado"