1
0
Fork 0

Proof-of-concept for new settings UI.

This commit is contained in:
James Turner 2017-01-30 08:00:37 +01:00
parent cf318f1cc5
commit bf1ffb8875
38 changed files with 1979 additions and 456 deletions

View file

@ -0,0 +1,16 @@
#include "AdditionalSettings.h"
#include "ui_AdditionalSettings.h"
AdditionalSettings::AdditionalSettings(QWidget *parent) :
SettingsSection(parent),
ui(new Ui::AdditionalSettings)
{
ui->setupUi(this);
insertSettingsHeader();
}
AdditionalSettings::~AdditionalSettings()
{
delete ui;
}

View file

@ -0,0 +1,22 @@
#ifndef ADDITIONAL_SETTINGS_H
#define ADDITIONAL_SETTINGS_H
#include <GUI/settingssection.h>
namespace Ui {
class AdditionalSettings;
}
class AdditionalSettings : public SettingsSection
{
Q_OBJECT
public:
explicit AdditionalSettings(QWidget *parent = 0);
~AdditionalSettings();
private:
Ui::AdditionalSettings *ui;
};
#endif // ADDITIONAL_SETTINGS_H

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AdditionalSettings</class>
<widget class="SettingsSection" name="AdditionalSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>331</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="title" stdset="0">
<string>Additional settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Additional settings can be entered here. For information on available settings see &lt;this page&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPlainTextEdit" name="plainTextEdit">
<property name="placeholderText">
<string>--prop:foo=42</string>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/settingssection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,52 @@
#include "AdvancedSettingsButton.h"
#include <QPainter>
#include <QPixmap>
#include <QFontMetrics>
#include <QDebug>
const int MARGIN = 3;
AdvancedSettingsButton::AdvancedSettingsButton()
{
setCheckable(true);
setChecked(false);
setIcon(QIcon());
connect(this, &QAbstractButton::toggled, this, &AdvancedSettingsButton::updateUi);
updateUi();
}
void AdvancedSettingsButton::paintEvent(QPaintEvent *event)
{
QPixmap icon(":/settings-gear-white");
QPainter painter(this);
painter.setPen(Qt::white);
const int h = height();
QRect textRect = rect();
textRect.setRight(textRect.right() - (h + MARGIN));
painter.drawText(textRect, text(), Qt::AlignVCenter | Qt::AlignRight);
QRect iconRect = rect();
iconRect.setLeft(iconRect.right() - h);
iconRect.adjust(MARGIN, MARGIN, -MARGIN, -MARGIN);
painter.drawPixmap(iconRect, icon);
}
QSize AdvancedSettingsButton::sizeHint() const
{
const QFontMetrics f(font());
const QRect bounds = f.boundingRect(text());
const int height = bounds.height() + (MARGIN * 2);
return QSize(bounds.width() + 100 + height, height);
}
void AdvancedSettingsButton::updateUi()
{
const bool showAdvanced = isChecked();
setText(showAdvanced ? tr("Show less") : tr("Show more"));
updateGeometry();
}

View file

@ -0,0 +1,19 @@
#ifndef ADVANCEDSETTINGSBUTTON_H
#define ADVANCEDSETTINGSBUTTON_H
#include <QAbstractButton>
class AdvancedSettingsButton : public QAbstractButton
{
public:
AdvancedSettingsButton();
protected:
virtual void paintEvent(QPaintEvent* event) override;
virtual QSize sizeHint() const override;
private:
void updateUi();
};
#endif // ADVANCEDSETTINGSBUTTON_H

View file

@ -80,6 +80,12 @@ if (HAVE_QT)
InstallSceneryDialog.ui
EditCustomMPServerDialog.ui
UpdateAllAircraft.ui
RenderingSettings.ui
ViewSettings.ui
MPSettings.ui
DownloadSettings.ui
EnvironmentPage.ui
AdditionalSettings.ui
)
qt5_add_resources(qrc_sources resources.qrc)
@ -119,6 +125,24 @@ if (HAVE_QT)
EditCustomMPServerDialog.hxx
previewwindow.cpp
previewwindow.h
SettingsSection.cpp
SettingsSection.h
renderingsettings.cpp
renderingsettings.h
ViewSettings.cpp
ViewSettings.h
MPSettings.cpp
MPSettings.h
AdvancedSettingsButton.h
AdvancedSettingsButton.cpp
DownloadSettings.cpp
DownloadSettings.h
ToolboxButton.cpp
ToolboxButton.h
EnvironmentPage.cpp
EnvironmentPage.h
AdditionalSettings.cpp
AdditionalSettings.h
${uic_sources}
${qrc_sources})

View file

@ -0,0 +1,15 @@
#include "DownloadSettings.h"
#include "ui_DownloadSettings.h"
DownloadSettings::DownloadSettings(QWidget *parent) :
SettingsSection(parent),
ui(new Ui::DownloadSettings)
{
ui->setupUi(this);
insertSettingsHeader();
}
DownloadSettings::~DownloadSettings()
{
delete ui;
}

View file

@ -0,0 +1,22 @@
#ifndef DOWNLOAD_SETTINGS_H
#define DOWNLOAD_SETTINGS_H
#include <GUI/settingssection.h>
namespace Ui {
class DownloadSettings;
}
class DownloadSettings : public SettingsSection
{
Q_OBJECT
public:
explicit DownloadSettings(QWidget *parent = 0);
~DownloadSettings();
private:
Ui::DownloadSettings *ui;
};
#endif // DOWNLOAD_SETTINGS_H

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DownloadSettings</class>
<widget class="SettingsSection" name="DownloadSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>94</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="title" stdset="0">
<string>Downloads</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Download scenery automatically</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>FlightGear can automatically download and update scenery wherever you fly in the world. This can take some time depening on your Internet connection's speed, but is faster than download the entire world's scenery.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/settingssection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,17 @@
#include "EnvironmentPage.h"
#include "ui_EnvironmentPage.h"
EnvironmentPage::EnvironmentPage(QWidget *parent) :
QWidget(parent),
ui(new Ui::EnvironmentPage)
{
ui->setupUi(this);
ui->weatherSection->insertSettingsHeader();
ui->timeSection->insertSettingsHeader();
}
EnvironmentPage::~EnvironmentPage()
{
delete ui;
}

