1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 10:53:53 +00:00

Fixed default profile adding and made switching profiles more efficient

This commit is contained in:
Pieter van der Kloet 2012-10-30 04:21:31 +01:00
parent fe9120bcb3
commit d065b56948
3 changed files with 5 additions and 21 deletions

View file

@ -251,7 +251,7 @@ void DataFilesPage::setupConfig()
} }
// Add a default profile // Add a default profile
if (mProfilesComboBox->count() == 0) { if (mProfilesComboBox->findText(QString("Default")) == -1) {
mProfilesComboBox->addItem(QString("Default")); mProfilesComboBox->addItem(QString("Default"));
} }
@ -359,6 +359,8 @@ bool DataFilesPage::setupDataFiles()
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false)) ("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
("encoding", boost::program_options::value<std::string>()->default_value("win1252")); ("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
//boost::program_options::notify(variables);
mCfgMgr.readConfiguration(variables, desc); mCfgMgr.readConfiguration(variables, desc);
// Put the paths in a boost::filesystem vector to use with Files::Collections // Put the paths in a boost::filesystem vector to use with Files::Collections

View file

@ -141,11 +141,11 @@ void MainDialog::createPages()
connect(mPlayPage->mProfilesComboBox, connect(mPlayPage->mProfilesComboBox,
SIGNAL(currentIndexChanged(int)), SIGNAL(currentIndexChanged(int)),
this, SLOT(profileChanged(int))); mDataFilesPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
connect(mDataFilesPage->mProfilesComboBox, connect(mDataFilesPage->mProfilesComboBox,
SIGNAL(currentIndexChanged(int)), SIGNAL(currentIndexChanged(int)),
this, SLOT(profileChanged(int))); mPlayPage->mProfilesComboBox, SLOT(setCurrentIndex(int)));
} }
@ -196,23 +196,6 @@ bool MainDialog::setup()
return true; 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) void MainDialog::changePage(QListWidgetItem *current, QListWidgetItem *previous)
{ {
if (!current) if (!current)

View file

@ -27,7 +27,6 @@ public:
public slots: public slots:
void changePage(QListWidgetItem *current, QListWidgetItem *previous); void changePage(QListWidgetItem *current, QListWidgetItem *previous);
void play(); void play();
void profileChanged(int index);
bool setup(); bool setup();
private: private: