Refactoring of all help calls, deprecating QgsContextHelp and the former helviewer

This commit is contained in:
Jorge Gustavo Rocha 2017-08-09 09:27:29 +02:00
parent 518ffe3f62
commit 3a103b7c62
60 changed files with 130 additions and 323 deletions

View File

@ -31,8 +31,8 @@ from .console_sci import ShellScintilla
from .console_output import ShellOutputScintilla
from .console_editor import EditorTabWidget
from .console_settings import optionsDialog
from qgis.core import QgsApplication, QgsContextHelp, QgsSettings
from qgis.gui import QgsFilterLineEdit
from qgis.core import QgsApplication, QgsSettings
from qgis.gui import QgsFilterLineEdit, QgsHelp
from functools import partial
import sys
@ -59,7 +59,7 @@ def show_console():
# Shows help on first launch of the console
settings = QgsSettings()
if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool):
QgsContextHelp.run("PythonConsole")
QgsHelp.openHelp("../pyqgis_developer_cookbook/intro.html#python-console")
settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)
return _console
@ -657,7 +657,7 @@ class PythonConsoleWidget(QWidget):
self.updateTabListScript(pathFileName, action='remove')
def openHelp(self):
QgsContextHelp.run("PythonConsole")
QgsHelp.openHelp("../pyqgis_developer_cookbook/intro.html#python-console")
def openSettings(self):
if optionsDialog(self).exec_():

View File

@ -19,7 +19,6 @@
%Include qgscolorramp.sip
%Include qgscolorscheme.sip
%Include qgscolorschemeregistry.sip
%Include qgscontexthelp.sip
%Include qgsconditionalstyle.sip
%Include qgscoordinatetransform.sip
%Include qgscrscache.sip

View File