22
src/GUI/EnvironmentPage.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef ENVIRONMENTPAGE_H
#define ENVIRONMENTPAGE_H
#include <QWidget>
namespace Ui {
class EnvironmentPage;
}
class EnvironmentPage : public QWidget
{
Q_OBJECT
public:
explicit EnvironmentPage(QWidget *parent = 0);
~EnvironmentPage();
private:
Ui::EnvironmentPage *ui;
};
#endif // ENVIRONMENTPAGE_H

262
src/GUI/EnvironmentPage.ui Normal file
View file

@ -0,0 +1,262 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EnvironmentPage</class>
<widget class="QWidget" name="EnvironmentPage">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>728</width>
<height>580</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="SettingsSection" name="timeSection" native="true">
<property name="title" stdset="0">
<string>Time and Date</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>Predefined time</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>Manually selected date and time</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>Current local time</string>
</property>
</item>
<item>
<property name="text">
<string>Dawn</string>
</property>
</item>
<item>
<property name="text">
<string>Morning</string>
</property>
</item>
<item>
<property name="text">
<string>Noon</string>
</property>
</item>
<item>
<property name="text">
<string>Dusk</string>
</property>
</item>
<item>
<property name="text">
<string>Midnight</string>
</property>
</item>
</widget>
</item>
<item row="1" column="2">
<widget class="QDateTimeEdit" name="dateTimeEdit">
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Time of day:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="simple" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>By default the simulator uses your computer's local time as the local time at your chosen startup location. You can select a standard time of day, or enter an exact time and date.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="SettingsSection" name="weatherSection" native="true">
<property name="title" stdset="0">
<string>Weather</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Weather:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_3">
<item>
<property name="text">
<string>Real-world weather</string>
</property>
</item>
<item>
<property name="text">
<string>Clear and calm</string>
</property>
</item>
<item>
<property name="text">
<string>Thunderstorm</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Choose a standard weather scenario, or download weather reports (METAR) automatically online, from the closest airports.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Season:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_2">
<item>
<property name="text">
<string>Summer</string>
</property>
</item>
<item>
<property name="text">
<string>Winter</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Changing the season affects which textures are used for scenery, but otherwise has no effect.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
<zorder>timeSection</zorder>
<zorder>label_2</zorder>
<zorder>comboBox_2</zorder>
<zorder>weatherSection</zorder>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/SettingsSection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>642</width>
<height>600</height>
<width>795</width>
<height>658</height>
</rect>
</property>
<property name="windowTitle">
@ -18,44 +18,220 @@
<normaloff>:/app-icon-large</normaloff>:/app-icon-large</iconset>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>6</number>
<number>2</number>
</property>
<property name="topMargin">
<number>8</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>6</number>
<number>2</number>
</property>
<property name="bottomMargin">
<number>4</number>
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<item>
<widget class="QFrame" name="toolbox">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>8</red>
<green>84</green>
<blue>236</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>8</red>
<green>84</green>
<blue>236</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>8</red>
<green>84</green>
<blue>236</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>8</red>
<green>84</green>
<blue>236</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<widget class="QWidget" name="summaryTab">
<attribute name="title">
<string>Summary</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3" rowstretch="1,0,0,0,0,0,0,2,0,0" columnstretch="0,0,0,1,0">
<item row="6" column="2">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Settings:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<widget class="ToolboxButton" name="summaryButton">
<property name="text">
<string>Summary</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-summary</normaloff>:/toolbox-summary</iconset>
</property>
<property name="pageIndex" stdset="0">
<UInt>0</UInt>
</property>
</widget>
</item>
<item>
<widget class="ToolboxButton" name="aircraftButton">
<property name="text">
<string>Aircraft</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-aircraft</normaloff>:/toolbox-aircraft</iconset>
</property>
<property name="pageIndex" stdset="0">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="ToolboxButton" name="locationButton">
<property name="text">
<string>Location</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-location</normaloff>:/toolbox-location</iconset>
</property>
<property name="pageIndex" stdset="0">
<number>2</number>
</property>
</widget>
</item>
<item>
<widget class="ToolboxButton" name="environmentButton">
<property name="text">
<string>Environment</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-environment</normaloff>:/toolbox-environment</iconset>
</property>
<property name="pageIndex" stdset="0">
<number>3</number>
</property>
</widget>
</item>
<item>
<widget class="ToolboxButton" name="settingsButton">
<property name="text">
<string>Settings</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-settings</normaloff>:/toolbox-settings</iconset>
</property>
<property name="pageIndex" stdset="0">
<number>4</number>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="ToolboxButton" name="flyButton">
<property name="text">
<string>Fly!</string>
</property>
<property name="icon">
<iconset resource="resources.qrc">
<normaloff>:/toolbox-fly</normaloff>:/toolbox-fly</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="stack">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="summaryPage">
<layout class="QGridLayout" name="gridLayout_3" rowstretch="0,0,0,0,0,0,0,0,0,1" columnstretch="0,0,0,1,0">
<item row="5" column="2">
<widget class="QLabel" name="label_3">
<property name="font">
@ -71,26 +247,28 @@
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="aircraftHistory">
<item row="6" column="2">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>Settings:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="locationHistory">
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="2">
<widget class="QLabel" name="label_4">
<property name="font">
@ -106,6 +284,13 @@
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QPushButton" name="aircraftHistory">
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="9" column="3" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
@ -119,21 +304,6 @@
</property>
</spacer>
</item>
<item row="3" column="3">
<widget class="QLabel" name="aircraftName">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>aircraft</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="3" colspan="2">
<widget class="QLabel" name="aircraftDescription">
<property name="font">
@ -149,10 +319,33 @@
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="QPushButton" name="locationHistory">
<property name="autoDefault">
<bool>false</bool>
<item row="5" column="3">
<widget class="QLabel" name="locationDescription">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>location</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="aircraftName">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>aircraft</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
@ -174,21 +367,6 @@
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="locationDescription">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="text">
<string>location</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="3" colspan="2">
<widget class="QLabel" name="thumbnail">
<property name="sizePolicy">
@ -208,27 +386,58 @@
</property>
</widget>
</item>
<item row="0" column="3" colspan="2">
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>48</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>FlightGear 2017.1.0</string>
</property>
</widget>
</item>
<item row="1" column="3" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>©2017, Curtis L Olson. Licensed under the GNU Public License (GPL) version 2. See &lt;here&gt; for more information</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<widget class="QLabel" name="logoIcon">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="resources.qrc">:/app-icon-large</pixmap>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="aircraftTab">
<attribute name="title">
<string>Aircraft</string>
</attribute>
<widget class="QWidget" name="aircraftPage">
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,0,0">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>4</number>
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
<number>2</number>
</property>
<property name="rightMargin">
<number>4</number>
<number>0</number>
</property>
<property name="bottomMargin">
<number>4</number>
<number>2</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
@ -316,14 +525,16 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="locationTab">
<attribute name="title">
<string>Location</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<widget class="LocationWidget" name="location"/>
<widget class="EnvironmentPage" name="environmentPage"/>
<widget class="QWidget" name="newSettingsPage">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
@ -331,358 +542,78 @@
<number>4</number>
</property>
<item>
<widget class="LocationWidget" name="location" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="settingsTab">
<attribute name="title">
<string>Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>8</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item row="6" column="0" colspan="2">
<widget class="QGroupBox" name="mpBox">
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="title">
<string>Multi-player</string>
</property>
<property name="checkable">
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,2,0">
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Callsign:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Server:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="mpCallsign">
<property name="maxLength">
<number>10</number>
</property>
<property name="placeholderText">
<string>G-FGFS</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_11">
<property name="text">
<string>(Ten characters maximum)</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="mpServerCombo"/>
</item>
</layout>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Additional options</string>
</property>
<property name="startupOnly" stdset="0">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="leftMargin">
<number>4</number>
<widget class="QWidget" name="settingsScrollContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>173</width>
<height>28</height>
</rect>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QPlainTextEdit" name="commandLineArgs"/>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<pointsize>16</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Settings contents</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="placeholderText">
<string>Search...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item row="4" column="1">
<widget class="QCheckBox" name="fullScreenCheckbox">
<property name="text">
<string>Start full-screen</string>
</property>
<property name="startupOnly" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="msaaCheckbox">
<property name="text">
<string>Enable Multi-sample anti-aliasing</string>
</property>
<property name="startupOnly" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="fetchRealWxrCheckbox">
<property name="text">
<string>Fetch real weather online</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="startPausedCheck">
<property name="text">
<string>Start paused</string>
</property>
<property name="startupOnly" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QPushButton" name="restoreDefaultsButton">
<property name="text">
<string>Restore Defaults...</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Time of day:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="timeOfDayCombo">
<item>
<property name="text">
<string>Current time</string>
</property>
</item>
<item>
<property name="text">
<string>Dawn</string>
</property>
</item>
<item>
<property name="text">
<string>Morning</string>
</property>
</item>
<item>
<property name="text">
<string>Noon</string>
</property>
</item>
<item>
<property name="text">
<string>Afternoon</string>
</property>
</item>
<item>
<property name="text">
<string>Dusk</string>
</property>
</item>
<item>
<property name="text">
<string>Evening</string>
</property>
</item>
<item>
<property name="text">
<string>Midnight</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="rembrandtCheckbox">
<property name="text">
<string>Enable deferred rendering (Rembrandt)</string>
</property>
<property name="startupOnly" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="terrasyncCheck">
<property name="text">
<string>Enable automatic scenery downloading (TerraSync)</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_8">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;For information on additional options, please &lt;a href=&quot;http://flightgear.sourceforge.net/getstart-en/getstart-enpa2.html#x5-450004.5&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;see here&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If scenery download is disabled, you may need to download additional files from &lt;a href=&quot;http://www.flightgear.org/download/scenery/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;this page&lt;/span&gt;&lt;/a&gt; and install them in a scenery location; otherwise some objects may be missing from the world.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</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>
</layout>
</widget>
</widget>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="quitButton">
<property name="text">
<string>Quit</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>412</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="runButton">
<property name="text">
<string>Run</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
@ -693,6 +624,17 @@
<header location="global">GUI/LocationWidget.hxx</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ToolboxButton</class>
<extends>QPushButton</extends>
<header location="global">GUI/ToolboxButton.h</header>
</customwidget>
<customwidget>
<class>EnvironmentPage</class>
<extends>QWidget</extends>
<header location="global">GUI/EnvironmentPage.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="resources.qrc"/>

