summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2023-01-20 14:48:22 +0100
committerPapoteur <papoteur@mageia.org>2023-01-20 14:48:22 +0100
commit1a5596b29b497fe0d17a7189a4194ee22ceefc37 (patch)
treee5d0945e243f7ac5123369d6c3a85ce98f179d5d
parent96d5480f886a17567f3c641f50daddf2ec882ffc (diff)
downloadmageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar
mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.gz
mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.bz2
mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.tar.xz
mageiawelcome-1a5596b29b497fe0d17a7189a4194ee22ceefc37.zip
fix installation of applications
this was broken by setting /usr/bin/gurpmi in QML part now use a specific function to pass package to install and repository
-rw-r--r--qml/mageiawelcome.py25
-rw-r--r--qml/mw-ui.qml2
2 files changed, 17 insertions, 10 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):
diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml
index 685ed5f..ed6cecf 100644
--- a/qml/mw-ui.qml
+++ b/qml/mw-ui.qml
@@ -263,7 +263,7 @@ Rectangle {
height: Qt.application.font.pixelSize * 1.3
objectName: "launch"
onClicked: {
- launch.command(["/usr/bin/gurpmi",name,repo,])}
+ launch.install([name,repo,])}
style: ButtonStyle {
label: Label {
horizontalAlignment: TextInput.AlignHCenter