diff options
Diffstat (limited to 'qml/mageiawelcome.py')
-rw-r--r-- | qml/mageiawelcome.py | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py index d831dc5..29d0358 100644 --- a/qml/mageiawelcome.py +++ b/qml/mageiawelcome.py @@ -123,8 +123,21 @@ class Launcher(QObject): cmd = [] for i in range(0,app.property("length").toInt()): cmd.append(app.property(i).toString()) - if cmd[0] == "gurpmi": - repo = cmd[2] + try: + subprocess.Popen(cmd) + except: + print(f"Exception running {cmd[0]}" ) + self.noprogram.emit() + return + + @pyqtSlot(QVariant) + def install(self, app): + if app.isArray(): + cmd = [] + # app should contain package, repository + for i in range(0,app.property("length").toInt()): + cmd.append(app.property(i).toString()) + repo = cmd[1] # Check if repositories are enabled core = False updates = False @@ -173,17 +186,11 @@ class Launcher(QObject): # repo not enabled self.repo.emit() return - proc = subprocess.Popen(['gurpmi',cmd[1]]) + proc = subprocess.Popen(['/usr/bin/gurpmi',cmd[0]]) proc.wait() # Give the signal to reload the applist self.installed.emit() return - try: - subprocess.Popen(cmd) - except: - print(f"Exception running {cmd[0]}" ) - self.noprogram.emit() - return class Norun(QObject): def __init__(self): |