@ -1,41 +0,0 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscontexthelp.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsContextHelp : QObject
{
%Docstring
Provides a context based help browser for a dialog.
The help text is stored in SQLite and accessed by a context identifier
unique to each dialog. This is a singleton class which invokes the help
viewer using QProcess and ensures that only one viewer is open.
The viewer will be terminated if open when the main application quits.
%End
%TypeHeaderCode
#include "qgscontexthelp.h"
%End
public:
static void run( const QString &context );
private:
QgsContextHelp() ;
private:
~QgsContextHelp() ;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgscontexthelp.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -8,6 +8,9 @@
class QgsNewHttpConnection : QDialog
{
%Docstring
@ -28,12 +31,13 @@ Constructor
virtual void accept();
void helpRequest();
%Docstring
Open the help in a browser
%End
void on_txtName_textChanged( const QString & );
void on_txtUrl_textChanged( const QString & );
void on_buttonBox_helpRequested();
};
/************************************************************************

View File

@ -78,7 +78,10 @@ change search string shown in text field
are inserted into the values list box.
%End
void on_buttonBox_helpRequested();
void helpRequest();
%Docstring
Open the help in a browser
%End
void saveQuery();
void loadQuery();

View File

@ -77,7 +77,6 @@ class QgsSublayersDialog : QDialog
%End
public slots:
void on_buttonBox_helpRequested();
int exec();
%Docstring
:rtype: int

37
scripts/chkdoclink.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
###########################################################################
# chkdoclink.sh
# ---------------------
# Date : August 2017
# Copyright : (C) 2017 by Jorge Gustavo Rocha
# Email : jgr at geomaster dot pt
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
# This script is used to check missing links to the documentation
# This script only reports missing links
# An option argument can be used to indicate the base URL of the documentation, for example:
#
# scripts/chkdoclink.sh http://docs.qgis.org/2.18/en/docs/user_manual/
#
# When no link is indicated, the link used is:
# http://docs.qgis.org/testing/en/docs/user_manual/
#
# Nødebo, August 2017
prefix=${1:-http://docs.qgis.org/testing/en/docs/user_manual/}
find .. \( -name \*.h -o -name \*.cpp \) -exec grep -H "QgsHelp::openHelp(" \{\} \; | sed 's/:[^"]\+/\t/;s/" .\+$/"/' | sort | sed 's/^\.\.\/QGIS\///' | awk -F $'\t' '{print $1 ";" $2;}' | grep -v ";$" | sed 's/"//g' | while read line; do
file=${line%;*}
suffix=${line##*;}
link=$prefix$suffix
if ! wget --spider $link 2>/dev/null; then
echo "Documentation missing for: $file Key: $suffix"
fi
done

View File

@ -1,27 +0,0 @@
import os
import glob
import sys
cpp = open(sys.argv[1], "w")
cpp.write(
"#include \"qgscontexthelp.h\"\n"
"#include <QCoreApplication>\n\n"
"QHash<QString, QString> QgsContextHelp::sContextHelpTexts;\n"
"\n"
"void QgsContextHelp::init()\n"
"{\n"
" if( !sContextHelpTexts.isEmpty() )\n"
" return;\n"
)
for f in sorted(glob.glob('resources/context_help/*')):
n = os.path.basename(f)
if os.path.isdir(f):
# Protect from IOError: [Errno 21] Is a directory
continue
with open(f) as content:
cpp.write("\n sContextHelpTexts.insert( \"{0}\", QCoreApplication::translate( \"context_help\", \"{1}\") );".format(
n, content.read().replace("\\", "&#92;").replace('\\', '\\\\').replace('"', '\\"').replace('\n', '\\n"\n\"')))
cpp.write("\n}\n")
cpp.close()

View File

@ -22,6 +22,7 @@
# name is reserved for the Windows qmake project file
echo "deprecated - use push_ts.sh and pull_ts.sh" >&2
echo "deprecated - src/core/qgscontexthelp_texts.cpp are no longer used" >&2
set -e

View File

@ -57,7 +57,6 @@
#include "qgsproject.h"
#include "qgsmapcanvas.h"
#include "qgsmessageviewer.h"
#include "qgscontexthelp.h"
#include "qgscursors.h"
#include "qgsmaplayeractionregistry.h"
#include "qgsgeometry.h"

View File

@ -17,7 +17,6 @@
#include "qgisapp.h"
#include "qgsapplication.h"
#include "qgsbookmarks.h"
#include "qgscontexthelp.h"
#include "qgsmapcanvas.h"
#include "qgsproject.h"
#include "qgsmessagelog.h"

View File

@ -53,6 +53,7 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer *vl, QWidget *parent )
connect( builder, &QgsExpressionBuilderWidget::expressionParsed, this, &QgsFieldCalculator::setOkButtonState );
connect( mOutputFieldWidthSpinBox, &QAbstractSpinBox::editingFinished, this, &QgsFieldCalculator::setPrecisionMinMax );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsFieldCalculator::helpRequest );
QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs() );
@ -482,3 +483,8 @@ void QgsFieldCalculator::setPrecisionMinMax()
mOutputFieldPrecisionSpinBox->setMinimum( minPrecType );
mOutputFieldPrecisionSpinBox->setMaximum( qMax( minPrecType, qMin( maxPrecType, mOutputFieldWidthSpinBox->value() ) ) );
}
void QgsFieldCalculator::helpRequest()
{
QgsHelp::openHelp( "working_with_vector/attribute_table.html#field-calculator" );
}

View File

@ -41,9 +41,7 @@ class APP_EXPORT QgsFieldCalculator: public QDialog, private Ui::QgsFieldCalcula
void on_mCreateVirtualFieldCheckbox_stateChanged( int state );
void on_mOutputFieldNameLineEdit_textChanged( const QString &text );
void on_mOutputFieldTypeComboBox_activated( int index );
void on_mButtonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#editing-attribute-values" ) ); }
void helpRequest();
private slots:
//! Sets the OK button enabled / disabled

View File

@ -23,7 +23,6 @@
#include "qgsdistancearea.h"
#include "qgisapp.h"
#include "qgscomposer.h"
#include "qgscontexthelp.h"
#include "qgscoordinatetransform.h"
#include "qgslayoutmanager.h"
#include "qgslogger.h"

View File

@ -22,7 +22,6 @@
#include "qgsapplication.h"
#include "qgsbilinearrasterresampler.h"
#include "qgsbrightnesscontrastfilter.h"
#include "qgscontexthelp.h"
#include "qgscontrastenhancement.h"
#include "qgscoordinatetransform.h"
#include "qgscubicrasterresampler.h"

View File

@ -25,7 +25,6 @@
#include "qgsapplication.h"
#include "qgsattributeactiondialog.h"
#include "qgsapplydialog.h"
#include "qgscontexthelp.h"
#include "qgscoordinatetransform.h"
#include "qgsdiagramproperties.h"
#include "qgsdiagramrenderer.h"

View File

@ -139,8 +139,7 @@ SET(QGIS_CORE_SRCS
qgscolorscheme.cpp
qgscolorschemeregistry.cpp
qgsconditionalstyle.cpp
qgscontexthelp.cpp
qgscoordinatereferencesystem.cpp
qgscoordinatereferencesystem.cpp
qgscoordinatetransform.cpp
qgscoordinatetransform_p.cpp
qgscoordinateutils.cpp
@ -459,7 +458,6 @@ SET(QGIS_CORE_SRCS
fieldformatter/qgsvaluemapfieldformatter.cpp
fieldformatter/qgsvaluerelationfieldformatter.cpp
${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp
${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp
qgsuserprofile.cpp
@ -480,14 +478,6 @@ ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
FILE(GLOB CONTEXT_HELP_FILES "${CMAKE_SOURCE_DIR}/resources/context_help/*")
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_contexthelp.py ${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp.temp
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
DEPENDS ${CONTEXT_HELP_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
IF(ENABLE_MODELTEST)
SET(MODELTEST_SRCS
../../tests/qt_modeltest/modeltest.cpp
@ -554,8 +544,7 @@ SET(QGIS_CORE_MOC_HDRS
qgsactionscoperegistry.h
qgsanimatedicon.h
qgsbrowsermodel.h
qgscontexthelp.h
qgscoordinatereferencesystem.h
qgscoordinatereferencesystem.h
qgscredentials.h
qgsdataitem.h
qgsdataprovider.h
@ -770,8 +759,7 @@ SET(QGIS_CORE_HDRS
qgscolorscheme.h
qgscolorschemeregistry.h
qgsconnectionpool.h
qgscontexthelp.h
qgsconditionalstyle.h
qgsconditionalstyle.h
qgscoordinatetransform.h
qgscoordinateutils.h
qgscrscache.h

View File

@ -1,103 +0,0 @@
/***************************************************************************
qgscontexthelp.cpp
Display context help for a dialog
-------------------
begin : 2005-06-19
copyright : (C) 2005 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <QString>
#include <QProcess>
#include <QTextStream>
#include "qgscontexthelp.h"
#include "qgsmessagelog.h"
#include "qgsapplication.h"
#include "qgslogger.h"
QgsContextHelp *QgsContextHelp::sContextHelp = nullptr; // Singleton instance
void QgsContextHelp::run( const QString &context )
{
if ( !sContextHelp )
{
// Create singleton instance if it does not exist
sContextHelp = new QgsContextHelp();
}
sContextHelp->showContext( context );
}
QgsContextHelp::QgsContextHelp()
{
mProcess = start();
}
QgsContextHelp::~QgsContextHelp()
{
delete mProcess;
}
QProcess *QgsContextHelp::start()
{
// Get the path to the help viewer
QString helpPath = QgsApplication::helpAppPath();
QgsDebugMsg( QString( "Help path is %1" ).arg( helpPath ) );
QProcess *process = new QProcess;
// Delete this object if the process terminates
connect( process, static_cast < void ( QProcess::* )( int ) >( &QProcess::finished ), this, [ = ] { processExited(); } );
connect( process, static_cast < void ( QProcess::* )( QProcess::ProcessError ) >( &QProcess::error ), this, &QgsContextHelp::error );
#ifdef Q_OS_WIN
if ( QgsApplication::isRunningFromBuildDir() )
{
process->setEnvironment( QStringList() << QString( "PATH=%1;%2" ).arg( getenv( "PATH" ) ).arg( QApplication::applicationDirPath() ) );
}
#endif
process->start( helpPath, QStringList() );
return process;
}
void QgsContextHelp::error( QProcess::ProcessError error )
{
QgsMessageLog::logMessage( tr( "Error starting help viewer [%1]" ).arg( error ), tr( "Context help" ) );
}
void QgsContextHelp::showContext( const QString &context )
{
init();
QString helpContents = sContextHelpTexts.value( context,
tr( "<h3>Oops! QGIS can't find help for this form.</h3>"
"The help file for %1 was not found for your language<br>"
"If you would like to create it, contact the QGIS development team"
).arg( context ) );
QString myStyle = QgsApplication::reportStyleSheet();
helpContents = "<head><style>" + myStyle + "</style></head><body>" + helpContents + "</body>\nEOH\n";
mProcess->write( helpContents.toUtf8() );
}
void QgsContextHelp::processExited()
{
// Delete this object if the process terminates
delete sContextHelp;
sContextHelp = nullptr;
}

View File

@ -1,65 +0,0 @@
/***************************************************************************
qgscontexthelp.h
Display context help for a dialog by invoking the
QgsHelpViewer
-------------------
begin : 2005-06-19
copyright : (C) 2005 by Gary E.Sherman
email : sherman at mrcc.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSCONTEXTHELP_H
#define QGSCONTEXTHELP_H
#include <QObject>
#include <QHash>
#include <QProcess>
#include "qgis_core.h"
#include "qgis.h"
/** \ingroup core
* Provides a context based help browser for a dialog.
*
* The help text is stored in SQLite and accessed by a context identifier
* unique to each dialog. This is a singleton class which invokes the help
* viewer using QProcess and ensures that only one viewer is open.
* The viewer will be terminated if open when the main application quits.
*
*/
class CORE_EXPORT QgsContextHelp : public QObject
{
Q_OBJECT
public:
static void run( const QString &context );
private slots:
void processExited();
void error( QProcess::ProcessError error );
private:
//! Constructor
QgsContextHelp() SIP_FORCE;
~QgsContextHelp() SIP_FORCE;
QProcess *start();
void showContext( const QString &context );
static QgsContextHelp *sContextHelp; // Singleton instance
QProcess *mProcess = nullptr;
static QHash<QString, QString> sContextHelpTexts;
void init();
};
#endif //QGSCONTEXTHELP_H

View File

@ -18,7 +18,6 @@
#include <QRegExpValidator>
#include "qgsnewogrconnection.h"
#include "qgscontexthelp.h"
#include "qgslogger.h"
#include "qgsproviderregistry.h"
#include "qgsogrhelperfunctions.h"
@ -27,12 +26,14 @@
#include <ogr_api.h>
#include <cpl_error.h>
#include <qgshelp.h>
QgsNewOgrConnection::QgsNewOgrConnection( QWidget *parent, const QString &connType, const QString &connName, Qt::WindowFlags fl )
: QDialog( parent, fl )
, mOriginalConnName( connName )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewOgrConnection::helpRequest );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/OGRDatabaseConnection/geometry" ) ).toByteArray() );
@ -138,4 +139,9 @@ void QgsNewOgrConnection::on_btnConnect_clicked()
testConnection();
}
void QgsNewOgrConnection::helpRequest()
{
QgsHelp::openHelp( "managing_data_source/opening_data.html#connecting-to-ogr" );
}
//! End Autoconnected SLOTS *

