mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 22:29:13 +08:00
fix: Use links to new documentation
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
},
|
},
|
||||||
"mappingMinimumVersion": "0.9.0",
|
"mappingMinimumVersion": "0.9.0",
|
||||||
"onlineHelpUrl": {
|
"onlineHelpUrl": {
|
||||||
"url": "https://datastore.swift-project.org/page/swifthelpdispatcher.html"
|
"url": "https://url.swift-project.org/"
|
||||||
},
|
},
|
||||||
"predefinedServers": {
|
"predefinedServers": {
|
||||||
"containerbase": [
|
"containerbase": [
|
||||||
|
|||||||
@@ -41,20 +41,7 @@ namespace swift::core::data
|
|||||||
const CUrl &CGlobalSetup::getSwiftSharedUrl() const { return m_sharedUrl; }
|
const CUrl &CGlobalSetup::getSwiftSharedUrl() const { return m_sharedUrl; }
|
||||||
CUrl CGlobalSetup::getDbHomePageUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/page/index.php"); }
|
CUrl CGlobalSetup::getDbHomePageUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/page/index.php"); }
|
||||||
|
|
||||||
CUrl CGlobalSetup::getHelpPageUrl(const QString &context) const
|
CUrl CGlobalSetup::getHelpPageUrl() const { return m_onlineHelpUrl; }
|
||||||
{
|
|
||||||
// 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::getLegalDirectoryUrl() const { return getDbRootDirectoryUrl().withAppendedPath("/legal/"); }
|
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; }
|
swift::misc::network::CUrl getVatsimFsdHttpUrl() const { return m_vatsimFsdHttpUrl; }
|
||||||
|
|
||||||
//! Help page URL
|
//! Help page URL
|
||||||
swift::misc::network::CUrl getHelpPageUrl(const QString &context = {}) const;
|
swift::misc::network::CUrl getHelpPageUrl() const;
|
||||||
|
|
||||||
//! Predefined servers
|
//! Predefined servers
|
||||||
const swift::misc::network::CServerList &getPredefinedServers() const { return m_predefinedServers; }
|
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)));
|
this->setWindowTitle(QStringLiteral("Model validation for '%1'").arg(simulator.toQString(true)));
|
||||||
CGuiApplication::modalWindowToFront();
|
CGuiApplication::modalWindowToFront();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAircraftModelSetValidationDialog::event(QEvent *event)
|
|
||||||
{
|
|
||||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
|
||||||
return QDialog::event(event);
|
|
||||||
}
|
|
||||||
} // namespace swift::gui::components
|
} // namespace swift::gui::components
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ namespace swift::gui::components
|
|||||||
const swift::misc::simulation::CAircraftModelList &invalid, bool stopped,
|
const swift::misc::simulation::CAircraftModelList &invalid, bool stopped,
|
||||||
const swift::misc::CStatusMessageList &msgs);
|
const swift::misc::CStatusMessageList &msgs);
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CAircraftModelSetValidationDialog> ui;
|
QScopedPointer<Ui::CAircraftModelSetValidationDialog> ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ namespace swift::gui::components
|
|||||||
void CAircraftModelValidationComponent::showHelp()
|
void CAircraftModelValidationComponent::showHelp()
|
||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
sGui->showHelp(this);
|
sGui->showHelp("model_set_validation");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAircraftModelValidationComponent::saveInvalidModels(const CAircraftModelList &models) const
|
void CAircraftModelValidationComponent::saveInvalidModels(const CAircraftModelList &models) const
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace swift::gui::components
|
|||||||
connect(this, &QWizard::helpRequested, sGui, [=] {
|
connect(this, &QWizard::helpRequested, sGui, [=] {
|
||||||
if (!myself) { return; }
|
if (!myself) { return; }
|
||||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
sGui->showHelp(this);
|
sGui->showHelp("install");
|
||||||
});
|
});
|
||||||
|
|
||||||
this->setScreenGeometry();
|
this->setScreenGeometry();
|
||||||
@@ -71,12 +71,6 @@ namespace swift::gui::components
|
|||||||
return wizard && wizard->lastStepSkipped();
|
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)
|
void CConfigurationWizard::wizardCurrentIdChanged(int id)
|
||||||
{
|
{
|
||||||
const int previousId = m_previousId;
|
const int previousId = m_previousId;
|
||||||
|
|||||||
@@ -50,10 +50,6 @@ namespace swift::gui::components
|
|||||||
//! Static version of CConfigurationWizard::lastStepSkipped
|
//! Static version of CConfigurationWizard::lastStepSkipped
|
||||||
static bool lastWizardStepSkipped(const QWizard *standardWizard);
|
static bool lastWizardStepSkipped(const QWizard *standardWizard);
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! The current page has changed
|
//! The current page has changed
|
||||||
void wizardCurrentIdChanged(int id);
|
void wizardCurrentIdChanged(int id);
|
||||||
|
|||||||
@@ -64,12 +64,6 @@ namespace swift::gui::components
|
|||||||
return QDialog::exec();
|
return QDialog::exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CDbOwnModelSetFormDialog::event(QEvent *event)
|
|
||||||
{
|
|
||||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
|
||||||
return QDialog::event(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDbOwnModelSetFormDialog::buttonClicked()
|
void CDbOwnModelSetFormDialog::buttonClicked()
|
||||||
{
|
{
|
||||||
const QObject *sender = QObject::sender();
|
const QObject *sender = QObject::sender();
|
||||||
|
|||||||
@@ -56,10 +56,6 @@ namespace swift::gui::components
|
|||||||
//! Exec and display simulator
|
//! Exec and display simulator
|
||||||
virtual int exec() override;
|
virtual int exec() override;
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDbOwnModelSetFormDialog> ui;
|
QScopedPointer<Ui::CDbOwnModelSetFormDialog> ui;
|
||||||
swift::misc::simulation::CAircraftModelList m_modelSet;
|
swift::misc::simulation::CAircraftModelList m_modelSet;
|
||||||
|
|||||||
@@ -39,10 +39,4 @@ namespace swift::gui::components
|
|||||||
{
|
{
|
||||||
ui->comp_InterpolationLogDisplay->setAirspaceMonitor(airspaceMonitor);
|
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
|
} // namespace swift::gui::components
|
||||||
|
|||||||
@@ -44,10 +44,6 @@ namespace swift::gui::components
|
|||||||
//! Set airspace monitor
|
//! Set airspace monitor
|
||||||
void setAirspaceMonitor(swift::core::CAirspaceMonitor *airspaceMonitor);
|
void setAirspaceMonitor(swift::core::CAirspaceMonitor *airspaceMonitor);
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CInterpolationLogDisplayDialog> ui;
|
QScopedPointer<Ui::CInterpolationLogDisplayDialog> ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace swift::gui::components
|
|||||||
{
|
{
|
||||||
if (!sGui) { return; }
|
if (!sGui) { return; }
|
||||||
const CGlobalSetup gs = sGui->getGlobalSetup();
|
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>")
|
ui->lbl_Tip->setText(QStringLiteral("Please read the <a href=\"%1\">checklist before your 1st flight</a>")
|
||||||
.arg(url.getFullUrl()));
|
.arg(url.getFullUrl()));
|
||||||
ui->lbl_Tip->setTextFormat(Qt::RichText);
|
ui->lbl_Tip->setTextFormat(Qt::RichText);
|
||||||
|
|||||||
@@ -19,12 +19,6 @@ namespace swift::gui::components
|
|||||||
// void;
|
// void;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CModelBrowserDialog::event(QEvent *event)
|
|
||||||
{
|
|
||||||
if (CGuiApplication::triggerShowHelp(this, event)) { return true; }
|
|
||||||
return QDialog::event(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CModelBrowserDialog::done(int r)
|
void CModelBrowserDialog::done(int r)
|
||||||
{
|
{
|
||||||
ui->comp_ModelBrowser->close();
|
ui->comp_ModelBrowser->close();
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ namespace swift::gui::components
|
|||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CModelBrowserDialog() override;
|
virtual ~CModelBrowserDialog() override;
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
//! \copydoc QDialog::closeEvent
|
//! \copydoc QDialog::closeEvent
|
||||||
virtual void done(int r) override;
|
virtual void done(int r) override;
|
||||||
|
|
||||||
|
|||||||
@@ -45,12 +45,6 @@ namespace swift::gui::components
|
|||||||
return r;
|
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::onDontShowAgain(bool dontShowAgain) { m_setting.setAndSave(!dontShowAgain); }
|
||||||
|
|
||||||
void CUpdateInfoDialog::selectionChanged()
|
void CUpdateInfoDialog::selectionChanged()
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ namespace swift::gui::components
|
|||||||
//! \copydoc QDialog::exec
|
//! \copydoc QDialog::exec
|
||||||
virtual int exec() override;
|
virtual int exec() override;
|
||||||
|
|
||||||
protected:
|
|
||||||
//! \copydoc QObject::event
|
|
||||||
virtual bool event(QEvent *event) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CUpdateInfoDialog> ui;
|
QScopedPointer<Ui::CUpdateInfoDialog> ui;
|
||||||
swift::misc::CSetting<swift::gui::settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
|
swift::misc::CSetting<swift::gui::settings::TUpdateNotificationSettings> m_setting { this }; //!< show again?
|
||||||
|
|||||||
@@ -851,43 +851,14 @@ namespace swift::gui
|
|||||||
Q_UNUSED(c)
|
Q_UNUSED(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGuiApplication::showHelp(const QString &context) const
|
void CGuiApplication::showHelp(const QString &subpath) const
|
||||||
{
|
{
|
||||||
if (this->isShuttingDown()) { return; }
|
if (this->isShuttingDown()) { return; }
|
||||||
const CGlobalSetup gs = this->getGlobalSetup();
|
const CGlobalSetup gs = this->getGlobalSetup();
|
||||||
const CUrl helpPage = gs.getHelpPageUrl(context);
|
const CUrl helpPage = gs.getHelpPageUrl().withAppendedPath(subpath);
|
||||||
if (helpPage.isEmpty())
|
|
||||||
{
|
|
||||||
CLogMessage(this).warning(u"No help page");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QDesktopServices::openUrl(helpPage);
|
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; }
|
const CStyleSheetUtility &CGuiApplication::getStyleSheetUtility() const { return m_styleSheetUtility; }
|
||||||
|
|
||||||
QString CGuiApplication::getWidgetStyle() const
|
QString CGuiApplication::getWidgetStyle() const
|
||||||
|
|||||||
@@ -161,13 +161,7 @@ namespace swift::gui
|
|||||||
void addMenuHelp(QMenu &menu);
|
void addMenuHelp(QMenu &menu);
|
||||||
|
|
||||||
//! Show help page (online help)
|
//! Show help page (online help)
|
||||||
void showHelp(const QString &context = {}) const;
|
void showHelp(const QString &subpath = {}) 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);
|
|
||||||
|
|
||||||
//! Style sheet handling
|
//! Style sheet handling
|
||||||
const CStyleSheetUtility &getStyleSheetUtility() const;
|
const CStyleSheetUtility &getStyleSheetUtility() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user