Info about checklist

This commit is contained in:
Klaus Basan
2018-11-14 04:41:03 +01:00
parent c94a619599
commit 21506293f3
3 changed files with 53 additions and 12 deletions

View File

@@ -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();

View File

@@ -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 };
};

View File

@@ -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>