View File

@ -22,7 +22,6 @@
#include "ui_qgsnewogrconnectionbase.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgis_gui.h"
@ -45,7 +44,7 @@ class GUI_EXPORT QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConn
public slots:
void accept() override;
void on_btnConnect_clicked();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void helpRequest();
private:
QString mOriginalConnName;

View File

@ -28,6 +28,7 @@
#include "qgsprojectionselectiondialog.h"
#include "qgslogger.h"
#include "qgssettings.h"
#include "qgshelp.h"
#include <QPushButton>
#include <QLineEdit>
@ -48,6 +49,7 @@ QgsNewGeoPackageLayerDialog::QgsNewGeoPackageLayerDialog( QWidget *parent, Qt::W
, mLayerIdentifierEdited( false )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewGeoPackageLayerDialog::helpRequest );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/NewGeoPackageLayer/geometry" ) ).toByteArray() );
@ -473,3 +475,7 @@ bool QgsNewGeoPackageLayerDialog::apply()
return false;
}
void QgsNewGeoPackageLayerDialog::helpRequest()
{
QgsHelp::openHelp( "managing_data_source/opening_data.html#loading-a-layer-from-a-file" );
}

View File

@ -19,7 +19,6 @@
#include "ui_qgsnewgeopackagelayerdialogbase.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgis.h"
#include "qgis_gui.h"
@ -55,7 +54,7 @@ class GUI_EXPORT QgsNewGeoPackageLayerDialog: public QDialog, private Ui::QgsNew
void selectionChanged();
void checkOk();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void helpRequest();
void on_buttonBox_accepted();
void on_buttonBox_rejected();

