aboutsummaryrefslogtreecommitdiff
path: root/src/settings_pane.cc
diff options
context:
space:
mode:
authorccolin2021-01-04 14:19:05 +0100
committerccolin2021-01-04 14:19:05 +0100
commit72c6a89727d34d140a835d697d08d91401ae1ef8 (patch)
treebbfa5069c0af8d66b0e0d456df51efa0fe2c7f92 /src/settings_pane.cc
parentd48a05212b6389818993ea8e7cc0f22b7903d4f7 (diff)
add speed limit violations interface to the settings pane
Diffstat (limited to 'src/settings_pane.cc')
-rw-r--r--src/settings_pane.cc19
1 files changed, 19 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;
+ }
+}