diff options
author | DaMichel <mw.pub@welter-4d.de> | 2016-07-29 11:12:22 +0200 |
---|---|---|
committer | DaMichel <mw.pub@welter-4d.de> | 2016-07-29 11:38:21 +0200 |
commit | 7b3be452b6be528de753a1a633a3aacdb11be86c (patch) | |
tree | 63df2693909a92529610a055e2f670d5860cedf8 /gui/options-dialog.cpp | |
parent | 2bae0bce582f05259f64fb13b364fe6dbd28817a (diff) |
new track logging: record poses in various stages of processing into a file
Diffstat (limited to 'gui/options-dialog.cpp')
-rw-r--r-- | gui/options-dialog.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 3b54ae9a..8987ba34 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -11,6 +11,7 @@ #include <QPushButton> #include <QLayout> #include <QDialog> +#include <QFileDialog> static QString kopts_to_string(const key_opts& kopts) { @@ -72,6 +73,9 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) : tie_setting(main.center_method, ui.center_method); + tie_setting(main.tracklogging_enabled, ui.tracklogging_enabled); + tie_setting(main.tracklogging_filename, ui.tracklogging_filenameedit); + struct tmp { key_opts& opt; @@ -102,6 +106,8 @@ OptionsDialog::OptionsDialog(std::function<void(bool)> pause_keybindings) : connect(val.button, &QPushButton::pressed, this, [=]() -> void { bind_key(val.opt, val.label); }); } } + + connect(ui.tracklogging_fileselectbtn, SIGNAL(clicked()), this, SLOT(browse_datalogging_file())); } void OptionsDialog::bind_key(key_opts& kopts, QLabel* label) @@ -163,3 +169,18 @@ void OptionsDialog::doCancel() close(); } +void OptionsDialog::browse_datalogging_file() +{ + QString filename = ui.tracklogging_filenameedit->text(); + if (filename.isEmpty()) + filename = QDir::currentPath(); + QString newfilename = QFileDialog::getSaveFileName(this, tr("Select Filename"), filename, tr("CSV File (*.csv)")); + if (!newfilename.isEmpty()) + ui.tracklogging_filenameedit->setText(newfilename); +} + +void OptionsDialog::update_widgets_states(bool tracker_is_running) +{ + ui.tracklogging_enabled->setEnabled(!tracker_is_running); + ui.tracklogging_fileselectbtn->setEnabled(!tracker_is_running); +}
\ No newline at end of file |