fix: Use links to new documentation

This commit is contained in:
Lars Toenning
2025-06-13 22:15:24 +02:00
parent acb52d978e
commit 497ff56438
19 changed files with 9 additions and 117 deletions

View File

@@ -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/"); }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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