2020-01-02 06:13:03 +00:00
|
|
|
#pragma once
|
|
|
|
#include "core/types.h"
|
|
|
|
#include <QtWidgets/QComboBox>
|
|
|
|
#include <QtWidgets/QGridLayout>
|
|
|
|
#include <QtWidgets/QLabel>
|
|
|
|
#include <QtWidgets/QLineEdit>
|
|
|
|
#include <QtWidgets/QPushButton>
|
2020-05-20 13:26:24 +00:00
|
|
|
#include <QtWidgets/QScrollArea>
|
2020-01-02 06:13:03 +00:00
|
|
|
#include <QtWidgets/QTabWidget>
|
|
|
|
#include <QtWidgets/QWidget>
|
|
|
|
#include <array>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class QTimer;
|
|
|
|
|
|
|
|
class QtHostInterface;
|
2020-04-14 15:44:16 +00:00
|
|
|
class InputBindingWidget;
|
2020-01-02 06:13:03 +00:00
|
|
|
|
2020-05-20 13:26:24 +00:00
|
|
|
class ControllerSettingsWidget : public QWidget
|
2020-01-02 06:13:03 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-05-20 13:26:24 +00:00
|
|
|
ControllerSettingsWidget(QtHostInterface* host_interface, QWidget* parent = nullptr);
|
|
|
|
~ControllerSettingsWidget();
|
2020-01-02 06:13:03 +00:00
|
|
|
|
2020-04-14 15:44:16 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void onProfileLoaded();
|
|
|
|
|
2020-01-02 06:13:03 +00:00
|
|
|
private:
|
|
|
|
QtHostInterface* m_host_interface;
|
|
|
|
|
|
|
|
QTabWidget* m_tab_widget;
|
|
|
|
|
|
|
|
struct PortSettingsUI
|
|
|
|
{
|
|
|
|
QWidget* widget;
|
|
|
|
QVBoxLayout* layout;
|
|
|
|
QComboBox* controller_type;
|
2020-05-20 13:26:24 +00:00
|
|
|
QScrollArea* bindings_scroll_area;
|
|
|
|
QWidget* bindings_container;
|
2020-04-14 15:44:16 +00:00
|
|
|
InputBindingWidget* first_button;
|
2020-01-02 06:13:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void createUi();
|
2020-04-14 15:44:16 +00:00
|
|
|
void reloadBindingButtons();
|
2020-01-02 06:13:03 +00:00
|
|
|
void createPortSettingsUi(int index, PortSettingsUI* ui);
|
2020-01-24 04:49:49 +00:00
|
|
|
void createPortBindingSettingsUi(int index, PortSettingsUI* ui, ControllerType ctype);
|
2020-01-02 06:13:03 +00:00
|
|
|
void onControllerTypeChanged(int index);
|
2020-04-14 15:44:16 +00:00
|
|
|
void onLoadProfileClicked();
|
|
|
|
void onSaveProfileClicked();
|
2020-01-02 06:13:03 +00:00
|
|
|
|
2021-01-21 07:59:40 +00:00
|
|
|
std::array<PortSettingsUI, NUM_CONTROLLER_AND_CARD_PORTS> m_port_ui = {};
|
2020-01-02 06:13:03 +00:00
|
|
|
};
|