@@ -7,6 +7,7 @@
#include <QVBoxLayout>

#include "DolphinQt2/Config/FilesystemWidget.h"
#include "DolphinQt2/Config/GeckoCodeWidget.h"
#include "DolphinQt2/Config/InfoWidget.h"
#include "DolphinQt2/Config/PropertiesDialog.h"

@@ -18,7 +19,14 @@ PropertiesDialog::PropertiesDialog(QWidget* parent, const GameFile& game) : QDia

QTabWidget* tab_widget = new QTabWidget(this);
InfoWidget* info = new InfoWidget(game);

GeckoCodeWidget* gecko = new GeckoCodeWidget(game);

connect(gecko, &GeckoCodeWidget::OpenGeneralSettings, this,
&PropertiesDialog::OpenGeneralSettings);

tab_widget->addTab(info, tr("Info"));
tab_widget->addTab(gecko, tr("Gecko Codes"));

if (DiscIO::IsDisc(game.GetPlatformID()))
{
@@ -13,4 +13,7 @@ class PropertiesDialog final : public QDialog
Q_OBJECT
public:
explicit PropertiesDialog(QWidget* parent, const GameFile& game);

signals:
void OpenGeneralSettings();
};
@@ -39,7 +39,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
m_tabs = new ListTabWidget();
layout->addWidget(m_tabs);

AddTab(m_tabs, tr("General"), new GeneralPane(), "config");
m_general_pane_index = AddTab(m_tabs, tr("General"), new GeneralPane(), "config");
AddTab(m_tabs, tr("Interface"), new InterfacePane(), "browse");
m_audio_pane_index = AddTab(m_tabs, tr("Audio"), new AudioPane(), "play");
AddTab(m_tabs, tr("Paths"), new PathPane(), "browse");
@@ -57,3 +57,8 @@ void SettingsWindow::SelectAudioPane()
{
m_tabs->setCurrentIndex(m_audio_pane_index);
}

void SettingsWindow::SelectGeneralPane()
{
m_tabs->setCurrentIndex(m_general_pane_index);
}
@@ -13,9 +13,11 @@ class SettingsWindow final : public QDialog
Q_OBJECT
public:
explicit SettingsWindow(QWidget* parent = nullptr);
void SelectGeneralPane();
void SelectAudioPane();

private:
ListTabWidget* m_tabs;
int m_audio_pane_index = -1;
int m_general_pane_index = -1;
};
@@ -60,8 +60,10 @@
<!--NOTE: When adding moc'd files, you must list outputs in the ClCompile ItemGroup too!-->
<ItemGroup>
<QtMoc Include="AboutDialog.h" />
<QtMoc Include="Config\CheatWarningWidget.h" />
<QtMoc Include="Config\ControllersWindow.h" />
<QtMoc Include="Config\FilesystemWidget.h" />
<QtMoc Include="Config\GeckoCodeWidget.h" />
<QtMoc Include="Config\Mapping\IOWindow.h" />
<QtMoc Include="Config\Mapping\MappingButton.h" />
<QtMoc Include="Config\Mapping\MappingWidget.h" />
@@ -113,14 +115,16 @@
<ClCompile Include="$(QtMocOutPrefix)AdvancedPane.cpp" />
<ClCompile Include="$(QtMocOutPrefix)AudioPane.cpp" />
<ClCompile Include="$(QtMocOutPrefix)AdvancedWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)EnhancementsWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)CheatWarningWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)ControllersWindow.cpp" />
<ClCompile Include="$(QtMocOutPrefix)EnhancementsWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)FilesystemWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)WindowActivationEventFilter.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GameList.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GameListDialog.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GameListModel.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GameTracker.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GeckoCodeWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GeneralPane.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GeneralWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)GraphicsBool.cpp" />
@@ -156,8 +160,10 @@
<ClCompile Include="$(QtMocOutPrefix)SoftwareRendererWidget.cpp" />
<ClCompile Include="$(QtMocOutPrefix)ToolBar.cpp" />
<ClCompile Include="AboutDialog.cpp" />
<ClCompile Include="Config\CheatWarningWidget.cpp" />
<ClCompile Include="Config\ControllersWindow.cpp" />
<ClCompile Include="Config\FilesystemWidget.cpp" />
<ClCompile Include="Config\GeckoCodeWidget.cpp" />
<ClCompile Include="Config\Graphics\AdvancedWidget.cpp" />
<ClCompile Include="Config\Graphics\EnhancementsWidget.cpp" />
<ClCompile Include="Config\Graphics\HacksWidget.cpp" />
@@ -229,8 +235,8 @@
</ItemGroup>
<!--Put standard C/C++ headers here-->
<ItemGroup>
<ClInclude Include="Config\LogWidget.h" />
<ClInclude Include="Config\LogConfigWidget.h" />
<ClInclude Include="Config\CheatWarningWidget.h" />
<ClInclude Include="Config\GeckoCodeWidget.h" />
<ClInclude Include="Config\Mapping\GCKeyboardEmu.h" />
<ClInclude Include="Config\Mapping\GCPadEmu.h" />
<ClInclude Include="Config\Mapping\GCPadWiiU.h" />
@@ -241,6 +241,9 @@ void GameList::ShowContextMenu(const QPoint&)
void GameList::OpenProperties()
{
PropertiesDialog* properties = new PropertiesDialog(this, *GetSelectedGame());

connect(properties, &PropertiesDialog::OpenGeneralSettings, this, &GameList::OpenGeneralSettings);

properties->show();
}

@@ -31,6 +31,7 @@ class GameList final : public QStackedWidget
void GameSelected();
void NetPlayHost(const QString& game_id);
void SelectionChanged(QSharedPointer<GameFile> game_file);
void OpenGeneralSettings();

private:
void ShowContextMenu(const QPoint&);
@@ -279,6 +279,8 @@ void MainWindow::ConnectGameList()
{
connect(m_game_list, &GameList::GameSelected, this, &MainWindow::Play);
connect(m_game_list, &GameList::NetPlayHost, this, &MainWindow::NetPlayHost);

connect(m_game_list, &GameList::OpenGeneralSettings, this, &MainWindow::ShowGeneralWindow);
}

void MainWindow::ConnectRenderWidget()
@@ -550,6 +552,12 @@ void MainWindow::ShowAudioWindow()
ShowSettingsWindow();
}

void MainWindow::ShowGeneralWindow()
{
m_settings_window->SelectGeneralPane();
ShowSettingsWindow();
}

void MainWindow::ShowAboutDialog()
{
AboutDialog about{this};
@@ -91,6 +91,7 @@ class MainWindow final : public QMainWindow
void HideRenderWidget();

void ShowSettingsWindow();
void ShowGeneralWindow();
void ShowAudioWindow();
void ShowControllersWindow();
void ShowGraphicsWindow();
@@ -209,3 +209,17 @@ void Settings::ResetNetPlayServer(NetPlayServer* server)
{
m_server.reset(server);
}

bool Settings::GetCheatsEnabled() const
{
return SConfig::GetInstance().bEnableCheats;
}

void Settings::SetCheatsEnabled(bool enabled)
{
if (SConfig::GetInstance().bEnableCheats != enabled)
{
SConfig::GetInstance().bEnableCheats = enabled;
emit EnableCheatsChanged(enabled);
}
}
@@ -77,6 +77,10 @@ class Settings final : public QObject
NetPlayServer* GetNetPlayServer();
void ResetNetPlayServer(NetPlayServer* server = nullptr);

// Cheats
bool GetCheatsEnabled() const;
void SetCheatsEnabled(bool enabled);

// Other
GameListModel* GetGameListModel() const;

@@ -91,6 +95,7 @@ class Settings final : public QObject
void NANDRefresh();
void LogVisibilityChanged(bool visible);
void LogConfigVisibilityChanged(bool visible);
void EnableCheatsChanged(bool enabled);

private:
std::unique_ptr<NetPlayClient> m_client;
@@ -145,7 +145,7 @@ void GeneralPane::LoadConfig()
m_checkbox_enable_analytics->setChecked(SConfig::GetInstance().m_analytics_enabled);
#endif
m_checkbox_dualcore->setChecked(SConfig::GetInstance().bCPUThread);
m_checkbox_cheats->setChecked(SConfig::GetInstance().bEnableCheats);
m_checkbox_cheats->setChecked(Settings::Instance().GetCheatsEnabled());
int selection = qRound(SConfig::GetInstance().m_EmulationSpeed * 10);
if (selection < m_combobox_speedlimit->count())
m_combobox_speedlimit->setCurrentIndex(selection);
@@ -177,7 +177,7 @@ void GeneralPane::OnSaveConfig()
SConfig::GetInstance().m_analytics_enabled = m_checkbox_enable_analytics->isChecked();
#endif
SConfig::GetInstance().bCPUThread = m_checkbox_dualcore->isChecked();
SConfig::GetInstance().bEnableCheats = m_checkbox_cheats->isChecked();
Settings::Instance().SetCheatsEnabled(m_checkbox_cheats->isChecked());
SConfig::GetInstance().m_EmulationSpeed = m_combobox_speedlimit->currentIndex() * 0.1f;
int engine_value = 0;
if (m_radio_interpreter->isChecked())