aboutsummaryrefslogtreecommitdiff
path: root/src/main_window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_window.cc')
-rw-r--r--src/main_window.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main_window.cc b/src/main_window.cc
index 8acfefb..7bc7855 100644
--- a/src/main_window.cc
+++ b/src/main_window.cc
@@ -53,16 +53,19 @@ void MainWindow::open(const QString &path) {
QByteArray data = file.readAll();
QJsonDocument json_doc = QJsonDocument::fromJson(data);
if (dc) delete dc;
+ glw.meshes.clear();
dc = new DroneController(json_doc.object());
playpause_action->setEnabled(true);
connect(dc, &DroneController::playing, this, &MainWindow::play);
connect(dc, &DroneController::pausing, this, &MainWindow::pause);
slider->setMinimum(0);
slider->setMaximum(dc->getDuration());
+ slider->setValue(0);
connect(slider, &QSlider::sliderPressed, dc, &DroneController::suspend);
connect(slider, &QSlider::sliderReleased, dc, &DroneController::resume);
connect(slider, &QSlider::valueChanged, dc, &DroneController::seek);
connect(dc, &DroneController::frameChanged, slider, &QSlider::setValue);
+ pause();
slider->setEnabled(true);
}