mirror of
https://github.com/Snigdha-OS/snigdhaos-blackbox.git
synced 2025-09-21 20:15:02 +02:00
show_in_app_notification(), restart_program()
This commit is contained in:

committed by
GitHub

parent
b6e4aea78f
commit
d9746d8567
@@ -1911,3 +1911,23 @@ def cache_btn():
|
||||
|
||||
logger.debug("Caching applications finished")
|
||||
|
||||
def restart_program():
|
||||
os.unlink("/tmp/blackbox.lock")
|
||||
python = sys.executable
|
||||
os.execl(python, python, *sys.argv)
|
||||
|
||||
def show_in_app_notification(self, message, err):
|
||||
if self.timeout_id is not None:
|
||||
GLib.source_remove(self.timeout_id)
|
||||
self.timeout_id = None
|
||||
|
||||
if err is True:
|
||||
self.notification_label.set_markup(
|
||||
'<span background="yellow" foreground="black">' + message + "</span>"
|
||||
)
|
||||
else:
|
||||
self.notification_label.set_markup(
|
||||
'<span foreground="white">' + message + "</span>"
|
||||
)
|
||||
self.notification_revealer.set_reveal_child(True)
|
||||
self.timeout_id = GLib.timeout_add(3000, timeout, self)
|
||||
|
Reference in New Issue
Block a user