summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2018-12-09 10:38:35 +0100
committerPapoteur <papoteur@mageia.org>2018-12-17 10:19:29 +0100
commit86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c (patch)
treebcb7023285a3f07053fb1c5fb347cefe6cbfa4df
parent17e9e64cfced1efa89aac1599d5b50a718bff38e (diff)
downloadmageiawelcome-86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c.tar
mageiawelcome-86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c.tar.gz
mageiawelcome-86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c.tar.bz2
mageiawelcome-86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c.tar.xz
mageiawelcome-86bb8ab5bcd4c8920fbe24576e97669d8bd8e84c.zip
Manage checkbox norun at launch
-rw-r--r--qml/mw-ui.qml1
-rw-r--r--qml/mw.py17
2 files changed, 10 insertions, 8 deletions
diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml
index 69ac115..27f2943 100644
--- a/qml/mw-ui.qml
+++ b/qml/mw-ui.qml
@@ -757,6 +757,7 @@ It is highly recommended that you update your system regularly. An Update icon w
CheckBox {
text: qsTr("Show this window at startup")
checked: startupcheck
+ onClicked: norun.setRunAtLaunch(checked)
}
}
}
diff --git a/qml/mw.py b/qml/mw.py
index 5608ca1..09d975b 100644
--- a/qml/mw.py
+++ b/qml/mw.py
@@ -91,15 +91,16 @@ class Norun(QObject):
self.conffile = self.home + "/.config/mageiawelcome/norun.flag"
print(self.conffile, os.path.exists(self.conffile))
- @pyqtSlot()
- def setRunAtLaunch(self):
- if os.path.exists(self.conffile):
+ @pyqtSlot(bool)
+ def setRunAtLaunch(self, checked):
+ print("Setting",checked)
+ if checked:
+ if os.path.exists(self.conffile):
os.remove( self.conffile)
- @pyqtSlot()
- def setNoRunAtLaunch(self):
- os.makedirs(self.home + "/.config/mageiawelcome", exist_ok=True)
- with open( self.conffile, w) as f:
- pass
+ else:
+ os.makedirs(self.home + "/.config/mageiawelcome", exist_ok=True)
+ with open( self.conffile, 'w') as f:
+ pass
@pyqtSlot(result=bool)
def startupcheck(self):