Skip to content
Permalink
Browse files
Add only parameters with description and headers with parameters
  • Loading branch information
pathmapper authored and nyalldawson committed Sep 6, 2021
1 parent 4659870 commit 39b6d035bdbb67a57c2de2e9f5736866bf610d40
Showing with 22 additions and 10 deletions.
  1. +12 −6 python/plugins/processing/gui/HelpEditionDialog.py
  2. +10 −4 src/core/processing/qgsprocessingutils.cpp
@@ -86,17 +86,23 @@ def accept(self):

def getHtml(self):
s = '<p>' + self.getDescription(self.ALG_DESC) + '</p>\n'
s += self.tr('<h2>Input parameters</h2>\n')
inputs = ""
for param in self.alg.parameterDefinitions():
if param.flags() & QgsProcessingParameterDefinition.FlagHidden or param.isDestination():
continue

s += '<h3>' + param.description() + '</h3>\n'
s += '<p>' + self.getDescription(param.name()) + '</p>\n'
s += self.tr('<h2>Outputs</h2>\n')
if self.getDescription(param.name()):
inputs += '<h3>' + param.description() + '</h3>\n'
inputs += '<p>' + self.getDescription(param.name()) + '</p>\n'
if inputs:
s += self.tr('<h2>Input parameters</h2>\n') + inputs
outputs = ""
for out in self.alg.outputDefinitions():
s += '<h3>' + out.description() + '</h3>\n'
s += '<p>' + self.getDescription(out.name()) + '</p>\n'
if self.getDescription(param.name()):
outputs += '<h3>' + out.description() + '</h3>\n'
outputs += '<p>' + self.getDescription(out.name()) + '</p>\n'
if outputs:
s += self.tr('<h2>Outputs</h2>\n') + outputs
return s

def fillTree(self):
@@ -1048,8 +1048,11 @@ QString QgsProcessingUtils::formatHelpMapAsHtml( const QVariantMap &map, const Q
if ( def->flags() & QgsProcessingParameterDefinition::FlagHidden || def->isDestination() )
continue;

inputs += QStringLiteral( "<h3>" ) + def->description() + QStringLiteral( "</h3>\n" );
inputs += QStringLiteral( "<p>" ) + getText( def->name() ) + QStringLiteral( "</p>\n" );
if ( !getText( def->name() ).isEmpty() )
{
inputs += QStringLiteral( "<h3>" ) + def->description() + QStringLiteral( "</h3>\n" );
inputs += QStringLiteral( "<p>" ) + getText( def->name() ) + QStringLiteral( "</p>\n" );
}
}
if ( !inputs.isEmpty() )
s += QObject::tr( "<h2>Input parameters</h2>\n" ) + inputs;
@@ -1058,8 +1061,11 @@ QString QgsProcessingUtils::formatHelpMapAsHtml( const QVariantMap &map, const Q
const auto outputDefinitions = algorithm->outputDefinitions();
for ( const QgsProcessingOutputDefinition *def : outputDefinitions )
{
outputs += QStringLiteral( "<h3>" ) + def->description() + QStringLiteral( "</h3>\n" );
outputs += QStringLiteral( "<p>" ) + getText( def->name() ) + QStringLiteral( "</p>\n" );
if ( !getText( def->name() ).isEmpty() )
{
outputs += QStringLiteral( "<h3>" ) + def->description() + QStringLiteral( "</h3>\n" );
outputs += QStringLiteral( "<p>" ) + getText( def->name() ) + QStringLiteral( "</p>\n" );
}
}
if ( !outputs.isEmpty() )
s += QObject::tr( "<h2>Outputs</h2>\n" ) + outputs;

0 comments on commit 39b6d03

Please sign in to comment.