mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Info about checklist
This commit is contained in:
@@ -7,14 +7,20 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackmisc/crashsettings.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
#include "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::Network;
|
||||
using namespace BlackMisc::Settings;
|
||||
using namespace BlackCore::Data;
|
||||
using namespace BlackConfig;
|
||||
|
||||
namespace BlackGui
|
||||
@@ -26,8 +32,10 @@ namespace BlackGui
|
||||
ui(new Ui::CLegalInfoComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setChecklistInfo();
|
||||
|
||||
const CCrashSettings settings = m_crashDumpSettings.get();
|
||||
|
||||
ui->cb_CrashDumps->setChecked(settings.isEnabled());
|
||||
ui->cb_Agree->setChecked(CBuildConfig::isLocalDeveloperDebugBuild());
|
||||
connect(ui->cb_CrashDumps, &QCheckBox::toggled, this, &CLegalInfoComponent::onAllowCrashDumps);
|
||||
@@ -56,6 +64,17 @@ namespace BlackGui
|
||||
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()
|
||||
{
|
||||
return m_legalInfo && m_legalInfo->validateAgreement();
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace BlackGui
|
||||
//! Allow crash dumps
|
||||
void onAllowCrashDumps(bool checked);
|
||||
|
||||
//! Set the checklist info
|
||||
void setChecklistInfo();
|
||||
|
||||
QScopedPointer<Ui::CLegalInfoComponent> ui;
|
||||
BlackMisc::CSetting<BlackCore::Application::TCrashDumpSettings> m_crashDumpSettings { this };
|
||||
};
|
||||
|
||||
@@ -7,13 +7,36 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>252</height>
|
||||
<height>285</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>swift legal information</string>
|
||||
</property>
|
||||
<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>
|
||||
<widget class="BlackGui::Components::CAboutHtmlComponent" name="comp_AboutHTML">
|
||||
<property name="minimumSize">
|
||||
@@ -26,13 +49,7 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="fr_Agree">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="hl_Agree">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_Agree">
|
||||
<property name="text">
|
||||
@@ -60,6 +77,8 @@
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
Reference in New Issue
Block a user