From 569653708c79d2a232fcdca46c9945867de4f2a0 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Fri, 26 Jun 2020 22:40:29 +0200 Subject: Add dialog messages when repositories are not enabled for software installation (mga#24695) Suppress warning about int conversion. --- qml/mw-ui.qml | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) (limited to 'qml/mw-ui.qml') diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index 4c93854..3adf1b1 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -83,10 +83,10 @@ Rectangle { // MCC Page Mcc {} - + // Install software page InstallSoftware {} - + // Applications page function update_list(group) { appListDM.items.remove(0,appListDM.count ); @@ -263,7 +263,7 @@ Rectangle { height: Qt.application.font.pixelSize * 1.3 objectName: "launch" onClicked: { - launch.command(["gurpmi",name,])} + launch.command(["gurpmi",name,repo,])} style: ButtonStyle { label: Label { horizontalAlignment: TextInput.AlignHCenter @@ -345,7 +345,6 @@ Rectangle { } } } - // Configuration summary Page Configuration {} @@ -382,7 +381,7 @@ Rectangle { anchors.leftMargin: 0 anchors.topMargin: 0 anchors { fill: parent; bottomMargin: startCB.implicitHeight +10 } - model: itemModelLive + model: (user == 'live' ? itemModelLive : itemModel) preferredHighlightBegin: 0; preferredHighlightEnd: 0 highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal @@ -445,12 +444,42 @@ Rectangle { onClicked: norun.setRunAtLaunch(checked) } } + + MessageDialog { + id: no_tainted + icon: StandardIcon.Warning + title: qsTr("Application installation") + //: %1 will be replaced with the 'Media sources' translation + text: qsTr("Tainted repositories are not enabled. See the '%1' tab.").arg(qsTr("Media sources")) + standardButtons: StandardButton.Close + } + + MessageDialog { + id: no_core + icon: StandardIcon.Warning + title: qsTr("Application installation") + //: %1 will be replaced with the 'Media sources' translation + text: qsTr("Core repositories are not enabled. See the '%1' tab.").arg(qsTr("Media sources")) + standardButtons: StandardButton.Close + } + Connections { target: launch - onInstalled: { + function onInstalled() { // get the signal to reload the applist console.log("Reload applications list") itemModel.update_list(categoriesList.currentItem.myGroup) } + + function onRepo() { + // get the signal that core repo is not enabled + console.log("Core repository is not enabled") + no_core.visible = true + } + function onTainted() { + // get the signal that tainted repo is not enabled + console.log("Tainted is not enabled") + no_tainted.visible = true + } } } -- cgit v1.2.1