forked from evtnlife/muemu-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.cpp
89 lines (83 loc) · 3.4 KB
/
config.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "config.h"
#include "ui_config.h"
#include <QSettings>
#include <QMessageBox>
Config::Config(QWidget *parent) :
QDialog(parent),
ui(new Ui::Config)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint);
controlConnections();
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("LangSelection","eng");
}
Config::~Config()
{
delete ui;
}
void Config::controlConnections()
{
connect(ui->btnCancelar,SIGNAL(clicked(bool)),this,SLOT(accept()));
connect(ui->btnSalvarConfig,SIGNAL(clicked(bool)),this,SLOT(SalvarConfig()));
}
void Config::SalvarConfig()
{
if(ui->rbModoJanela->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("WindowMode",00000001);
}
if(ui->rbTelaCheia->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("WindowMode",00000000);
}
if(ui->rb640x480->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000000);
}
if(ui->rb800x600->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000001);
}
if(ui->rb1024x768->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000002);
}
if(ui->rb1280x1024->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000003);
}
if(ui->rb1366x768->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000005);
}
if(ui->rb1600x1280->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",00000004);
}
if(ui->rb1920x1080->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("Resolution",8);
}
if(ui->rbMusicOff->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("MusicOnOFF",00000000);
settings.setValue("VolumeLevel",00000000);
}
if(ui->rbMusicOn->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("MusicOnOFF",00000001);
settings.setValue("VolumeLevel",00000001);
}
if(ui->rbSoundOn->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("SoundOnOFF",00000001);
settings.setValue("VolumeLevel",00000001);
}
if(ui->rbSoundOff->isChecked()){
QSettings settings("HKEY_CURRENT_USER\\Software\\Webzen\\Mu\\Config",QSettings::NativeFormat);
settings.setValue("SoundOnOFF",00000000);
}
QMessageBox::about(0,"Atenção!!!","Você salvou suas configurações com sucesso!");
this->accept();
}