15
src/GUI/MPSettings.cpp Normal file
View file

@ -0,0 +1,15 @@
#include "MPSettings.h"
#include "ui_MPSettings.h"
MPSettings::MPSettings(QWidget *parent) :
SettingsSection(parent),
ui(new Ui::MPSettings)
{
ui->setupUi(this);
insertSettingsHeader();
}
MPSettings::~MPSettings()
{
delete ui;
}

22
src/GUI/MPSettings.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef MP_SETTINGS_H
#define MP_SETTINGS_H
#include <GUI/settingssection.h>
namespace Ui {
class MPSettings;
}
class MPSettings : public SettingsSection
{
Q_OBJECT
public:
explicit MPSettings(QWidget *parent = 0);
~MPSettings();
private:
Ui::MPSettings *ui;
};
#endif // MP_SETTINGS_H

160
src/GUI/MPSettings.ui Normal file
View file

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MPSettings</class>
<widget class="SettingsSection" name="MPSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>331</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="title" stdset="0">
<string>Multi-player</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Connect to the multi-player network</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Fly with hundreds of other pilots around the world.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Callsign:</string>
</property>
<property name="advanced" stdset="0">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Your call-sign identifies you to other pliots and controllers on the network. Callsigns are limited to ten characters.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Server:</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_3">
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Automatic</string>
</property>
</item>
<item>
<property name="text">
<string>Thread for culling and drawing</string>
</property>
</item>
<item>
<property name="text">
<string>Separate threads for culling and drawing</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Choose a specific multiplayer server, or enter a custom server</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/settingssection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -85,6 +85,12 @@
#include <Network/HTTPClient.hxx>
#include <Network/RemoteXMLRequest.hxx>
#include "renderingsettings.h"
#include "ViewSettings.h"
#include "MPSettings.h"
#include "DownloadSettings.h"
#include "AdditionalSettings.h"
using namespace flightgear;
using namespace simgear::pkg;
using std::string;
@ -749,7 +755,7 @@ QtLauncher::QtLauncher() :
#if QT_VERSION >= 0x050300
// don't require Qt 5.3
m_ui->commandLineArgs->setPlaceholderText("--option=value --prop:/sim/name=value");
//m_ui->commandLineArgs->setPlaceholderText("--option=value --prop:/sim/name=value");
#endif
#if QT_VERSION >= 0x050200
@ -778,8 +784,15 @@ QtLauncher::QtLauncher() :
connect(m_ui->aircraftFilter, &QLineEdit::textChanged,
m_aircraftProxy, &AircraftProxyModel::setAircraftFilterString);
connect(m_ui->runButton, SIGNAL(clicked()), this, SLOT(onRun()));
connect(m_ui->quitButton, SIGNAL(clicked()), this, SLOT(onQuit()));
connect(m_ui->flyButton, SIGNAL(clicked()), this, SLOT(onRun()));
connect(m_ui->summaryButton, &QAbstractButton::clicked, this, &QtLauncher::onClickToolboxButton);
connect(m_ui->aircraftButton, &QAbstractButton::clicked, this, &QtLauncher::onClickToolboxButton);
connect(m_ui->locationButton, &QAbstractButton::clicked, this, &QtLauncher::onClickToolboxButton);
connect(m_ui->environmentButton, &QAbstractButton::clicked, this, &QtLauncher::onClickToolboxButton);
connect(m_ui->settingsButton, &QAbstractButton::clicked, this, &QtLauncher::onClickToolboxButton);
// connect(m_ui->quitButton, SIGNAL(clicked()), this, SLOT(onQuit()));
connect(m_ui->aircraftHistory, &QPushButton::clicked,
this, &QtLauncher::onPopupAircraftHistory);
@ -803,6 +816,7 @@ QtLauncher::QtLauncher() :
m_ui->aircraftHistory->setIcon(historyIcon);
m_ui->locationHistory->setIcon(historyIcon);
#if 0
connect(m_ui->timeOfDayCombo, SIGNAL(currentIndexChanged(int)),
this, SLOT(updateSettingsSummary()));
connect(m_ui->seasonCombo, SIGNAL(currentIndexChanged(int)),
@ -827,11 +841,14 @@ QtLauncher::QtLauncher() :
this, SLOT(onRembrandtToggled(bool)));
connect(m_ui->terrasyncCheck, &QCheckBox::toggled,
this, &QtLauncher::onToggleTerrasync);
#endif
updateSettingsSummary();
#if 0
connect(m_ui->mpServerCombo, SIGNAL(activated(int)),
this, SLOT(onMPServerActivated(int)));
#endif
m_aircraftModel = new AircraftItemModel(this);
m_aircraftProxy->setSourceModel(m_aircraftModel);
@ -864,9 +881,10 @@ QtLauncher::QtLauncher() :
this, &QtLauncher::onAircraftInstallFailed);
connect(m_aircraftModel, &AircraftItemModel::scanCompleted,
this, &QtLauncher::updateSelectedAircraft);
#if 0
connect(m_ui->restoreDefaultsButton, &QPushButton::clicked,
this, &QtLauncher::onRestoreDefaults);
#endif
AddOnsPage* addOnsPage = new AddOnsPage(NULL, globals->packageRoot());
connect(addOnsPage, &AddOnsPage::downloadDirChanged,
@ -876,7 +894,7 @@ QtLauncher::QtLauncher() :
connect(addOnsPage, &AddOnsPage::aircraftPathsChanged,
this, &QtLauncher::onAircraftPathsChanged);
m_ui->tabWidget->addTab(addOnsPage, tr("Add-ons"));
// m_ui->tabWidget->addTab(addOnsPage, tr("Add-ons"));
// after any kind of reset, try to restore selection and scroll
// to match the m_selectedAircraft. This needs to be delayed
// fractionally otherwise the scrollTo seems to be ignored,
@ -893,6 +911,24 @@ QtLauncher::QtLauncher() :
restoreSettings();
onRefreshMPServers();
RenderingSettings* renderSettings = new RenderingSettings(m_ui->settingsScrollContents);
QVBoxLayout* settingsVBox = static_cast<QVBoxLayout*>(m_ui->settingsScrollContents->layout());
settingsVBox->addWidget(renderSettings);
ViewSettings* viewSettings = new ViewSettings(m_ui->settingsScrollContents);
settingsVBox->addWidget(viewSettings);
MPSettings* mpSettings = new MPSettings(m_ui->settingsScrollContents);
settingsVBox->addWidget(mpSettings);
DownloadSettings* downloadSettings = new DownloadSettings(m_ui->settingsScrollContents);
settingsVBox->addWidget(downloadSettings);
AdditionalSettings* addSettings = new AdditionalSettings(m_ui->settingsScrollContents);
settingsVBox->addWidget(addSettings);
settingsVBox->addStretch(1);
}
QtLauncher::~QtLauncher()
@ -936,14 +972,14 @@ void QtLauncher::setSceneryPaths() // static method
bool QtLauncher::execInApp()
{
m_inAppMode = true;
m_ui->tabWidget->removeTab(3);
m_ui->tabWidget->removeTab(3);
// m_ui->tabWidget->removeTab(3);
// m_ui->tabWidget->removeTab(3);
m_ui->runButton->setText(tr("Apply"));
m_ui->quitButton->setText(tr("Cancel"));
// m_ui->runButton->setText(tr("Apply"));
// m_ui->quitButton->setText(tr("Cancel"));
disconnect(m_ui->runButton, SIGNAL(clicked()), this, SLOT(onRun()));
connect(m_ui->runButton, SIGNAL(clicked()), this, SLOT(onApply()));
disconnect(m_ui->flyButton, SIGNAL(clicked()), this, SLOT(onRun()));
connect(m_ui->flyButton, SIGNAL(clicked()), this, SLOT(onApply()));
m_runInApp = true;
show();
@ -961,6 +997,7 @@ void QtLauncher::restoreSettings()
restoreGeometry(settings.value("window-geometry").toByteArray());
#if 0
m_ui->rembrandtCheckbox->setChecked(settings.value("enable-rembrandt", false).toBool());
m_ui->terrasyncCheck->setChecked(settings.value("enable-terrasync", true).toBool());
m_ui->fullScreenCheckbox->setChecked(settings.value("start-fullscreen", false).toBool());
@ -969,7 +1006,7 @@ void QtLauncher::restoreSettings()
m_ui->startPausedCheck->setChecked(settings.value("start-paused", false).toBool());
m_ui->timeOfDayCombo->setCurrentIndex(settings.value("timeofday", 0).toInt());
m_ui->seasonCombo->setCurrentIndex(settings.value("season", 0).toInt());
#endif
// full paths to -set.xml files
m_recentAircraft = QUrl::fromStringList(settings.value("recent-aircraft").toStringList());
@ -1026,11 +1063,12 @@ void QtLauncher::restoreSettings()
updateSelectedAircraft();
maybeRestoreAircraftSelection();
#if 0
m_ui->commandLineArgs->setPlainText(settings.value("additional-args").toString());
m_ui->mpBox->setChecked(settings.value("mp-enabled").toBool());
m_ui->mpCallsign->setText(settings.value("mp-callsign").toString());
#endif
// don't restore MP server here, we do it after a refresh
m_doRestoreMPServer = true;
}
@ -1059,17 +1097,21 @@ void QtLauncher::maybeRestoreAircraftSelection()
void QtLauncher::saveSettings()
{
QSettings settings;
#if 0
settings.setValue("enable-rembrandt", m_ui->rembrandtCheckbox->isChecked());
settings.setValue("enable-terrasync", m_ui->terrasyncCheck->isChecked());
settings.setValue("enable-msaa", m_ui->msaaCheckbox->isChecked());
settings.setValue("start-fullscreen", m_ui->fullScreenCheckbox->isChecked());
settings.setValue("enable-realwx", m_ui->fetchRealWxrCheckbox->isChecked());
settings.setValue("start-paused", m_ui->startPausedCheck->isChecked());
#endif
settings.setValue("ratings-filter", m_ui->ratingsFilterCheck->isChecked());
settings.setValue("only-show-installed", m_ui->onlyShowInstalledCheck->isChecked());
settings.setValue("recent-aircraft", QUrl::toStringList(m_recentAircraft));
settings.setValue("recent-location-sets", m_recentLocations);
#if 0
settings.setValue("timeofday", m_ui->timeOfDayCombo->currentIndex());
settings.setValue("season", m_ui->seasonCombo->currentIndex());
settings.setValue("additional-args", m_ui->commandLineArgs->toPlainText());
@ -1077,7 +1119,7 @@ void QtLauncher::saveSettings()
settings.setValue("mp-callsign", m_ui->mpCallsign->text());
settings.setValue("mp-server", m_ui->mpServerCombo->currentData());
settings.setValue("mp-enabled", m_ui->mpBox->isChecked());
#endif
settings.setValue("window-geometry", saveGeometry());
}
@ -1100,6 +1142,7 @@ void QtLauncher::closeEvent(QCloseEvent *event)
void QtLauncher::onRun()
{
flightgear::Options* opt = flightgear::Options::sharedInstance();
#if 0
setEnableDisableOptionFromCheckbox(m_ui->terrasyncCheck, "terrasync");
setEnableDisableOptionFromCheckbox(m_ui->fetchRealWxrCheckbox, "real-weather-fetch");
setEnableDisableOptionFromCheckbox(m_ui->rembrandtCheckbox, "rembrandt");
@ -1111,7 +1154,9 @@ void QtLauncher::onRun()
if (startPaused) {
opt->addOption("enable-freeze", "");
}
#endif
#if 0
// MSAA is more complex
if (!m_ui->rembrandtCheckbox->isChecked()) {
if (m_ui->msaaCheckbox->isChecked()) {
@ -1121,6 +1166,7 @@ void QtLauncher::onRun()
globals->get_props()->setIntValue("/sim/rendering/multi-sample-buffers", 0);
}
}
#endif
// aircraft
if (!m_selectedAircraft.isEmpty()) {
@ -1148,6 +1194,7 @@ void QtLauncher::onRun()
m_recentAircraft.pop_back();
}
#if 0
if (m_ui->mpBox->isChecked()) {
std::string callSign = m_ui->mpCallsign->text().toStdString();
if (!callSign.empty()) {
@ -1169,10 +1216,12 @@ void QtLauncher::onRun()
globals->get_props()->setStringValue("/sim/multiplay/txhost", host.toStdString());
globals->get_props()->setIntValue("/sim/multiplay/txport", port);
}
#endif
m_ui->location->setLocationProperties();
updateLocationHistory();
#if 0
// time of day
if (m_ui->timeOfDayCombo->currentIndex() != 0) {
QString dayval = m_ui->timeOfDayCombo->currentText().toLower();
@ -1183,6 +1232,7 @@ void QtLauncher::onRun()
QString seasonName = m_ui->seasonCombo->currentText().toLower();
opt->addOption("season", seasonName.toStdString());
}
#endif
QSettings settings;
QString downloadDir = settings.value("download-dir").toString();
@ -1216,6 +1266,7 @@ void QtLauncher::onRun()
}
// additional arguments
#if 0
ArgumentsTokenizer tk;
Q_FOREACH(ArgumentsTokenizer::Arg a, tk.tokenize(m_ui->commandLineArgs->toPlainText())) {
if (a.arg.startsWith("prop:")) {
@ -1230,6 +1281,7 @@ void QtLauncher::onRun()
opt->addOption(a.arg.toStdString(), a.value.toStdString());
}
}
#endif
if (settings.contains("restore-defaults-on-run")) {
settings.remove("restore-defaults-on-run");
@ -1329,7 +1381,7 @@ void QtLauncher::onToggleTerrasync(bool enabled)
int result = msg.exec();
if (result == QMessageBox::Cancel) {
m_ui->terrasyncCheck->setChecked(false);
//m_ui->terrasyncCheck->setChecked(false);
return;
}
@ -1472,7 +1524,7 @@ void QtLauncher::updateSelectedAircraft()
int status = index.data(AircraftPackageStatusRole).toInt();
bool canRun = (status == PackageInstalled);
m_ui->runButton->setEnabled(canRun);
m_ui->flyButton->setEnabled(canRun);
LauncherAircraftType aircraftType = Airplane;
if (index.data(AircraftIsHelicopterRole).toBool()) {
@ -1486,7 +1538,7 @@ void QtLauncher::updateSelectedAircraft()
m_ui->thumbnail->setPixmap(QPixmap());
m_ui->aircraftName->setText("");
m_ui->aircraftDescription->hide();
m_ui->runButton->setEnabled(false);
m_ui->flyButton->setEnabled(false);
}
}
@ -1504,6 +1556,15 @@ void QtLauncher::onPackagesNeedUpdate(bool yes)
checkUpdateAircraft();
}
void QtLauncher::onClickToolboxButton()
{
int pageIndex = sender()->property("pageIndex").toInt();
m_ui->stack->setCurrentIndex(pageIndex);
Q_FOREACH (ToolboxButton* tb, findChildren<ToolboxButton*>()) {
tb->setChecked(tb->property("pageIndex").toInt() == pageIndex);
}
}
QModelIndex QtLauncher::proxyIndexForAircraftURI(QUrl uri) const
{
return m_aircraftProxy->mapFromSource(sourceIndexForAircraftURI(uri));
@ -1589,6 +1650,7 @@ void QtLauncher::onEditRatingsFilter()
void QtLauncher::updateSettingsSummary()
{
QStringList summary;
#if 0
if (m_ui->timeOfDayCombo->currentIndex() > 0) {
summary.append(QString(m_ui->timeOfDayCombo->currentText().toLower()));
}
@ -1622,12 +1684,13 @@ void QtLauncher::updateSettingsSummary()
QString s = summary.join(", ");
s[0] = s[0].toUpper();
m_ui->settingsDescription->setText(s);
#endif
}
void QtLauncher::onRembrandtToggled(bool b)
{
// Rembrandt and multi-sample are exclusive
m_ui->msaaCheckbox->setEnabled(!b);
// m_ui->msaaCheckbox->setEnabled(!b);
}
void QtLauncher::onShowInstalledAircraftToggled(bool b)
@ -1750,6 +1813,7 @@ void QtLauncher::onRefreshMPServers()
void QtLauncher::onRefreshMPServersDone(simgear::HTTP::Request*)
{
#if 0
// parse the properties
SGPropertyNode *targetnode = fgGetNode("/sim/multiplay/server-list", true);
m_ui->mpServerCombo->clear();
@ -1773,7 +1837,7 @@ void QtLauncher::onRefreshMPServersDone(simgear::HTTP::Request*)
EditCustomMPServerDialog::addCustomItem(m_ui->mpServerCombo);
restoreMPServerSelection();
#endif
m_mpServerRequest.clear();
}
@ -1781,12 +1845,15 @@ void QtLauncher::onRefreshMPServersFailed(simgear::HTTP::Request*)
{
qWarning() << "refreshing MP servers failed:" << QString::fromStdString(m_mpServerRequest->responseReason());
m_mpServerRequest.clear();
#if 0
EditCustomMPServerDialog::addCustomItem(m_ui->mpServerCombo);
restoreMPServerSelection();
#endif
}
void QtLauncher::restoreMPServerSelection()
{
#if 0
if (m_doRestoreMPServer) {
QSettings settings;
int index = m_ui->mpServerCombo->findData(settings.value("mp-server"));
@ -1795,10 +1862,12 @@ void QtLauncher::restoreMPServerSelection()
}
m_doRestoreMPServer = false;
}
#endif
}
void QtLauncher::onMPServerActivated(int index)
{
#if 0
if (m_ui->mpServerCombo->itemData(index) == "custom") {
EditCustomMPServerDialog dlg(this);
dlg.exec();
@ -1806,6 +1875,7 @@ void QtLauncher::onMPServerActivated(int index)
m_ui->mpServerCombo->setItemText(index, tr("Custom - %1").arg(dlg.hostname()));
}
}
#endif
}
int QtLauncher::findMPServerPort(const std::string& host)

View file

@ -109,6 +109,7 @@ private slots:
void onPackagesNeedUpdate(bool yes);
void onClickToolboxButton();
void onAircraftPathsChanged();
private:

46
src/GUI/ToolboxButton.cpp Normal file
View file

@ -0,0 +1,46 @@
#include "ToolboxButton.h"
#include <QPainter>
#include <QFontMetrics>
const int ICON_SIZE = 50;
const int INDICATOR_WIDTH = 4;
const int PADDING = 8;
ToolboxButton::ToolboxButton(QWidget *pr) :
QAbstractButton(pr)
{
setCheckable(true);
}
void ToolboxButton::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
if (isChecked()) {
QRect indicatorRect = rect();
indicatorRect.setWidth(INDICATOR_WIDTH);
painter.fillRect(indicatorRect, Qt::white);
}
const int iconLeft = (width() - ICON_SIZE) / 2;
QRect iconRect(iconLeft, PADDING, ICON_SIZE, ICON_SIZE);
icon().paint(&painter, iconRect);
painter.setPen(Qt::white);
QRect textRect = rect();
textRect.setTop(iconRect.bottom());
painter.drawText(textRect, Qt::AlignHCenter, text());
}
QSize ToolboxButton::sizeHint() const
{
QSize icon(ICON_SIZE, ICON_SIZE);
QFontMetrics metrics(font());
QRect bounds = metrics.boundingRect(text());
const int PAD_2 = PADDING * 2;
return QSize(qMax(ICON_SIZE, bounds.width()) + PAD_2, ICON_SIZE + bounds.height() + PAD_2);
}

19
src/GUI/ToolboxButton.h Normal file
View file

@ -0,0 +1,19 @@
#ifndef TOOLBOXBUTTON_H
#define TOOLBOXBUTTON_H
#include <QAbstractButton>
class ToolboxButton : public QAbstractButton
{
public:
ToolboxButton(QWidget* pr = nullptr);
protected:
virtual void paintEvent(QPaintEvent* event) override;
virtual QSize sizeHint() const override;
private:
};
#endif // TOOLBOXBUTTON_H

15
src/GUI/ViewSettings.cpp Normal file
View file

@ -0,0 +1,15 @@
#include "ViewSettings.h"
#include "ui_ViewSettings.h"
ViewSettings::ViewSettings(QWidget *parent) :
SettingsSection(parent),
ui(new Ui::ViewSettings)
{
ui->setupUi(this);
insertSettingsHeader();
}
ViewSettings::~ViewSettings()
{
delete ui;
}

22
src/GUI/ViewSettings.h Normal file
View file

@ -0,0 +1,22 @@
#ifndef VIEWSETTINGS_H
#define VIEWSETTINGS_H
#include <GUI/settingssection.h>
namespace Ui {
class ViewSettings;
}
class ViewSettings : public SettingsSection
{
Q_OBJECT
public:
explicit ViewSettings(QWidget *parent = 0);
~ViewSettings();
private:
Ui::ViewSettings *ui;
};
#endif // VIEWSETTINGS_H

157
src/GUI/ViewSettings.ui Normal file
View file

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ViewSettings</class>
<widget class="SettingsSection" name="ViewSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>740</width>
<height>338</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="title" stdset="0">
<string>View</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Start full-screen</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Full-screen mode can be toggled inside the simulator by pressing F10.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Window size:</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>800 x 600</string>
</property>
</item>
<item>
<property name="text">
<string>1024 x 768</string>
</property>
</item>
<item>
<property name="text">
<string>Custom size...</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Field-of-view angle:</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<property name="maximum">
<number>180</number>
</property>
<property name="value">
<number>90</number>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Field-of-view depends on your monitor size. It can be adjusted in the simulator using the x/X keys</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/settingssection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -0,0 +1,16 @@
#include "aircraftpreviewwindow.h"
AircraftPreviewWindow::AircraftPreviewWindow(QWidget *parent) : QWidget(parent)
{
// setWindowFlags(); // frameless ?
}
void AircraftPreviewWindow::setUrls(QList<QUrl> urls)
{
}
void AircraftPreviewWindow::paintEvent(QPaintEvent *event)
{
}

View file

@ -0,0 +1,28 @@
#ifndef AIRCRAFTPREVIEWWINDOW_H
#define AIRCRAFTPREVIEWWINDOW_H
#include <QWidget>
#include <QUrl>
class AircraftPreviewWindow : public QWidget
{
Q_OBJECT
public:
explicit AircraftPreviewWindow(QWidget *parent = 0);
void setUrls(QList<QUrl> urls);
signals:
public slots:
protected:
virtual void paintEvent(QPaintEvent* event) override;
private:
unsigned int m_currentIndex = 0;
QList<QUrl> m_urls;
QList<QPixmap> m_pixmaps; // lazily populated
};
#endif // AIRCRAFTPREVIEWWINDOW_H

