Commit a5654d95 authored by John Stowers's avatar John Stowers

Make logout notification persistant

parent 4acf82ac
......@@ -23,7 +23,7 @@ from gi.repository import Gtk, Gdk, GObject
import gtweak.tweakmodel
from gtweak.tweakmodel import TweakModel
from gtweak.utils import Notification
from gtweak.utils import LogoutNotification
from gtweak.widgets import Title
DEFAULT_TWEAKGROUP = gtweak.tweakmodel.TWEAK_GROUP_APPEARANCE
......@@ -232,8 +232,12 @@ class Window(Gtk.ApplicationWindow):
#the main window
if need_logout:
notification = Notification()
notification.show()
try:
notification = LogoutNotification()
notification.show()
return
except:
pass
info = Gtk.InfoBar()
info.get_content_area().add(Gtk.Label(desc))
......
......@@ -312,14 +312,23 @@ class XSettingsOverrides:
def get_enable_primary_paste(self):
self._get_override('Gtk/EnablePrimaryPaste', True)
class Notification:
def __init__(self):
class LogoutNotification:
def __init__(self):
self.notification = None
if Notify.is_initted() or Notify.init("GNOME Tweak Tool"):
self.notification = Notify.Notification.new("Configuration changes requiere restart","Your session needs to be restarted for settings to take effect", 'gnome-tweak-tool')
self.notification.add_action("restart", "Restart Session",self.logout,None,None)
self.notification.add_action(
"restart",
"Restart Session",
self.logout,None,None)
self.notification.set_hint(
"resident",
GLib.Variant('b', True))
self.notification.set_hint(
"desktop-entry",
GLib.Variant('s', 'gnome-tweak-tool'))
else:
print "Error: Could not create the notification"
raise Exception("Not Supported")
def show(self):
if self.notification:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment