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