aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/settings_pane.cc19
-rw-r--r--src/settings_pane.hh3
2 files changed, 22 insertions, 0 deletions
diff --git a/src/settings_pane.cc b/src/settings_pane.cc
index 76de98f..7d3b10f 100644
--- a/src/settings_pane.cc
+++ b/src/settings_pane.cc
@@ -25,6 +25,8 @@ SettingsPane::SettingsPane(QWidget *parent)
this, &SettingsPane::toggledGuides);
connect(collisions, &QListWidget::itemClicked,
[&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); });
+ connect(speeding_violations, &QListWidget::itemClicked,
+ [&](QListWidgetItem *item) { emit bookmarkClicked(((BookmarkItem *) item)->getFrame()); });
QTabWidget *tabs = new QTabWidget();
@@ -50,9 +52,26 @@ void SettingsPane::addCollision(int idA, int idB, int frame) {
}
+void SettingsPane::addSpeedingViolation(int id, int frame, double speed) {
+ BookmarkItem *item = new BookmarkItem("Frame " + QString::number(frame) + ": #"
+ + QString::number(id) + " (" + QString::number(speed) + ")",
+ frame);
+ item->setFlags(Qt::ItemIsEnabled | Qt::ItemNeverHasChildren);
+ speeding_violations->addItem(item);
+}
+
+
void SettingsPane::clearCollisions() {
QListWidgetItem *item;
while ((item = collisions->takeItem(0)) != nullptr) {
delete item;
}
}
+
+
+void SettingsPane::clearSpeedingViolations() {
+ QListWidgetItem *item;
+ while ((item = speeding_violations->takeItem(0)) != nullptr) {
+ delete item;
+ }
+}
diff --git a/src/settings_pane.hh b/src/settings_pane.hh
index 6b6f198..8b2e04c 100644
--- a/src/settings_pane.hh
+++ b/src/settings_pane.hh
@@ -28,10 +28,13 @@ public:
public slots:
void addCollision(int idA, int idB, int frame);
+ void addSpeedingViolation(int id, int frame, double speed);
void clearCollisions();
+ void clearSpeedingViolations();
signals:
void sphereRadiusChanged(double sqRadius);
+ void speedLimitChanged(double limit);
void toggledTrajectories(int shown);
void toggledGuides(int shown);
void bookmarkClicked(int frame);