Add copy notification
This commit is contained in:
parent
0e7561bd61
commit
94c26a76dc
1 changed files with 6 additions and 1 deletions
|
|
@ -3,12 +3,13 @@ gi.require_version('Gtk', '4.0')
|
||||||
gi.require_version('Adw', '1')
|
gi.require_version('Adw', '1')
|
||||||
import gc
|
import gc
|
||||||
import time
|
import time
|
||||||
from gi.repository import Gtk, Adw, GLib
|
from gi.repository import Gtk, Adw, GLib, Notify
|
||||||
import goldwarden
|
import goldwarden
|
||||||
import clipboard
|
import clipboard
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
Notify.init("Goldwarden")
|
||||||
|
|
||||||
class MyApp(Adw.Application):
|
class MyApp(Adw.Application):
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
|
@ -93,9 +94,13 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||||
if keyval == 112:
|
if keyval == 112:
|
||||||
print("copy password")
|
print("copy password")
|
||||||
clipboard.write(self.history_list.get_selected_row().password)
|
clipboard.write(self.history_list.get_selected_row().password)
|
||||||
|
Notify.Notification.new("Goldwarden", "Password Copied", "dialog-information").show()
|
||||||
elif keyval == 117:
|
elif keyval == 117:
|
||||||
print("copy username")
|
print("copy username")
|
||||||
clipboard.write(self.history_list.get_selected_row().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)
|
keycont.connect('key-pressed', handle_keypress, self)
|
||||||
self.add_controller(keycont)
|
self.add_controller(keycont)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue