From 2a181dd460e5ef3d861e7101ced97574e29622ac Mon Sep 17 00:00:00 2001 From: Steven Cherry Date: Thu, 7 Jul 2016 19:42:35 -0500 Subject: [PATCH] Cleanup --- src/citra_qt/config.h | 3 ++- src/citra_qt/configure.ui | 6 ------ src/citra_qt/configure_input.cpp | 32 +++++++++++--------------------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index 0ef55b28a..0f42aaf8b 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h @@ -1,8 +1,9 @@ -// Copyright 2014 Citra Emulator Project +// Copyright 2014 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. #pragma once + #include #include diff --git a/src/citra_qt/configure.ui b/src/citra_qt/configure.ui index 847605c44..2f98eb5ba 100644 --- a/src/citra_qt/configure.ui +++ b/src/citra_qt/configure.ui @@ -10,12 +10,6 @@ 501 - - - 441 - 0 - - Citra Configuration diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index dd78c463a..fb69e53a7 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 Citra Emulator Project +// Copyright 2016 Citra Emulator Project // Licensed under GPLv2 or any later version // Refer to the license.txt file included. @@ -9,8 +9,7 @@ ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), - ui(new Ui::ConfigureInput) -{ + ui(new Ui::ConfigureInput){ ui->setupUi(this); // Initialize mapping of input enum to UI button. @@ -52,13 +51,11 @@ ConfigureInput::ConfigureInput(QWidget* parent) : this->setConfiguration(); } -ConfigureInput::~ConfigureInput() -{ +ConfigureInput::~ConfigureInput(){ } /// Event handler for all button released() event. -void ConfigureInput::handleClick() -{ +void ConfigureInput::handleClick(){ QPushButton* sender = qobject_cast(QObject::sender()); previous_mapping = sender->text(); sender->setText(tr("[waiting]")); @@ -70,8 +67,7 @@ void ConfigureInput::handleClick() } /// Save all button configurations to settings file -void ConfigureInput::applyConfiguration() -{ +void ConfigureInput::applyConfiguration(){ for (int i = 0; i < Settings::NativeInput::NUM_INPUTS - 1; ++i) { int value = getKeyValue(input_mapping[Settings::NativeInput::Values(i)]->text()); Settings::values.input_mappings[Settings::NativeInput::All[i]] = value; @@ -80,8 +76,7 @@ void ConfigureInput::applyConfiguration() } /// Load configuration settings into button text -void ConfigureInput::setConfiguration() -{ +void ConfigureInput::setConfiguration(){ for (int i = 0; i < Settings::NativeInput::NUM_INPUTS - 1; ++i) { QString keyValue = getKeyName(Settings::values.input_mappings[i]); input_mapping[Settings::NativeInput::Values(i)]->setText(keyValue); @@ -89,8 +84,7 @@ void ConfigureInput::setConfiguration() } /// Handle key press event for input tab when a button is 'waiting'. -void ConfigureInput::keyPressEvent(QKeyEvent* event) -{ +void ConfigureInput::keyPressEvent(QKeyEvent* event){ if (changing_button != nullptr && event->key() != Qt::Key_unknown) { key_pressed = event->key(); @@ -100,8 +94,7 @@ void ConfigureInput::keyPressEvent(QKeyEvent* event) } /// Set button text to name of key pressed. -void ConfigureInput::setKey() -{ +void ConfigureInput::setKey(){ QString key_value = getKeyName(key_pressed); if (key_pressed == Qt::Key_Escape) changing_button->setText(previous_mapping); @@ -116,8 +109,7 @@ void ConfigureInput::setKey() } /// Convert key ASCII value to its' letter/name -QString ConfigureInput::getKeyName(int key_code) const -{ +QString ConfigureInput::getKeyName(int key_code) const{ if (key_code == Qt::Key_Shift) return tr("Shift"); @@ -137,8 +129,7 @@ QString ConfigureInput::getKeyName(int key_code) const } /// Convert letter/name of key to its ASCII value. -Qt::Key ConfigureInput::getKeyValue(const QString& text) const -{ +Qt::Key ConfigureInput::getKeyValue(const QString& text) const{ if (text == "Shift") return Qt::Key_Shift; if (text == "Ctrl") @@ -153,8 +144,7 @@ Qt::Key ConfigureInput::getKeyValue(const QString& text) const } /// Check all inputs for duplicate keys. Clears out any other button with same key as new button. -void ConfigureInput::removeDuplicates(const QString& newValue) -{ +void ConfigureInput::removeDuplicates(const QString& newValue){ for (int i = 0; i < Settings::NativeInput::NUM_INPUTS - 1; ++i) { if (changing_button != input_mapping[Settings::NativeInput::Values(i)]) { QString oldValue = input_mapping[Settings::NativeInput::Values(i)]->text();