View file

@ -0,0 +1,15 @@
#include "renderingsettings.h"
#include "ui_renderingsettings.h"
RenderingSettings::RenderingSettings(QWidget *parent) :
SettingsSection(parent),
ui(new Ui::RenderingSettings)
{
ui->setupUi(this);
insertSettingsHeader();
}
RenderingSettings::~RenderingSettings()
{
delete ui;
}

View file

@ -0,0 +1,22 @@
#ifndef RENDERINGSETTINGS_H
#define RENDERINGSETTINGS_H
#include <GUI/settingssection.h>
namespace Ui {
class RenderingSettings;
}
class RenderingSettings : public SettingsSection
{
Q_OBJECT
public:
explicit RenderingSettings(QWidget *parent = 0);
~RenderingSettings();
private:
Ui::RenderingSettings *ui;
};
#endif // RENDERINGSETTINGS_H

View file

@ -0,0 +1,229 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RenderingSettings</class>
<widget class="SettingsSection" name="RenderingSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>771</width>
<height>331</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="title" stdset="0">
<string>Rendering</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Renderer:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox">
<item>
<property name="text">
<string>ALS</string>
</property>
</item>
<item>
<property name="text">
<string>Rembrandt</string>
</property>
</item>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Lots of information about which renderer is selcted</string>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>Enable multi-sample anti-aliasingg</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Multi-sample anti-aliasing (MSAA) reduces the appearance of jagged edges. Depending on your graphics card, this may reduce framerates</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,0">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Multi-sampling setting:</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_2">
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>2x</string>
</property>
</item>
<item>
<property name="text">
<string>4x</string>
</property>
</item>
<item>
<property name="text">
<string>8x</string>
</property>
</item>
<item>
<property name="text">
<string>16x</string>
</property>
</item>
<item>
<property name="text">
<string>Custom...</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Renderer threading model:</string>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_3">
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<item>
<property name="text">
<string>Automatic</string>
</property>
</item>
<item>
<property name="text">
<string>Thread for culling and drawing</string>
</property>
</item>
<item>
<property name="text">
<string>Separate threads for culling and drawing</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Choose how the rendering code uses multiple CPU cores to get the best performance. Automatic selection is usually recommended, and some settings can lead to problems including crashes.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="advanced" stdset="0">
<bool>true</bool>
</property>
<property name="help" stdset="0">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>SettingsSection</class>
<extends>QWidget</extends>
<header location="global">GUI/settingssection.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View file

