mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-03 17:37:18 +00:00
Fixed default profile adding and made switching profiles more efficient
This commit is contained in:
parent
fe9120bcb3
commit
d065b56948
@ -251,7 +251,7 @@ void DataFilesPage::setupConfig()
|
||||
}
|
||||
|
||||
// Add a default profile
|
||||
if (mProfilesComboBox->count() == 0) {
|
||||
if (mProfilesComboBox->findText(QString("Default")) == -1) {
|
||||
mProfilesComboBox->addItem(QString("Default"));
|
||||
}
|
||||
|
||||
@ -359,6 +359,8 @@ bool DataFilesPage::setupDataFiles()
|
||||
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
|
||||
("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
|
||||
|
||||
//boost::program_options::notify(variables);
|
||||
|
||||
mCfgMgr.readConfiguration(variables, desc);
|
||||
|
||||
// Put the paths in a boost::filesystem vector to use with Files::Collections
|
||||
|
@ -141,11 +141,11 @@ void MainDialog::createPages()
|
||||
|
||||
connect(mPlayPage->mProfilesComboBox,
|
||||
SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(profileChanged(int)));
|
||||
mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
|
||||
|
||||
connect(mDataFilesPage->mProfilesComboBox,
|
||||
SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(profileChanged(int)));
|
||||
mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
|
||||
|
||||
}
|
||||
|
||||
@ -196,23 +196,6 @@ bool MainDialog::setup()
|
||||
return true;
|
||||
}
|
||||
|
||||
void MainDialog::profileChanged(int index)
|
||||
{
|
||||
// Just to be sure, should always have a selection
|
||||
if (!mIconWidget->selectionModel()->hasSelection()) {
|
||||
return;
|
||||
}
|
||||
|
||||
QString currentPage = mIconWidget->currentItem()->data(Qt::DisplayRole).toString();
|
||||
if (currentPage == QLatin1String("Play")) {
|
||||
mDataFilesPage->mProfilesComboBox->setCurrentIndex(index);
|
||||
}
|
||||
|
||||
if (currentPage == QLatin1String("Data Files")) {
|
||||
mPlayPage->mProfilesComboBox->setCurrentIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
|
||||
{
|
||||
if (!current)
|
||||
|
@ -27,7 +27,6 @@ public:
|
||||
public slots:
|
||||
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
|
||||
void play();
|
||||
void profileChanged(int index);
|
||||
bool setup();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user