mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge remote-tracking branch 'dteviot/master'
This commit is contained in:
commit
05be353fec
2 changed files with 22 additions and 27 deletions
|
@ -69,19 +69,6 @@ void Launcher::DataFilesPage::buildView()
|
||||||
|
|
||||||
bool Launcher::DataFilesPage::loadSettings()
|
bool Launcher::DataFilesPage::loadSettings()
|
||||||
{
|
{
|
||||||
QStringList paths = mGameSettings.getDataDirs();
|
|
||||||
|
|
||||||
foreach (const QString &path, paths)
|
|
||||||
mSelector->addFiles(path);
|
|
||||||
|
|
||||||
mDataLocal = mGameSettings.getDataLocal();
|
|
||||||
|
|
||||||
if (!mDataLocal.isEmpty())
|
|
||||||
mSelector->addFiles(mDataLocal);
|
|
||||||
|
|
||||||
paths.insert (0, mDataLocal);
|
|
||||||
PathIterator pathIterator (paths);
|
|
||||||
|
|
||||||
QStringList profiles = mLauncherSettings.getContentLists();
|
QStringList profiles = mLauncherSettings.getContentLists();
|
||||||
QString currentProfile = mLauncherSettings.getCurrentContentListName();
|
QString currentProfile = mLauncherSettings.getCurrentContentListName();
|
||||||
|
|
||||||
|
@ -94,11 +81,27 @@ bool Launcher::DataFilesPage::loadSettings()
|
||||||
if (!currentProfile.isEmpty())
|
if (!currentProfile.isEmpty())
|
||||||
addProfile(currentProfile, true);
|
addProfile(currentProfile, true);
|
||||||
|
|
||||||
mSelector->setProfileContent(filesInProfile(currentProfile, pathIterator));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Launcher::DataFilesPage::populateFileViews(const QString& contentModelName)
|
||||||
|
{
|
||||||
|
QStringList paths = mGameSettings.getDataDirs();
|
||||||
|
|
||||||
|
foreach(const QString &path, paths)
|
||||||
|
mSelector->addFiles(path);
|
||||||
|
|
||||||
|
mDataLocal = mGameSettings.getDataLocal();
|
||||||
|
|
||||||
|
if (!mDataLocal.isEmpty())
|
||||||
|
mSelector->addFiles(mDataLocal);
|
||||||
|
|
||||||
|
paths.insert(0, mDataLocal);
|
||||||
|
PathIterator pathIterator(paths);
|
||||||
|
|
||||||
|
mSelector->setProfileContent(filesInProfile(contentModelName, pathIterator));
|
||||||
|
}
|
||||||
|
|
||||||
QStringList Launcher::DataFilesPage::filesInProfile(const QString& profileName, PathIterator& pathIterator)
|
QStringList Launcher::DataFilesPage::filesInProfile(const QString& profileName, PathIterator& pathIterator)
|
||||||
{
|
{
|
||||||
QStringList files = mLauncherSettings.getContentListFiles(profileName);
|
QStringList files = mLauncherSettings.getContentListFiles(profileName);
|
||||||
|
@ -175,7 +178,7 @@ void Launcher::DataFilesPage::setProfile (const QString &previous, const QString
|
||||||
|
|
||||||
ui.profilesComboBox->setCurrentProfile (ui.profilesComboBox->findText (current));
|
ui.profilesComboBox->setCurrentProfile (ui.profilesComboBox->findText (current));
|
||||||
|
|
||||||
loadSettings();
|
populateFileViews(current);
|
||||||
|
|
||||||
checkForDefaultProfile();
|
checkForDefaultProfile();
|
||||||
}
|
}
|
||||||
|
@ -229,13 +232,6 @@ void Launcher::DataFilesPage::on_newProfileAction_triggered()
|
||||||
mLauncherSettings.setCurrentContentListName(profile);
|
mLauncherSettings.setCurrentContentListName(profile);
|
||||||
|
|
||||||
addProfile(profile, true);
|
addProfile(profile, true);
|
||||||
mSelector->clearCheckStates();
|
|
||||||
|
|
||||||
mSelector->setGameFile();
|
|
||||||
|
|
||||||
saveSettings();
|
|
||||||
|
|
||||||
emit signalProfileChanged (ui.profilesComboBox->findText(profile));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Launcher::DataFilesPage::addProfile (const QString &profile, bool setAsCurrent)
|
void Launcher::DataFilesPage::addProfile (const QString &profile, bool setAsCurrent)
|
||||||
|
@ -262,15 +258,13 @@ void Launcher::DataFilesPage::on_deleteProfileAction_triggered()
|
||||||
|
|
||||||
// this should work since the Default profile can't be deleted and is always index 0
|
// this should work since the Default profile can't be deleted and is always index 0
|
||||||
int next = ui.profilesComboBox->currentIndex()-1;
|
int next = ui.profilesComboBox->currentIndex()-1;
|
||||||
|
|
||||||
|
// changing the profile forces a reload of plugin file views.
|
||||||
ui.profilesComboBox->setCurrentIndex(next);
|
ui.profilesComboBox->setCurrentIndex(next);
|
||||||
|
|
||||||
removeProfile(profile);
|
removeProfile(profile);
|
||||||
ui.profilesComboBox->removeItem(ui.profilesComboBox->findText(profile));
|
ui.profilesComboBox->removeItem(ui.profilesComboBox->findText(profile));
|
||||||
|
|
||||||
saveSettings();
|
|
||||||
|
|
||||||
loadSettings();
|
|
||||||
|
|
||||||
checkForDefaultProfile();
|
checkForDefaultProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ namespace Launcher
|
||||||
bool showDeleteMessageBox (const QString &text);
|
bool showDeleteMessageBox (const QString &text);
|
||||||
void addProfile (const QString &profile, bool setAsCurrent);
|
void addProfile (const QString &profile, bool setAsCurrent);
|
||||||
void checkForDefaultProfile();
|
void checkForDefaultProfile();
|
||||||
|
void populateFileViews(const QString& contentModelName);
|
||||||
|
|
||||||
class PathIterator
|
class PathIterator
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue