diff options
author | Papoteur <papoteur@mageia.org> | 2019-01-01 15:07:13 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-01-01 15:07:13 +0100 |
commit | 09851e0e61bd6681170b803e9bac665d6a765b66 (patch) | |
tree | bd12be4c1dc5f7e92ffd1a0223092a88605a8c05 /qml/mw-ui.qml | |
parent | 9f29395b06414eddfd9afe45a1e5959fc63155d6 (diff) | |
parent | 415e31257fd17ae59fd6a825ba80613ac4bb500a (diff) | |
download | mageiawelcome-09851e0e61bd6681170b803e9bac665d6a765b66.tar mageiawelcome-09851e0e61bd6681170b803e9bac665d6a765b66.tar.gz mageiawelcome-09851e0e61bd6681170b803e9bac665d6a765b66.tar.bz2 mageiawelcome-09851e0e61bd6681170b803e9bac665d6a765b66.tar.xz mageiawelcome-09851e0e61bd6681170b803e9bac665d6a765b66.zip |
Merge branch 'master' into topic/mga6
Diffstat (limited to 'qml/mw-ui.qml')
-rw-r--r-- | qml/mw-ui.qml | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/qml/mw-ui.qml b/qml/mw-ui.qml index d20819d..334c06d 100644 --- a/qml/mw-ui.qml +++ b/qml/mw-ui.qml @@ -468,6 +468,20 @@ Rectangle { } } // Applications page + function update_list(group) { + appListDM.items.remove(0,appListDM.count ); + var rowCount = appList.count; + for( var i = 0;i < rowCount;i++ ) + { + var entry = appList.get(i); + var pattern = new RegExp(group, "g"); + if(pattern.test(entry.group) ) { + appListDM.items.insert(entry, "group"); + } + } + appListDM.filterOnGroup = "items"; + } + Rectangle { property var title: qsTr("Applications") width: view.width; height: view.height @@ -526,6 +540,7 @@ Rectangle { {'name':qsTr("Programming"),'group': "programming"}] height: (Qt.application.font.pixelSize + 16) * 9 delegate: Rectangle{ + property variant myGroup: modelData.group width: parent.width height: Qt.application.font.pixelSize + 16 color:"#20FFFFFF" @@ -540,19 +555,9 @@ Rectangle { width: parent.width height: 25 onClicked: { - categoriesList.currentIndex = index - appListDM.items.remove(0,appListDM.count ); - var rowCount = appList.count; - for( var i = 0;i < rowCount;i++ ) - { - var entry = appList.get(i); - entry.installable = installable.installable(entry.name, entry.inst_repo) - var pattern = new RegExp(modelData.group, "g"); - if(pattern.test(entry.group) ) { - appListDM.items.insert(entry, "group"); - } - } - appListDM.filterOnGroup = "items";} + categoriesList.currentIndex = index; + itemModel.update_list(modelData.group); + } } } } @@ -561,7 +566,7 @@ Rectangle { Rectangle { // Software list height: box.height - 222 - x: 200 + x: 210 DelegateModel { id: appListDM @@ -580,7 +585,6 @@ Rectangle { { var entry = appList.get(i); var pattern = /featured/g; - entry.installable = installable.installable(entry.name, entry.inst_repo) if(pattern.test(entry.group) ) { items.insert(entry, "group"); } @@ -605,7 +609,7 @@ Rectangle { text: description font.italic: true font.pixelSize: Qt.application.font.pixelSize * .9 - width: view.width - (200 + 32 +30 + Qt.application.font.pixelSize * 4 * 2) + width: view.width - (200 + 44 +38 + Qt.application.font.pixelSize * 4 * 2) wrapMode: Text.WordWrap color: "white" } @@ -628,6 +632,7 @@ Rectangle { } } } + } Component { id: launcher; Button { @@ -647,12 +652,14 @@ Rectangle { } } Component { id: dummy;Label {text: qsTr("Installed") + padding: 2 + horizontalAlignment: TextInput.AlignHCenter font.pixelSize: Qt.application.font.pixelSize * .8 width: Qt.application.font.pixelSize * 4 color: "white" } } - sourceComponent: (installable === "True") ? button : (command === "" ? dummy : launcher) + sourceComponent: ( pyinstallable.installable(name, repo)) ? button : (command === "" ? dummy : launcher) } Loader { @@ -661,7 +668,7 @@ Rectangle { Rectangle { color: "#FF4C4C" radius: 3 - width: Qt.application.font.pixelSize * 3; height: Qt.application.font.pixelSize * 1.3 + width: Qt.application.font.pixelSize * 3.2; height: Qt.application.font.pixelSize * 1.3 Label { anchors.centerIn: parent text: repo @@ -841,4 +848,11 @@ Rectangle { onClicked: norun.setRunAtLaunch(checked) } } + Connections { + target: launch + onInstalled: { + // get the signal to reload the applist + itemModel.update_list(categoriesList.currentItem.myGroup) + } + } } |