dolphin/Source/Core/DolphinQt2/Config/SettingsWindow.cpp

72 lines
2.3 KiB
C++
Raw Normal View History

// 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>
#include "DolphinQt2/Config/SettingsWindow.h"
2017-06-21 08:27:21 +00:00
#include "DolphinQt2/MainWindow.h"
#include "DolphinQt2/QtUtils/WrapInScrollArea.h"
#include "DolphinQt2/Resources.h"
#include "DolphinQt2/Settings.h"
2017-06-28 04:36:27 +00:00
#include "DolphinQt2/Settings/AdvancedPane.h"
2017-06-21 08:27:21 +00:00
#include "DolphinQt2/Settings/AudioPane.h"
2018-01-04 00:41:31 +00:00
#include "DolphinQt2/Settings/GameCubePane.h"
#include "DolphinQt2/Settings/GeneralPane.h"
#include "DolphinQt2/Settings/InterfacePane.h"
#include "DolphinQt2/Settings/PathPane.h"
#include "DolphinQt2/Settings/WiiPane.h"
#include "Core/Core.h"
SettingsWindow::SettingsWindow(QWidget* parent) : QDialog(parent)
{
// Set Window Properties
setWindowTitle(tr("Settings"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
// Main Layout
QVBoxLayout* layout = new QVBoxLayout;
// 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
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"));
auto* wii_pane = new WiiPane;
m_tab_widget->addTab(GetWrappedWidget(wii_pane, this, 125, 100), tr("Wii"));
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"));
// 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);
setLayout(layout);
}
void SettingsWindow::SelectAudioPane()
{
2018-04-16 20:55:37 +00:00
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::Audio));
}
void SettingsWindow::SelectGeneralPane()
{
m_tab_widget->setCurrentIndex(static_cast<int>(TabIndex::General));
}