mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-31 19:20:26 +00:00
Merge branch 'issue-6685' into 'master'
issue 6685 - wizard failure if config dir does not exist See merge request OpenMW/openmw!1735
This commit is contained in:
commit
4575df957e
@ -4,6 +4,7 @@
|
|||||||
#include <components/misc/helpviewer.hpp>
|
#include <components/misc/helpviewer.hpp>
|
||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
|
#include <QDir>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -153,6 +154,20 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog()
|
|||||||
if (!setupLauncherSettings())
|
if (!setupLauncherSettings())
|
||||||
return FirstRunDialogResultFailure;
|
return FirstRunDialogResultFailure;
|
||||||
|
|
||||||
|
// Dialog wizard and setup will fail if the config directory does not already exist
|
||||||
|
QDir userConfigDir = QDir(QString::fromStdString(mCfgMgr.getUserConfigPath().string()));
|
||||||
|
if ( ! userConfigDir.exists() ) {
|
||||||
|
if ( ! userConfigDir.mkpath(".") )
|
||||||
|
{
|
||||||
|
cfgError(tr("Error opening OpenMW configuration file"),
|
||||||
|
tr("<br><b>Could not create directory %0</b><br><br> \
|
||||||
|
Please make sure you have the right permissions \
|
||||||
|
and try again.<br>").arg(userConfigDir.canonicalPath())
|
||||||
|
);
|
||||||
|
return FirstRunDialogResultFailure;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true"))
|
if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true"))
|
||||||
{
|
{
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user