mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Use a separate INI file for UI settings.
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "DiscIO/VolumeCreator.h"
|
||||
#include "DolphinQt2/Resources.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "DolphinQt2/GameList/GameFile.h"
|
||||
|
||||
static const int CACHE_VERSION = 13; // Last changed in PR #3261
|
||||
@ -50,12 +51,6 @@ GameFile::GameFile(QString path) : m_path(path)
|
||||
m_valid = true;
|
||||
}
|
||||
|
||||
DiscIO::IVolume::ELanguage GameFile::GetDefaultLanguage() const
|
||||
{
|
||||
bool wii = m_platform != DiscIO::IVolume::GAMECUBE_DISC;
|
||||
return SConfig::GetInstance().GetCurrentLanguage(wii);
|
||||
}
|
||||
|
||||
QString GameFile::GetCacheFileName() const
|
||||
{
|
||||
QString folder = QString::fromStdString(File::GetUserPath(D_CACHE_IDX));
|
||||
@ -194,7 +189,14 @@ QString GameFile::GetLanguageString(QMap<DiscIO::IVolume::ELanguage, QString> m)
|
||||
// Try the settings language, then English, then just pick one.
|
||||
if (m.isEmpty())
|
||||
return QString();
|
||||
DiscIO::IVolume::ELanguage current_lang = GetDefaultLanguage();
|
||||
|
||||
bool wii = m_platform != DiscIO::IVolume::GAMECUBE_DISC;
|
||||
DiscIO::IVolume::ELanguage current_lang;
|
||||
if (wii)
|
||||
current_lang = Settings().GetWiiSystemLanguage();
|
||||
else
|
||||
current_lang = Settings().GetGCSystemLanguage();
|
||||
|
||||
if (m.contains(current_lang))
|
||||
return m[current_lang];
|
||||
if (m.contains(DiscIO::IVolume::LANGUAGE_ENGLISH))
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include <QHeaderView>
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "DolphinQt2/GameList/GameList.h"
|
||||
#include "DolphinQt2/GameList/ListProxyModel.h"
|
||||
#include "DolphinQt2/GameList/TableProxyModel.h"
|
||||
|
@ -6,9 +6,20 @@
|
||||
#include <QDirIterator>
|
||||
#include <QFile>
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "DolphinQt2/Settings.h"
|
||||
#include "DolphinQt2/GameList/GameTracker.h"
|
||||
|
||||
static const QStringList game_filters{
|
||||
QStringLiteral("*.gcm"),
|
||||
QStringLiteral("*.iso"),
|
||||
QStringLiteral("*.ciso"),
|
||||
QStringLiteral("*.gcz"),
|
||||
QStringLiteral("*.wbfs"),
|
||||
QStringLiteral("*.wad"),
|
||||
QStringLiteral("*.elf"),
|
||||
QStringLiteral("*.dol")
|
||||
};
|
||||
|
||||
GameTracker::GameTracker(QObject* parent)
|
||||
: QFileSystemWatcher(parent)
|
||||
{
|
||||
@ -22,12 +33,10 @@ GameTracker::GameTracker(QObject* parent)
|
||||
connect(this, &GameTracker::PathChanged, m_loader, &GameLoader::LoadGame);
|
||||
connect(m_loader, &GameLoader::GameLoaded, this, &GameTracker::GameLoaded);
|
||||
|
||||
GenerateFilters();
|
||||
|
||||
m_loader_thread.start();
|
||||
|
||||
for (const std::string& dir : SConfig::GetInstance().m_ISOFolder)
|
||||
AddDirectory(QString::fromStdString(dir));
|
||||
for (QString dir : Settings().GetPaths())
|
||||
AddDirectory(dir);
|
||||
}
|
||||
|
||||
GameTracker::~GameTracker()
|
||||
@ -44,7 +53,7 @@ void GameTracker::AddDirectory(QString dir)
|
||||
|
||||
void GameTracker::UpdateDirectory(QString dir)
|
||||
{
|
||||
QDirIterator it(dir, m_filters);
|
||||
QDirIterator it(dir, game_filters);
|
||||
while (it.hasNext())
|
||||
{
|
||||
QString path = QFileInfo(it.next()).canonicalFilePath();
|
||||
@ -69,16 +78,3 @@ void GameTracker::UpdateFile(QString file)
|
||||
emit GameRemoved(file);
|
||||
}
|
||||
}
|
||||
|
||||
void GameTracker::GenerateFilters()
|
||||
{
|
||||
m_filters.clear();
|
||||
if (SConfig::GetInstance().m_ListGC)
|
||||
m_filters << tr("*.gcm");
|
||||
if (SConfig::GetInstance().m_ListWii || SConfig::GetInstance().m_ListGC)
|
||||
m_filters << tr("*.iso") << tr("*.ciso") << tr("*.gcz") << tr("*.wbfs");
|
||||
if (SConfig::GetInstance().m_ListWad)
|
||||
m_filters << tr("*.wad");
|
||||
if (SConfig::GetInstance().m_ListElfDol)
|
||||
m_filters << tr("*.elf") << tr("*.dol");
|
||||
}
|
||||
|
@ -39,10 +39,8 @@ signals:
|
||||
private:
|
||||
void UpdateDirectory(QString dir);
|
||||
void UpdateFile(QString path);
|
||||
void GenerateFilters();
|
||||
|
||||
QSet<QString> m_tracked_files;
|
||||
QStringList m_filters;
|
||||
QThread m_loader_thread;
|
||||
GameLoader* m_loader;
|
||||
};
|
||||
|
Reference in New Issue
Block a user