-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Add controller (overview) window #5377
Conversation
I don't really like how this is split. You have GC controllers all by themselves on the left with a ton of empty space, with everything else on the right. And background input isn't really worthy of it's own visual section. I get what you were going for, but I feel the old design was better. |
Yeah, the split thing was more of an afterthought, but I can change this in one minute, so that's not really a problem. The separate section is also present in the original Wx Dialog so I'm not sure what to do about that (As it's neither a GameCube nor a Wii option), I could slim it down a bit by not wrapping it in this "Advanced" box if that's preferable? |
Ah, you're right, it looks fine in the old Wx UI because it isn't stretched across two sections |
Yeah, I'll just see how it looks when I use the classic "top-down" approach and see what to do afterwards. |
ba7393d
to
3bd86f3
Compare
|
||
#pragma once | ||
|
||
#include <QBoxLayout> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QHBoxLayout* m_advanced_layout; | ||
QCheckBox* m_advanced_bg_input; | ||
|
||
static const std::unordered_map<SerialInterface::SIDevices, int> m_gc_types; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
static int ToGCMenuIndex(const SerialInterface::SIDevices&); | ||
static SerialInterface::SIDevices FromGCMenuIndex(const int& menudevice); | ||
|
||
static int ToWiimoteMenuIndex(const int& device); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Q_OBJECT | ||
public: | ||
explicit ControllersWindow(QWidget* parent); | ||
private slots: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QGroupBox* m_gc_box; | ||
QLabel* m_gc_label; | ||
QFormLayout* m_gc_layout; | ||
QComboBox* m_gc_controller_boxes[4]; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
auto* box = static_cast<QComboBox*>(QObject::sender()); | ||
|
||
for (int i = 0; i < 4; i++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include <QLabel> | ||
#include <QMessageBox> | ||
#include <QPixmap> | ||
#include <iostream> |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
void ControllersWindow::ConnectWidgets() | ||
{ | ||
connect(m_wiimote_passthrough, SIGNAL(toggled(bool)), this, SLOT(OnWiimoteModeChanged(bool))); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
static int ToWiimoteMenuIndex(const int& device); | ||
static int FromWiimoteMenuIndex(const int& menudevice); | ||
}; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -1,81 +1,100 @@ | |||
find_package(Qt5Widgets REQUIRED) | |||
message(STATUS "Found Qt version ${Qt5Core_VERSION}") | |||
find_package(Qt5Widgets REQUIRED) message(STATUS "Found Qt version ${Qt5Core_VERSION}") |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Updated GUI as suggested by @Helios747. |
auto device = ios->GetDeviceByName("/dev/usb/oh1/57e/305"); | ||
if (device != nullptr) | ||
{ | ||
static_cast<IOS::HLE::Device::BluetoothBase*>(device.get())->TriggerSyncButtonHeldEvent(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
if (device != nullptr) | ||
{ | ||
static_cast<IOS::HLE::Device::BluetoothBase*>(device.get())->TriggerSyncButtonPressedEvent(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
for (int i = 0; i < 4; i++) | ||
{ | ||
if (m_gc_controller_boxes[i] == box) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
auto* box = static_cast<QComboBox*>(QObject::sender()); | ||
|
||
for (int i = 0; i < 4; i++) |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aa9cdbb
to
87f3934
Compare
Source/Core/DolphinQt2/Settings.cpp
Outdated
@@ -1,7 +1,8 @@ | |||
// Copyright 2015 Dolphin Emulator Project |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/Settings.h
Outdated
@@ -1,4 +1,4 @@ | |||
// Copyright 2015 Dolphin Emulator Project | |||
// Copyright 2017 Dolphin Emulator Project |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Source/Core/DolphinQt2/MainWindow.h
Outdated
@@ -9,6 +9,7 @@ | |||
#include <QString> | |||
#include <QToolBar> | |||
|
|||
#include "DolphinQt2/Config/ControllersWindow.h" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
auto it = std::find_if(gc_types.begin(), gc_types.end(), | ||
[=](auto pair) { return pair.second == menudevice; }); | ||
return (*it).first; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
{ | ||
auto it = std::find_if(wiimote_types.begin(), wiimote_types.end(), | ||
[=](auto pair) { return pair.second == menudevice; }); | ||
return (*it).first; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
#include "Core/IOS/USB/Bluetooth/BTReal.h" | ||
#include "DolphinQt2/Settings.h" | ||
|
||
#include "ControllersWindow.h" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
#include "ControllersWindow.h" | ||
|
||
static const std::unordered_map<SerialInterface::SIDevices, int> gc_types = { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QHBoxLayout* m_advanced_layout; | ||
QCheckBox* m_advanced_bg_input; | ||
|
||
static int ToGCMenuIndex(const SerialInterface::SIDevices); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayImilae should the emulation settings come first, and then the passthrough ones? (I'm assuming most users would emulate it, so it would likely be better to place that first if so). |
@MayImilae Adjusted it. |
That shows up when you use the keyboard to switch between options, it shows what you have selected. |
Hmm, interesting. Oh btw, the config icons weren't meant to be the size you are displaying them there. That's not really something for this PR, but if you want size adjusted versions for any icons or new icons, please let me know! |
234b416
to
3040084
Compare
|
||
#include <array> | ||
|
||
#include "Core/HW/SI/SI.h" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
608f8e4
to
f97cfc0
Compare
Added a Windows screenshot. |
Really subjective opinion: I think the dialog would look a lot better if the controls were aligned. Right now, it's all very, very inconsistent :( |
@leoetlino Hm, I'll see what I can do about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the silly nitpicks, I think this looks fine to merge.
{ | ||
m_gc_box = new QGroupBox(m_gc_label); | ||
m_gc_layout = new QFormLayout(); | ||
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
m_wiimote_pt_labels[0] = new QLabel(tr("Sync real Wii Remotes and pair them")); | ||
m_wiimote_pt_labels[1] = new QLabel(tr("Reset all saved Wii Remote pairings")); | ||
m_wiimote_emu = new QRadioButton(tr("Emulate the Wii Bluetooth Adapter")); | ||
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
QRadioButton* m_wiimote_passthrough; | ||
QPushButton* m_wiimote_sync; | ||
QPushButton* m_wiimote_reset; | ||
QCheckBox* m_wiimote_continous_scanning; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
m_wiimote_pt_labels[1] = new QLabel(tr("Reset all saved Wii Remote pairings")); | ||
m_wiimote_emu = new QRadioButton(tr("Emulate the Wii Bluetooth Adapter")); | ||
|
||
m_wiimote_continous_scanning = new QCheckBox(tr("Continous Scanning")); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
0602c5a
to
7e3a4ba
Compare
@leoetlino Can this be merged now? I fixed the alignment and spelling mistakes (Can't update the screenshots ATM). |
This has merge conflicts now. |
Should be rather easy to fix. |
Mostly finished, but I want to get some Feedback before finishing this up.
TODO List:
Configuration Windows(For Mapping etc.) Separate PR(s).