mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Ref T157, add context for help calls and call dispatcher
This commit is contained in:
committed by
Mathew Sutcliffe
parent
0a4accc809
commit
ad32d33aa1
@@ -46,7 +46,10 @@ namespace BlackGui
|
||||
connect(this, &QWizard::accepted, this, &CConfigurationWizard::ended);
|
||||
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||
connect(this, &QWizard::helpRequested, sGui, &CGuiApplication::showHelp);
|
||||
connect(this, &QWizard::helpRequested, sGui, [ = ]
|
||||
{
|
||||
sGui->showHelp(this);
|
||||
});
|
||||
}
|
||||
|
||||
CConfigurationWizard::~CConfigurationWizard()
|
||||
|
||||
@@ -556,10 +556,10 @@ namespace BlackGui
|
||||
Q_UNUSED(c);
|
||||
}
|
||||
|
||||
void CGuiApplication::showHelp()
|
||||
void CGuiApplication::showHelp(const QString &context) const
|
||||
{
|
||||
const CGlobalSetup gs = this->getGlobalSetup();
|
||||
const CUrl helpPage = gs.getHelpPageUrl();
|
||||
const CUrl helpPage = gs.getHelpPageUrl(context);
|
||||
if (helpPage.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning("No help page");
|
||||
@@ -568,6 +568,12 @@ namespace BlackGui
|
||||
QDesktopServices::openUrl(helpPage);
|
||||
}
|
||||
|
||||
void CGuiApplication::showHelp(const QObject *qObject) const
|
||||
{
|
||||
if (!qObject || qObject->objectName().isEmpty()) { return this->showHelp(); }
|
||||
return this->showHelp(qObject->objectName());
|
||||
}
|
||||
|
||||
const CStyleSheetUtility &CGuiApplication::getStyleSheetUtility() const
|
||||
{
|
||||
return this->m_styleSheetUtility;
|
||||
|
||||
@@ -143,7 +143,10 @@ namespace BlackGui
|
||||
void addMenuHelp(QMenu &menu);
|
||||
|
||||
//! Show help page (online help)
|
||||
void showHelp();
|
||||
void showHelp(const QString &context = {}) const;
|
||||
|
||||
//! Show help page (online help), use QObject::objectName as 2nd level context
|
||||
void showHelp(const QObject *qObject) const;
|
||||
|
||||
//! Style sheet handling
|
||||
const CStyleSheetUtility &getStyleSheetUtility() const;
|
||||
|
||||
Reference in New Issue
Block a user