View File

@ -15,9 +15,9 @@
* *
***************************************************************************/
#include "qgsnewhttpconnection.h"
#include "qgscontexthelp.h"
#include "qgsauthconfigselect.h"
#include "qgssettings.h"
#include "qgshelp.h"
#include <QMessageBox>
#include <QUrl>
@ -33,6 +33,7 @@ QgsNewHttpConnection::QgsNewHttpConnection(
, mAuthConfigSelect( nullptr )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsNewHttpConnection::helpRequest );
QRegExp rx( "/connections-([^/]+)/" );
rx.indexIn( baseKey );
@ -330,3 +331,8 @@ void QgsNewHttpConnection::accept()
QDialog::accept();
}
void QgsNewHttpConnection::helpRequest()
{
QgsHelp::openHelp( "managing_data_source/opening_data.html#connecting-to-web-services" );
}

View File

@ -14,11 +14,15 @@
* (at your option) any later version. *
* *
***************************************************************************/
#define SIP_NO_FILE
#ifndef QGSNEWHTTPCONNECTION_H
#define QGSNEWHTTPCONNECTION_H
#include <qgis_sip.h>
#include "ui_qgsnewhttpconnectionbase.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgis_gui.h"
class QgsAuthConfigSelect;
@ -39,12 +43,13 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo
// Saves the connection to ~/.qt/qgisrc
void accept() override;
/**
* Open the help in a browser
*/
void helpRequest();
void on_txtName_textChanged( const QString & );
void on_txtUrl_textChanged( const QString & );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
private:
QString mBaseKey;
QString mCredentialsBaseKey;

