<rect>
<x>0</x>
<y>0</y>
- <width>700</width>
- <height>700</height>
+ <width>667</width>
+ <height>821</height>
</rect>
</property>
<property name="windowTitle">
<attribute name="title">
<string>Settings</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_4">
+ <layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
- <number>10</number>
+ <number>8</number>
</property>
<property name="rightMargin">
- <number>10</number>
+ <number>8</number>
</property>
<property name="bottomMargin">
- <number>10</number>
+ <number>8</number>
</property>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
</item>
</layout>
</item>
+ <item row="0" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>Season:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="seasonCombo">
+ <item>
+ <property name="text">
+ <string>Summer</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Winter</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item row="1" column="0">
<widget class="QCheckBox" name="msaaCheckbox">
<property name="text">
</property>
</widget>
</item>
- <item row="1" column="1" colspan="2">
+ <item row="1" column="1">
<widget class="QCheckBox" name="rembrandtCheckbox">
<property name="text">
<string>Enable deferred rendering (Rembrandt)</string>
</property>
</widget>
</item>
- <item row="3" column="0" colspan="3">
+ <item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="horizontalSpacer_2">
</property>
</widget>
</item>
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="fullScreenCheckbox">
+ <property name="text">
+ <string>Start full-screen</string>
+ </property>
+ </widget>
+ </item>
<item row="5" column="0">
<widget class="QCheckBox" name="startPausedCheck">
<property name="text">
</property>
</widget>
</item>
- <item row="7" column="0" colspan="3">
+ <item row="6" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,0">
+ <item>
+ <widget class="QLabel" name="customAircraftDirLabel">
+ <property name="text">
+ <string>Custom aircraft directory:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="openAircraftDirButton">
+ <property name="text">
+ <string>Open in Finder</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="7" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Additional scenery locations</string>
<property name="spacing">
<number>0</number>
</property>
- <item row="0" column="0" colspan="3">
- <widget class="QListWidget" name="sceneryPathsList"/>
- </item>
<item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
</property>
</widget>
</item>
+ <item row="0" column="0" colspan="3">
+ <widget class="QListWidget" name="sceneryPathsList"/>
+ </item>
</layout>
</widget>
</item>
- <item row="0" column="1" colspan="2">
- <layout class="QHBoxLayout" name="horizontalLayout_8">
- <item>
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>Season:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="seasonCombo">
- <item>
+ <item row="8" column="0" colspan="2">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Additional aircraft locations</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <property name="leftMargin">
+ <number>8</number>
+ </property>
+ <property name="topMargin">
+ <number>8</number>
+ </property>
+ <property name="rightMargin">
+ <number>8</number>
+ </property>
+ <property name="bottomMargin">
+ <number>8</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0" colspan="3">
+ <widget class="QListWidget" name="aircraftPathsList"/>
+ </item>
+ <item row="1" column="0">
+ <spacer name="horizontalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>567</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="2">
+ <widget class="QToolButton" name="removeAircraftPath">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
<property name="text">
- <string>Summer</string>
+ <string>-</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QToolButton" name="addAircraftPath">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
</property>
- </item>
- <item>
<property name="text">
- <string>Winter</string>
+ <string>+</string>
</property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- <item row="4" column="1" colspan="2">
- <widget class="QCheckBox" name="fullScreenCheckbox">
- <property name="text">
- <string>Start full-screen</string>
- </property>
+ </widget>
+ </item>
+ </layout>
</widget>
</item>
- <item row="6" column="0" colspan="3">
- <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="1,0">
- <item>
- <widget class="QLabel" name="customAircraftDirLabel">
- <property name="text">
- <string>Custom aircraft directory:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="openAircraftDirButton">
- <property name="text">
- <string>Open in Finder</string>
- </property>
- <property name="autoDefault">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="8" column="0" colspan="3">
+ <item row="9" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Additional options</string>
<number>8</number>
</property>
<item>
- <widget class="QPlainTextEdit" name="commandLineArgs">
- </widget>
+ <widget class="QPlainTextEdit" name="commandLineArgs"/>
</item>
</layout>
</widget>
// will happen as normal
http->init();
- m_aircraftProxy->setSourceModel(new AircraftItemModel(this, r));
+ m_aircraftModel = new AircraftItemModel(this, r);
+ m_aircraftProxy->setSourceModel(m_aircraftModel);
m_aircraftProxy->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_aircraftProxy->setSortCaseSensitivity(Qt::CaseInsensitive);
this, &QtLauncher::onAddSceneryPath);
connect(m_ui->removeSceneryPath, &QToolButton::clicked,
this, &QtLauncher::onRemoveSceneryPath);
+
+ connect(m_ui->addAircraftPath, &QToolButton::clicked,
+ this, &QtLauncher::onAddAircraftPath);
+ connect(m_ui->removeAircraftPath, &QToolButton::clicked,
+ this, &QtLauncher::onRemoveAircraftPath);
+
+ QSettings settings;
+ m_aircraftModel->setPaths(settings.value("aircraft-paths").toStringList());
+ m_aircraftModel->scanDirs();
}
QtLauncher::~QtLauncher()
QStringList sceneryPaths = settings.value("scenery-paths").toStringList();
m_ui->sceneryPathsList->addItems(sceneryPaths);
+ QStringList aircraftPaths = settings.value("aircraft-paths").toStringList();
+ m_ui->aircraftPathsList->addItems(aircraftPaths);
+
m_ui->commandLineArgs->setPlainText(settings.value("additional-args").toString());
}
}
settings.setValue("scenery-paths", paths);
+ paths.clear();
+
+ for (int i=0; i<m_ui->aircraftPathsList->count(); ++i) {
+ paths.append(m_ui->aircraftPathsList->item(i)->text());
+ }
+
+ settings.setValue("aircraft-paths", paths);
settings.setValue("additional-args", m_ui->commandLineArgs->toPlainText());
}
opt->addOption("fg-scenery", path.toStdString());
}
+ // aircraft paths
+ for (int i=0; i<m_ui->aircraftPathsList->count(); ++i) {
+ QString path = m_ui->aircraftPathsList->item(i)->text();
+ opt->addOption("fg-aircraft", path.toStdString());
+ }
+
// additional arguments
ArgumentsTokenizer tk;
Q_FOREACH(ArgumentsTokenizer::Arg a, tk.tokenize(m_ui->commandLineArgs->toPlainText())) {
}
}
+void QtLauncher::onAddAircraftPath()
+{
+ QString path = QFileDialog::getExistingDirectory(this, tr("Choose aircraft folder"));
+ if (!path.isEmpty()) {
+ m_ui->aircraftPathsList->addItem(path);
+ saveSettings();
+
+ // re-scan the aircraft list
+ QSettings settings;
+ m_aircraftModel->setPaths(settings.value("aircraft-paths").toStringList());
+ m_aircraftModel->scanDirs();
+ }
+}
+
+void QtLauncher::onRemoveAircraftPath()
+{
+ if (m_ui->aircraftPathsList->currentItem()) {
+ delete m_ui->aircraftPathsList->currentItem();
+ saveSettings();
+ }
+}
+
void QtLauncher::onRembrandtToggled(bool b)
{
// Rembrandt and multi-sample are exclusive