mirror of https://github.com/ioquake/launch.git
Make installing from Steam a separate option than installing from CD. Copy all pk3 files instead of just pak0.pk3.
This commit is contained in:
parent
36883f0eee
commit
616b422e3b
|
@ -33,7 +33,17 @@ void InstallWizard_InstallType::initializePage()
|
||||||
|
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
// Use the same default install directory as the Q3A installer.
|
// Use the same default install directory as the Q3A installer.
|
||||||
ui->txtInstallDest->setText(QString(qgetenv("PROGRAMFILES").constData()) + QString("\\Quake III Arena"));
|
const QString windowsInstallDefault(QString(qgetenv("PROGRAMFILES").constData()) + QString("\\Quake III Arena"));
|
||||||
|
ui->txtInstallDest->setText(windowsInstallDefault);
|
||||||
|
ui->txtInstallSteamDest->setText(windowsInstallDefault);
|
||||||
|
|
||||||
|
// Try to get the Steam path from the registry.
|
||||||
|
QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Valve\\Steam", QSettings::NativeFormat);
|
||||||
|
|
||||||
|
if (registry.contains("InstallPath"))
|
||||||
|
{
|
||||||
|
ui->txtInstallSteamSource->setText(registry.value("InstallPath").toString());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,10 +57,40 @@ bool InstallWizard_InstallType::validatePage()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy page will copy pak0.pk3.
|
// Copy page will copy baseq3/pak0.pk3.
|
||||||
((InstallWizard *)wizard())->addCopyFile(ui->txtInstallSource->text(), ui->txtInstallDest->text() + QString("/baseq3/pak0.pk3"));
|
((InstallWizard *)wizard())->addCopyFile(ui->txtInstallSource->text(), ui->txtInstallDest->text() + QString("/baseq3/pak0.pk3"));
|
||||||
registerField("quake3Path", ui->txtInstallDest);
|
registerField("quake3Path", ui->txtInstallDest);
|
||||||
}
|
}
|
||||||
|
else if (ui->stackPages->currentIndex() == Page_InstallSteam)
|
||||||
|
{
|
||||||
|
// Check that the selected Steam path is valid.
|
||||||
|
QDir dir(ui->txtInstallSteamSource->text());
|
||||||
|
|
||||||
|
if (!dir.exists())
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, "Invalid Steam location", "The selected Steam location doesn't exist. Please select a valid directory.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that Q3A is installed (the baseq3 dir exists).
|
||||||
|
QDir steamQuakeDir(ui->txtInstallSteamSource->text() + QString("/steamapps/common/quake 3 arena/baseq3"));
|
||||||
|
|
||||||
|
if (!steamQuakeDir.exists())
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, "Steam Quake III Arena not installed", QString("Steam Quake III Arena not installed. Directory '%1' doesn't exist. Please select a valid directory.").arg(steamQuakeDir.path()));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy page will copy baseq3/*.pk3 files.
|
||||||
|
QFileInfoList pakFiles = steamQuakeDir.entryInfoList(QStringList("*.pk3"), QDir::Files | QDir::NoSymLinks | QDir::Readable, QDir::Name);
|
||||||
|
|
||||||
|
for (int i = 0; i < pakFiles.size(); i++)
|
||||||
|
{
|
||||||
|
((InstallWizard *)wizard())->addCopyFile(pakFiles.at(i).absoluteFilePath(), ui->txtInstallSteamDest->text() + QString("/baseq3/") + pakFiles.at(i).fileName());
|
||||||
|
}
|
||||||
|
|
||||||
|
registerField("quake3Path", ui->txtInstallSteamDest);
|
||||||
|
}
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
else if (ui->stackPages->currentIndex() == Page_Locate)
|
else if (ui->stackPages->currentIndex() == Page_Locate)
|
||||||
{
|
{
|
||||||
|
@ -98,6 +138,10 @@ bool InstallWizard_InstallType::isComplete() const
|
||||||
{
|
{
|
||||||
return !ui->txtInstallSource->text().isEmpty() && !ui->txtInstallDest->text().isEmpty();
|
return !ui->txtInstallSource->text().isEmpty() && !ui->txtInstallDest->text().isEmpty();
|
||||||
}
|
}
|
||||||
|
else if (ui->stackPages->currentIndex() == Page_InstallSteam)
|
||||||
|
{
|
||||||
|
return !ui->txtInstallSteamSource->text().isEmpty() && !ui->txtInstallSteamDest->text().isEmpty();
|
||||||
|
}
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
else if (ui->stackPages->currentIndex() == Page_Locate)
|
else if (ui->stackPages->currentIndex() == Page_Locate)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +154,7 @@ bool InstallWizard_InstallType::isComplete() const
|
||||||
|
|
||||||
int InstallWizard_InstallType::nextId() const
|
int InstallWizard_InstallType::nextId() const
|
||||||
{
|
{
|
||||||
if (ui->stackPages->currentIndex() == Page_Install)
|
if (ui->stackPages->currentIndex() == Page_Install || ui->stackPages->currentIndex() == Page_InstallSteam)
|
||||||
{
|
{
|
||||||
return InstallWizard::Page_Eula;
|
return InstallWizard::Page_Eula;
|
||||||
}
|
}
|
||||||
|
@ -143,6 +187,11 @@ void InstallWizard_InstallType::on_rbInstall_clicked()
|
||||||
ui->stackPages->setCurrentIndex(Page_Install);
|
ui->stackPages->setCurrentIndex(Page_Install);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstallWizard_InstallType::on_rbInstallSteam_clicked()
|
||||||
|
{
|
||||||
|
ui->stackPages->setCurrentIndex(Page_InstallSteam);
|
||||||
|
}
|
||||||
|
|
||||||
void InstallWizard_InstallType::on_btnLocateBrowse_clicked()
|
void InstallWizard_InstallType::on_btnLocateBrowse_clicked()
|
||||||
{
|
{
|
||||||
const QString location = QFileDialog::getExistingDirectory(this, tr("Select Quake III Arena Location"), settings->getQuakePath());
|
const QString location = QFileDialog::getExistingDirectory(this, tr("Select Quake III Arena Location"), settings->getQuakePath());
|
||||||
|
@ -188,3 +237,33 @@ void InstallWizard_InstallType::on_txtInstallDest_textChanged(const QString & /*
|
||||||
{
|
{
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InstallWizard_InstallType::on_btnInstallSteamBrowseSource_clicked()
|
||||||
|
{
|
||||||
|
const QString location = QFileDialog::getExistingDirectory(this, tr("Select Steam Location"), ui->txtInstallSteamSource->text());
|
||||||
|
|
||||||
|
if (!location.isEmpty())
|
||||||
|
{
|
||||||
|
ui->txtInstallSteamSource->setText(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstallWizard_InstallType::on_btnInstallSteamBrowseDest_clicked()
|
||||||
|
{
|
||||||
|
const QString location = QFileDialog::getExistingDirectory(this, tr("Select Quake III Arena Location"), ui->txtInstallSteamDest->text());
|
||||||
|
|
||||||
|
if (!location.isEmpty())
|
||||||
|
{
|
||||||
|
ui->txtInstallSteamDest->setText(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstallWizard_InstallType::on_txtInstallSteamSource_textChanged(const QString & /*arg1*/)
|
||||||
|
{
|
||||||
|
emit completeChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InstallWizard_InstallType::on_txtInstallSteamDest_textChanged(const QString & /*arg1*/)
|
||||||
|
{
|
||||||
|
emit completeChanged();
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ private slots:
|
||||||
|
|
||||||
void on_rbInstall_clicked();
|
void on_rbInstall_clicked();
|
||||||
|
|
||||||
|
void on_rbInstallSteam_clicked();
|
||||||
|
|
||||||
void on_btnLocateBrowse_clicked();
|
void on_btnLocateBrowse_clicked();
|
||||||
|
|
||||||
void on_txtLocatePath_textChanged(const QString &arg1);
|
void on_txtLocatePath_textChanged(const QString &arg1);
|
||||||
|
@ -38,11 +40,20 @@ private slots:
|
||||||
|
|
||||||
void on_txtInstallDest_textChanged(const QString &arg1);
|
void on_txtInstallDest_textChanged(const QString &arg1);
|
||||||
|
|
||||||
|
void on_btnInstallSteamBrowseSource_clicked();
|
||||||
|
|
||||||
|
void on_btnInstallSteamBrowseDest_clicked();
|
||||||
|
|
||||||
|
void on_txtInstallSteamSource_textChanged(const QString &arg1);
|
||||||
|
|
||||||
|
void on_txtInstallSteamDest_textChanged(const QString &arg1);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
Page_Locate,
|
Page_Locate,
|
||||||
Page_Install
|
Page_Install,
|
||||||
|
Page_InstallSteam
|
||||||
};
|
};
|
||||||
|
|
||||||
Ui::InstallWizard_InstallType *ui;
|
Ui::InstallWizard_InstallType *ui;
|
||||||
|
|
|
@ -32,7 +32,14 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="rbInstall">
|
<widget class="QRadioButton" name="rbInstall">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Install from CD or Steam</string>
|
<string>Install from CD</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="rbInstallSteam">
|
||||||
|
<property name="text">
|
||||||
|
<string>Install from Steam</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -141,6 +148,52 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QWidget" name="pageInstallFromSteam">
|
||||||
|
<layout class="QFormLayout" name="formLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Steam Path:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_7">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="txtInstallSteamSource"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnInstallSteamBrowseSource">
|
||||||
|
<property name="text">
|
||||||
|
<string>Browse...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Destination:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="txtInstallSteamDest"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="btnInstallSteamBrowseDest">
|
||||||
|
<property name="text">
|
||||||
|
<string>Browse...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
Loading…
Reference in New Issue