View File

@ -21,7 +21,6 @@
***************************************************************************/
#include "qgis.h" // GEO_EPSG_CRS_ID
#include "qgscontexthelp.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsdatasourceuri.h"
#include "qgsprojectionselectiondialog.h"

View File

@ -24,7 +24,6 @@
#include "qgis.h"
#include "qgsdatasourceuri.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgsproviderregistry.h"
#include "qgsabstractdatasourcewidget.h"

View File

@ -19,6 +19,7 @@
#include "qgssettings.h"
#include "qgsprojectionselectiondialog.h"
#include "qgshelp.h"
#include <QApplication>
QgsProjectionSelectionDialog::QgsProjectionSelectionDialog( QWidget *parent,
@ -26,6 +27,7 @@ QgsProjectionSelectionDialog::QgsProjectionSelectionDialog( QWidget *parent,
: QDialog( parent, fl )
{
setupUi( this );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsProjectionSelectionDialog::helpRequest );
QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ProjectionSelector/geometry" ) ).toByteArray() );
@ -89,3 +91,8 @@ void QgsProjectionSelectionDialog::setOgcWmsCrsFilter( const QSet<QString> &crsF
{
projectionSelector->setOgcWmsCrsFilter( crsFilter );
}
void QgsProjectionSelectionDialog::helpRequest()
{
QgsHelp::openHelp( "working_with_projections/working_with_projections.html" );
}

View File

@ -23,7 +23,6 @@
#include <QSet>
#include "qgscontexthelp.h"
#include "qgis_gui.h"
#include "qgscoordinatereferencesystem.h"
@ -118,7 +117,7 @@ class GUI_EXPORT QgsProjectionSelectionDialog : public QDialog, private Ui::QgsG
private slots:
void on_mButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void helpRequest();
};
#endif // #ifndef QGSLAYERCRSSELECTOR_H

View File

@ -31,6 +31,7 @@
#include "qgsexpression.h"
#include "qgsvectorlayer.h"
#include "qgslogger.h"
#include "qgshelp.h"
QgsSearchQueryBuilder::QgsSearchQueryBuilder( QgsVectorLayer *layer,
QWidget *parent, Qt::WindowFlags fl )
@ -39,6 +40,7 @@ QgsSearchQueryBuilder::QgsSearchQueryBuilder( QgsVectorLayer *layer,
{
setupUi( this );
setupListViews();
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsSearchQueryBuilder::helpRequest );
setWindowTitle( tr( "Search Query Builder" ) );
@ -488,3 +490,7 @@ void QgsSearchQueryBuilder::loadQuery()
txtSQL->insertText( newQueryText );
}
void QgsSearchQueryBuilder::helpRequest()
{
QgsHelp::openHelp( "working_with_vector/vector_properties.html#query-builder" );
}

View File

@ -23,7 +23,6 @@
#include "ui_qgsquerybuilderbase.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgis_gui.h"
class QgsField;
@ -88,7 +87,10 @@ class GUI_EXPORT QgsSearchQueryBuilder : public QDialog, private Ui::QgsQueryBui
*/
void on_btnSampleValues_clicked();
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
/**
* Open the help in a browser
*/
void helpRequest();
void saveQuery();
void loadQuery();

View File

@ -20,6 +20,7 @@ email : even.rouault at spatialys.com
#include "qgssqlcomposerdialog.h"
#include "qgssqlstatement.h"
#include "qgshelp.h"
#include <QMessageBox>
#include <QKeyEvent>
@ -61,6 +62,8 @@ QgsSQLComposerDialog::QgsSQLComposerDialog( QWidget *parent, Qt::WindowFlags fl
this, &QgsSQLComposerDialog::buildSQLFromFields );
connect( mTableJoins, &QTableWidget::cellChanged,
this, &QgsSQLComposerDialog::buildSQLFromFields );
connect( mButtonBox, &QDialogButtonBox::helpRequested,
this, &QgsSQLComposerDialog::helpRequest );
QStringList baseList;
baseList << QStringLiteral( "SELECT" );
@ -773,3 +776,8 @@ void QgsSQLComposerDialog::setSupportMultipleTables( bool on, const QString &mai
"but it must compulsory include the main typename%1 in the selected tables, \n"
"and only the geometry column of the main typename can be used as the geometry column of the resulting layer." ).arg( mainTypenameFormatted ) );
}
void QgsSQLComposerDialog::helpRequest()
{
QgsHelp::openHelp( "working_with_ogc/ogc_client_support.html#ogc-wfs" );
}

