mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
fix: Use links to new documentation
This commit is contained in:
@@ -41,20 +41,7 @@ namespace swift::core::data
|
||||
const CUrl &CGlobalSetup::getSwiftSharedUrl() const { return m_sharedUrl; }
|
||||
CUrl CGlobalSetup::getDbHomePageUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/page/index.php"); }
|
||||
|
||||
CUrl CGlobalSetup::getHelpPageUrl(const QString &context) const
|
||||
{
|
||||
// we display in the standard browser,
|
||||
// so the user will realize if the URL does not work
|
||||
CUrl url = m_onlineHelpUrl;
|
||||
if (url.isEmpty()) { return url; }
|
||||
|
||||
// context string something like "application.moreSpecific.evenMoreSpecific"
|
||||
QString c = "client";
|
||||
if (QCoreApplication::instance()) { c = QCoreApplication::instance()->applicationName(); }
|
||||
if (!context.isEmpty()) { c += "." + context; }
|
||||
url.appendQuery("context", c);
|
||||
return url;
|
||||
}
|
||||
CUrl CGlobalSetup::getHelpPageUrl() const { return m_onlineHelpUrl; }
|
||||
|
||||
CUrl CGlobalSetup::getLegalDirectoryUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/legal/"); }
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace swift::core::data
|
||||
swift::misc::network::CUrl getVatsimFsdHttpUrl() const { return m_vatsimFsdHttpUrl; }
|
||||
|
||||
//! Help page URL
|
||||
swift::misc::network::CUrl getHelpPageUrl(const QString &context = {}) const;
|
||||
swift::misc::network::CUrl getHelpPageUrl() const;
|
||||
|
||||
//! Predefined servers
|
||||
const swift::misc::network::CServerList &getPredefinedServers() const { return m_predefinedServers; }
|
||||
|
||||
@@ -32,10 +32,4 @@ namespace swift::gui::components
|
||||
this->setWindowTitle(QStringLiteral("Model validation for '%1'").arg(simulator.toQString(true)));
|
||||
CGuiApplication::modalWindowToFront();
|
||||
}
|
||||
|
||||
bool CAircraftModelSetValidationDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
} // namespace swift::gui::components
|
||||
|
||||
@@ -47,10 +47,6 @@ namespace swift::gui::components
|
||||
const swift::misc::simulation::CAircraftModelList &invalid, bool stopped,
|
||||
const swift::misc::CStatusMessageList &msgs);
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CAircraftModelSetValidationDialog> ui;
|
||||
};
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace swift::gui::components
|
||||
void CAircraftModelValidationComponent::showHelp()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
sGui->showHelp(this);
|
||||
sGui->showHelp("model_set_validation");
|
||||
}
|
||||
|
||||
void CAircraftModelValidationComponent::saveInvalidModels(const CAircraftModelList &models) const
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace swift::gui::components
|
||||
connect(this, &QWizard::helpRequested, sGui, [=] {
|
||||
if (!myself) { return; }
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
sGui->showHelp(this);
|
||||
sGui->showHelp("install");
|
||||
});
|
||||
|
||||
this->setScreenGeometry();
|
||||
@@ -71,12 +71,6 @@ namespace swift::gui::components
|
||||
return wizard && wizard->lastStepSkipped();
|
||||
}
|
||||
|
||||
bool CConfigurationWizard::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
void CConfigurationWizard::wizardCurrentIdChanged(int id)
|
||||
{
|
||||
const int previousId = m_previousId;
|
||||
|
||||
@@ -50,10 +50,6 @@ namespace swift::gui::components
|
||||
//! Static version of CConfigurationWizard::lastStepSkipped
|
||||
static bool lastWizardStepSkipped(const QWizard *standardWizard);
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
//! The current page has changed
|
||||
void wizardCurrentIdChanged(int id);
|
||||
|
||||
@@ -64,12 +64,6 @@ namespace swift::gui::components
|
||||
return QDialog::exec();
|
||||
}
|
||||
|
||||
bool CDbOwnModelSetFormDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
void CDbOwnModelSetFormDialog::buttonClicked()
|
||||
{
|
||||
const QObject *sender = QObject::sender();
|
||||
|
||||
@@ -56,10 +56,6 @@ namespace swift::gui::components
|
||||
//! Exec and display simulator
|
||||
virtual int exec() override;
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbOwnModelSetFormDialog> ui;
|
||||
swift::misc::simulation::CAircraftModelList m_modelSet;
|
||||
|
||||
@@ -39,10 +39,4 @@ namespace swift::gui::components
|
||||
{
|
||||
ui->comp_InterpolationLogDisplay->setAirspaceMonitor(airspaceMonitor);
|
||||
}
|
||||
|
||||
bool CInterpolationLogDisplayDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
} // namespace swift::gui::components
|
||||
|
||||
@@ -44,10 +44,6 @@ namespace swift::gui::components
|
||||
//! Set airspace monitor
|
||||
void setAirspaceMonitor(swift::core::CAirspaceMonitor *airspaceMonitor);
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CInterpolationLogDisplayDialog> ui;
|
||||
};
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace swift::gui::components
|
||||
{
|
||||
if (!sGui) { return; }
|
||||
const CGlobalSetup gs = sGui->getGlobalSetup();
|
||||
const CUrl url = gs.getHelpPageUrl("checklist");
|
||||
const CUrl url = gs.getHelpPageUrl().withAppendedPath("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);
|
||||
|
||||
@@ -19,12 +19,6 @@ namespace swift::gui::components
|
||||
// void;
|
||||
}
|
||||
|
||||
bool CModelBrowserDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
void CModelBrowserDialog::done(int r)
|
||||
{
|
||||
ui->comp_ModelBrowser->close();
|
||||
|
||||
@@ -29,10 +29,6 @@ namespace swift::gui::components
|
||||
//! Destructor
|
||||
virtual ~CModelBrowserDialog() override;
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
//! \copydoc QDialog::closeEvent
|
||||
virtual void done(int r) override;
|
||||
|
||||
|
||||
@@ -45,12 +45,6 @@ namespace swift::gui::components
|
||||
return r;
|
||||
}
|
||||
|
||||
bool CUpdateInfoDialog::event(QEvent *event)
|
||||
{
|
||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
||||
return QDialog::event(event);
|
||||
}
|
||||
|
||||
void CUpdateInfoDialog::onDontShowAgain(bool dontShowAgain) { m_setting.setAndSave(!dontShowAgain); }
|
||||
|
||||
void CUpdateInfoDialog::selectionChanged()
|
||||
|
||||
@@ -37,10 +37,6 @@ namespace swift::gui::components
|
||||
//! \copydoc QDialog::exec
|
||||
virtual int exec() override;
|
||||
|
||||
protected:
|
||||
//! \copydoc QObject::event
|
||||
virtual bool event(QEvent *event) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CUpdateInfoDialog> ui;
|
||||
swift::misc::CSetting<swift::gui::settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
|
||||
|
||||
@@ -851,43 +851,14 @@ namespace swift::gui
|
||||
Q_UNUSED(c)
|
||||
}
|
||||
|
||||
void CGuiApplication::showHelp(const QString &context) const
|
||||
void CGuiApplication::showHelp(const QString &subpath) const
|
||||
{
|
||||
if (this->isShuttingDown()) { return; }
|
||||
const CGlobalSetup gs = this->getGlobalSetup();
|
||||
const CUrl helpPage = gs.getHelpPageUrl(context);
|
||||
if (helpPage.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning(u"No help page");
|
||||
return;
|
||||
}
|
||||
const CUrl helpPage = gs.getHelpPageUrl().withAppendedPath(subpath);
|
||||
QDesktopServices::openUrl(helpPage);
|
||||
}
|
||||
|
||||
void CGuiApplication::showHelp(const QObject *qObject) const
|
||||
{
|
||||
if (this->isShuttingDown()) { return; }
|
||||
if (!qObject || qObject->objectName().isEmpty()) { this->showHelp(); }
|
||||
else { this->showHelp(qObject->objectName()); }
|
||||
}
|
||||
|
||||
bool CGuiApplication::triggerShowHelp(const QWidget *widget, QEvent *event)
|
||||
{
|
||||
if (!widget) { return false; }
|
||||
if (!event) { return false; }
|
||||
const QEvent::Type t = event->type();
|
||||
if (t != QEvent::EnterWhatsThisMode) { return false; }
|
||||
QWhatsThis::leaveWhatsThisMode();
|
||||
event->accept();
|
||||
if (!widget->isVisible()) { return true; } // ignore invisble ones
|
||||
const QPointer<const QWidget> wp(widget);
|
||||
QTimer::singleShot(0, sGui, [=] {
|
||||
if (!wp || !sGui || sGui->isShuttingDown()) { return; }
|
||||
sGui->showHelp(widget);
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
const CStyleSheetUtility &CGuiApplication::getStyleSheetUtility() const { return m_styleSheetUtility; }
|
||||
|
||||
QString CGuiApplication::getWidgetStyle() const
|
||||
|
||||
@@ -161,13 +161,7 @@ namespace swift::gui
|
||||
void addMenuHelp(QMenu &menu);
|
||||
|
||||
//! Show help page (online help)
|
||||
void showHelp(const QString &context = {}) const;
|
||||
|
||||
//! Show help page (online help), use QObject::objectName as 2nd level context
|
||||
void showHelp(const QObject *qObject) const;
|
||||
|
||||
//! Static version used with dialogs
|
||||
static bool triggerShowHelp(const QWidget *widget, QEvent *event);
|
||||
void showHelp(const QString &subpath = {}) const;
|
||||
|
||||
//! Style sheet handling
|
||||
const CStyleSheetUtility &getStyleSheetUtility() const;
|
||||
|
||||
Reference in New Issue
Block a user