mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 13:13:27 +02:00
Moved toggleSixense out of Menu
Moved into SixenseManager
This commit is contained in:
parent
8a827dbb3e
commit
3bce8204da
5 changed files with 13 additions and 19 deletions
|
@ -1678,11 +1678,11 @@ void Application::init() {
|
|||
if (Menu::getInstance()->isOptionChecked(MenuOption::SixenseEnabled)) {
|
||||
// on OS X we only setup sixense if the user wants it on - this allows running without the hid_init crash
|
||||
// if hydra support is temporarily not required
|
||||
Menu::getInstance()->toggleSixense(true);
|
||||
SixenseManager::getInstance().toggleSixense(true);
|
||||
}
|
||||
#else
|
||||
// setup sixense
|
||||
Menu::getInstance()->toggleSixense(true);
|
||||
SixenseManager::getInstance().toggleSixense(true);
|
||||
#endif
|
||||
|
||||
// initialize our face trackers after loading the menu settings
|
||||
|
|
|
@ -417,7 +417,7 @@ Menu::Menu() {
|
|||
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
||||
MenuOption::SixenseEnabled,
|
||||
0, false,
|
||||
this,
|
||||
&SixenseManager::getInstance(),
|
||||
SLOT(toggleSixense(bool)));
|
||||
#endif
|
||||
addCheckableActionToQMenuAndActionHash(sixenseOptionsMenu,
|
||||
|
@ -1088,18 +1088,6 @@ void Menu::bumpSettings() {
|
|||
|
||||
const float DIALOG_RATIO_OF_WINDOW = 0.30f;
|
||||
|
||||
void Menu::toggleSixense(bool shouldEnable) {
|
||||
SixenseManager& sixenseManager = SixenseManager::getInstance();
|
||||
|
||||
if (shouldEnable && !sixenseManager.isInitialized()) {
|
||||
sixenseManager.initialize();
|
||||
sixenseManager.setFilter(isOptionChecked(MenuOption::FilterSixense));
|
||||
sixenseManager.setLowVelocityFilter(isOptionChecked(MenuOption::LowVelocityFilter));
|
||||
}
|
||||
|
||||
sixenseManager.setIsEnabled(shouldEnable);
|
||||
}
|
||||
|
||||
void Menu::displayNameLocationResponse(const QString& errorString) {
|
||||
|
||||
if (!errorString.isEmpty()) {
|
||||
|
|
|
@ -141,9 +141,6 @@ public:
|
|||
signals:
|
||||
void scriptLocationChanged(const QString& newPath);
|
||||
|
||||
public slots:
|
||||
void toggleSixense(bool shouldEnable);
|
||||
|
||||
private slots:
|
||||
void aboutApp();
|
||||
void showEditEntitiesHelp();
|
||||
|
|
|
@ -568,5 +568,14 @@ void SixenseManager::emulateMouse(PalmData* palm, int index) {
|
|||
}
|
||||
}
|
||||
|
||||
void SixenseManager::toggleSixense(bool shouldEnable) {
|
||||
if (shouldEnable && !isInitialized()) {
|
||||
initialize();
|
||||
setFilter(Menu::getInstance()->isOptionChecked(MenuOption::FilterSixense));
|
||||
setLowVelocityFilter(Menu::getInstance()->isOptionChecked(MenuOption::LowVelocityFilter));
|
||||
}
|
||||
setIsEnabled(shouldEnable);
|
||||
}
|
||||
|
||||
#endif // HAVE_SIXENSE
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
void setInvertButtons(bool invertSixenseButtons) { _invertButtons = invertSixenseButtons; }
|
||||
|
||||
public slots:
|
||||
|
||||
void toggleSixense(bool shouldEnable);
|
||||
void setFilter(bool filter);
|
||||
void setLowVelocityFilter(bool lowVelocityFilter) { _lowVelocityFilter = lowVelocityFilter; };
|
||||
|
||||
|
|
Loading…
Reference in a new issue