diff --git a/main.py b/main.py index 318069a..a85e595 100644 --- a/main.py +++ b/main.py @@ -21,8 +21,8 @@ def clickMethod(self): } for k, v in settings.items(): - if v == '': - v = None + if v == "": + settings[k] = None with open("./.data/settings.json", "w+") as file: json.dump(settings, file) @@ -119,6 +119,8 @@ def retranslateUi(self, Dialog): class Tray(QSystemTrayIcon): def __init__(self, icon, parent, Dialog): + QSystemTrayIcon.__init__(self, icon, parent) + try: with open("./.data/settings.json", "r+") as file: self.settings = json.load(file) @@ -126,8 +128,6 @@ def __init__(self, icon, parent, Dialog): Dialog.show() return - QSystemTrayIcon.__init__(self, icon, parent) - menu = QMenu(parent) self.presence = Presence(self.settings["ApplicationID"])