forked from teamnwah/openmw-tes3coop
Write settings before invoking openmw-iniimporter
This commit is contained in:
parent
7e03dd0f12
commit
f2613a74b1
1 changed files with 2 additions and 18 deletions
|
@ -231,29 +231,13 @@ void Wizard::MainWizard::setupInstallations()
|
||||||
|
|
||||||
void Wizard::MainWizard::runSettingsImporter()
|
void Wizard::MainWizard::runSettingsImporter()
|
||||||
{
|
{
|
||||||
|
writeSettings();
|
||||||
|
|
||||||
QString path(field(QLatin1String("installation.path")).toString());
|
QString path(field(QLatin1String("installation.path")).toString());
|
||||||
|
|
||||||
// Create the file if it doesn't already exist, else the importer will fail
|
|
||||||
QString userPath(toQString(mCfgMgr.getUserConfigPath()));
|
QString userPath(toQString(mCfgMgr.getUserConfigPath()));
|
||||||
QFile file(userPath + QLatin1String("openmw.cfg"));
|
QFile file(userPath + QLatin1String("openmw.cfg"));
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.open(QIODevice::ReadWrite)) {
|
|
||||||
// File cannot be created
|
|
||||||
QMessageBox msgBox;
|
|
||||||
msgBox.setWindowTitle(tr("Error writing OpenMW configuration file"));
|
|
||||||
msgBox.setIcon(QMessageBox::Critical);
|
|
||||||
msgBox.setStandardButtons(QMessageBox::Ok);
|
|
||||||
msgBox.setText(tr("<html><head/><body><p><b>Could not open or create %1 for writing</b></p> \
|
|
||||||
<p>Please make sure you have the right permissions \
|
|
||||||
and try again.</p></body></html>").arg(file.fileName()));
|
|
||||||
msgBox.exec();
|
|
||||||
return qApp->quit();
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construct the arguments to run the importer
|
// Construct the arguments to run the importer
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue