2
* \file BatchImportPage.qml
9
* Copyright (C) 2015 Urs Fleisch
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation; version 3.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25
import "../componentsqtquick" //@!Ubuntu
26
//import Ubuntu.Components 1.1 //@Ubuntu
27
//import Ubuntu.Components.Popups 1.0 //@Ubuntu
33
title: qsTr("Automatic Import")
36
target: app.batchImporter
37
onReportImportEvent: {
40
case BatchImporter.ReadingDirectory:
41
str = qsTr("Reading Directory")
43
case BatchImporter.Started:
46
case BatchImporter.SourceSelected:
49
case BatchImporter.QueryingAlbumList:
50
str = qsTr("Querying")
52
case BatchImporter.FetchingTrackList:
53
case BatchImporter.FetchingCoverArt:
54
str = qsTr("Fetching")
56
case BatchImporter.TrackListReceived:
57
str = qsTr("Data received")
59
case BatchImporter.CoverArtReceived:
62
case BatchImporter.Finished:
63
str = qsTr("Finished")
65
case BatchImporter.Aborted:
68
case BatchImporter.Error:
83
property int labelWidth: constants.gu(10)
84
property int valueWidth: width - labelWidth -spacing
89
margins: constants.margins
92
spacing: constants.spacing
94
text: qsTr("Destination:")
95
width: parent.labelWidth
98
id: destinationComboBox
100
width: parent.valueWidth
101
model: [ qsTr("Tag 1"),
103
qsTr("Tag 1 and Tag 2") ]
104
function getTagVersion() {
105
return [ Frame.TagV1, Frame.TagV2, Frame.TagV2V1 ][currentIndex]
110
width: parent.labelWidth
111
height: profileComboBox.height
112
verticalAlignment: Text.AlignVCenter
113
text: qsTr("Profile:")
117
width: parent.valueWidth
119
model: configs.batchImportConfig().profileNames
120
currentIndex: configs.batchImportConfig().profileIndex
129
top: profileRow.bottom
130
bottom: buttonRow.top
131
margins: constants.margins
141
bottom: parent.bottom
142
margins: constants.margins
144
spacing: constants.spacing
146
width: (parent.width - parent.spacing) / 2
153
width: (parent.width - parent.spacing) / 2
157
app.batchImport(profileComboBox.currentText,
158
script.toTagVersion(destinationComboBox.getTagVersion()))
167
app.batchImporter.abort()