Commit 9e705ddd authored by Nate Graham's avatar Nate Graham 💤
Browse files

Port "Add Source" dialog to Kirigami.OverlaySheet

All the other popups/dialogs use it, so this should too.
parent 905d8ce7
......@@ -20,39 +20,25 @@
import QtQuick 2.1
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import org.kde.kirigami 2.2 as Kirigami
import org.kde.kirigami 2.10 as Kirigami
Popup
Kirigami.OverlaySheet
{
id: newSourceDialog
parent: applicationWindow().overlay
modal: true
focus: true
width: Kirigami.Units.gridUnit * 20
x: (parent.width - width)/2
y: (parent.height - height)/2
property string displayName
property QtObject source
header: Kirigami.Heading {
text: i18n("Add New %1 Repository", displayName)
wrapMode: Text.WordWrap
}
ColumnLayout {
id: info
anchors {
left: parent.left
right: parent.right
}
Kirigami.Heading {
level: 3
Layout.fillWidth: true
text: i18n("Add a new %1 repository", displayName)
}
Label {
id: description
Layout.fillWidth: true
Layout.fillHeight: true
wrapMode: Text.WordWrap
wrapMode: Text.Wrap
textFormat: Text.PlainText
text: source.idDescription
}
......
......@@ -56,14 +56,15 @@ DiscoverPage {
id: dialogComponent
AddSourceDialog {
source: backendItem.backend
onVisibleChanged: if (!visible) {
destroy()
onSheetOpenChanged: if(!sheetOpen) {
destroy(1000)
}
}
}
onTriggered: {
var addSourceDialog = dialogComponent.createObject(null, {displayName: backendItem.backend.resourcesBackend.displayName })
var addSourceDialog = dialogComponent.createObject(window, {displayName: backendItem.backend.resourcesBackend.displayName })
addSourceDialog.open()
}
}
......
......@@ -356,7 +356,7 @@ void FlatpakSourcesBackend::addRemote(FlatpakRemote *remote, FlatpakInstallation
QString FlatpakSourcesBackend::idDescription()
{
return i18n("Flatpak repository URI (*.flatpakrepo)");
return i18n("Enter a Flatpak repository URI (*.flatpakrepo):");
}
bool FlatpakSourcesBackend::moveSource(const QString& sourceId, int delta)
......
Markdown is supported
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