Add Configure widget
parent
446d7c7e55
commit
426c4a2a5b
@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureDialog</class>
|
||||
<widget class="QDialog" name="ConfigureDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>441</width>
|
||||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>370</width>
|
||||
<height>219</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>371</width>
|
||||
<height>221</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="ConfigureGeneral" name="generalTab">
|
||||
<attribute name="title">
|
||||
<string>General</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="inputTab">
|
||||
<attribute name="title">
|
||||
<string>Input</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="ConfigureDebug" name="debugTab">
|
||||
<attribute name="title">
|
||||
<string>Debug</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ConfigureGeneral</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configure_general.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>ConfigureDebug</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>configure_debug.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ConfigureDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>220</x>
|
||||
<y>380</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>220</x>
|
||||
<y>200</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ConfigureDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>220</x>
|
||||
<y>380</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>220</x>
|
||||
<y>200</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -0,0 +1,33 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/gdbstub/gdbstub.h" // TODO: can't include gdbstub without core.h
|
||||
#include "core/settings.h"
|
||||
|
||||
#include "configure_debug.h"
|
||||
#include "ui_configure_debug.h"
|
||||
|
||||
ConfigureDebug::ConfigureDebug(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ConfigureDebug)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setConfiguration();
|
||||
}
|
||||
|
||||
ConfigureDebug::~ConfigureDebug() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ConfigureDebug::setConfiguration() {
|
||||
ui->toogleGDBStub->setChecked(Settings::values.use_gdbstub);
|
||||
ui->GDBPortSpinBox->setValue(Settings::values.gdbstub_port);
|
||||
}
|
||||
|
||||
void ConfigureDebug::applyConfiguration() {
|
||||
GDBStub::ToggleServer(ui->toogleGDBStub->isChecked());
|
||||
Settings::values.use_gdbstub = ui->toogleGDBStub->isChecked();
|
||||
Settings::values.gdbstub_port = ui->GDBPortSpinBox->value();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef CONFIGURE_DEBUG_H
|
||||
#define CONFIGURE_DEBUG_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureDebug;
|
||||
}
|
||||
|
||||
class ConfigureDebug : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureDebug(QWidget *parent = 0);
|
||||
~ConfigureDebug();
|
||||
|
||||
void applyConfiguration();
|
||||
|
||||
private:
|
||||
void setConfiguration();
|
||||
|
||||
private:
|
||||
Ui::ConfigureDebug *ui;
|
||||
};
|
||||
|
||||
#endif // CONFIGURE_DEBUG_H
|
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureDebug</class>
|
||||
<widget class="QWidget" name="ConfigureDebug">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>GDB</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toogleGDBStub">
|
||||
<property name="text">
|
||||
<string>Enable GDB Stub</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Port:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="GDBPortSpinBox">
|
||||
<property name="maximum">
|
||||
<number>65536</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,32 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "configure_dialog.h"
|
||||
#include "ui_configure.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "core/settings.h"
|
||||
|
||||
ConfigureDialog::ConfigureDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::ConfigureDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setConfiguration();
|
||||
}
|
||||
|
||||
ConfigureDialog::~ConfigureDialog() {
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ConfigureDialog::setConfiguration() {
|
||||
}
|
||||
|
||||
void ConfigureDialog::applyConfiguration() {
|
||||
Config config;
|
||||
ui->generalTab->applyConfiguration();
|
||||
ui->debugTab->applyConfiguration();
|
||||
config.Save();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef CONFIGURE_DIALOG_H
|
||||
#define CONFIGURE_DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureDialog;
|
||||
}
|
||||
|
||||
class ConfigureDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureDialog(QWidget *parent = 0);
|
||||
~ConfigureDialog();
|
||||
|
||||
void applyConfiguration();
|
||||
|
||||
private:
|
||||
void setConfiguration();
|
||||
|
||||
private:
|
||||
Ui::ConfigureDialog *ui;
|
||||
};
|
||||
|
||||
#endif // CONFIGURE_DIALOG_H
|
@ -0,0 +1,40 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "citra_qt/configure_general.h"
|
||||
#include "citra_qt/ui_configure_general.h"
|
||||
#include "citra_qt/ui_settings.h"
|
||||
|
||||
#include "core/settings.h"
|
||||
|
||||
#include "video_core/video_core.h"
|
||||
|
||||
ConfigureGeneral::ConfigureGeneral(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ConfigureGeneral)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setConfiguration();
|
||||
}
|
||||
|
||||
ConfigureGeneral::~ConfigureGeneral()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void ConfigureGeneral::setConfiguration() {
|
||||
ui->toogleCheckExit->setChecked(UISettings::values.check_closure);
|
||||
ui->toogleHWRenderer->setChecked(Settings::values.use_hw_renderer);
|
||||
ui->toogleShaderJIT->setChecked(Settings::values.use_shader_jit);
|
||||
}
|
||||
|
||||
void ConfigureGeneral::applyConfiguration() {
|
||||
UISettings::values.check_closure = ui->toogleCheckExit->isChecked();
|
||||
|
||||
VideoCore::g_hw_renderer_enabled =
|
||||
Settings::values.use_hw_renderer = ui->toogleHWRenderer->isChecked();
|
||||
|
||||
VideoCore::g_shader_jit_enabled =
|
||||
Settings::values.use_shader_jit = ui->toogleShaderJIT->isChecked();
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef CONFIGURE_GENERAL_H
|
||||
#define CONFIGURE_GENERAL_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class ConfigureGeneral;
|
||||
}
|
||||
|
||||
class ConfigureGeneral : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ConfigureGeneral(QWidget *parent = 0);
|
||||
~ConfigureGeneral();
|
||||
|
||||
void applyConfiguration();
|
||||
|
||||
private:
|
||||
void setConfiguration();
|
||||
|
||||
private:
|
||||
Ui::ConfigureGeneral *ui;
|
||||
};
|
||||
|
||||
#endif // CONFIGURE_GENERAL_H
|
@ -0,0 +1,96 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ConfigureGeneral</class>
|
||||
<widget class="QWidget" name="ConfigureGeneral">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>284</width>
|
||||
<height>377</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>General</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toogleCheckExit">
|
||||
<property name="text">
|
||||
<string>Confirm exit while emulation is running</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Performance</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toogleHWRenderer">
|
||||
<property name="text">
|
||||
<string>Enable hardware renderer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="toogleShaderJIT">
|
||||
<property name="text">
|
||||
<string>Enable Shader JIT</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Hotkeys</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="GHotkeysDialog" name="widget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>GHotkeysDialog</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>hotkeys.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,11 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "ui_settings.h"
|
||||
|
||||
namespace UISettings {
|
||||
|
||||
Values values = {};
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
// Copyright 2016 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#ifndef UISETTINGS_H
|
||||
#define UISETTINGS_H
|
||||
|
||||
namespace UISettings {
|
||||
|
||||
struct Values {
|
||||
bool check_closure;
|
||||
} extern values;
|
||||
|
||||
}
|
||||
|
||||
#endif // UISETTINGS_H
|
Loading…
Reference in New Issue