2015-12-20 16:36:39 -07:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <QSize>
|
|
|
|
|
|
|
|
#include "Common/FileUtil.h"
|
|
|
|
#include "Core/ConfigManager.h"
|
|
|
|
#include "DolphinQt2/Settings.h"
|
|
|
|
|
|
|
|
static QString GetSettingsPath()
|
|
|
|
{
|
|
|
|
return QString::fromStdString(File::GetUserPath(D_CONFIG_IDX)) + QStringLiteral("/UI.ini");
|
|
|
|
}
|
|
|
|
|
|
|
|
Settings::Settings(QObject* parent)
|
|
|
|
: QSettings(GetSettingsPath(), QSettings::IniFormat, parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetThemeDir() const
|
|
|
|
{
|
|
|
|
QString theme_name = value(QStringLiteral("Theme"), QStringLiteral("Clean")).toString();
|
|
|
|
return QString::fromStdString(File::GetThemeDir(theme_name.toStdString()));
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetLastGame() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("GameList/LastGame")).toString();
|
|
|
|
}
|
|
|
|
|
2015-12-21 20:46:03 -07:00
|
|
|
void Settings::SetLastGame(const QString& path)
|
2015-12-20 16:36:39 -07:00
|
|
|
{
|
|
|
|
setValue(QStringLiteral("GameList/LastGame"), path);
|
|
|
|
}
|
|
|
|
|
|
|
|
QStringList Settings::GetPaths() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("GameList/Paths")).toStringList();
|
|
|
|
}
|
|
|
|
|
2015-12-21 20:46:03 -07:00
|
|
|
void Settings::SetPaths(const QStringList& paths)
|
2015-12-20 16:36:39 -07:00
|
|
|
{
|
|
|
|
setValue(QStringLiteral("GameList/Paths"), paths);
|
|
|
|
}
|
|
|
|
|
2015-12-30 20:03:13 -07:00
|
|
|
void Settings::RemovePath(int i)
|
|
|
|
{
|
|
|
|
QStringList paths = GetPaths();
|
|
|
|
paths.removeAt(i);
|
|
|
|
SetPaths(paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetDefaultGame() const
|
|
|
|
{
|
|
|
|
return QString::fromStdString(SConfig::GetInstance().m_strDefaultISO);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::SetDefaultGame(const QString& path)
|
|
|
|
{
|
|
|
|
SConfig::GetInstance().m_strDefaultISO = path.toStdString();
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetDVDRoot() const
|
|
|
|
{
|
|
|
|
return QString::fromStdString(SConfig::GetInstance().m_strDVDRoot);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::SetDVDRoot(const QString& path)
|
|
|
|
{
|
|
|
|
SConfig::GetInstance().m_strDVDRoot = path.toStdString();
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetApploader() const
|
|
|
|
{
|
|
|
|
return QString::fromStdString(SConfig::GetInstance().m_strApploader);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::SetApploader(const QString& path)
|
|
|
|
{
|
|
|
|
SConfig::GetInstance().m_strApploader = path.toStdString();
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Settings::GetWiiNAND() const
|
|
|
|
{
|
|
|
|
return QString::fromStdString(SConfig::GetInstance().m_NANDPath);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::SetWiiNAND(const QString& path)
|
|
|
|
{
|
|
|
|
SConfig::GetInstance().m_NANDPath = path.toStdString();
|
|
|
|
SConfig::GetInstance().SaveSettings();
|
|
|
|
}
|
|
|
|
|
2015-12-20 16:36:39 -07:00
|
|
|
DiscIO::IVolume::ELanguage Settings::GetWiiSystemLanguage() const
|
|
|
|
{
|
|
|
|
return SConfig::GetInstance().GetCurrentLanguage(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
DiscIO::IVolume::ELanguage Settings::GetGCSystemLanguage() const
|
|
|
|
{
|
|
|
|
return SConfig::GetInstance().GetCurrentLanguage(false);
|
|
|
|
}
|
|
|
|
|
2016-01-01 03:29:39 -07:00
|
|
|
bool Settings::GetPreferredView() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("PreferredView"), true).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Settings::SetPreferredView(bool table)
|
|
|
|
{
|
|
|
|
setValue(QStringLiteral("PreferredView"), table);
|
|
|
|
}
|
|
|
|
|
2015-12-20 16:36:39 -07:00
|
|
|
bool Settings::GetConfirmStop() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("Emulation/ConfirmStop"), true).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Settings::GetRenderToMain() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("Graphics/RenderToMain"), false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Settings::GetFullScreen() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("Graphics/FullScreen"), false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize Settings::GetRenderWindowSize() const
|
|
|
|
{
|
|
|
|
return value(QStringLiteral("Graphics/RenderWindowSize"), QSize(640, 480)).toSize();
|
|
|
|
}
|