got rid of 'src' folders in each sub-project
This commit is contained in:
parent
03c245345e
commit
63e46abdb8
148 changed files with 0 additions and 0 deletions
91
src/citra_qt/config/controller_config.cpp
Normal file
91
src/citra_qt/config/controller_config.cpp
Normal file
|
@ -0,0 +1,91 @@
|
|||
#include <QDialogButtonBox>
|
||||
|
||||
#include "controller_config.hxx"
|
||||
#include "controller_config_util.hxx"
|
||||
|
||||
/* TODO(bunnei): ImplementMe
|
||||
|
||||
using common::Config;
|
||||
|
||||
GControllerConfig::GControllerConfig(common::Config::ControllerPort* initial_config, QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
((QGridLayout*)ui.mainStickTab->layout())->addWidget(new GStickConfig(Config::ANALOG_LEFT, Config::ANALOG_RIGHT, Config::ANALOG_UP, Config::ANALOG_DOWN, this, this), 1, 1);
|
||||
((QGridLayout*)ui.cStickTab->layout())->addWidget(new GStickConfig(Config::C_LEFT, Config::C_RIGHT, Config::C_UP, Config::C_DOWN, this, this), 1, 1);
|
||||
((QGridLayout*)ui.dPadTab->layout())->addWidget(new GStickConfig(Config::DPAD_LEFT, Config::DPAD_RIGHT, Config::DPAD_UP, Config::DPAD_DOWN, this, this), 1, 1);
|
||||
|
||||
// TODO: Arrange these more compactly?
|
||||
QVBoxLayout* layout = (QVBoxLayout*)ui.buttonsTab->layout();
|
||||
layout->addWidget(new GButtonConfigGroup("A Button", Config::BUTTON_A, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("B Button", Config::BUTTON_B, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("X Button", Config::BUTTON_X, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("Y Button", Config::BUTTON_Y, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("Z Button", Config::BUTTON_Z, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("L Trigger", Config::TRIGGER_L, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("R Trigger", Config::TRIGGER_R, this, ui.buttonsTab));
|
||||
layout->addWidget(new GButtonConfigGroup("Start Button", Config::BUTTON_START, this, ui.buttonsTab));
|
||||
|
||||
memcpy(config, initial_config, sizeof(config));
|
||||
|
||||
emit ActivePortChanged(config[0]);
|
||||
}
|
||||
|
||||
void GControllerConfig::OnKeyConfigChanged(common::Config::Control id, int key, const QString& name)
|
||||
{
|
||||
if (InputSourceJoypad())
|
||||
{
|
||||
config[GetActiveController()].pads.key_code[id] = key;
|
||||
}
|
||||
else
|
||||
{
|
||||
config[GetActiveController()].keys.key_code[id] = key;
|
||||
}
|
||||
emit ActivePortChanged(config[GetActiveController()]);
|
||||
}
|
||||
|
||||
int GControllerConfig::GetActiveController()
|
||||
{
|
||||
return ui.activeControllerCB->currentIndex();
|
||||
}
|
||||
|
||||
bool GControllerConfig::InputSourceJoypad()
|
||||
{
|
||||
return ui.inputSourceCB->currentIndex() == 1;
|
||||
}
|
||||
|
||||
GControllerConfigDialog::GControllerConfigDialog(common::Config::ControllerPort* controller_ports, QWidget* parent) : QDialog(parent), config_ptr(controller_ports)
|
||||
{
|
||||
setWindowTitle(tr("Input configuration"));
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
config_widget = new GControllerConfig(controller_ports, this);
|
||||
layout->addWidget(config_widget);
|
||||
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
layout->addWidget(buttons);
|
||||
|
||||
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(EnableChanges()));
|
||||
|
||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
setLayout(layout);
|
||||
setModal(true);
|
||||
show();
|
||||
}
|
||||
|
||||
void GControllerConfigDialog::EnableChanges()
|
||||
{
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
{
|
||||
memcpy(&config_ptr[i], &config_widget->GetControllerConfig(i), sizeof(common::Config::ControllerPort));
|
||||
|
||||
if (common::g_config) {
|
||||
// Apply changes if running a game
|
||||
memcpy(&common::g_config->controller_ports(i), &config_widget->GetControllerConfig(i), sizeof(common::Config::ControllerPort));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
52
src/citra_qt/config/controller_config.hxx
Normal file
52
src/citra_qt/config/controller_config.hxx
Normal file
|
@ -0,0 +1,52 @@
|
|||
#ifndef _CONTROLLER_CONFIG_HXX_
|
||||
#define _CONTROLLER_CONFIG_HXX_
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include "ui_controller_config.h"
|
||||
|
||||
/* TODO(bunnei): ImplementMe
|
||||
|
||||
#include "config.h"
|
||||
|
||||
class GControllerConfig : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GControllerConfig(common::Config::ControllerPort* initial_config, QWidget* parent = NULL);
|
||||
|
||||
const common::Config::ControllerPort& GetControllerConfig(int index) const { return config[index]; }
|
||||
|
||||
signals:
|
||||
void ActivePortChanged(const common::Config::ControllerPort&);
|
||||
|
||||
public slots:
|
||||
void OnKeyConfigChanged(common::Config::Control id, int key, const QString& name);
|
||||
|
||||
private:
|
||||
int GetActiveController();
|
||||
bool InputSourceJoypad();
|
||||
|
||||
Ui::ControllerConfig ui;
|
||||
common::Config::ControllerPort config[4];
|
||||
};
|
||||
|
||||
class GControllerConfigDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
GControllerConfigDialog(common::Config::ControllerPort* controller_ports, QWidget* parent = NULL);
|
||||
|
||||
public slots:
|
||||
void EnableChanges();
|
||||
|
||||
private:
|
||||
GControllerConfig* config_widget;
|
||||
common::Config::ControllerPort* config_ptr;
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
#endif // _CONTROLLER_CONFIG_HXX_
|
308
src/citra_qt/config/controller_config.ui
Normal file
308
src/citra_qt/config/controller_config.ui
Normal file
|
@ -0,0 +1,308 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ControllerConfig</class>
|
||||
<widget class="QWidget" name="ControllerConfig">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>503</width>
|
||||
<height>293</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Controller Configuration</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="activeControllerCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Controller 1</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Controller 2</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Controller 3</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Controller 4</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="inputSourceCB">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Keyboard</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Joypad</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Active Controller:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Input Source:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainStickTab">
|
||||
<attribute name="title">
|
||||
<string>Main Stick</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="2" column="2">
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="cStickTab">
|
||||
<attribute name="title">
|
||||
<string>C-Stick</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="dPadTab">
|
||||
<attribute name="title">
|
||||
<string>D-Pad</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="horizontalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="buttonsTab">
|
||||
<attribute name="title">
|
||||
<string>Buttons</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2"/>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
<slots>
|
||||
<signal>ControlsChanged()</signal>
|
||||
<signal>MainStickCleared()</signal>
|
||||
<signal>CStickCleared()</signal>
|
||||
<signal>DPadCleared()</signal>
|
||||
<signal>ButtonsCleared()</signal>
|
||||
<slot>OnControlsChanged()</slot>
|
||||
<slot>OnMainStickCleared()</slot>
|
||||
<slot>OnCStickCleared()</slot>
|
||||
<slot>OnDPadCleared()</slot>
|
||||
<slot>OnButtonsCleared()</slot>
|
||||
</slots>
|
||||
</ui>
|
121
src/citra_qt/config/controller_config_util.cpp
Normal file
121
src/citra_qt/config/controller_config_util.cpp
Normal file
|
@ -0,0 +1,121 @@
|
|||
#include <QPushButton>
|
||||
#include <QStyle>
|
||||
#include <QGridLayout>
|
||||
#include <QKeyEvent>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
#include "controller_config_util.hxx"
|
||||
|
||||
/* TODO(bunnei): ImplementMe
|
||||
GStickConfig::GStickConfig(common::Config::Control leftid, common::Config::Control rightid, common::Config::Control upid, common::Config::Control downid, QObject* change_receiver, QWidget* parent) : QWidget(parent)
|
||||
{
|
||||
left = new GKeyConfigButton(leftid, style()->standardIcon(QStyle::SP_ArrowLeft), QString(), change_receiver, this);
|
||||
right = new GKeyConfigButton(rightid, style()->standardIcon(QStyle::SP_ArrowRight), QString(), change_receiver, this);
|
||||
up = new GKeyConfigButton(upid, style()->standardIcon(QStyle::SP_ArrowUp), QString(), change_receiver, this);
|
||||
down = new GKeyConfigButton(downid, style()->standardIcon(QStyle::SP_ArrowDown), QString(), change_receiver, this);
|
||||
clear = new QPushButton(tr("Clear"), this);
|
||||
|
||||
QGridLayout* layout = new QGridLayout(this);
|
||||
layout->addWidget(left, 1, 0);
|
||||
layout->addWidget(right, 1, 2);
|
||||
layout->addWidget(up, 0, 1);
|
||||
layout->addWidget(down, 2, 1);
|
||||
layout->addWidget(clear, 1, 1);
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
GKeyConfigButton::GKeyConfigButton(common::Config::Control id, const QIcon& icon, const QString& text, QObject* change_receiver, QWidget* parent) : QPushButton(icon, text, parent), id(id), inputGrabbed(false)
|
||||
{
|
||||
connect(this, SIGNAL(clicked()), this, SLOT(OnClicked()));
|
||||
connect(this, SIGNAL(KeyAssigned(common::Config::Control, int, const QString&)), change_receiver, SLOT(OnKeyConfigChanged(common::Config::Control, int, const QString&)));
|
||||
connect(change_receiver, SIGNAL(ActivePortChanged(const common::Config::ControllerPort&)), this, SLOT(OnActivePortChanged(const common::Config::ControllerPort&)));
|
||||
}
|
||||
|
||||
GKeyConfigButton::GKeyConfigButton(common::Config::Control id, const QString& text, QObject* change_receiver, QWidget* parent) : QPushButton(text, parent), id(id), inputGrabbed(false)
|
||||
{
|
||||
connect(this, SIGNAL(clicked()), this, SLOT(OnClicked()));
|
||||
connect(this, SIGNAL(KeyAssigned(common::Config::Control, int, const QString&)), change_receiver, SLOT(OnKeyConfigChanged(common::Config::Control, int, const QString&)));
|
||||
connect(change_receiver, SIGNAL(ActivePortChanged(const common::Config::ControllerPort&)), this, SLOT(OnActivePortChanged(const common::Config::ControllerPort&)));
|
||||
}
|
||||
|
||||
void GKeyConfigButton::OnActivePortChanged(const common::Config::ControllerPort& config)
|
||||
{
|
||||
// TODO: Doesn't use joypad struct if that's the input source...
|
||||
QString text = QKeySequence(config.keys.key_code[id]).toString(); // has a nicer format
|
||||
if (config.keys.key_code[id] == Qt::Key_Shift) text = tr("Shift");
|
||||
else if (config.keys.key_code[id] == Qt::Key_Control) text = tr("Control");
|
||||
else if (config.keys.key_code[id] == Qt::Key_Alt) text = tr("Alt");
|
||||
else if (config.keys.key_code[id] == Qt::Key_Meta) text = tr("Meta");
|
||||
setText(text);
|
||||
}
|
||||
|
||||
void GKeyConfigButton::OnClicked()
|
||||
{
|
||||
grabKeyboard();
|
||||
grabMouse();
|
||||
inputGrabbed = true;
|
||||
|
||||
old_text = text();
|
||||
setText(tr("Input..."));
|
||||
}
|
||||
|
||||
void GKeyConfigButton::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
if (inputGrabbed)
|
||||
{
|
||||
releaseKeyboard();
|
||||
releaseMouse();
|
||||
setText(QString());
|
||||
|
||||
// TODO: Doesn't capture "return" key
|
||||
// TODO: This doesn't quite work well, yet... find a better way
|
||||
QString text = QKeySequence(event->key()).toString(); // has a nicer format than event->text()
|
||||
int key = event->key();
|
||||
if (event->modifiers() == Qt::ShiftModifier) { text = tr("Shift"); key = Qt::Key_Shift; }
|
||||
else if (event->modifiers() == Qt::ControlModifier) { text = tr("Ctrl"); key = Qt::Key_Control; }
|
||||
else if (event->modifiers() == Qt::AltModifier) { text = tr("Alt"); key = Qt::Key_Alt; }
|
||||
else if (event->modifiers() == Qt::MetaModifier) { text = tr("Meta"); key = Qt::Key_Meta; }
|
||||
|
||||
setText(old_text);
|
||||
emit KeyAssigned(id, key, text);
|
||||
|
||||
inputGrabbed = false;
|
||||
|
||||
// TODO: Keys like "return" cause another keyPressEvent to be generated after this one...
|
||||
}
|
||||
|
||||
QPushButton::keyPressEvent(event); // TODO: Necessary?
|
||||
}
|
||||
|
||||
void GKeyConfigButton::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
// Abort key assignment
|
||||
if (inputGrabbed)
|
||||
{
|
||||
releaseKeyboard();
|
||||
releaseMouse();
|
||||
setText(old_text);
|
||||
inputGrabbed = false;
|
||||
}
|
||||
|
||||
QAbstractButton::mousePressEvent(event);
|
||||
}
|
||||
|
||||
GButtonConfigGroup::GButtonConfigGroup(const QString& name, common::Config::Control id, QObject* change_receiver, QWidget* parent) : QWidget(parent), id(id)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
QPushButton* clear_button = new QPushButton(tr("Clear"));
|
||||
|
||||
layout->addWidget(new QLabel(name, this));
|
||||
layout->addWidget(config_button = new GKeyConfigButton(id, QString(), change_receiver, this));
|
||||
layout->addWidget(clear_button);
|
||||
|
||||
// TODO: connect config_button, clear_button
|
||||
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
*/
|
78
src/citra_qt/config/controller_config_util.hxx
Normal file
78
src/citra_qt/config/controller_config_util.hxx
Normal file
|
@ -0,0 +1,78 @@
|
|||
#ifndef _CONTROLLER_CONFIG_UTIL_HXX_
|
||||
#define _CONTROLLER_CONFIG_UTIL_HXX_
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPushButton>
|
||||
|
||||
/* TODO(bunnei): ImplementMe
|
||||
|
||||
#include "config.h"
|
||||
|
||||
class GStickConfig : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot!
|
||||
GStickConfig(common::Config::Control leftid, common::Config::Control rightid, common::Config::Control upid, common::Config::Control downid, QObject* change_receiver, QWidget* parent = NULL);
|
||||
|
||||
signals:
|
||||
void LeftChanged();
|
||||
void RightChanged();
|
||||
void UpChanged();
|
||||
void DownChanged();
|
||||
|
||||
private:
|
||||
QPushButton* left;
|
||||
QPushButton* right;
|
||||
QPushButton* up;
|
||||
QPushButton* down;
|
||||
|
||||
QPushButton* clear;
|
||||
};
|
||||
|
||||
class GKeyConfigButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// TODO: change_receiver also needs to have an ActivePortChanged(const common::Config::ControllerPort&) signal
|
||||
// change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot!
|
||||
GKeyConfigButton(common::Config::Control id, const QIcon& icon, const QString& text, QObject* change_receiver, QWidget* parent);
|
||||
GKeyConfigButton(common::Config::Control id, const QString& text, QObject* change_receiver, QWidget* parent);
|
||||
|
||||
signals:
|
||||
void KeyAssigned(common::Config::Control id, int key, const QString& text);
|
||||
|
||||
private slots:
|
||||
void OnActivePortChanged(const common::Config::ControllerPort& config);
|
||||
|
||||
void OnClicked();
|
||||
|
||||
void keyPressEvent(QKeyEvent* event); // TODO: bGrabbed?
|
||||
void mousePressEvent(QMouseEvent* event);
|
||||
|
||||
private:
|
||||
common::Config::Control id;
|
||||
bool inputGrabbed;
|
||||
|
||||
QString old_text;
|
||||
};
|
||||
|
||||
class GButtonConfigGroup : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// change_receiver needs to have a OnKeyConfigChanged(common::Config::Control, int, const QString&) slot!
|
||||
GButtonConfigGroup(const QString& name, common::Config::Control id, QObject* change_receiver, QWidget* parent = NULL);
|
||||
|
||||
private:
|
||||
GKeyConfigButton* config_button;
|
||||
|
||||
common::Config::Control id;
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
#endif // _CONTROLLER_CONFIG_HXX_
|
222
src/citra_qt/config/ui_controller_config.h
Normal file
222
src/citra_qt/config/ui_controller_config.h
Normal file
|
@ -0,0 +1,222 @@
|
|||
/********************************************************************************
|
||||
** Form generated from reading UI file 'controller_config.ui'
|
||||
**
|
||||
** Created by: Qt User Interface Compiler version 4.8.5
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef UI_CONTROLLER_CONFIG_H
|
||||
#define UI_CONTROLLER_CONFIG_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QAction>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QButtonGroup>
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QComboBox>
|
||||
#include <QtGui/QGridLayout>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QLabel>
|
||||
#include <QtGui/QSpacerItem>
|
||||
#include <QtGui/QTabWidget>
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_ControllerConfig
|
||||
{
|
||||
public:
|
||||
QVBoxLayout *verticalLayout;
|
||||
QGridLayout *gridLayout;
|
||||
QComboBox *activeControllerCB;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QCheckBox *checkBox;
|
||||
QComboBox *inputSourceCB;
|
||||
QLabel *label_2;
|
||||
QLabel *label;
|
||||
QTabWidget *tabWidget;
|
||||
QWidget *mainStickTab;
|
||||
QGridLayout *gridLayout_3;
|
||||
QSpacerItem *verticalSpacer_2;
|
||||
QSpacerItem *verticalSpacer_3;
|
||||
QSpacerItem *horizontalSpacer_4;
|
||||
QSpacerItem *horizontalSpacer_3;
|
||||
QWidget *cStickTab;
|
||||
QGridLayout *gridLayout_4;
|
||||
QSpacerItem *horizontalSpacer_6;
|
||||
QSpacerItem *verticalSpacer_5;
|
||||
QSpacerItem *verticalSpacer_4;
|
||||
QSpacerItem *horizontalSpacer_5;
|
||||
QWidget *dPadTab;
|
||||
QGridLayout *gridLayout_5;
|
||||
QSpacerItem *horizontalSpacer_7;
|
||||
QSpacerItem *verticalSpacer_7;
|
||||
QSpacerItem *verticalSpacer_6;
|
||||
QSpacerItem *horizontalSpacer_8;
|
||||
QWidget *buttonsTab;
|
||||
QVBoxLayout *verticalLayout_2;
|
||||
|
||||
void setupUi(QWidget *ControllerConfig)
|
||||
{
|
||||
if (ControllerConfig->objectName().isEmpty())
|
||||
ControllerConfig->setObjectName(QString::fromUtf8("ControllerConfig"));
|
||||
ControllerConfig->resize(503, 293);
|
||||
QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
sizePolicy.setHorizontalStretch(0);
|
||||
sizePolicy.setVerticalStretch(0);
|
||||
sizePolicy.setHeightForWidth(ControllerConfig->sizePolicy().hasHeightForWidth());
|
||||
ControllerConfig->setSizePolicy(sizePolicy);
|
||||
verticalLayout = new QVBoxLayout(ControllerConfig);
|
||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||
verticalLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||
gridLayout = new QGridLayout();
|
||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||
activeControllerCB = new QComboBox(ControllerConfig);
|
||||
activeControllerCB->setObjectName(QString::fromUtf8("activeControllerCB"));
|
||||
|
||||
gridLayout->addWidget(activeControllerCB, 1, 1, 1, 1);
|
||||
|
||||
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout->addItem(horizontalSpacer, 0, 2, 1, 1);
|
||||
|
||||
checkBox = new QCheckBox(ControllerConfig);
|
||||
checkBox->setObjectName(QString::fromUtf8("checkBox"));
|
||||
|
||||
gridLayout->addWidget(checkBox, 1, 2, 1, 1);
|
||||
|
||||
inputSourceCB = new QComboBox(ControllerConfig);
|
||||
inputSourceCB->setObjectName(QString::fromUtf8("inputSourceCB"));
|
||||
|
||||
gridLayout->addWidget(inputSourceCB, 0, 1, 1, 1);
|
||||
|
||||
label_2 = new QLabel(ControllerConfig);
|
||||
label_2->setObjectName(QString::fromUtf8("label_2"));
|
||||
|
||||
gridLayout->addWidget(label_2, 1, 0, 1, 1);
|
||||
|
||||
label = new QLabel(ControllerConfig);
|
||||
label->setObjectName(QString::fromUtf8("label"));
|
||||
|
||||
gridLayout->addWidget(label, 0, 0, 1, 1);
|
||||
|
||||
|
||||
verticalLayout->addLayout(gridLayout);
|
||||
|
||||
tabWidget = new QTabWidget(ControllerConfig);
|
||||
tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
|
||||
mainStickTab = new QWidget();
|
||||
mainStickTab->setObjectName(QString::fromUtf8("mainStickTab"));
|
||||
gridLayout_3 = new QGridLayout(mainStickTab);
|
||||
gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
|
||||
verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_3->addItem(verticalSpacer_2, 2, 2, 1, 1);
|
||||
|
||||
verticalSpacer_3 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_3->addItem(verticalSpacer_3, 0, 2, 1, 1);
|
||||
|
||||
horizontalSpacer_4 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_3->addItem(horizontalSpacer_4, 1, 0, 1, 1);
|
||||
|
||||
horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_3->addItem(horizontalSpacer_3, 1, 4, 1, 1);
|
||||
|
||||
tabWidget->addTab(mainStickTab, QString());
|
||||
cStickTab = new QWidget();
|
||||
cStickTab->setObjectName(QString::fromUtf8("cStickTab"));
|
||||
gridLayout_4 = new QGridLayout(cStickTab);
|
||||
gridLayout_4->setObjectName(QString::fromUtf8("gridLayout_4"));
|
||||
horizontalSpacer_6 = new QSpacerItem(40, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_4->addItem(horizontalSpacer_6, 1, 0, 1, 1);
|
||||
|
||||
verticalSpacer_5 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_4->addItem(verticalSpacer_5, 0, 1, 1, 1);
|
||||
|
||||
verticalSpacer_4 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_4->addItem(verticalSpacer_4, 2, 1, 1, 1);
|
||||
|
||||
horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_4->addItem(horizontalSpacer_5, 1, 2, 1, 1);
|
||||
|
||||
tabWidget->addTab(cStickTab, QString());
|
||||
dPadTab = new QWidget();
|
||||
dPadTab->setObjectName(QString::fromUtf8("dPadTab"));
|
||||
gridLayout_5 = new QGridLayout(dPadTab);
|
||||
gridLayout_5->setObjectName(QString::fromUtf8("gridLayout_5"));
|
||||
horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_5->addItem(horizontalSpacer_7, 1, 2, 1, 1);
|
||||
|
||||
verticalSpacer_7 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_5->addItem(verticalSpacer_7, 0, 1, 1, 1);
|
||||
|
||||
verticalSpacer_6 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
gridLayout_5->addItem(verticalSpacer_6, 2, 1, 1, 1);
|
||||
|
||||
horizontalSpacer_8 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
gridLayout_5->addItem(horizontalSpacer_8, 1, 0, 1, 1);
|
||||
|
||||
tabWidget->addTab(dPadTab, QString());
|
||||
buttonsTab = new QWidget();
|
||||
buttonsTab->setObjectName(QString::fromUtf8("buttonsTab"));
|
||||
verticalLayout_2 = new QVBoxLayout(buttonsTab);
|
||||
verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2"));
|
||||
tabWidget->addTab(buttonsTab, QString());
|
||||
|
||||
verticalLayout->addWidget(tabWidget);
|
||||
|
||||
|
||||
retranslateUi(ControllerConfig);
|
||||
|
||||
tabWidget->setCurrentIndex(0);
|
||||
|
||||
|
||||
QMetaObject::connectSlotsByName(ControllerConfig);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QWidget *ControllerConfig)
|
||||
{
|
||||
ControllerConfig->setWindowTitle(QApplication::translate("ControllerConfig", "Controller Configuration", 0, QApplication::UnicodeUTF8));
|
||||
activeControllerCB->clear();
|
||||
activeControllerCB->insertItems(0, QStringList()
|
||||
<< QApplication::translate("ControllerConfig", "Controller 1", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("ControllerConfig", "Controller 2", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("ControllerConfig", "Controller 3", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("ControllerConfig", "Controller 4", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
checkBox->setText(QApplication::translate("ControllerConfig", "Enabled", 0, QApplication::UnicodeUTF8));
|
||||
inputSourceCB->clear();
|
||||
inputSourceCB->insertItems(0, QStringList()
|
||||
<< QApplication::translate("ControllerConfig", "Keyboard", 0, QApplication::UnicodeUTF8)
|
||||
<< QApplication::translate("ControllerConfig", "Joypad", 0, QApplication::UnicodeUTF8)
|
||||
);
|
||||
label_2->setText(QApplication::translate("ControllerConfig", "Active Controller:", 0, QApplication::UnicodeUTF8));
|
||||
label->setText(QApplication::translate("ControllerConfig", "Input Source:", 0, QApplication::UnicodeUTF8));
|
||||
tabWidget->setTabText(tabWidget->indexOf(mainStickTab), QApplication::translate("ControllerConfig", "Main Stick", 0, QApplication::UnicodeUTF8));
|
||||
tabWidget->setTabText(tabWidget->indexOf(cStickTab), QApplication::translate("ControllerConfig", "C-Stick", 0, QApplication::UnicodeUTF8));
|
||||
tabWidget->setTabText(tabWidget->indexOf(dPadTab), QApplication::translate("ControllerConfig", "D-Pad", 0, QApplication::UnicodeUTF8));
|
||||
tabWidget->setTabText(tabWidget->indexOf(buttonsTab), QApplication::translate("ControllerConfig", "Buttons", 0, QApplication::UnicodeUTF8));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class ControllerConfig: public Ui_ControllerConfig {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_CONTROLLER_CONFIG_H
|
Loading…
Add table
Add a link
Reference in a new issue