Commit 4e4d109d authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Show backend actions more prominently in the sources page

Instead of showing in the hamburger menu, have them shown by the menu
button.
This is useful as our PackageKit management tooling is pretty bad and
some distros had ad-hoc UI for it.
parent 1ee7ec0f
......@@ -35,7 +35,8 @@ DiscoverPage {
readonly property QtObject resourcesBackend: backend.resourcesBackend
readonly property bool isDefault: ResourcesModel.currentApplicationBackend == resourcesBackend
RowLayout {
GridLayout {
id: sourceTitleLayout
Layout.fillHeight: true
Connections {
target: backendItem.backend
......@@ -53,9 +54,26 @@ DiscoverPage {
text: backendItem.isDefault ? i18n("%1 (Default)", resourcesBackend.displayName) : resourcesBackend.displayName
level: 3
}
Instantiator {
id: backendActionsInst
model: ActionsModel {
actions: backendItem.backend ? backendItem.backend.actions : undefined
}
delegate: Button {
parent: sourceTitleLayout
Layout.column: 1
text: modelData.text
}
onObjectRemoved: {
object.destroy()
}
}
Button {
Layout.alignment: Qt.AlignVCenter
icon.name: "preferences-other"
Layout.column: 2
visible: resourcesBackend && resourcesBackend.hasApplications
Component {
......@@ -87,28 +105,6 @@ DiscoverPage {
addSourceDialog.open()
}
}
MenuSeparator {
visible: backendActionsInst.count>0
}
Instantiator {
id: backendActionsInst
model: ActionsModel {
actions: backendItem.backend ? backendItem.backend.actions : undefined
}
delegate: MenuItem {
action: ActionBridge {
action: modelData
}
}
onObjectAdded: {
settingsMenu.insertItem(index, object)
}
onObjectRemoved: {
object.destroy()
}
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment