Commit 5012275a authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5117 from DonLakeFlyer/LogReplayFixes

Some simple fixes to LogReplay
parents c6c5fcbf 8509f015
......@@ -9,6 +9,8 @@
#include "QGC.h"
#include "ui_QGCMAVLinkLogPlayer.h"
#include "QGCApplication.h"
#include "SettingsManager.h"
#include "AppSettings.h"
#include "LinkManager.h"
#include "QGCQFileDialog.h"
#include "QGCMessageBox.h"
......@@ -22,10 +24,10 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(QWidget *parent) :
_ui->horizontalLayout->setAlignment(Qt::AlignTop);
// Setup buttons
connect(_ui->selectFileButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_selectLogFileForPlayback);
connect(_ui->playButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_playPauseToggle);
connect(_ui->positionSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setPlayheadFromSlider);
connect(_ui->positionSlider, &QSlider::sliderPressed, this, &QGCMAVLinkLogPlayer::_pause);
connect(_ui->selectFileButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_selectLogFileForPlayback);
connect(_ui->playButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_playPauseToggle);
connect(_ui->positionSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setPlayheadFromSlider);
connect(_ui->positionSlider, &QSlider::sliderPressed, this, &QGCMAVLinkLogPlayer::_pause);
#if 0
// Speed slider is removed from 3.0 release. Too broken to fix.
......@@ -71,8 +73,8 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void)
QString logFilename = QGCQFileDialog::getOpenFileName(
this,
tr("Load MAVLink Log File"),
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
tr("Load Telemetry Log File"),
qgcApp()->toolbox()->settingsManager()->appSettings()->telemetrySavePath(),
tr("MAVLink Log Files (*.tlog);;All Files (*)"));
if (logFilename.isEmpty()) {
......@@ -138,6 +140,7 @@ void QGCMAVLinkLogPlayer::_playbackStarted(void)
_enablePlaybackControls(true);
_ui->playButton->setChecked(true);
_ui->playButton->setIcon(QIcon(":/res/Pause"));
_ui->positionSlider->setEnabled(false);
}
/// Signalled from LogReplayLink when replay is paused
......@@ -145,6 +148,7 @@ void QGCMAVLinkLogPlayer::_playbackPaused(void)
{
_ui->playButton->setIcon(QIcon(":/res/Play"));
_ui->playButton->setChecked(false);
_ui->positionSlider->setEnabled(true);
}
void QGCMAVLinkLogPlayer::_playbackPercentCompleteChanged(int percentComplete)
......
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