Simplify change_autostart()
parent
5bafe3c7c7
commit
7ee76863f9
|
@ -148,18 +148,15 @@ class ManjaroHello():
|
||||||
for page in ("readme", "release", "involved"):
|
for page in ("readme", "release", "involved"):
|
||||||
self.builder.get_object(page + "label").set_markup(self.read_page(page))
|
self.builder.get_object(page + "label").set_markup(self.read_page(page))
|
||||||
|
|
||||||
def change_autostart(self, state):
|
def change_autostart(self, autostart):
|
||||||
if state and not os.path.isfile(self.autostart_path):
|
try:
|
||||||
try:
|
if autostart and not os.path.isfile(self.autostart_path):
|
||||||
os.symlink(self.desktop_path, self.autostart_path)
|
os.symlink(self.desktop_path, self.autostart_path)
|
||||||
except OSError as e:
|
elif not autostart and os.path.isfile(self.autostart_path):
|
||||||
print(e)
|
|
||||||
elif not state and os.path.isfile(self.autostart_path):
|
|
||||||
try:
|
|
||||||
os.unlink(self.autostart_path)
|
os.unlink(self.autostart_path)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(e)
|
print(e)
|
||||||
self.preferences["autostart"] = state
|
self.preferences["autostart"] = autostart
|
||||||
self.save_preferences()
|
self.save_preferences()
|
||||||
|
|
||||||
def save_preferences(self):
|
def save_preferences(self):
|
||||||
|
|
Loading…
Reference in New Issue