Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: Implement mapping dialogs #5405

Merged
merged 1 commit into from May 20, 2017

Conversation

spycrab
Copy link
Contributor

@spycrab spycrab commented May 12, 2017

Features:

  • Windows
    • GameCube
      • Controller (Emulated)
      • Controller (Passthrough)
      • Keyboard
      • Bongos
      • Steering Wheel
      • Dance Mat
    • Wii
      • Emulated
      • Hybrid
        • Extensions
          • Nunchuck
          • Classic Controller
          • Guitar
          • Drums
          • Turntable
  • Basics
    • Load Settings
    • Save Settings
    • Configure Mappings
    • Configure Checkboxes
    • Configure Numbers
    • Configure Outputs (Separate PR)
  • Dialogs
    • Advanced Input Dialogs (Separate PR)
    • Output Configuration Dialogs (Separate PR)
  • Profiles
    • Deleting
    • Saving
    • Loading
  • Devices
    • Changing devices
    • Remembering default device

Screenshots (Outdated):
GC Adapter
Emulated Wii Remote

@spycrab spycrab force-pushed the qt_mapping_windows branch 9 times, most recently from 4480379 to 6babb05 Compare May 12, 2017 17:47
virtual void OnSaveProfile(const QString& profile) = 0;
virtual void OnLoadProfile(const QString& profile) = 0;

MappingWindow* GetParent();

This comment was marked as off-topic.


#include "DolphinQt2/Config/MappingWindow.h"

MappingWindow::MappingWindow(const int portnr, QWidget* parent)

This comment was marked as off-topic.

MAPPING_WIIMOTE_HYBRID
};

explicit MappingWindow(const int portnr, QWidget* parent);

This comment was marked as off-topic.

void CreateMainLayout();
void ConnectWidgets();

bool IsLayoutComplex();

This comment was marked as off-topic.


void RefreshDevices();

ControllerEmu::EmulatedController* controller;

This comment was marked as off-topic.

if (controller == nullptr)
return;

std::cout << "Refreshing devices..." << std::endl;

This comment was marked as off-topic.

g_controller_interface.RefreshDevices();
controller->UpdateReferences(g_controller_interface);

std::cout << g_controller_interface.GetAllDeviceStrings().size() << " device(s) found."

This comment was marked as off-topic.


std::cout << "Refreshing devices..." << std::endl;

bool paused = Core::PauseAndLock(true);

This comment was marked as off-topic.


QTabWidget* m_tab_widget;

int mapping_type;

This comment was marked as off-topic.

#include "DolphinQt2/Config/MappingWindow.h"

MappingWindow::MappingWindow(const int portnr, QWidget* parent)
: QDialog(parent), controller(nullptr), port(portnr)

This comment was marked as off-topic.

@spycrab spycrab force-pushed the qt_mapping_windows branch 5 times, most recently from 1e22c21 to c9371c4 Compare May 13, 2017 23:49
m_profiles_box->setHidden(!is_complex);
m_devices_box->setHidden(!is_complex);

this->m_is_complex = is_complex;

This comment was marked as off-topic.


void MappingWindow::ConnectWidgets()
{
const QString& text =

This comment was marked as off-topic.

connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices);
connect(m_devices_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &MappingWindow::OnDeviceChanged);
connect(m_reset_clear, &QPushButton::clicked, this, [this]() { emit ClearFields(); });

This comment was marked as off-topic.


m_main_layout->addWidget(CreateGroupBox("Buttons", Pad::GetGroup(GetPort(), PadGroup::Buttons)));
m_main_layout->addWidget(
CreateGroupBox("Controlstick", Pad::GetGroup(GetPort(), PadGroup::MainStick)));

This comment was marked as off-topic.


QGroupBox* MappingWidget::CreateGroupBox(const char* name, ControllerEmu::ControlGroup* group) const
{
QGroupBox* group_box = new QGroupBox(tr(name));

This comment was marked as off-topic.

@spycrab spycrab force-pushed the qt_mapping_windows branch 3 times, most recently from 3704358 to d4f952a Compare May 14, 2017 14:57

void MappingButton::OnButtonPressed()
{
if (m_reference->IsInput())

This comment was marked as off-topic.

This comment was marked as off-topic.


#include <QRegExp>
#include <QString>
#include <chrono>

This comment was marked as off-topic.

connect(this, &MappingButton::clicked, this, &MappingButton::OnButtonPressed);
}

static inline QString

This comment was marked as off-topic.

}

