2016-05-09 13:34:07 +00:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2017-05-31 23:53:46 +00:00
|
|
|
#include <QDialogButtonBox>
|
2018-03-20 09:12:11 +00:00
|
|
|
#include <QPushButton>
|
2018-04-16 20:55:37 +00:00
|
|
|
#include <QTabWidget>
|
2017-05-31 23:53:46 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2018-07-06 22:40:15 +00:00
|
|
|
#include "DolphinQt/Config/SettingsWindow.h"
|
|
|
|
#include "DolphinQt/MainWindow.h"
|
|
|
|
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
|
|
|
#include "DolphinQt/Resources.h"
|
|
|
|
#include "DolphinQt/Settings.h"
|
|
|
|
#include "DolphinQt/Settings/AdvancedPane.h"
|
|
|
|
#include "DolphinQt/Settings/AudioPane.h"
|
|
|
|
#include "DolphinQt/Settings/GameCubePane.h"
|
|
|
|
#include "DolphinQt/Settings/GeneralPane.h"
|
|
|
|
#include "DolphinQt/Settings/InterfacePane.h"
|
|
|
|
#include "DolphinQt/Settings/PathPane.h"
|
|
|
|
#include "DolphinQt/Settings/WiiPane.h"
|
2017-07-21 09:22:01 +00:00
|
|
|
|
|
|
|
#include "Core/Core.h"
|
2016-05-09 13:34:07 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
|
2016-05-09 13:34:07 +00:00
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
// Set Window Properties
|
|
|
|
setWindowTitle(tr("Settings"));
|
2017-06-30 00:52:53 +00:00
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
2016-05-09 13:34:07 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
// Main Layout
|
|
|
|
QVBoxLayout* layout = new QVBoxLayout;
|
2016-05-09 13:34:07 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
// Add content to layout before dialog buttons.
|
2018-04-16 20:55:37 +00:00
|
|
|
m_tab_widget = new QTabWidget();
|
|
|
|
layout->addWidget(m_tab_widget);
|
2017-06-21 08:27:21 +00:00
|
|
|
|
2018-05-12 16:35:53 +00:00
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new GeneralPane, this, 125, 100), tr("General"));
|
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new InterfacePane, this, 125, 100), tr("Interface"));
|
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new AudioPane, this, 125, 100), tr("Audio"));
|
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new PathPane, this, 125, 100), tr("Paths"));
|
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new GameCubePane, this, 125, 100), tr("GameCube"));
|
2017-07-21 09:22:01 +00:00
|
|
|
|
|
|
|
auto* wii_pane = new WiiPane;
|
2018-05-12 16:35:53 +00:00
|
|
|
m_tab_widget->addTab(GetWrappedWidget(wii_pane, this, 125, 100), tr("Wii"));
|
2017-07-21 09:22:01 +00:00
|
|
|
|
|
|
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, [wii_pane](Core::State state) {
|
|
|
|
wii_pane->OnEmulationStateChanged(state != Core::State::Uninitialized);
|
|
|
|
});
|
|
|
|
|
2018-04-16 20:55:37 +00:00
|
|
|
m_tab_widget->addTab(new AdvancedPane(), tr("Advanced"));
|
2017-07-16 21:25:36 +00:00
|
|
|
|
|
|
|
// Dialog box buttons
|
2018-03-20 09:12:11 +00:00
|
|
|
QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
|
|
|
|
connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
|
|
|
|
|
|
layout->addWidget(close_box);
|
2016-05-09 13:34:07 +00:00
|
|
|
|
2017-07-16 21:25:36 +00:00
|
|
|
setLayout(layout);
|
2016-05-09 13:34:07 +00:00
|
|
|
}
|
2017-07-16 21:11:11 +00:00
|
|
|
|
|
|
|
void SettingsWindow::SelectAudioPane()
|
|
|
|
{
|
2018-04-16 20:55:37 +00:00
|
|
|
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::Audio));
|
2017-07-16 21:11:11 +00:00
|
|
|
}
|
2017-08-26 18:54:37 +00:00
|
|
|
|
|
|
|
void SettingsWindow::SelectGeneralPane()
|
|
|
|
{
|
2018-05-27 01:36:25 +00:00
|
|
|
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::General));
|
2017-08-26 18:54:37 +00:00
|
|
|
}
|