Initial FTB support. Allows "tracking" of FTB instances.
This commit is contained in:

committed by
Petr Mrázek

parent
34a3fedf7b
commit
82c87aa06f
@ -60,6 +60,32 @@ void SettingsDialog::updateCheckboxStuff()
|
||||
ui->windowHeightSpinBox->setEnabled(!ui->maximizedCheckBox->isChecked());
|
||||
}
|
||||
|
||||
void SettingsDialog::on_ftbLauncherBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Launcher Directory"),
|
||||
ui->ftbLauncherBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
{
|
||||
ui->ftbLauncherBox->setText(cooked_dir);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_ftbBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Directory"),
|
||||
ui->ftbBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
{
|
||||
ui->ftbBox->setText(cooked_dir);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::on_instDirBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"),
|
||||
@ -135,6 +161,11 @@ void SettingsDialog::applySettings(SettingsObject *s)
|
||||
// Updates
|
||||
s->set("AutoUpdate", ui->autoUpdateCheckBox->isChecked());
|
||||
|
||||
// FTB
|
||||
s->set("TrackFTBInstances", ui->trackFtbBox->isChecked());
|
||||
s->set("FTBLauncherRoot", ui->ftbLauncherBox->text());
|
||||
s->set("FTBRoot", ui->ftbBox->text());
|
||||
|
||||
// Folders
|
||||
// TODO: Offer to move instances to new instance folder.
|
||||
s->set("InstanceDir", ui->instDirTextBox->text());
|
||||
@ -185,6 +216,11 @@ void SettingsDialog::loadSettings(SettingsObject *s)
|
||||
ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool());
|
||||
ui->devBuildsCheckBox->setChecked(s->get("UseDevBuilds").toBool());
|
||||
|
||||
// FTB
|
||||
ui->trackFtbBox->setChecked(s->get("TrackFTBInstances").toBool());
|
||||
ui->ftbLauncherBox->setText(s->get("FTBLauncherRoot").toString());
|
||||
ui->ftbBox->setText(s->get("FTBRoot").toString());
|
||||
|
||||
// Folders
|
||||
ui->instDirTextBox->setText(s->get("InstanceDir").toString());
|
||||
ui->modsDirTextBox->setText(s->get("CentralModsDir").toString());
|
||||
|
@ -45,6 +45,10 @@ protected:
|
||||
|
||||
private
|
||||
slots:
|
||||
void on_ftbLauncherBrowseBtn_clicked();
|
||||
|
||||
void on_ftbBrowseBtn_clicked();
|
||||
|
||||
void on_instDirBrowseBtn_clicked();
|
||||
|
||||
void on_modsDirBrowseBtn_clicked();
|
||||
|
@ -95,6 +95,87 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>FTB</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="ftbLauncherBrowseBtn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::TabFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Launcher:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="ftbLauncherBox">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="trackFtbBox">
|
||||
<property name="text">
|
||||
<string>Track FTB instances</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="ftbBox"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="ftbBrowseBtn">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>28</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Files:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="foldersBox">
|
||||
<property name="title">
|
||||
|
Reference in New Issue
Block a user