static inline QString
GetExpressionForControl(QString& control_name,

This comment was marked as off-topic.

#include "Core/HW/GCPad.h"
#include "Core/HW/GCPadEmu.h"

#include "DolphinQt2/Config/Mapping/GCPadEmu.h"

This comment was marked as off-topic.

#include <QFormLayout>
#include <QGroupBox>
#include <QPushButton>
#include <iostream>

This comment was marked as off-topic.

#include <QPushButton>
#include <QTabWidget>
#include <QVBoxLayout>
#include <iostream>

This comment was marked as off-topic.


int m_mapping_type;
const int m_port;
bool m_is_complex;

This comment was marked as off-topic.

This comment was marked as off-topic.

public:
explicit GCPadEmu(MappingWindow* window);

protected:

This comment was marked as off-topic.

public:
explicit GCPadWiiU(MappingWindow* window);

protected:

This comment was marked as off-topic.

@spycrab spycrab force-pushed the qt_mapping_windows branch 6 times, most recently from 1387174 to 31f113e Compare May 16, 2017 19:56
@spycrab spycrab changed the title [WIP] [RFC] Qt: Implement mapping windows [WIP] Qt: Implement mapping windows May 16, 2017
@spycrab spycrab force-pushed the qt_mapping_windows branch 3 times, most recently from 502547f to 9c3dd56 Compare May 17, 2017 20:40
@spycrab spycrab force-pushed the qt_mapping_windows branch 3 times, most recently from bdddb7e to 242e3cb Compare May 18, 2017 18:00
case MAPPING_WIIMOTE_EMU:
case MAPPING_WIIMOTE_HYBRID:
widget = new WiimoteEmuGeneral(this);
setWindowTitle(tr("Wiimote at Port %1").arg(GetPort() + 1));

This comment was marked as off-topic.

@spycrab spycrab changed the title [WIP] Qt: Implement mapping windows Qt: Implement mapping windows May 20, 2017
@spycrab
Copy link
Contributor Author

spycrab commented May 20, 2017

Not everything is perfect or complete yet, but I want to implement the missing features later down the road in different PRs (Will also result in others being able to work on it in the meantime).

@spycrab spycrab changed the title Qt: Implement mapping windows Implement mapping windows May 20, 2017

void MappingButton::Clear()
{
m_reference->expression = "";

This comment was marked as off-topic.

m_first = false;
return true;
}
else

This comment was marked as off-topic.

{
if (!m_block)
return QDialog::event(event);
else

This comment was marked as off-topic.

public:
enum
{
NONE = 0,

This comment was marked as off-topic.

void SetGCAdapterRumbleEnabled(int port, bool enabled);

bool IsGCAdapterSimulatingDKBongos(int port) const;
void SetGCAdapterSimulatingDKBongos(int potr, bool enabled);

This comment was marked as off-topic.

{
Q_OBJECT
public:
enum

This comment was marked as off-topic.

{
const QString value = m_extension_combo->currentText();

const static QMap<QString, int> value_map = {

This comment was marked as off-topic.

@spycrab spycrab force-pushed the qt_mapping_windows branch 2 times, most recently from 87d65d6 to ec29706 Compare May 20, 2017 01:47
@spycrab spycrab changed the title Implement mapping windows Qt: Implement mapping windows May 20, 2017
@spycrab spycrab changed the title Qt: Implement mapping windows Qt: Implement mapping dialogs May 20, 2017
@spycrab
Copy link
Contributor Author

spycrab commented May 20, 2017

Should be ready to merge now.

@Helios747 Helios747 merged commit cf60564 into dolphin-emu:master May 20, 2017
@spycrab spycrab deleted the qt_mapping_windows branch May 21, 2017 20:39
@leoetlino leoetlino modified the milestone: Qt Sep 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants