mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-12 12:45: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); });
|
||||
connect(this, &ControlSettings::AxisChanged, this,
|
||||
[this]() { ConnectAxisInputs(MappingButton); });
|
||||
|
||||
connect(ui->ActiveGamepadBox, &QComboBox::currentIndexChanged, this,
|
||||
&ControlSettings::ActiveControllerChanged);
|
||||
|
||||
connect(ui->DefaultGamepadButton, &QPushButton::clicked, this, [this]() {
|
||||
char pszGUID[33];
|
||||
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"));
|
||||
});
|
||||
|
||||
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();
|
||||
SdlEventWrapper::Wrapper::wrapperActive = true;
|
||||
QObject::connect(RemapWrapper, &SdlEventWrapper::Wrapper::SDLEvent, this,
|
||||
|
|
|
@ -746,17 +746,34 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="DefaultGamepadButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Set Active Gamepad as Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||
<item>
|
||||
<widget class="QPushButton" name="DefaultGamepadButton">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>9</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<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>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue