mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 20:55:56 +00:00
Add remove default button
This commit is contained in:
parent
f4c096ea4e
commit
22b9d04fb5
2 changed files with 41 additions and 12 deletions
|
@ -122,9 +122,9 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, b
|
||||||
[this]() { CheckMapping(MappingButton); });
|
[this]() { CheckMapping(MappingButton); });
|
||||||
connect(this, &ControlSettings::AxisChanged, this,
|
connect(this, &ControlSettings::AxisChanged, this,
|
||||||
[this]() { ConnectAxisInputs(MappingButton); });
|
[this]() { ConnectAxisInputs(MappingButton); });
|
||||||
|
|
||||||
connect(ui->ActiveGamepadBox, &QComboBox::currentIndexChanged, this,
|
connect(ui->ActiveGamepadBox, &QComboBox::currentIndexChanged, this,
|
||||||
&ControlSettings::ActiveControllerChanged);
|
&ControlSettings::ActiveControllerChanged);
|
||||||
|
|
||||||
connect(ui->DefaultGamepadButton, &QPushButton::clicked, this, [this]() {
|
connect(ui->DefaultGamepadButton, &QPushButton::clicked, this, [this]() {
|
||||||
char pszGUID[33];
|
char pszGUID[33];
|
||||||
SDL_GUIDToString(SDL_GetGamepadGUIDForID(gamepads[ui->ActiveGamepadBox->currentIndex()]),
|
SDL_GUIDToString(SDL_GetGamepadGUIDForID(gamepads[ui->ActiveGamepadBox->currentIndex()]),
|
||||||
|
@ -138,6 +138,18 @@ ControlSettings::ControlSettings(std::shared_ptr<GameInfoClass> game_info_get, b
|
||||||
tr("Active controller set as default"));
|
tr("Active controller set as default"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(ui->RemoveDefaultGamepadButton, &QPushButton::clicked, this, [this]() {
|
||||||
|
char pszGUID[33];
|
||||||
|
SDL_GUIDToString(SDL_GetGamepadGUIDForID(gamepads[ui->ActiveGamepadBox->currentIndex()]),
|
||||||
|
pszGUID, 33);
|
||||||
|
ui->DefaultGamepadName->setText("No default selected");
|
||||||
|
ui->DefaultGamepadLabel->setText("n/a");
|
||||||
|
Config::setDefaultControllerID("");
|
||||||
|
Config::save(Common::FS::GetUserPath(Common::FS::PathType::UserDir) / "config.toml");
|
||||||
|
QMessageBox::information(this, tr("Default Controller Removed"),
|
||||||
|
tr("No default controller currently selected"));
|
||||||
|
});
|
||||||
|
|
||||||
RemapWrapper = SdlEventWrapper::Wrapper::GetInstance();
|
RemapWrapper = SdlEventWrapper::Wrapper::GetInstance();
|
||||||
SdlEventWrapper::Wrapper::wrapperActive = true;
|
SdlEventWrapper::Wrapper::wrapperActive = true;
|
||||||
QObject::connect(RemapWrapper, &SdlEventWrapper::Wrapper::SDLEvent, this,
|
QObject::connect(RemapWrapper, &SdlEventWrapper::Wrapper::SDLEvent, this,
|
||||||
|
|
|
@ -746,17 +746,34 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="DefaultGamepadButton">
|
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||||
<property name="font">
|
<item>
|
||||||
<font>
|
<widget class="QPushButton" name="DefaultGamepadButton">
|
||||||
<pointsize>9</pointsize>
|
<property name="font">
|
||||||
<bold>true</bold>
|
<font>
|
||||||
</font>
|
<pointsize>9</pointsize>
|
||||||
</property>
|
<bold>true</bold>
|
||||||
<property name="text">
|
</font>
|
||||||
<string>Set Active Gamepad as Default</string>
|
</property>
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Set Active Gamepad as Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="RemoveDefaultGamepadButton">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove Default Gamepad</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue