DolphinQt: Add way to override "Load" folder that controls the location of custom textures
This commit is contained in:
parent
a7d4be79ae
commit
876a1ccc3e
|
@ -135,6 +135,7 @@ const ConfigInfo<int> MAIN_AUDIO_VOLUME{{System::Main, "DSP", "Volume"}, 100};
|
||||||
// Main.General
|
// Main.General
|
||||||
|
|
||||||
const ConfigInfo<std::string> MAIN_DUMP_PATH{{System::Main, "General", "DumpPath"}, ""};
|
const ConfigInfo<std::string> MAIN_DUMP_PATH{{System::Main, "General", "DumpPath"}, ""};
|
||||||
|
const ConfigInfo<std::string> MAIN_LOAD_PATH{{System::Main, "General", "LoadPath"}, ""};
|
||||||
const ConfigInfo<std::string> MAIN_FS_PATH{{System::Main, "General", "NANDRootPath"}, ""};
|
const ConfigInfo<std::string> MAIN_FS_PATH{{System::Main, "General", "NANDRootPath"}, ""};
|
||||||
const ConfigInfo<std::string> MAIN_SD_PATH{{System::Main, "General", "WiiSDCardPath"}, ""};
|
const ConfigInfo<std::string> MAIN_SD_PATH{{System::Main, "General", "WiiSDCardPath"}, ""};
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ extern const ConfigInfo<bool> MAIN_DISABLE_SCREENSAVER;
|
||||||
// Main.General
|
// Main.General
|
||||||
|
|
||||||
extern const ConfigInfo<std::string> MAIN_DUMP_PATH;
|
extern const ConfigInfo<std::string> MAIN_DUMP_PATH;
|
||||||
|
extern const ConfigInfo<std::string> MAIN_LOAD_PATH;
|
||||||
extern const ConfigInfo<std::string> MAIN_FS_PATH;
|
extern const ConfigInfo<std::string> MAIN_FS_PATH;
|
||||||
extern const ConfigInfo<std::string> MAIN_SD_PATH;
|
extern const ConfigInfo<std::string> MAIN_SD_PATH;
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,17 @@ void PathPane::BrowseDump()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PathPane::BrowseLoad()
|
||||||
|
{
|
||||||
|
QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(
|
||||||
|
this, tr("Select Load Path"), QString::fromStdString(Config::Get(Config::MAIN_LOAD_PATH))));
|
||||||
|
if (!dir.isEmpty())
|
||||||
|
{
|
||||||
|
m_load_edit->setText(dir);
|
||||||
|
Config::SetBase(Config::MAIN_LOAD_PATH, dir.toStdString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void PathPane::BrowseSDCard()
|
void PathPane::BrowseSDCard()
|
||||||
{
|
{
|
||||||
QString file = QDir::toNativeSeparators(QFileDialog::getOpenFileName(
|
QString file = QDir::toNativeSeparators(QFileDialog::getOpenFileName(
|
||||||
|
@ -183,13 +194,22 @@ QGridLayout* PathPane::MakePathsLayout()
|
||||||
layout->addWidget(m_dump_edit, 2, 1);
|
layout->addWidget(m_dump_edit, 2, 1);
|
||||||
layout->addWidget(dump_open, 2, 2);
|
layout->addWidget(dump_open, 2, 2);
|
||||||
|
|
||||||
|
m_load_edit = new QLineEdit(QString::fromStdString(Config::Get(Config::MAIN_LOAD_PATH)));
|
||||||
|
connect(m_load_edit, &QLineEdit::editingFinished,
|
||||||
|
[=] { Config::SetBase(Config::MAIN_LOAD_PATH, m_load_edit->text().toStdString()); });
|
||||||
|
QPushButton* load_open = new QPushButton(QStringLiteral("..."));
|
||||||
|
connect(load_open, &QPushButton::clicked, this, &PathPane::BrowseLoad);
|
||||||
|
layout->addWidget(new QLabel(tr("Load Path:")), 3, 0);
|
||||||
|
layout->addWidget(m_load_edit, 3, 1);
|
||||||
|
layout->addWidget(load_open, 3, 2);
|
||||||
|
|
||||||
m_sdcard_edit = new QLineEdit(QString::fromStdString(Config::Get(Config::MAIN_SD_PATH)));
|
m_sdcard_edit = new QLineEdit(QString::fromStdString(Config::Get(Config::MAIN_SD_PATH)));
|
||||||
connect(m_sdcard_edit, &QLineEdit::editingFinished, this, &PathPane::OnSDCardPathChanged);
|
connect(m_sdcard_edit, &QLineEdit::editingFinished, this, &PathPane::OnSDCardPathChanged);
|
||||||
QPushButton* sdcard_open = new QPushButton(QStringLiteral("..."));
|
QPushButton* sdcard_open = new QPushButton(QStringLiteral("..."));
|
||||||
connect(sdcard_open, &QPushButton::clicked, this, &PathPane::BrowseSDCard);
|
connect(sdcard_open, &QPushButton::clicked, this, &PathPane::BrowseSDCard);
|
||||||
layout->addWidget(new QLabel(tr("SD Card Path:")), 3, 0);
|
layout->addWidget(new QLabel(tr("SD Card Path:")), 4, 0);
|
||||||
layout->addWidget(m_sdcard_edit, 3, 1);
|
layout->addWidget(m_sdcard_edit, 4, 1);
|
||||||
layout->addWidget(sdcard_open, 3, 2);
|
layout->addWidget(sdcard_open, 4, 2);
|
||||||
|
|
||||||
return layout;
|
return layout;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ private:
|
||||||
void BrowseDefaultGame();
|
void BrowseDefaultGame();
|
||||||
void BrowseWiiNAND();
|
void BrowseWiiNAND();
|
||||||
void BrowseDump();
|
void BrowseDump();
|
||||||
|
void BrowseLoad();
|
||||||
void BrowseSDCard();
|
void BrowseSDCard();
|
||||||
QGroupBox* MakeGameFolderBox();
|
QGroupBox* MakeGameFolderBox();
|
||||||
QGridLayout* MakePathsLayout();
|
QGridLayout* MakePathsLayout();
|
||||||
|
@ -35,6 +36,7 @@ private:
|
||||||
QLineEdit* m_game_edit;
|
QLineEdit* m_game_edit;
|
||||||
QLineEdit* m_nand_edit;
|
QLineEdit* m_nand_edit;
|
||||||
QLineEdit* m_dump_edit;
|
QLineEdit* m_dump_edit;
|
||||||
|
QLineEdit* m_load_edit;
|
||||||
QLineEdit* m_sdcard_edit;
|
QLineEdit* m_sdcard_edit;
|
||||||
|
|
||||||
QPushButton* m_remove_path;
|
QPushButton* m_remove_path;
|
||||||
|
|
|
@ -62,9 +62,17 @@ static void CreateDumpPath(const std::string& path)
|
||||||
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
File::CreateFullPath(File::GetUserPath(D_DUMPTEXTURES_IDX));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CreateLoadPath(const std::string& path)
|
||||||
|
{
|
||||||
|
if (!path.empty())
|
||||||
|
File::SetUserPath(D_LOAD_IDX, path + '/');
|
||||||
|
File::CreateFullPath(File::GetUserPath(D_HIRESTEXTURES_IDX));
|
||||||
|
}
|
||||||
|
|
||||||
static void InitCustomPaths()
|
static void InitCustomPaths()
|
||||||
{
|
{
|
||||||
File::SetUserPath(D_WIIROOT_IDX, Config::Get(Config::MAIN_FS_PATH));
|
File::SetUserPath(D_WIIROOT_IDX, Config::Get(Config::MAIN_FS_PATH));
|
||||||
|
CreateLoadPath(Config::Get(Config::MAIN_LOAD_PATH));
|
||||||
CreateDumpPath(Config::Get(Config::MAIN_DUMP_PATH));
|
CreateDumpPath(Config::Get(Config::MAIN_DUMP_PATH));
|
||||||
const std::string sd_path = Config::Get(Config::MAIN_SD_PATH);
|
const std::string sd_path = Config::Get(Config::MAIN_SD_PATH);
|
||||||
if (!sd_path.empty())
|
if (!sd_path.empty())
|
||||||
|
|
Loading…
Reference in New Issue