|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
|
#include <QFileDialog>
|
|
|
|
|
#include <QDesktopServices>
|
|
|
|
|
|
|
|
|
|
#include "mainwizard.hpp"
|
|
|
|
|
|
|
|
|
@ -11,12 +12,37 @@ Wizard::InstallationTargetPage::InstallationTargetPage(MainWizard *wizard) :
|
|
|
|
|
{
|
|
|
|
|
setupUi(this);
|
|
|
|
|
|
|
|
|
|
registerField("installation.path*", targetLineEdit);
|
|
|
|
|
registerField(QLatin1String("installation.path*"), targetLineEdit);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Wizard::InstallationTargetPage::initializePage()
|
|
|
|
|
{
|
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
QString path = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
|
QString path = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
|
|
|
|
|
QString path = QFile::decodeName(qgetenv("XDG_DATA_HOME"));
|
|
|
|
|
|
|
|
|
|
if (path.isEmpty())
|
|
|
|
|
path = QDir::homePath() + QLatin1String("/.local/share");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
path.append(QLatin1String("/openmw/data"));
|
|
|
|
|
|
|
|
|
|
if (!QFile::exists(path)) {
|
|
|
|
|
QDir dir;
|
|
|
|
|
dir.mkpath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir dir(path);
|
|
|
|
|
targetLineEdit->setText(QDir::toNativeSeparators(dir.absolutePath()));
|
|
|
|
|
|
|
|
|
|
qDebug() << path;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Wizard::InstallationTargetPage::on_browseButton_clicked()
|
|
|
|
|