View File

@ -22,7 +22,6 @@ email : even.rouault at spatialys.com
#include "ui_qgssqlcomposerdialogbase.h"
#include <qgis.h>
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include <QPair>
#include <QStringList>
@ -162,9 +161,7 @@ class GUI_EXPORT QgsSQLComposerDialog : public QDialog, private Ui::QgsSQLCompos
void on_mAddJoinButton_clicked();
void on_mRemoveJoinButton_clicked();
void on_mTableJoins_itemSelectionChanged();
void on_mButtonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void helpRequest();
void reset();
void buildSQLFromFields();
void splitSQLIntoFields();

View File

@ -208,4 +208,4 @@ int QgsSublayersDialog::exec()
if ( mCheckboxAddToGroup )
settings.setValue( QStringLiteral( "/qgis/openSublayersInGroup" ), mCheckboxAddToGroup->isChecked() );
return ret;
}
}

View File

@ -19,7 +19,7 @@
#include <QDialog>
#include <QCheckBox>
#include <ui_qgssublayersdialogbase.h>
#include "qgscontexthelp.h"
#include <qgis_sip.h>
#include "qgis_gui.h"
/** \ingroup gui
@ -85,7 +85,6 @@ class GUI_EXPORT QgsSublayersDialog : public QDialog, private Ui::QgsSublayersDi
int countColumn() const { return mShowCount ? 2 : -1; }
public slots:
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
int exec();
protected:

View File

@ -60,7 +60,6 @@ class GUI_EXPORT QgsSmartGroupCondition : public QWidget, private Ui::QgsSmartGr
#include <QDialog>
#include "ui_qgssmartgroupeditordialogbase.h"
//#include "qgscontexthelp.h"
#include "qgsstyle.h" //for QgsSmartConditionMap

View File

@ -18,7 +18,6 @@
***************************************************************************/
#include "qgisinterface.h"
//#include "qgscontexthelp.h"
#include "qgslogger.h"
#include <QPainter>

View File

@ -20,7 +20,6 @@
#define PLUGINGUI_H
#include "ui_qgscompasspluginguibase.h"
#include "qgscontexthelp.h"
#include <QtGui/QDockWidget>
#include "compass.h"
@ -44,7 +43,6 @@ class QgsCompassPluginGui : public QWidget, private Ui::QgsCompassPluginGuiBase
Compass *compass = nullptr;
private slots:
// void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
void handleVisibilityChanged( bool visible );
void handleAzimuth( const QVariant &azimuth, const QVariant &calibrationLevel );
void rotatePixmap( QLabel *pixmapLabel, QString myFileNameQString, int rotationInt );

View File

@ -10,7 +10,6 @@
* (at your option) any later version. *
***************************************************************************/
#include "coordinatecapturegui.h"
#include "qgscontexthelp.h"
//qt includes

View File

@ -26,7 +26,6 @@
**/
#include "evisdatabaseconnectiongui.h"
#include "qgscontexthelp.h"
#include "qgsapplication.h"
#include <QMessageBox>

View File

@ -13,7 +13,6 @@
#include "qgsgpsdevicedialog.h"
#include "qgsmaplayer.h"
#include "qgsdataprovider.h"
#include "qgscontexthelp.h"
#include "qgslogger.h"
#include "qgsgpsdetector.h"
#include "qgssettings.h"

View File

