Skip to content

Commit

Permalink
Various UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Jun 27, 2019
1 parent e04cec8 commit 41bd14f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 58 deletions.
2 changes: 1 addition & 1 deletion deploy_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else
fi

echo '---- Running macdeployqt'
macdeployqt bin/OffloadBuddy.app -qmldir=qml/;
macdeployqt bin/OffloadBuddy.app -qmldir=qml/ -appstore-compliant;

# Copy ffmpeg binary and libs
cp contribs/env/macos_x86_64/usr/bin/ffmpeg bin/OffloadBuddy.app/Contents/MacOS/
Expand Down
2 changes: 1 addition & 1 deletion qml/ItemMediaDirectory.qml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Rectangle {

ComboBoxThemed {
id: comboBox_content
width: 140
width: 160
height: 40
anchors.left: textField_path.right
anchors.leftMargin: 16
Expand Down
23 changes: 6 additions & 17 deletions qml/MediaDetailMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Item {
if (shot.latitude !== 0.0) {
mapPointGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)
mapPointGPS.zoomLevel = 12
mapPointGPS.anchors.topMargin = 48
mapMarker.visible = true
mapMarker.coordinate = QtPositioning.coordinate(shot.latitude, shot.longitude)
button_map_dezoom.enabled = true
Expand All @@ -28,30 +27,21 @@ Item {
rectangleCoordinates.visible = true
coordinates.text = shot.latitudeString + " " + shot.longitudeString
altitude.text = UtilsString.altitudeToString(shot.altitude, 0, settingsManager.appunits)
} else {
mapPointGPS.center = QtPositioning.coordinate(45.5, 6)
mapPointGPS.zoomLevel = 2
mapPointGPS.anchors.topMargin = 16
mapMarker.visible = false
rectangleCoordinates.visible = false
button_map_dezoom.enabled = false
button_map_zoom.enabled = false
button_gps_export.visible = false
}
}

Map {
id: mapPointGPS
copyrightsVisible: false
anchors.topMargin: 48
anchors.fill: parent
anchors.margins: 16
z: parent.z + 1

copyrightsVisible: false
gesture.enabled: false
z: parent.z + 1
plugin: Plugin { name: "mapboxgl" } // "osm", "mapboxgl", "esri"
center: QtPositioning.coordinate(45.5, 6)
zoomLevel: 2
//center: QtPositioning.coordinate(45.5, 6)
//zoomLevel: 2

MapQuickItem {
id: mapMarker
Expand All @@ -68,14 +58,13 @@ Item {
anchors.fill: parent
onWheel: {
if (wheel.angleDelta.y < 0)
onClicked: parent.zoomLevel--
parent.zoomLevel--
else
onClicked: parent.zoomLevel++
parent.zoomLevel++
}
}

Row {
id: row
anchors.top: parent.top
anchors.topMargin: 16
anchors.right: parent.right
Expand Down
1 change: 1 addition & 0 deletions qml/MediaDetailOverview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ Item {
width: 28
height: 28

visible: shot.audioCodec.length
source: "qrc:/icons_material/baseline-speaker-24px.svg"
color: Theme.colorText

Expand Down
90 changes: 51 additions & 39 deletions qml/MediaDetailTelemetry.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ Item {
onHeightChanged()

if (shot) {
if (shot.latitude !== 0.0) {
mapTraceGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)
mapTraceGPS.zoomLevel = 12
mapMarker.visible = false
mapMarker.coordinate = QtPositioning.coordinate(shot.latitude, shot.longitude)
button_map_dezoom.enabled = true
button_map_zoom.enabled = true
}

// Graphs datas
speedsGraph.title = "Speed (" + UtilsString.speedUnit(settingsManager.appunits) + ")"
shot.updateSpeedsSerie(speedsSeries, settingsManager.appunits)
Expand Down Expand Up @@ -88,26 +79,40 @@ Item {
axisGyroX0.max = gyroX.count

// GPS trace
mapTrace.visible = true

if (shot.distanceKm < 0.5)
mapTraceGPS.zoomLevel = 18
else if (shot.distanceKm < 2)
mapTraceGPS.zoomLevel = 15
else if (shot.distanceKm < 10)
mapTraceGPS.zoomLevel = 12
else if (shot.distanceKm < 50)
mapTraceGPS.zoomLevel = 10
else if (shot.distanceKm < 100)
mapTraceGPS.zoomLevel = 8

// clean GPS points
while (mapTrace.pathLength() > 0)
mapTrace.removeCoordinate(mapTrace.coordinateAt(0))

// add new GPS points // FIXME
for (var i = 0; i < 18000; i+=18)
mapTrace.addCoordinate(shot.getGpsCoordinates(i))
if (shot.latitude !== 0.0) {
button_map_dezoom.enabled = true
button_map_zoom.enabled = true

// clean GPS points
while (mapTrace.pathLength() > 0)
mapTrace.removeCoordinate(mapTrace.coordinateAt(0))

// add new GPS points // FIXME
for (var i = 0; i < 18000; i+=18)
mapTrace.addCoordinate(shot.getGpsCoordinates(i))

if (shot.distanceKm < 0.5)
mapTraceGPS.zoomLevel = 18
else if (shot.distanceKm < 2)
mapTraceGPS.zoomLevel = 15
else if (shot.distanceKm < 10)
mapTraceGPS.zoomLevel = 12
else if (shot.distanceKm < 50)
mapTraceGPS.zoomLevel = 10
else if (shot.distanceKm < 100)
mapTraceGPS.zoomLevel = 8

mapTraceGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)

if (mapTrace.pathLength() > 1) {
mapTrace.visible = true
mapMarker.visible = false
} else {
mapTrace.visible = false
mapMarker.visible = true
mapMarker.coordinate = QtPositioning.coordinate(shot.latitude, shot.longitude)
}
}
}
}

Expand Down Expand Up @@ -140,29 +145,30 @@ Item {

Map {
id: mapTraceGPS
anchors.leftMargin: 0
anchors.fill: parent
copyrightsVisible: false
anchors.margins: 16
z: parent.z + 1

copyrightsVisible: false
gesture.enabled: false
z: parent.z + 1
plugin: Plugin { name: "mapboxgl" } // "osm", "mapboxgl", "esri"
center: QtPositioning.coordinate(45.5, 6)
zoomLevel: 2

//zoomLevel: 2
//center: QtPositioning.coordinate(45.5, 6)

MouseArea {
anchors.fill: parent
onWheel: {
if (wheel.angleDelta.y < 0)
onClicked: parent.zoomLevel--
mapTraceGPS.zoomLevel--
else
onClicked: parent.zoomLevel++
mapTraceGPS.zoomLevel++

mapTraceGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)
}
}

Row {
id: row
anchors.top: parent.top
anchors.topMargin: 16
anchors.right: parent.right
Expand All @@ -178,7 +184,10 @@ Item {
font.pointSize: 16
opacity: 0.8

onClicked: parent.parent.zoomLevel--
onClicked: {
mapTraceGPS.zoomLevel--
mapTraceGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)
}
}

ButtonThemed {
Expand All @@ -190,7 +199,10 @@ Item {
font.pointSize: 16
opacity: 0.8

onClicked: parent.parent.zoomLevel++
onClicked: {
mapTraceGPS.zoomLevel++
mapTraceGPS.center = QtPositioning.coordinate(shot.latitude, shot.longitude)
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/JobManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ bool JobManager::addJobs(JobType type, Device *d, MediaLibrary *ml, QList<Shot
// ffmpeg worker
if (m_job_cpu == nullptr)
{
qDebug() << "Starting an async worker";

m_job_cpu = new JobWorkerAsync();

connect(m_job_cpu, SIGNAL(jobStarted(int)), this, SLOT(jobStarted(int)));
Expand Down Expand Up @@ -315,6 +317,8 @@ bool JobManager::addJobs(JobType type, Device *d, MediaLibrary *ml, QList<Shot

if (m_selected_worker == nullptr)
{
qDebug() << "Starting a sync worker";

m_selected_worker = new JobWorkerSync();
m_selected_worker->thread = new QThread();

Expand Down

0 comments on commit 41bd14f

Please sign in to comment.