Commit 13268748 authored by Alberto Mardegan's avatar Alberto Mardegan

Desktop, WelcomeDialog: skip import pages if no photos found

Fixes: #6
parent beeb3d72
Pipeline #47730414 passed with stages
in 21 minutes and 46 seconds
......@@ -25,6 +25,8 @@ WizardDialog {
}
WizardPage {
enabled: root.hasPhotosToImport()
WizardImporterSelect {
digikamImporter: __importers[0]
fspotImporter: __importers[1]
......@@ -35,13 +37,21 @@ WizardDialog {
var importer = item.selectedImporter
var index = __importers.indexOf(importer)
if (index >= 0) {
root.jumpTo(root.currentIndex + index + 1)
root.jumpTo(root.currentIndex + index + 2)
} else {
root.jumpTo(root.currentIndex + __importers.length + 1)
root.jumpTo(root.currentIndex + __importers.length + 2)
}
}
}
WizardPage {
WizardImporterNone {}
function onConfirmed() {
root.jumpTo(root.currentIndex + __importers.length + 1)
}
}
WizardPage {
WizardImporterDigikam {
importer: __importers[0]
......@@ -73,4 +83,12 @@ WizardDialog {
DigikamImporter { id: digikamImporter }
FspotImporter { id: fspotImporter }
ShotwellImporter { id: shotwellImporter }
function hasPhotosToImport() {
for (var i = 0; i < __importers.length; i++) {
if (__importers[i].count > 0) return true
}
return false
}
}
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.0
Item {
id: root
Column {
anchors {
left: parent.left; right: parent.right; margins: 16
verticalCenter: parent.verticalCenter
}
spacing: 12
Label {
anchors { left: parent.left; right: parent.right }
text: qsTr("No import sources found")
font.bold: true
horizontalAlignment: Text.AlignHCenter
}
Label {
anchors { left: parent.left; right: parent.right }
text: qsTr("Couldn't find any application to import photos from. Currently Imaginario can import photos from Digikam, F-Spot and Shotwell.")
textFormat: Text.StyledText
wrapMode: Text.Wrap
}
}
}
......@@ -58,6 +58,7 @@
<file>WizardDialog.qml</file>
<file>WizardImporterDigikam.qml</file>
<file>WizardImporterFspot.qml</file>
<file>WizardImporterNone.qml</file>
<file>WizardImporterSelect.qml</file>
<file>WizardImporterShotwell.qml</file>
<file>WizardPage.qml</file>
......
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