-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.cpp
39 lines (31 loc) · 956 Bytes
/
settings.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
#include "settings.h"
#include "ui_settings.h"
Player::Channel Settings::source=Player::Netease;
Player::PlayEngine Settings::engine=Player::QtMediaPlayer;
Settings::Settings(QWidget *parent) :
QWidget(parent),
ui(new Ui::Settings)
{
ui->setupUi(this);
settings=new QSettings("MiraclePlayerGroup","MiraclePlayer");
if(settings->contains("Channel")){
ui->channelSel->setCurrentIndex(settings->value("Channel").value<int>());
}
if(settings->contains("Engine")){
ui->engineSel->setCurrentIndex(settings->value("Engine").value<int>());
}
}
Settings::~Settings()
{
delete ui;
}
void Settings::on_engineSel_currentIndexChanged(int index)
{
engine=Player::PlayEngine(index);
settings->setValue("Engine",QVariant::fromValue(index));
}
void Settings::on_channelSel_currentIndexChanged(int index)
{
source=Player::Channel(index);
settings->setValue("Channel",QVariant::fromValue(index));
}