2016-05-09 07:34:07 -06:00
|
|
|
// Copyright 2016 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2016-05-09 07:34:07 -06:00
|
|
|
|
2021-12-09 19:22:16 -07:00
|
|
|
#include "DolphinQt/Config/SettingsWindow.h"
|
|
|
|
|
2017-05-31 17:53:46 -06:00
|
|
|
#include <QDialogButtonBox>
|
2018-03-20 03:12:11 -06:00
|
|
|
#include <QPushButton>
|
2018-04-16 14:55:37 -06:00
|
|
|
#include <QTabWidget>
|
2017-05-31 17:53:46 -06:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2018-07-06 16:40:15 -06:00
|
|
|
#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 03:22:01 -06:00
|
|
|
|
|
|
|
#include "Core/Core.h"
|
2016-05-09 07:34:07 -06:00
|
|
|
|
|
|
|
SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
|
|
|
|
{
|
|
|
|
// Set Window Properties
|
|
|
|
setWindowTitle(tr("Settings"));
|
2017-06-29 18:52:53 -06:00
|
|
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
2016-05-09 07:34:07 -06:00
|
|
|
|
|
|
|
// Main Layout
|
|
|
|
QVBoxLayout* layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
// Add content to layout before dialog buttons.
|
2018-04-16 14:55:37 -06:00
|
|
|
m_tab_widget = new QTabWidget();
|
|
|
|
layout->addWidget(m_tab_widget);
|
2017-06-21 02:27:21 -06:00
|
|
|
|
2018-05-12 10:35:53 -06: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"));
|
2019-10-26 09:51:43 -06:00
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new WiiPane, this, 125, 100), tr("Wii"));
|
2019-10-15 16:23:12 -06:00
|
|
|
m_tab_widget->addTab(GetWrappedWidget(new AdvancedPane, this, 125, 200), tr("Advanced"));
|
2017-07-16 15:25:36 -06:00
|
|
|
|
|
|
|
// Dialog box buttons
|
2018-03-20 03:12:11 -06:00
|
|
|
QDialogButtonBox* close_box = new QDialogButtonBox(QDialogButtonBox::Close);
|
|
|
|
|
|
|
|
connect(close_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
|
|
|
|
|
|
|
layout->addWidget(close_box);
|
2016-05-09 07:34:07 -06:00
|
|
|
|
2017-07-16 15:25:36 -06:00
|
|
|
setLayout(layout);
|
2016-05-09 07:34:07 -06:00
|
|
|
}
|
2017-07-16 15:11:11 -06:00
|
|
|
|
|
|
|
void SettingsWindow::SelectAudioPane()
|
|
|
|
{
|
2018-04-16 14:55:37 -06:00
|
|
|
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::Audio));
|
2017-07-16 15:11:11 -06:00
|
|
|
}
|
2017-08-26 12:54:37 -06:00
|
|
|
|
|
|
|
void SettingsWindow::SelectGeneralPane()
|
|
|
|
{
|
2018-05-26 19:36:25 -06:00
|
|
|
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::General));
|
2017-08-26 12:54:37 -06:00
|
|
|
}
|