Skip to content
Permalink
Browse files

Refactoring of all help calls, deprecating QgsContextHelp and the for…

…mer helviewer
  • Loading branch information
jgrocha committed Aug 9, 2017
1 parent 518ffe3 commit 3a103b7c62d9dd617a8de850e21f6d28bea35e23
Showing with 130 additions and 323 deletions.
  1. +4 −4 python/console/console.py
  2. +0 −1 python/core/core_auto.sip
  3. +0 −41 python/core/qgscontexthelp.sip
  4. +7 −3 python/gui/qgsnewhttpconnection.sip
  5. +4 −1 python/gui/qgssearchquerybuilder.sip
  6. +0 −1 python/gui/qgssublayersdialog.sip
  7. +37 −0 scripts/chkdoclink.sh
  8. +0 −27 scripts/process_contexthelp.py
  9. +1 −0 scripts/update_ts_files.sh
  10. +0 −1 src/app/composer/qgscomposer.cpp
  11. +0 −1 src/app/qgsbookmarks.cpp
  12. +6 −0 src/app/qgsfieldcalculator.cpp
  13. +1 −3 src/app/qgsfieldcalculator.h
  14. +0 −1 src/app/qgsprojectproperties.cpp
  15. +0 −1 src/app/qgsrasterlayerproperties.cpp
  16. +0 −1 src/app/qgsvectorlayerproperties.cpp
  17. +3 −15 src/core/CMakeLists.txt
  18. +0 −103 src/core/qgscontexthelp.cpp
  19. +0 −65 src/core/qgscontexthelp.h
  20. +7 −1 src/gui/ogr/qgsnewogrconnection.cpp
  21. +1 −2 src/gui/ogr/qgsnewogrconnection.h
  22. +6 −0 src/gui/qgsnewgeopackagelayerdialog.cpp
  23. +1 −2 src/gui/qgsnewgeopackagelayerdialog.h
  24. +7 −1 src/gui/qgsnewhttpconnection.cpp
  25. +9 −4 src/gui/qgsnewhttpconnection.h
  26. +0 −1 src/gui/qgsowssourceselect.cpp
  27. +0 −1 src/gui/qgsowssourceselect.h
  28. +7 −0 src/gui/qgsprojectionselectiondialog.cpp
  29. +1 −2 src/gui/qgsprojectionselectiondialog.h
  30. +6 −0 src/gui/qgssearchquerybuilder.cpp
  31. +4 −2 src/gui/qgssearchquerybuilder.h
  32. +8 −0 src/gui/qgssqlcomposerdialog.cpp
  33. +1 −4 src/gui/qgssqlcomposerdialog.h
  34. +1 −1 src/gui/qgssublayersdialog.cpp
  35. +1 −2 src/gui/qgssublayersdialog.h
  36. +0 −1 src/gui/symbology/qgssmartgroupeditordialog.h
  37. +0 −1 src/plugins/compass/qgscompassplugingui.cpp
  38. +0 −2 src/plugins/compass/qgscompassplugingui.h
  39. +0 −1 src/plugins/coordinate_capture/coordinatecapturegui.cpp
  40. +0 −1 src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp
  41. +0 −1 src/plugins/gps_importer/qgsgpsplugingui.cpp
  42. +2 −2 src/plugins/plugin_template/plugingui.cpp
  43. +4 −3 src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp
  44. +1 −1 src/providers/arcgisrest/qgsarcgisservicesourceselect.h
  45. +0 −1 src/providers/db2/qgsdb2newconnection.cpp
  46. +0 −1 src/providers/db2/qgsdb2sourceselect.cpp
  47. +0 −1 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
  48. +0 −1 src/providers/mssql/qgsmssqlnewconnection.cpp
  49. +0 −1 src/providers/mssql/qgsmssqlsourceselect.cpp
  50. +0 −1 src/providers/ogr/qgsogrsourceselect.cpp
  51. +0 −1 src/providers/oracle/qgsoraclenewconnection.cpp
  52. +0 −1 src/providers/oracle/qgsoraclesourceselect.cpp
  53. +0 −1 src/providers/postgres/qgspgnewconnection.cpp
  54. +0 −1 src/providers/postgres/qgspgsourceselect.cpp
  55. +0 −1 src/providers/spatialite/qgsspatialitesourceselect.cpp
  56. +0 −1 src/providers/wcs/qgswcssourceselect.h
  57. +0 −1 src/providers/wfs/qgswfssourceselect.cpp
  58. +0 −1 src/providers/wms/qgswmssourceselect.cpp
  59. +0 −2 src/providers/wms/qgswmtsdimensions.h
  60. +0 −2 tests/code_layout/acceptable_missing_doc.py
@@ -31,8 +31,8 @@
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 @@ def saveAsScriptFile(self, index=None):
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_():
@@ -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

This file was deleted.

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

};

/************************************************************************
@@ -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();
@@ -77,7 +77,6 @@ class QgsSublayersDialog : QDialog
%End

public slots:
void on_buttonBox_helpRequested();
int exec();
%Docstring
:rtype: int
@@ -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

This file was deleted.

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

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

0 comments on commit 3a103b7

Please sign in to comment.
You can’t perform that action at this time.