@ -10,7 +10,7 @@
* (at your option) any later version. *
***************************************************************************/
#include "[pluginlcasename]gui.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"
//qt includes
@ -94,6 +94,6 @@ void [pluginname]Gui::on_buttonBox_rejected()
void [pluginname]Gui::on_buttonBox_helpRequested()
{
QgsContextHelp::run( context_id );
QgsHelp::openHelp( "plugins/plugins.html#[pluginname]" );
}

View File

@ -20,7 +20,6 @@
#include "qgsnewhttpconnection.h"
#include "qgsprojectionselectiondialog.h"
#include "qgsexpressionbuilderdialog.h"
#include "qgscontexthelp.h"
#include "qgsproject.h"
#include "qgscoordinatereferencesystem.h"
#include "qgscoordinatetransform.h"
@ -36,6 +35,7 @@
#include <QFileDialog>
#include <QRadioButton>
#include <QImageReader>
#include <qgshelp.h>
/**
* Item delegate with tweaked sizeHint.
@ -58,6 +58,7 @@ QgsArcGisServiceSourceSelect::QgsArcGisServiceSourceSelect( const QString &servi
{
setupUi( this );
setupButtons( buttonBox );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsArcGisServiceSourceSelect::helpRequest );
setWindowTitle( QStringLiteral( "Add %1 Layer from a Server" ).arg( mServiceName ) );
if ( mServiceType == FeatureService )
@ -468,7 +469,7 @@ QSize QgsAbstractDataSourceWidgetItemDelegate::sizeHint( const QStyleOptionViewI
return size;
}
void QgsArcGisServiceSourceSelect::on_buttonBox_helpRequested() const
void QgsArcGisServiceSourceSelect::helpRequest()
{
QgsContextHelp::run( metaObject()->className() );
QgsHelp::openHelp( "managing_data_source/index.html" );
}

View File

@ -111,7 +111,7 @@ class QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protect
void connectToServer();
void filterChanged( const QString &text );
void on_cmbConnections_activated( int index );
void on_buttonBox_helpRequested() const;
void helpRequest();
void treeWidgetItemDoubleClicked( const QModelIndex &index );
void treeWidgetCurrentRowChanged( const QModelIndex &current, const QModelIndex &previous );
};

View File

@ -26,7 +26,6 @@
#include "qgsdb2newconnection.h"
#include "qgsdb2dataitems.h"
#include "qgsdb2provider.h"
#include "qgscontexthelp.h"
QgsDb2NewConnection::QgsDb2NewConnection( QWidget *parent, const QString &connName, Qt::WindowFlags fl )
: QDialog( parent, fl )

View File

@ -25,7 +25,6 @@
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgsmanageconnectionsdialog.h"
#include "qgsquerybuilder.h"
#include "qgsdatasourceuri.h"

View File

@ -14,7 +14,6 @@
#include "qgsdelimitedtextsourceselect.h"
#include "qgisinterface.h"
#include "qgscontexthelp.h"
#include "qgslogger.h"
#include "qgsvectordataprovider.h"
#include "qgsdelimitedtextprovider.h"

View File

@ -23,7 +23,6 @@
#include "qgsmssqlnewconnection.h"
#include "qgsmssqlprovider.h"
#include "qgscontexthelp.h"
#include "qgssettings.h"
QgsMssqlNewConnection::QgsMssqlNewConnection( QWidget *parent, const QString &connName, Qt::WindowFlags fl )

View File

@ -20,7 +20,6 @@
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgsmssqlgeomcolumntypethread.h"
#include "qgsmssqlprovider.h"
#include "qgsmssqlnewconnection.h"

View File

@ -29,7 +29,6 @@
#include "qgsproviderregistry.h"
#include "ogr/qgsnewogrconnection.h"
#include "ogr/qgsogrhelperfunctions.h"
#include "qgscontexthelp.h"
#include "qgsapplication.h"
QgsOgrSourceSelect::QgsOgrSourceSelect( QWidget *parent, Qt::WindowFlags fl, QgsProviderRegistry::WidgetMode widgetMode )

View File

@ -21,7 +21,6 @@
#include "qgssettings.h"
#include "qgsoraclenewconnection.h"
#include "qgscontexthelp.h"
#include "qgsdatasourceuri.h"
#include "qgsoracletablemodel.h"
#include "qgsoracleconnpool.h"

View File

@ -20,7 +20,6 @@ email : jef at norbit dot de
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgsoracleprovider.h"
#include "qgsoraclenewconnection.h"
#include "qgsoracletablecache.h"

View File

@ -21,7 +21,6 @@
#include "qgspgnewconnection.h"
#include "qgsauthmanager.h"
#include "qgscontexthelp.h"
#include "qgsdatasourceuri.h"
#include "qgspostgresconn.h"
#include "qgssettings.h"

View File

@ -20,7 +20,6 @@ email : sherman at mrcc.com
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgspostgresprovider.h"
#include "qgspgnewconnection.h"
#include "qgsmanageconnectionsdialog.h"

View File

@ -21,7 +21,6 @@ email : a.furieri@lqt.it
#include "qgslogger.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgsquerybuilder.h"
#include "qgsdatasourceuri.h"
#include "qgsvectorlayer.h"

View File

@ -23,7 +23,6 @@
#include "qgsowssourceselect.h"
#include "qgsdatasourceuri.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgswcscapabilities.h"
#include "qgsproviderregistry.h"
#include "qgsdataprovider.h"

View File

@ -24,7 +24,6 @@
#include "qgswfsutils.h"
#include "qgsnewhttpconnection.h"
#include "qgsprojectionselectiondialog.h"
#include "qgscontexthelp.h"
#include "qgsproject.h"
#include "qgscoordinatereferencesystem.h"
#include "qgscoordinatetransform.h"

View File

@ -20,7 +20,6 @@
#include "qgswmsprovider.h"
#include "qgis.h" // GEO_EPSG_CRS_ID
#include "qgscontexthelp.h"
#include "qgscoordinatereferencesystem.h"
#include "qgsdatasourceuri.h"
#include "qgsprojectionselectiondialog.h"

View File

@ -19,7 +19,6 @@
#define QGSWMTSDIMENSIONS_H
#include "ui_qgswmtsdimensionsbase.h"
#include "qgsguiutils.h"
#include "qgscontexthelp.h"
#include "qgswmsprovider.h"
#include <QHash>
@ -43,7 +42,6 @@ class QgsWmtsDimensions : public QDialog, private Ui::QgsWmtsDimensionsBase
void selectedDimensions( QHash<QString, QString> &dims );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
};

View File

@ -630,7 +630,6 @@ ACCEPTABLE_MISSING_DOCS = {
"QgsCategorizedSymbolRenderer": ["symbolForValue(const QVariant &value)", "addCategory(const QgsRendererCategory &category)", "setSizeScaleField(const QString &fieldOrExpression)", "setInvertedColorRamp(bool inverted)", "rebuildHash()", "scaleMethod() const ", "QgsCategorizedSymbolRenderer(const QString &attrName=QString(), const QgsCategoryList &categories=QgsCategoryList())", "updateCategoryValue(int catIndex, const QVariant &value)", "categories() const ", "sizeScaleField() const ", "sortByLabel(Qt::SortOrder order=Qt::AscendingOrder)", "setClassAttribute(const QString &attr)", "classAttribute() const ", "sortByValue(Qt::SortOrder order=Qt::AscendingOrder)", "updateCategorySymbol(int catIndex, QgsSymbol *symbol)", "setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)", "skipRender()", "deleteCategory(int catIndex)", "deleteAllCategories()", "updateCategoryLabel(int catIndex, const QString &label)"],
"QgsExpression::NodeFunction": ["args() const ", "fnIndex() const ", "NodeFunction(int fnIndex, NodeList *args)"],
"QgsDualView": ["setFeatureSelectionManager(QgsIFeatureSelectionManager *featureSelectionManager)", "openConditionalStyles()", "setRequest(const QgsFeatureRequest &request)", "filterMode()", "filteredFeatures()"],
"QgsContextHelp": ["run(const QString &context)"],
"QgsCodeEditorSQL": ["QgsCodeEditorSQL(QWidget *parent=0)"],
"QgsVectorFileWriter::IntOption": ["IntOption(const QString &docString, int defaultValue)"],
"QgsExternalResourceWidgetWrapper": ["QgsExternalResourceWidgetWrapper(QgsVectorLayer *vl, int fieldIdx, QWidget *editor=nullptr, QWidget *parent=nullptr)"],
@ -758,7 +757,6 @@ ACCEPTABLE_MISSING_ADDED_NOTE = [
"QgsSingleSymbolRendererWidget",
"QgsDbFilterProxyModel",
"QgsRasterShaderFunction",
"QgsContextHelp",
"QgsBrushStyleComboBox",
"QgsSVGFillSymbolLayer",
"QgsPluginLayerRegistry",