@ -20,6 +20,13 @@
<file alias="airplane-icon">airplane-icon.png</file>
<file alias="airport-closed-icon">airport-closed-icon.png</file>
<file alias="preview-icon">preview-icon.png</file>
<file alias="settings-gear-white">settings-gear-white.png</file>
<file alias="toolbox-aircraft">toolbox-aircraft.png</file>
<file alias="toolbox-environment">toolbox-environment.png</file>
<file alias="toolbox-fly">toolbox-fly.png</file>
<file alias="toolbox-location">toolbox-location.png</file>
<file alias="toolbox-settings">toolbox-settings.png</file>
<file alias="toolbox-summary">toolbox-summary.png</file>
</qresource>
<qresource prefix="/preview">
<file alias="close-icon">preview-close.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

109
src/GUI/settingssection.cpp Normal file
View file

@ -0,0 +1,109 @@
#include "settingssection.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPalette>
#include <QPushButton>
#include <QVariant>
#include "AdvancedSettingsButton.h"
SettingsSection::SettingsSection(QWidget* pr) :
QFrame(pr)
{
m_titleLabel = new QLabel;
QFont titleFont = m_titleLabel->font();
titleFont.setPointSize(14);
titleFont.setBold(true);
m_titleLabel->setFont(titleFont);
QPalette pal = palette();
pal.setColor(QPalette::Normal, QPalette::WindowText, Qt::white);
m_titleLabel->setPalette(pal);
}
void SettingsSection::setShowAdvanced(bool showAdvanced)
{
if (m_showAdvanced == showAdvanced)
return;
m_showAdvanced = showAdvanced;
internalUpdateAdvanced();
emit showAdvancedChanged(showAdvanced);
}
void SettingsSection::setTitle(QString title)
{
if (m_title == title)
return;
m_title = title;
m_titleLabel->setText(m_title);
emit titleChanged(title);
}
void SettingsSection::toggleShowAdvanced()
{
setShowAdvanced(!m_showAdvanced);
}
void SettingsSection::insertSettingsHeader()
{
QVBoxLayout* topLevelVBox = qobject_cast<QVBoxLayout*>(layout());
Q_ASSERT(topLevelVBox);
topLevelVBox->setMargin(0);
QFrame* headerPanel = new QFrame(this);
headerPanel->setFrameStyle(QFrame::Box);
headerPanel->setAutoFillBackground(true);
QPalette p = headerPanel->palette();
p.setColor(QPalette::Normal, QPalette::Background, QColor(0x7f, 0x7f, 0x7f));
p.setColor(QPalette::Normal, QPalette::Foreground, Qt::black);
p.setColor(QPalette::Normal, QPalette::WindowText, Qt::white);
headerPanel->setPalette(p);
topLevelVBox->insertWidget(0, headerPanel);
QHBoxLayout* hbox = new QHBoxLayout(headerPanel);
hbox->setContentsMargins(32, 0, 32, 0);
headerPanel->setLayout(hbox);
hbox->addWidget(m_titleLabel);
hbox->addStretch(1);
m_advancedModeToggle = new AdvancedSettingsButton;
connect(m_advancedModeToggle, &QPushButton::toggled, this, &SettingsSection::toggleShowAdvanced);
hbox->addWidget(m_advancedModeToggle);
QFont helpLabelFont;
helpLabelFont.setPointSize(helpLabelFont.pointSize() - 1);
QPalette pal = palette();
pal.setColor(QPalette::Normal, QPalette::WindowText, QColor(0x3f, 0x3f, 0x3f));
Q_FOREACH(QLabel* w, findChildren<QLabel*>()) {
if (w->property("help").toBool()) {
w->setFont(helpLabelFont);
w->setPalette(pal);
}
}
internalUpdateAdvanced();
}
void SettingsSection::internalUpdateAdvanced()
{
Q_FOREACH(QWidget* w, findChildren<QWidget*>()) {
if (w->property("advanced").toBool()) {
w->setVisible(m_showAdvanced);
}
if (w->property("simple").toBool()) {
w->setVisible(!m_showAdvanced);
}
}
}

53
src/GUI/settingssection.h Normal file
View file

@ -0,0 +1,53 @@
#ifndef SETTINGSSECTION_H
#define SETTINGSSECTION_H
#include <QFrame>
#include <QLabel>
class AdvancedSettingsButton;
class SettingsSection : public QFrame
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
Q_PROPERTY(bool showAdvanced READ showAdvanced WRITE setShowAdvanced NOTIFY showAdvancedChanged)
public:
SettingsSection(QWidget* pr = nullptr);
bool showAdvanced() const
{
return m_showAdvanced;
}
QString title() const
{
return m_title;
}
void insertSettingsHeader();
public slots:
void setShowAdvanced(bool showAdvanced);
void setTitle(QString title);
void toggleShowAdvanced();
signals:
void showAdvancedChanged(bool showAdvanced);
void titleChanged(QString title);
private:
void internalUpdateAdvanced();
QString m_title;
bool m_showAdvanced = false;
QLabel* m_titleLabel;
AdvancedSettingsButton* m_advancedModeToggle;
};
#endif // SETTINGSSECTION_H

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
src/GUI/toolbox-fly.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

BIN
src/GUI/toolbox-summary.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B