diff --git a/OffloadBuddy.pro b/OffloadBuddy.pro index ad9a69c..e30fc83 100644 --- a/OffloadBuddy.pro +++ b/OffloadBuddy.pro @@ -7,7 +7,7 @@ DEFINES+= APP_VERSION=\\\"$$VERSION\\\" CONFIG += c++17 QT += core qml quickcontrols2 svg QT += multimedia charts -QT += location +QT += location # Validate Qt version !versionAtLeast(QT_VERSION, 6.5) : error("You need at least Qt version 6.5 for $${TARGET}") diff --git a/qml/ScreenDeviceInfos.qml b/qml/ScreenDeviceInfos.qml index bcdb570..bb20141 100644 --- a/qml/ScreenDeviceInfos.qml +++ b/qml/ScreenDeviceInfos.qml @@ -396,7 +396,7 @@ Loader { DataBarPower { id: deviceBatteryBar width: columnStorage.width - height: Theme.componentMargin + height: 16 visible: currentDevice.batteryLevel > 0 value: currentDevice.batteryLevel diff --git a/qml/ScreenMedia.qml b/qml/ScreenMedia.qml index 74ade1b..8aa13b9 100644 --- a/qml/ScreenMedia.qml +++ b/qml/ScreenMedia.qml @@ -350,6 +350,14 @@ Loader { anchors.verticalCenter: parent.verticalCenter spacing: Theme.componentMarginS + Rectangle { // separator + width: 2; height: 40; + anchors.verticalCenter: parent.verticalCenter + visible: rowActions1.visible + color: Theme.colorHeaderContent + opacity: 0.1 + } + Row { id: rowActions1 anchors.verticalCenter: parent.verticalCenter @@ -392,7 +400,7 @@ Loader { Rectangle { // separator width: 2; height: 40; anchors.verticalCenter: parent.verticalCenter - visible: rowActions1.visible + visible: rowActions2.visible color: Theme.colorHeaderContent opacity: 0.1 } diff --git a/qml/popups/PopupDelete.qml b/qml/popups/PopupDelete.qml index 259f1c3..1442142 100644 --- a/qml/popups/PopupDelete.qml +++ b/qml/popups/PopupDelete.qml @@ -248,7 +248,7 @@ Popup { //////// - ListView { + ListView { // filesArea id: listArea anchors.left: parent.left anchors.right: parent.right diff --git a/qml/popups/PopupEncoding.qml b/qml/popups/PopupEncoding.qml index 7ef0ea3..f184b78 100755 --- a/qml/popups/PopupEncoding.qml +++ b/qml/popups/PopupEncoding.qml @@ -468,7 +468,8 @@ Popup { ListView { id: listArea - anchors.fill: parent + anchors.left: parent.left + anchors.right: parent.right visible: recapOpened @@ -1376,7 +1377,7 @@ Popup { anchors.right: parent.right Item { - height: Theme.componentMarginXL + height: 24 anchors.left: parent.left anchors.right: parent.right diff --git a/qml/popups/PopupExit.qml b/qml/popups/PopupExit.qml index a3644ea..9b44add 100644 --- a/qml/popups/PopupExit.qml +++ b/qml/popups/PopupExit.qml @@ -36,7 +36,7 @@ Popup { color: Theme.colorPrimary } - Rectangle { + Rectangle { // border anchors.fill: parent radius: Theme.componentRadius color: "transparent" @@ -46,7 +46,7 @@ Popup { } layer.enabled: true - layer.effect: MultiEffect { + layer.effect: MultiEffect { // clip maskEnabled: true maskInverted: false maskThresholdMin: 0.5 @@ -65,7 +65,7 @@ Popup { } layer.enabled: true - layer.effect: MultiEffect { + layer.effect: MultiEffect { // shadow autoPaddingEnabled: true shadowEnabled: true shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff" diff --git a/qml/popups/PopupMediaDirectory.qml b/qml/popups/PopupMediaDirectory.qml index b4b5644..bcd7d61 100644 --- a/qml/popups/PopupMediaDirectory.qml +++ b/qml/popups/PopupMediaDirectory.qml @@ -232,7 +232,6 @@ Popup { } ComboBoxThemed { - height: 36 anchors.left: parent.left anchors.leftMargin: popupMediaDirectory.legendWidth + 16 anchors.right: parent.right @@ -299,7 +298,6 @@ Popup { } ComboBoxThemed { - height: 36 anchors.left: parent.left anchors.leftMargin: popupMediaDirectory.legendWidth + 16 anchors.right: parent.right @@ -364,7 +362,6 @@ Popup { id: tfHC anchors.right: parent.right anchors.left: parent.left - height: 36 anchors.verticalCenter: parent.verticalCenter selectByMouse: true diff --git a/qml/popups/PopupMerge.qml b/qml/popups/PopupMerge.qml index 6a59cdc..2ebc98b 100644 --- a/qml/popups/PopupMerge.qml +++ b/qml/popups/PopupMerge.qml @@ -114,7 +114,7 @@ Popup { } } - Rectangle { + Rectangle { // border anchors.fill: parent radius: Theme.componentRadius color: "transparent" @@ -124,7 +124,7 @@ Popup { } layer.enabled: true - layer.effect: MultiEffect { + layer.effect: MultiEffect { // clip maskEnabled: true maskInverted: false maskThresholdMin: 0.5 @@ -143,7 +143,7 @@ Popup { } layer.enabled: true - layer.effect: MultiEffect { + layer.effect: MultiEffect { // shadow autoPaddingEnabled: true shadowEnabled: true shadowColor: ThemeEngine.isLight ? "#aa000000" : "#aaffffff" @@ -228,11 +228,14 @@ Popup { //////// - ListView { + ListView { // filesArea id: listArea - anchors.fill: parent + anchors.left: parent.left + anchors.right: parent.right - visible: recapOpened + visible: recapOpened || (shots_files.length > 0 && shots_files.length <= 8) + height: Math.min(128, contentHeight) + interactive: (contentHeight > 128) model: shots_files delegate: Text { @@ -251,9 +254,6 @@ Popup { anchors.left: parent.left anchors.right: parent.right - topPadding: Theme.componentMargin - bottomPadding: Theme.componentMargin - visible: !recapOpened Item { @@ -308,184 +308,210 @@ Popup { } } - Item { - height: 40 - anchors.right: parent.right - anchors.left: parent.left + //////// - Text { - id: textDestinationTitle - anchors.left: parent.left - anchors.bottom: parent.bottom + Item { // delimiter + anchors.left: parent.left + anchors.leftMargin: -Theme.componentMarginXL + Theme.componentBorderWidth + anchors.right: parent.right + anchors.rightMargin: -Theme.componentMarginXL + Theme.componentBorderWidth + height: 32 - text: qsTr("Destination") - color: Theme.colorSubText - font.pixelSize: Theme.fontSizeContent + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + height: Theme.componentBorderWidth + color: Theme.colorForeground } } - Item { - height: 48 - anchors.right: parent.right + //////// + + Column { + id: columnDestination anchors.left: parent.left + anchors.right: parent.right - ComboBoxFolder { - id: comboBoxDestination + Item { + height: 24 + anchors.right: parent.right anchors.left: parent.left + + Text { + id: textDestinationTitle + anchors.left: parent.left + anchors.bottom: parent.bottom + + text: qsTr("Destination") + color: Theme.colorSubText + font.pixelSize: Theme.fontSizeContent + } + } + + Item { + height: 48 anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: 36 + anchors.left: parent.left - ListModel { id: cbDestinations } - model: cbDestinations + ComboBoxFolder { + id: comboBoxDestination + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter - function updateDestinations() { - cbDestinations.clear() + ListModel { id: cbDestinations } + model: cbDestinations - if (currentShot && appContent.state !== "device") - cbDestinations.append( { "text": qsTr("Next to the video file") } ) + function updateDestinations() { + cbDestinations.clear() - for (var child in storageManager.directoriesList) { - if (storageManager.directoriesList[child].available && - storageManager.directoriesList[child].enabled && - storageManager.directoriesList[child].directoryContent !== StorageUtils.ContentAudio) { - cbDestinations.append( { "text": storageManager.directoriesList[child].directoryPath } ) + if (currentShot && appContent.state !== "device") + cbDestinations.append( { "text": qsTr("Next to the video file") } ) + + for (var child in storageManager.directoriesList) { + if (storageManager.directoriesList[child].available && + storageManager.directoriesList[child].enabled && + storageManager.directoriesList[child].directoryContent !== StorageUtils.ContentAudio) { + cbDestinations.append( { "text": storageManager.directoriesList[child].directoryPath } ) + } } - } - cbDestinations.append( { "text": qsTr("Select path manually") } ) + cbDestinations.append( { "text": qsTr("Select path manually") } ) - // TODO save value instead of reset? - comboBoxDestination.currentIndex = 0 - } + // TODO save value instead of reset? + comboBoxDestination.currentIndex = 0 + } - property bool cbinit: false - onCurrentIndexChanged: { - if (storageManager.directoriesCount <= 0) return - - var selectedDestination = comboBoxDestination.textAt(comboBoxDestination.currentIndex) - var previousDestination = comboBoxDestination.currentText - if (previousDestination === qsTr("Next to the video file")) previousDestination = currentShot.folder - - if (currentShot) { - if (comboBoxDestination.currentIndex === 0 && appContent.state !== "device") { - fileInput.folder = currentShot.folder + jobManager.getDestinationHierarchy(currentShot, selectedDestination) - } else if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { - fileInput.folder = previousDestination + jobManager.getDestinationHierarchy(currentShot, previousDestination) - } else if (comboBoxDestination.currentIndex < cbDestinations.count) { - fileInput.folder = selectedDestination + jobManager.getDestinationHierarchy(currentShot, selectedDestination) - } - fileInput.file = currentShot.name + "_merged" - } else { - if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { - folderInput.folder = previousDestination - } else if (comboBoxDestination.currentIndex < cbDestinations.count) { - folderInput.folder = selectedDestination + property bool cbinit: false + onCurrentIndexChanged: { + if (storageManager.directoriesCount <= 0) return + + var selectedDestination = comboBoxDestination.textAt(comboBoxDestination.currentIndex) + var previousDestination = comboBoxDestination.currentText + if (previousDestination === qsTr("Next to the video file")) previousDestination = currentShot.folder + + if (currentShot) { + if (comboBoxDestination.currentIndex === 0 && appContent.state !== "device") { + fileInput.folder = currentShot.folder + jobManager.getDestinationHierarchy(currentShot, selectedDestination) + } else if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { + fileInput.folder = previousDestination + jobManager.getDestinationHierarchy(currentShot, previousDestination) + } else if (comboBoxDestination.currentIndex < cbDestinations.count) { + fileInput.folder = selectedDestination + jobManager.getDestinationHierarchy(currentShot, selectedDestination) + } + fileInput.file = currentShot.name + "_merged" + } else { + if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { + folderInput.folder = previousDestination + } else if (comboBoxDestination.currentIndex < cbDestinations.count) { + folderInput.folder = selectedDestination + } } } - } - folders: jobManager.getDestinationHierarchyDisplay(currentShot, currentText) + folders: jobManager.getDestinationHierarchyDisplay(currentShot, currentText) + } } - } - FolderInputArea { - id: folderInput - anchors.left: parent.left - anchors.right: parent.right + FolderInputArea { + id: folderInput + anchors.left: parent.left + anchors.right: parent.right - visible: (popupMode === 2) && (comboBoxDestination.currentIndex === (cbDestinations.count-1)) - enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) - } + visible: (popupMode === 2) && (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + } - FileInputArea { - id: fileInput - anchors.left: parent.left - anchors.right: parent.right + FileInputArea { + id: fileInput + anchors.left: parent.left + anchors.right: parent.right + + visible: (popupMode === 1) + enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) - visible: (popupMode === 1) - enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) - - extension: "mp4" - onPathChanged: { - if (currentShot && currentShot.containSourceFile(fileInput.path)) { - fileWarning.setError() - } else if (jobManager.fileExists(fileInput.path)) { - fileWarning.setWarning() - } else { - fileWarning.setOK() + extension: "mp4" + onPathChanged: { + if (currentShot && currentShot.containSourceFile(fileInput.path)) { + fileWarning.setError() + } else if (jobManager.fileExists(fileInput.path)) { + fileWarning.setWarning() + } else { + fileWarning.setOK() + } } } - } - FileWarning { - id: fileWarning + FileWarning { + id: fileWarning + } } } - } - ////////////////// + //////////// - Row { - anchors.right: parent.right + Row { + anchors.right: parent.right - topPadding: Theme.componentMargin - spacing: Theme.componentMargin + topPadding: Theme.componentMargin + spacing: Theme.componentMargin - ButtonSolid { - anchors.bottom: parent.bottom + ButtonSolid { + anchors.bottom: parent.bottom - text: qsTr("Cancel") - color: Theme.colorGrey + text: qsTr("Cancel") + color: Theme.colorGrey - onClicked: popupMerge.close() - } + onClicked: popupMerge.close() + } - ButtonSolid { - anchors.bottom: parent.bottom + ButtonSolid { + anchors.bottom: parent.bottom - enabled: (shots_files.length > 1) + enabled: (shots_files.length > 1) - text: qsTr("Merge") - source: "qrc:/assets/icons/material-symbols/merge_type.svg" + text: qsTr("Merge") + source: "qrc:/assets/icons/material-symbols/merge_type.svg" - onClicked: { - if (typeof mediaProvider === "undefined" || !mediaProvider) return + onClicked: { + if (typeof mediaProvider === "undefined" || !mediaProvider) return - var settingsMerge = {} + var settingsMerge = {} - // destination - if (popupMode === 1) { - if (comboBoxDestination.currentIndex === 0 && appContent.state !== "device") { - settingsMerge["folder"] = currentShot.folder - settingsMerge["file"] = fileInput.file - settingsMerge["extension"] = fileInput.extension - } else if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { - settingsMerge["folder"] = fileInput.folder - settingsMerge["file"] = fileInput.file - settingsMerge["extension"] = fileInput.extension - } else { - settingsMerge["mediaDirectory"] = comboBoxDestination.currentText - } - } else if (popupMode === 2) { - if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { - settingsMerge["folder"] = folderInput.folder - } else { - settingsMerge["mediaDirectory"] = comboBoxDestination.currentText + // destination + if (popupMode === 1) { + if (comboBoxDestination.currentIndex === 0 && appContent.state !== "device") { + settingsMerge["folder"] = currentShot.folder + settingsMerge["file"] = fileInput.file + settingsMerge["extension"] = fileInput.extension + } else if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { + settingsMerge["folder"] = fileInput.folder + settingsMerge["file"] = fileInput.file + settingsMerge["extension"] = fileInput.extension + } else { + settingsMerge["mediaDirectory"] = comboBoxDestination.currentText + } + } else if (popupMode === 2) { + if (comboBoxDestination.currentIndex === (cbDestinations.count-1)) { + settingsMerge["folder"] = folderInput.folder + } else { + settingsMerge["mediaDirectory"] = comboBoxDestination.currentText + } } - } - // settings - settingsMerge["autoDelete"] = switchDelete.checked + // settings + settingsMerge["autoDelete"] = switchDelete.checked - // dispatch job - if (currentShot) { - mediaProvider.mergeSelected(currentShot.uuid, settingsMerge) - } else if (mediaProvider && shots_uuids.length > 0) { - mediaProvider.mergeSelection(shots_uuids, settingsMerge) + // dispatch job + if (currentShot) { + mediaProvider.mergeSelected(currentShot.uuid, settingsMerge) + } else if (mediaProvider && shots_uuids.length > 0) { + mediaProvider.mergeSelection(shots_uuids, settingsMerge) + } + popupMerge.close() } - popupMerge.close() } } + + //////////// } ////////////////// diff --git a/qml/popups/PopupMove.qml b/qml/popups/PopupMove.qml index a8a39bd..9c68bbe 100644 --- a/qml/popups/PopupMove.qml +++ b/qml/popups/PopupMove.qml @@ -86,11 +86,24 @@ Popup { Item { anchors.fill: parent - Rectangle { // title area + Column { anchors.left: parent.left anchors.right: parent.right - height: 64 - color: Theme.colorPrimary + + Rectangle { // title area + anchors.left: parent.left + anchors.right: parent.right + height: 64 + color: Theme.colorPrimary + } + + Rectangle { // subtitle area + anchors.left: parent.left + anchors.right: parent.right + height: 48 + color: Theme.colorForeground + visible: (recapEnabled && shots_files.length) + } } Rectangle { // border @@ -207,12 +220,14 @@ Popup { //////////// - ListView { + ListView { // filesArea id: listArea anchors.left: parent.left anchors.right: parent.right - visible: recapOpened + visible: recapOpened || (shots_files.length > 0 && shots_files.length <= 8) + height: Math.min(128, contentHeight) + interactive: (contentHeight > 128) model: shots_files delegate: Text { @@ -269,84 +284,108 @@ Popup { } } - Item { - height: 40 - anchors.right: parent.right - anchors.left: parent.left + //////// - Text { - id: textDestinationTitle - anchors.left: parent.left - anchors.bottom: parent.bottom + Item { // delimiter + anchors.left: parent.left + anchors.leftMargin: -Theme.componentMarginXL + Theme.componentBorderWidth + anchors.right: parent.right + anchors.rightMargin: -Theme.componentMarginXL + Theme.componentBorderWidth + height: 32 - text: qsTr("Destination") - color: Theme.colorSubText - font.pixelSize: Theme.fontSizeContent + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + height: Theme.componentBorderWidth + color: Theme.colorForeground } } - Item { - height: 48 - anchors.right: parent.right + //////// + + Column { + id: columnDestination anchors.left: parent.left + anchors.right: parent.right - ComboBoxFolder { - id: comboBoxDestination + Item { + height: 24 + anchors.right: parent.right anchors.left: parent.left + + Text { + id: textDestinationTitle + anchors.left: parent.left + anchors.bottom: parent.bottom + + text: qsTr("Destination") + color: Theme.colorSubText + font.pixelSize: Theme.fontSizeContent + } + } + + Item { + height: 48 anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: 36 - - ListModel { id: cbDestinations } - model: cbDestinations - - function updateDestinations() { - cbDestinations.clear() - - for (var child in storageManager.directoriesList) { - if (storageManager.directoriesList[child].available && - storageManager.directoriesList[child].enabled && - storageManager.directoriesList[child].directoryContent !== StorageUtils.ContentAudio) - { - if (currentShot && storageManager.directoriesList[child].directoryPath.includes(currentShot.folder)) { - // ignore this one - } else { - cbDestinations.append( { "text": storageManager.directoriesList[child].directoryPath } ) + anchors.left: parent.left + + ComboBoxFolder { + id: comboBoxDestination + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + ListModel { id: cbDestinations } + model: cbDestinations + + function updateDestinations() { + cbDestinations.clear() + + for (var child in storageManager.directoriesList) { + if (storageManager.directoriesList[child].available && + storageManager.directoriesList[child].enabled && + storageManager.directoriesList[child].directoryContent !== StorageUtils.ContentAudio) + { + if (currentShot && storageManager.directoriesList[child].directoryPath.includes(currentShot.folder)) { + // ignore this one + } else { + cbDestinations.append( { "text": storageManager.directoriesList[child].directoryPath } ) + } } } - } - cbDestinations.append( { "text": qsTr("Select path manually") } ) + cbDestinations.append( { "text": qsTr("Select path manually") } ) - // TODO save value instead of reset? - comboBoxDestination.currentIndex = 0 - } + // TODO save value instead of reset? + comboBoxDestination.currentIndex = 0 + } - property bool cbinit: false - onCurrentIndexChanged: { - if (storageManager.directoriesCount <= 0) return + property bool cbinit: false + onCurrentIndexChanged: { + if (storageManager.directoriesCount <= 0) return - var previousDestination = comboBoxDestination.currentText - var selectedDestination = comboBoxDestination.textAt(comboBoxDestination.currentIndex) + var previousDestination = comboBoxDestination.currentText + var selectedDestination = comboBoxDestination.textAt(comboBoxDestination.currentIndex) - if (cbinit) { - if (comboBoxDestination.currentIndex < cbDestinations.count) { - folderInput.text = previousDestination + if (cbinit) { + if (comboBoxDestination.currentIndex < cbDestinations.count) { + folderInput.text = previousDestination + } + } else { + cbinit = true } - } else { - cbinit = true } - } - folders: jobManager.getDestinationHierarchyDisplay(currentShot, currentText) + folders: jobManager.getDestinationHierarchyDisplay(currentShot, currentText) + } } - } - FolderInputArea { - id: folderInput - anchors.left: parent.left - anchors.right: parent.right + FolderInputArea { + id: folderInput + anchors.left: parent.left + anchors.right: parent.right - visible: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + visible: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + } } } diff --git a/qml/popups/PopupOffload.qml b/qml/popups/PopupOffload.qml index ac8b6a1..6027101 100644 --- a/qml/popups/PopupOffload.qml +++ b/qml/popups/PopupOffload.qml @@ -245,7 +245,8 @@ Popup { ListView { id: listArea - anchors.fill: parent + anchors.left: parent.left + anchors.right: parent.right visible: recapOpened @@ -389,7 +390,6 @@ Popup { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - height: 36 ListModel { id: cbDestinations } model: cbDestinations diff --git a/qml/popups/PopupTelemetry.qml b/qml/popups/PopupTelemetry.qml index 0d10213..feeef23 100644 --- a/qml/popups/PopupTelemetry.qml +++ b/qml/popups/PopupTelemetry.qml @@ -356,9 +356,9 @@ Popup { Item { // delimiter anchors.left: parent.left - anchors.leftMargin: -23 + anchors.leftMargin: -Theme.componentMarginXL + Theme.componentBorderWidth anchors.right: parent.right - anchors.rightMargin: -23 + anchors.rightMargin: -Theme.componentMarginXL + Theme.componentBorderWidth height: 32 Rectangle { @@ -371,116 +371,121 @@ Popup { //////// - Item { - height: 24 + Column { + id: columnDestination anchors.left: parent.left anchors.right: parent.right - Text { - id: textDestinationTitle + Item { + height: 24 anchors.left: parent.left - anchors.bottom: parent.bottom - //anchors.verticalCenter: parent.verticalCenter - - text: qsTr("Destination") - color: Theme.colorSubText - font.pixelSize: Theme.fontSizeContent - } - } - - Item { - id: itemDestination - height: 44 - anchors.left: parent.left - anchors.right: parent.right + anchors.right: parent.right - property string gpsExtension: "gpx" - property string telemetryExtension: "json" - property string lastExtension: "json" + Text { + id: textDestinationTitle + anchors.left: parent.left + anchors.bottom: parent.bottom + //anchors.verticalCenter: parent.verticalCenter - function resetDestination() { - if (typeof currentShot === "undefined" || !currentShot) { - folderInput.folder = utilsApp.getStandardPath_string("") - } else { - fileInput.folder = currentShot.folder - fileInput.file = currentShot.name + text: qsTr("Destination") + color: Theme.colorSubText + font.pixelSize: Theme.fontSizeContent } } - ComboBoxThemed { - id: comboBoxDestination + Item { + id: itemDestination + height: 44 anchors.left: parent.left anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - height: 36 - ListModel { - id: cbDestinations - ListElement { text: qsTr("Next to the video file"); } - ListElement { text: qsTr("Select path manually"); } - } - model: cbDestinations + property string gpsExtension: "gpx" + property string telemetryExtension: "json" + property string lastExtension: "json" - property bool cbinit: false - onCurrentIndexChanged: { - if (currentIndex === 0) itemDestination.resetDestination() + function resetDestination() { + if (typeof currentShot === "undefined" || !currentShot) { + folderInput.folder = utilsApp.getStandardPath_string("") + } else { + fileInput.folder = currentShot.folder + fileInput.file = currentShot.name + } } - } - } - Item { - height: 48 - anchors.left: parent.left - anchors.right: parent.right + ComboBoxThemed { + id: comboBoxDestination + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + ListModel { + id: cbDestinations + ListElement { text: qsTr("Next to the video file"); } + ListElement { text: qsTr("Select path manually"); } + } + model: cbDestinations - visible: (popupMode === 2) && (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + property bool cbinit: false + onCurrentIndexChanged: { + if (currentIndex === 0) itemDestination.resetDestination() + } + } + } - FolderInputArea { - id: folderInput + Item { + height: 48 anchors.left: parent.left anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - folder: currentShot.folder + visible: (popupMode === 2) && (comboBoxDestination.currentIndex === (cbDestinations.count-1)) - onPathChanged: { - // - } - } - } + FolderInputArea { + id: folderInput + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter - Item { - height: 48 - anchors.left: parent.left - anchors.right: parent.right + folder: currentShot.folder - visible: (popupMode === 1) - enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + onPathChanged: { + // + } + } + } - FileInputArea { - id: fileInput + Item { + height: 48 anchors.left: parent.left anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - - folder: currentShot.folder - file: currentShot.name - extension: itemDestination.lastExtension - onPathChanged: { - if (currentShot && currentShot.containSourceFile(fileInput.path)) { - fileWarning.setError() - } else if (jobManager.fileExists(fileInput.path)) { - fileWarning.setWarning() - } else { - fileWarning.setOK() + visible: (popupMode === 1) + enabled: (comboBoxDestination.currentIndex === (cbDestinations.count-1)) + + FileInputArea { + id: fileInput + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + folder: currentShot.folder + file: currentShot.name + extension: itemDestination.lastExtension + + onPathChanged: { + if (currentShot && currentShot.containSourceFile(fileInput.path)) { + fileWarning.setError() + } else if (jobManager.fileExists(fileInput.path)) { + fileWarning.setWarning() + } else { + fileWarning.setOK() + } } } } - } - FileWarning { - id: fileWarning + FileWarning { + id: fileWarning + } } } diff --git a/src/main.cpp b/src/main.cpp index 070d3bd..1ea28c5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -127,6 +127,9 @@ int main(int argc, char *argv[]) //qputenv("QT_MEDIA_BACKEND", "gstreamer"); #endif + // Mouse wheel hack + qputenv("QT_QUICK_FLICKABLE_WHEEL_DECELERATION", "10000"); + SingleApplication app(argc, argv, false); app.setWindowIcon(QIcon(":/gfx/offloadbuddy.svg"));