From 86708a2311c1a3efd975798ff42d934eea0078ed Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 5 Dec 2015 23:32:43 +0100 Subject: api/shortcuts: no longer keep shortcuts hardcoded --- gui/options-dialog.cpp | 3 +++ gui/ui.cpp | 23 +---------------------- gui/ui.h | 4 ---- 3 files changed, 4 insertions(+), 26 deletions(-) (limited to 'gui') diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp index 9631d41e..70d5be62 100644 --- a/gui/options-dialog.cpp +++ b/gui/options-dialog.cpp @@ -73,6 +73,9 @@ OptionsDialog::OptionsDialog() connect(ui.bind_center, &QPushButton::pressed, [&]() -> void { bind_key(s.center, ui.center_text); }); connect(ui.bind_zero, &QPushButton::pressed, [&]() -> void { bind_key(s.zero, ui.zero_text); }); connect(ui.bind_toggle, &QPushButton::pressed, [&]() -> void { bind_key(s.toggle, ui.toggle_text); }); + connect(ui.bind_start, &QPushButton::pressed, [&]() -> void { bind_key(s.start_tracking, ui.start_tracking_text); }); + connect(ui.bind_stop, &QPushButton::pressed, [&]() -> void { bind_key(s.stop_tracking, ui.stop_tracking_text); }); + connect(ui.bind_toggle_tracking, &QPushButton::pressed, [&]() -> void { bind_key(s.toggle_tracking, ui.toggle_tracking_text); }); ui.center_text->setText(kopts_to_string(s.center)); ui.toggle_text->setText(kopts_to_string(s.toggle)); diff --git a/gui/ui.cpp b/gui/ui.cpp index fc6d4754..c3e47912 100644 --- a/gui/ui.cpp +++ b/gui/ui.cpp @@ -281,7 +281,7 @@ void MainWindow::startTracker() { return; } - work = std::make_shared(s, pose, libs, this, winId()); + work = std::make_shared(s, pose, libs, winId()); reload_options(); @@ -489,27 +489,6 @@ void MainWindow::profileSelected(QString name) } } -void MainWindow::shortcutRecentered() -{ - qDebug() << "Center"; - if (work) - work->tracker->center(); -} - -void MainWindow::shortcutToggled() -{ - qDebug() << "Toggle"; - if (work) - work->tracker->toggle_enabled(); -} - -void MainWindow::shortcutZeroed() -{ - qDebug() << "Zero"; - if (work) - work->tracker->zero(); -} - void MainWindow::ensure_tray() { if (tray) diff --git a/gui/ui.h b/gui/ui.h index 44bcde0c..b4bab271 100644 --- a/gui/ui.h +++ b/gui/ui.h @@ -100,10 +100,6 @@ private slots: void startTracker(); void stopTracker(); void reload_options(); -public slots: - void shortcutRecentered(); - void shortcutToggled(); - void shortcutZeroed(); public: MainWindow(); ~MainWindow(); -- cgit v1.2.3