Commit e4a31015 authored by Alberto Mardegan's avatar Alberto Mardegan Committed by Alberto Mardegan

Desktop: add UI for Digikam import

parent 3200d8ea
Pipeline #47726692 failed with stages
in 21 minutes and 2 seconds
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-09-27 17:33+0300\n"
"POT-Creation-Date: 2019-02-04 19:01+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -497,6 +497,7 @@ msgid "Ignored items: <b>%1</b>"
msgstr ""
#: ../src/desktop/qml/ImportWizardProgress.qml:55
#: ../src/desktop/qml/WizardImporterDigikam.qml:32
#: ../src/desktop/qml/WizardImporterFspot.qml:32
#: ../src/desktop/qml/WizardImporterShotwell.qml:32
#, qt-format
......@@ -515,6 +516,7 @@ msgid "Importing..."
msgstr ""
#: ../src/desktop/qml/ImportWizardProgress.qml:88
#: ../src/desktop/qml/WizardImporterDigikam.qml:80
#: ../src/desktop/qml/WizardImporterFspot.qml:79
#: ../src/desktop/qml/WizardImporterShotwell.qml:73
msgid "Import completed"
......@@ -602,11 +604,11 @@ msgstr ""
msgid "Preferences"
msgstr ""
#: ../src/desktop/qml/PreferencesDialog.qml:17
#: ../src/desktop/qml/PreferencesDialog.qml:18
msgid "General"
msgstr ""
#: ../src/desktop/qml/PreferencesDialog.qml:26
#: ../src/desktop/qml/PreferencesDialog.qml:27
msgid "External editors"
msgstr ""
......@@ -715,68 +717,103 @@ msgstr ""
msgid "Close"
msgstr ""
#: ../src/desktop/qml/WizardImporterFspot.qml:15
#: ../src/desktop/qml/WizardImporterDigikam.qml:15
#, qt-format
msgid "F-Spot version: <b>%1</b>"
msgid "Digikam version: <b>%1</b>"
msgstr ""
#: ../src/desktop/qml/WizardImporterFspot.qml:22
#: ../src/desktop/qml/WizardImporterDigikam.qml:22
#, qt-format
msgid "F-Spot database version: <b>%1</b>"
msgid "Digikam database version: <b>%1</b>"
msgstr ""
#: ../src/desktop/qml/WizardImporterDigikam.qml:39
#: ../src/desktop/qml/WizardImporterFspot.qml:39
#: ../src/desktop/qml/WizardImporterShotwell.qml:39
msgid "Start import"
msgstr ""
#: ../src/desktop/qml/WizardImporterDigikam.qml:55
#: ../src/desktop/qml/WizardImporterFspot.qml:55
#: ../src/desktop/qml/WizardImporterShotwell.qml:55
msgid "Ready"
msgstr ""
#: ../src/desktop/qml/WizardImporterDigikam.qml:61
#: ../src/desktop/qml/WizardImporterFspot.qml:61
#: ../src/desktop/qml/WizardImporterShotwell.qml:61
msgid "Importing tags"
msgstr ""
#: ../src/desktop/qml/WizardImporterFspot.qml:68
msgid "Importing rolls"
#: ../src/desktop/qml/WizardImporterDigikam.qml:68
msgid "Importing albums as photo rolls"
msgstr ""
#: ../src/desktop/qml/WizardImporterDigikam.qml:74
#: ../src/desktop/qml/WizardImporterFspot.qml:73
#: ../src/desktop/qml/WizardImporterShotwell.qml:67
msgid "Importing photos"
msgstr ""
#: ../src/desktop/qml/WizardImporterDigikam.qml:86
#: ../src/desktop/qml/WizardImporterFspot.qml:85
#: ../src/desktop/qml/WizardImporterShotwell.qml:79
msgid "Import failed"
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:28
#: ../src/desktop/qml/WizardImporterFspot.qml:15
#, qt-format
msgid "F-Spot version: <b>%1</b>"
msgstr ""
#: ../src/desktop/qml/WizardImporterFspot.qml:22
#, qt-format
msgid "F-Spot database version: <b>%1</b>"
msgstr ""
#: ../src/desktop/qml/WizardImporterFspot.qml:68
msgid "Importing rolls"
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:14
msgid ""
"Imaginario can import your photo database from a program you used previously."
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:36
msgid "Import photos from Digikam"
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:41
#, qt-format
msgid ""
"It appears you have been using Digikam before. There are <b>%1 photos</b> in "
"your Digikam database."
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:54
msgid "Import photos from F-Spot"
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:33
#: ../src/desktop/qml/WizardImporterSelect.qml:59
#, qt-format
msgid ""
"It appears you have been using F-Spot before. There are <b>%1 photos</b> in "
"your F-Spot database."
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:46
#: ../src/desktop/qml/WizardImporterSelect.qml:72
msgid "Import photos from Shotwell"
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:51
#: ../src/desktop/qml/WizardImporterSelect.qml:77
#, qt-format
msgid ""
"It appears you have been using Shotwell before. There are <b>%1 photos</b> "
"in your Shotwell database."
msgstr ""
#: ../src/desktop/qml/WizardImporterSelect.qml:59
#: ../src/desktop/qml/WizardImporterSelect.qml:85
msgid "Don't import photos from another program."
msgstr ""
......
......@@ -20,22 +20,34 @@ WizardDialog {
WizardPage {
WizardImporterSelect {
digikamImporter: __digikamImporter
fspotImporter: __fspotImporter
shotwellImporter: __shotwellImporter
}
function onConfirmed() {
var importer = item.selectedImporter
if (importer == __fspotImporter) {
if (importer == __digikamImporter) {
root.jumpTo(root.currentIndex + 1)
} else if (importer == __shotwellImporter) {
} else if (importer == __fspotImporter) {
root.jumpTo(root.currentIndex + 2)
} else {
} else if (importer == __shotwellImporter) {
root.jumpTo(root.currentIndex + 3)
} else {
root.jumpTo(root.currentIndex + 4)
}
}
}
WizardPage {
WizardImporterDigikam {
importer: __digikamImporter
}
function onConfirmed() {
root.jumpTo(root.currentIndex + 3)
}
}
WizardPage {
WizardImporterFspot {
importer: __fspotImporter
......@@ -55,6 +67,7 @@ WizardDialog {
WelcomeWizardFinished {}
}
property var __digikamImporter: DigikamImporter {}
property var __fspotImporter: FspotImporter {}
property var __shotwellImporter: ShotwellImporter {}
}
import Imaginario 1.0
import QtQuick 2.5
import QtQuick.Controls 1.4
Column {
id: root
property var importer: null
property bool done: false
spacing: 8
Label {
anchors { left: parent.left; right: parent.right }
text: qsTr("Digikam version: <b>%1</b>").arg(importer.version)
textFormat: Text.StyledText
wrapMode: Text.Wrap
}
Label {
anchors { left: parent.left; right: parent.right }
text: qsTr("Digikam database version: <b>%1</b>").arg(importer.dbVersion)
textFormat: Text.StyledText
wrapMode: Text.Wrap
}
Label {
id: statusLabel
property string name: ""
anchors { left: parent.left; right: parent.right }
text: qsTr("Current status: <b>%1</b>").arg(name)
textFormat: Text.StyledText
wrapMode: Text.Wrap
}
Button {
enabled: importer.status == DigikamImporter.Ready
text: qsTr("Start import")
onClicked: importer.exec()
}
ProgressBar {
id: progressBar
minimumValue: 0
maximumValue: 1
value: importer.progress
visible: false
}
states: [
State {
name: "ready"
when: importer.status == DigikamImporter.Ready
PropertyChanges { target: statusLabel; name: qsTr("Ready") }
},
State {
name: "tags"
extend: "photos"
when: importer.status == DigikamImporter.ImportingTags
PropertyChanges { target: statusLabel; name: qsTr("Importing tags") }
PropertyChanges { target: progressBar; indeterminate: true }
},
State {
name: "rolls"
extend: "photos"
when: importer.status == DigikamImporter.ImportingRolls
PropertyChanges { target: statusLabel; name: qsTr("Importing albums as photo rolls") }
PropertyChanges { target: progressBar; indeterminate: true }
},
State {
name: "photos"
when: importer.status == DigikamImporter.ImportingPhotos
PropertyChanges { target: statusLabel; name: qsTr("Importing photos") }
PropertyChanges { target: progressBar; visible: true }
},
State {
name: "done"
when: importer.status == DigikamImporter.Done
PropertyChanges { target: statusLabel; name: qsTr("Import completed") }
PropertyChanges { target: root; done: true }
},
State {
name: "failed"
when: importer.status == DigikamImporter.Failed
PropertyChanges { target: statusLabel; name: qsTr("Import failed") }
PropertyChanges { target: root; done: true }
}
]
}
......@@ -2,6 +2,7 @@ import QtQuick 2.5
import QtQuick.Controls 1.4
Column {
property var digikamImporter: null
property var fspotImporter: null
property var shotwellImporter: null
property var selectedImporter: importerGroup.selectedImporter()
......@@ -18,12 +19,31 @@ Column {
id: importerGroup
function selectedImporter() {
if (current == radioDigikam) return digikamImporter
if (current == radioFspot) return fspotImporter
if (current == radioShotwell) return shotwellImporter
return null
}
}
Column {
anchors { left: parent.left; right: parent.right }
visible: digikamImporter.count > 0
RadioButton {
id: radioDigikam
exclusiveGroup: importerGroup
text: qsTr("Import photos from Digikam")
}
Label {
anchors { left: parent.left; right: parent.right; leftMargin: 25 }
text: qsTr("It appears you have been using Digikam before. There are <b>%1 photos</b> in your Digikam database.", "", digikamImporter.count).arg(digikamImporter.count)
textFormat: Text.StyledText
wrapMode: Text.Wrap
}
}
Column {
anchors { left: parent.left; right: parent.right }
visible: fspotImporter.count > 0
......@@ -69,7 +89,9 @@ Column {
Component.onCompleted: selectFirst()
function selectFirst() {
var firstButton = radioFspot.visible ? radioFspot :
var firstButton =
radioDigikam.visible ? radioDigikam :
radioFspot.visible ? radioFspot :
radioShotwell.visible ? radioShotwell :
radioNoImport
firstButton.checked = true
......
......@@ -18,6 +18,7 @@
*/
#include "clipboard.h"
#include "digikam_importer.h"
#include "folder_model.h"
#include "fspot_importer.h"
#include "helper_model.h"
......@@ -67,6 +68,7 @@ void Imaginario::registerTypes()
[](QQmlEngine *, QJSEngine *) -> QObject * {
return new Clipboard;
});
qmlRegisterType<DigikamImporter>("Imaginario", 1, 0, "DigikamImporter");
qmlRegisterType<FolderModel>("Imaginario", 1, 0, "FolderModel");
qmlRegisterType<FspotImporter>("Imaginario", 1, 0, "FspotImporter");
qmlRegisterType<HelperModel>("Imaginario", 1, 0, "HelperModel");
......
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