From 94c26a76dc7bcf9615813f1e4302fd66f320d137 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Sat, 30 Dec 2023 19:24:58 +0100 Subject: [PATCH] Add copy notification --- ui/autofill.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/autofill.py b/ui/autofill.py index 9c05f2b..dbe1489 100644 --- a/ui/autofill.py +++ b/ui/autofill.py @@ -3,12 +3,13 @@ gi.require_version('Adw', '1') import gc import time -from gi.repository import Gtk, Adw, GLib +from gi.repository import Gtk, Adw, GLib, Notify import goldwarden import clipboard from threading import Thread import sys import os +Notify.init("Goldwarden") class MyApp(Adw.Application): def __init__(self, **kwargs): @@ -93,9 +94,13 @@ def do_autotype(username, password): if keyval == 112: print("copy password") clipboard.write(self.history_list.get_selected_row().password) + Notify.Notification.new("Goldwarden", "Password Copied", "dialog-information").show() elif keyval == 117: print("copy username") clipboard.write(self.history_list.get_selected_row().username) + notification=Notify.Notification.new("Goldwarden", "Username Copied", "dialog-information") + notification.set_timeout(5) + notification.show() keycont.connect('key-pressed', handle_keypress, self) self.add_controller(keycont)