diff options
| author | Papoteur <papoteur@mageia.org> | 2025-06-08 09:24:46 +0200 |
|---|---|---|
| committer | Papoteur <papoteur@mageia.org> | 2025-06-11 08:47:55 +0200 |
| commit | daf2c74c51bac3a5c08c6a87a867c196e9ee2f93 (patch) | |
| tree | 90949d6a69a799c69d20aeaaefdda6cdcbc1b088 /src | |
| parent | eee9bb0b410c107e118f6caa29245c3417b018cf (diff) | |
| download | mageiawelcome-daf2c74c51bac3a5c08c6a87a867c196e9ee2f93.tar mageiawelcome-daf2c74c51bac3a5c08c6a87a867c196e9ee2f93.tar.gz mageiawelcome-daf2c74c51bac3a5c08c6a87a867c196e9ee2f93.tar.bz2 mageiawelcome-daf2c74c51bac3a5c08c6a87a867c196e9ee2f93.tar.xz mageiawelcome-daf2c74c51bac3a5c08c6a87a867c196e9ee2f93.zip | |
Recognize old settings of autostart and move them to new method
Cleaning
Diffstat (limited to 'src')
| -rw-r--r-- | src/mageiawelcome.py | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/mageiawelcome.py b/src/mageiawelcome.py index a6c7de7..49330fe 100644 --- a/src/mageiawelcome.py +++ b/src/mageiawelcome.py @@ -9,14 +9,12 @@ from PyQt6.QtCore import ( QVariant, Qt, QObject, - pyqtSlot, - pyqtSignal, QCoreApplication, ) from PyQt6.QtWidgets import QApplication import sys import os -from helpers import get_desktop_name, get_desktop_name2, is_installed, NetworkState, ConfList +from helpers import get_desktop_name, get_desktop_name2, is_installed, NetworkState, ConfList, Autostart from ui import SlideShowApp # Workaround for opengl lib selection @@ -24,25 +22,15 @@ from OpenGL import GL translate = QCoreApplication.translate -class Installable(QObject): - def __init__(self): - QObject.__init__(self) - - @pyqtSlot(str, str, result=bool) - def installable(self, app, repo): - is_app_installed, inst_repo = is_installed(app) - installable = (not is_app_installed) or (repo != inst_repo and inst_repo == "") - return installable - - @pyqtSlot(str, str, result=bool) - def other(self, app, repo): - is_app_installed, inst_repo = is_installed(app) - return is_app_installed and repo == "" and inst_repo != "" - - - if __name__ == "__main__": + # old method of autostart + old_path = os.getenv("HOME") + "/.config/mageiawelcome/norun.flag" + if os.path.exists(old_path): + # disable autostart according to new method and remove old method + Autostart().disable() + os.remove(old_path) + app = QApplication(sys.argv) locale = QLocale.system().name() qtTranslator = QTranslator() @@ -60,7 +48,6 @@ if __name__ == "__main__": direction = Qt.LayoutDirection.LeftToRight if translate("mw-ui", "LTR") == "LTR" else Qt.LayoutDirection.RightToLeft app.setLayoutDirection(direction) app.setWindowIcon(QIcon("/usr/share/icons/hicolor/32x32/apps/mageiawelcome.png")) - ins = Installable() ns = NetworkState() cl = ConfList(ns) # sc = nr.startupcheck() @@ -78,7 +65,6 @@ if __name__ == "__main__": # defaultWidth, # defaultHeight, # ) - current_path = os.path.abspath(os.path.dirname(__file__)) view = SlideShowApp() view.show() res = app.exec() |
