Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MediaTrackMetadataView.qml
Show All 29 Lines | 27 | Window { | |||
---|---|---|---|---|---|
30 | property int initialDatabaseId: 0 | 30 | property int initialDatabaseId: 0 | ||
31 | property var modelType | 31 | property var modelType | ||
32 | property string fileName | 32 | property string fileName | ||
33 | property bool editableMetadata | 33 | property bool editableMetadata | ||
34 | property alias showImage: metadataImage.visible | 34 | property alias showImage: metadataImage.visible | ||
35 | property alias showTrackFileName: fileNameRow.visible | 35 | property alias showTrackFileName: fileNameRow.visible | ||
36 | property alias showDeleteButton: deleteButtonBox.visible | 36 | property alias showDeleteButton: deleteButtonBox.visible | ||
37 | property alias showApplyButton: applyButton.visible | 37 | property alias showApplyButton: applyButton.visible | ||
38 | property double widthIndex: 2.8 | ||||
astippich: this looks to specific. why is this needed? | |||||
It is used to make the window larger depending on the case. The default value is overrided in DataListView.qml l.52. In the case of radios, the window is then larger as most of the time urls are larger than classic music fields. jguidon: It is used to make the window larger depending on the case. The default value is overrided in… | |||||
38 | 39 | | |||
39 | signal rejected() | 40 | signal rejected() | ||
40 | 41 | | |||
41 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | 42 | LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft | ||
42 | LayoutMirroring.childrenInherit: true | 43 | LayoutMirroring.childrenInherit: true | ||
43 | 44 | | |||
44 | title: (initialDatabaseId === -1) ? i18nc("Window title for track metadata", "Create a Radio") : i18nc("Window title for track metadata", "View Details") | 45 | title: (initialDatabaseId === -1) ? i18nc("Window title for track metadata", "Create a Radio") : i18nc("Window title for track metadata", "View Details") | ||
45 | 46 | | |||
46 | TrackMetadataModel { | 47 | TrackMetadataModel { | ||
47 | id: realModel | 48 | id: realModel | ||
48 | 49 | | |||
49 | manager: elisa.musicManager | 50 | manager: elisa.musicManager | ||
50 | } | 51 | } | ||
51 | 52 | | |||
52 | modality: Qt.NonModal | 53 | modality: Qt.NonModal | ||
53 | flags: Qt.Dialog | Qt.WindowCloseButtonHint | 54 | flags: Qt.Dialog | Qt.WindowCloseButtonHint | ||
54 | 55 | | |||
55 | color: myPalette.window | 56 | color: myPalette.window | ||
56 | 57 | | |||
57 | minimumHeight: elisaTheme.coverImageSize * 1.8 | 58 | minimumHeight: elisaTheme.coverImageSize * 1.8 | ||
58 | minimumWidth: elisaTheme.coverImageSize * 2.8 | 59 | minimumWidth: elisaTheme.coverImageSize * trackMetadata.widthIndex | ||
59 | 60 | | |||
60 | ColumnLayout { | 61 | ColumnLayout { | ||
61 | anchors.fill: parent | 62 | anchors.fill: parent | ||
62 | anchors.margins: elisaTheme.layoutVerticalMargin | 63 | anchors.margins: elisaTheme.layoutVerticalMargin | ||
63 | 64 | | |||
64 | spacing: elisaTheme.layoutVerticalMargin | 65 | spacing: elisaTheme.layoutVerticalMargin | ||
65 | 66 | | |||
66 | RowLayout { | 67 | RowLayout { | ||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | |||||
230 | } | 231 | } | ||
231 | 232 | | |||
232 | Component.onCompleted: { | 233 | Component.onCompleted: { | ||
233 | if (elisa.musicManager) { | 234 | if (elisa.musicManager) { | ||
234 | if (initialDatabaseId === -1) { | 235 | if (initialDatabaseId === -1) { | ||
235 | realModel.initializeForNewRadio() | 236 | realModel.initializeForNewRadio() | ||
236 | } else if (initialDatabaseId !== 0) { | 237 | } else if (initialDatabaseId !== 0) { | ||
237 | realModel.initializeById(modelType, initialDatabaseId) | 238 | realModel.initializeById(modelType, initialDatabaseId) | ||
238 | } else { | 239 | } else { | ||
This is needed because when the image is going into error state and changed later on, the image would not get updated, right? astippich: This is needed because when the image is going into error state and changed later on, the image… | |||||
jguidon: Yes exactly :) | |||||
239 | realModel.initializeByTrackFileName(fileName) | 240 | realModel.initializeByTrackFileName(fileName) | ||
240 | } | 241 | } | ||
241 | } | 242 | } | ||
242 | } | 243 | } | ||
243 | } | 244 | } |
this looks to specific. why is this needed?