mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 07:05:38 +08:00
Info about checklist
This commit is contained in:
@@ -7,14 +7,20 @@
|
|||||||
* contained in the LICENSE file.
|
* contained in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackmisc/crashsettings.h"
|
|
||||||
#include "blackmisc/statusmessage.h"
|
|
||||||
#include "blackconfig/buildconfig.h"
|
|
||||||
#include "legalinfocomponent.h"
|
#include "legalinfocomponent.h"
|
||||||
#include "ui_legalinfocomponent.h"
|
#include "ui_legalinfocomponent.h"
|
||||||
|
|
||||||
|
#include "blackgui/guiapplication.h"
|
||||||
|
#include "blackcore/data/globalsetup.h"
|
||||||
|
#include "blackmisc/network/url.h"
|
||||||
|
#include "blackmisc/crashsettings.h"
|
||||||
|
#include "blackmisc/statusmessage.h"
|
||||||
|
#include "blackconfig/buildconfig.h"
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackMisc::Settings;
|
using namespace BlackMisc::Settings;
|
||||||
|
using namespace BlackCore::Data;
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
@@ -26,8 +32,10 @@ namespace BlackGui
|
|||||||
ui(new Ui::CLegalInfoComponent)
|
ui(new Ui::CLegalInfoComponent)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
this->setChecklistInfo();
|
||||||
|
|
||||||
const CCrashSettings settings = m_crashDumpSettings.get();
|
const CCrashSettings settings = m_crashDumpSettings.get();
|
||||||
|
|
||||||
ui->cb_CrashDumps->setChecked(settings.isEnabled());
|
ui->cb_CrashDumps->setChecked(settings.isEnabled());
|
||||||
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
|
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
|
||||||
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
|
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
|
||||||
@@ -56,6 +64,17 @@ namespace BlackGui
|
|||||||
m_crashDumpSettings.setAndSave(settings);
|
m_crashDumpSettings.setAndSave(settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLegalInfoComponent::setChecklistInfo()
|
||||||
|
{
|
||||||
|
if (!sGui) { return; }
|
||||||
|
const CGlobalSetup gs = sGui->getGlobalSetup();
|
||||||
|
const CUrl url = gs.getHelpPageUrl("checklist");
|
||||||
|
ui->lbl_Tip->setText(QStringLiteral("Please read the <a href=\"%1\">checklist before your 1st flight</a>").arg(url.getFullUrl()));
|
||||||
|
ui->lbl_Tip->setTextFormat(Qt::RichText);
|
||||||
|
ui->lbl_Tip->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||||
|
ui->lbl_Tip->setOpenExternalLinks(true);
|
||||||
|
}
|
||||||
|
|
||||||
bool CLegalInfoWizardPage::validatePage()
|
bool CLegalInfoWizardPage::validatePage()
|
||||||
{
|
{
|
||||||
return m_legalInfo && m_legalInfo->validateAgreement();
|
return m_legalInfo && m_legalInfo->validateAgreement();
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ namespace BlackGui
|
|||||||
//! Allow crash dumps
|
//! Allow crash dumps
|
||||||
void onAllowCrashDumps(bool checked);
|
void onAllowCrashDumps(bool checked);
|
||||||
|
|
||||||
|
//! Set the checklist info
|
||||||
|
void setChecklistInfo();
|
||||||
|
|
||||||
QScopedPointer<Ui::CLegalInfoComponent> ui;
|
QScopedPointer<Ui::CLegalInfoComponent> ui;
|
||||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpSettings> m_crashDumpSettings { this };
|
BlackMisc::CSetting<BlackCore::Application::TCrashDumpSettings> m_crashDumpSettings { this };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,13 +7,36 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>542</width>
|
<width>542</width>
|
||||||
<height>252</height>
|
<height>285</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>swift legal information</string>
|
<string>swift legal information</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_Tip">
|
||||||
|
<layout class="QHBoxLayout" name="hl_Tp" stretch="0,1">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Icon">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="pixmap">
|
||||||
|
<pixmap resource="../../blackmisc/blackmisc.qrc">:/pastel/icons/pastel/32/exclamation.png</pixmap>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Tip">
|
||||||
|
<property name="text">
|
||||||
|
<string>HINT: Read the checklist before the first flight</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML">
|
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@@ -26,13 +49,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="fr_Agree">
|
<widget class="QFrame" name="fr_Agree">
|
||||||
<property name="frameShape">
|
<layout class="QHBoxLayout" name="hl_Agree">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="cb_Agree">
|
<widget class="QCheckBox" name="cb_Agree">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -60,6 +77,8 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user