Skip to content
Permalink
Browse files

Merge pull request #5004 from jgrocha/helpviewer

[needs-docs] Refactoring of all help calls, deprecating QgsContextHelp+Helpviewer
  • Loading branch information
m-kuhn committed Aug 16, 2017
2 parents 0be0a4e + 32c81a0 commit 55cdc89a11b010b8c548f24298d285b449cd9fa4
Showing with 387 additions and 851 deletions.
  1. +4 −4 python/console/console.py
  2. +0 −1 python/core/core_auto.sip
  3. +0 −41 python/core/qgscontexthelp.sip
  4. +2 −4 python/gui/qgsnewhttpconnection.sip
  5. +5 −1 python/gui/qgsnewvectorlayerdialog.sip
  6. +0 −2 python/gui/qgsquerybuilder.sip
  7. +0 −2 python/gui/qgssearchquerybuilder.sip
  8. +0 −1 python/gui/qgssublayersdialog.sip
  9. +9 −1 python/gui/symbology/qgsstylemanagerdialog.sip
  10. +37 −0 scripts/chkdoclink.sh
  11. +0 −27 scripts/process_contexthelp.py
  12. +1 −0 scripts/update_ts_files.sh
  13. +0 −1 src/CMakeLists.txt
  14. +0 −1 src/app/composer/qgscomposer.cpp
  15. +5 −1 src/app/pluginmanager/qgspluginmanager.cpp
  16. +1 −1 src/app/pluginmanager/qgspluginmanager.h
  17. +0 −1 src/app/qgsbookmarks.cpp
  18. +5 −0 src/app/qgscustomprojectiondialog.cpp
  19. +1 −2 src/app/qgscustomprojectiondialog.h
  20. +2 −1 src/app/qgsdecorationcopyrightdialog.cpp
  21. +1 −1 src/app/qgsdecorationcopyrightdialog.h
  22. +2 −1 src/app/qgsdecorationgriddialog.cpp
  23. +1 −1 src/app/qgsdecorationgriddialog.h
  24. +2 −1 src/app/qgsdecorationnortharrowdialog.cpp
  25. +1 −1 src/app/qgsdecorationnortharrowdialog.h
  26. +2 −1 src/app/qgsdecorationscalebardialog.cpp
  27. +1 −1 src/app/qgsdecorationscalebardialog.h
  28. +6 −0 src/app/qgsfieldcalculator.cpp
  29. +1 −3 src/app/qgsfieldcalculator.h
  30. +6 −1 src/app/qgsidentifyresultsdialog.cpp
  31. +2 −2 src/app/qgsidentifyresultsdialog.h
  32. +6 −0 src/app/qgsmeasuredialog.cpp
  33. +2 −3 src/app/qgsmeasuredialog.h
  34. +6 −0 src/app/qgsnewspatialitelayerdialog.cpp
  35. +2 −1 src/app/qgsnewspatialitelayerdialog.h
  36. +6 −0 src/app/qgsoptions.cpp
  37. +2 −3 src/app/qgsoptions.h
  38. +7 −1 src/app/qgsprojectproperties.cpp
  39. +2 −5 src/app/qgsprojectproperties.h
  40. +7 −1 src/app/qgsrasterlayerproperties.cpp
  41. +1 −1 src/app/qgsrasterlayerproperties.h
  42. +7 −1 src/app/qgsvectorlayerproperties.cpp
  43. +2 −1 src/app/qgsvectorlayerproperties.h
  44. +0 −12 src/core/CMakeLists.txt
  45. +0 −103 src/core/qgscontexthelp.cpp
  46. +0 −65 src/core/qgscontexthelp.h
  47. +7 −1 src/gui/ogr/qgsnewogrconnection.cpp
  48. +1 −2 src/gui/ogr/qgsnewogrconnection.h
  49. +7 −0 src/gui/ogr/qgsvectorlayersaveasdialog.cpp
  50. +1 −1 src/gui/ogr/qgsvectorlayersaveasdialog.h
  51. +6 −0 src/gui/qgsnewgeopackagelayerdialog.cpp
  52. +1 −2 src/gui/qgsnewgeopackagelayerdialog.h
  53. +7 −1 src/gui/qgsnewhttpconnection.cpp
  54. +5 −5 src/gui/qgsnewhttpconnection.h
  55. +6 −0 src/gui/qgsnewvectorlayerdialog.cpp
  56. +3 −1 src/gui/qgsnewvectorlayerdialog.h
  57. +0 −1 src/gui/qgsowssourceselect.cpp
  58. +0 −1 src/gui/qgsowssourceselect.h
  59. +7 −0 src/gui/qgsprojectionselectiondialog.cpp
  60. +1 −2 src/gui/qgsprojectionselectiondialog.h
  61. +6 −0 src/gui/qgsquerybuilder.cpp
  62. +2 −2 src/gui/qgsquerybuilder.h
  63. +6 −0 src/gui/qgssearchquerybuilder.cpp
  64. +5 −3 src/gui/qgssearchquerybuilder.h
  65. +8 −0 src/gui/qgssqlcomposerdialog.cpp
  66. +1 −4 src/gui/qgssqlcomposerdialog.h
  67. +1 −1 src/gui/qgssublayersdialog.cpp
  68. +1 −2 src/gui/qgssublayersdialog.h
  69. +2 −1 src/gui/symbology/qgscptcitycolorrampdialog.cpp
  70. +1 −1 src/gui/symbology/qgscptcitycolorrampdialog.h
  71. +0 −1 src/gui/symbology/qgssmartgroupeditordialog.h
  72. +11 −0 src/gui/symbology/qgsstylemanagerdialog.cpp
  73. +5 −1 src/gui/symbology/qgsstylemanagerdialog.h
  74. +0 −95 src/helpviewer/CMakeLists.txt
  75. +0 −91 src/helpviewer/main.cpp
  76. +0 −122 src/helpviewer/qgshelpviewer.cpp
  77. +0 −60 src/helpviewer/qgshelpviewer.h
  78. +0 −66 src/helpviewer/qgshelpviewerbase.ui
  79. +0 −1 src/plugins/compass/qgscompassplugingui.cpp
  80. +0 −2 src/plugins/compass/qgscompassplugingui.h
  81. +0 −1 src/plugins/coordinate_capture/coordinatecapturegui.cpp
  82. +0 −1 src/plugins/coordinate_capture/coordinatecapturegui.h
  83. +6 −1 src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.cpp
  84. +1 −1 src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h
  85. +6 −1 src/plugins/gps_importer/qgsgpsplugingui.cpp
  86. +1 −1 src/plugins/gps_importer/qgsgpsplugingui.h
  87. +2 −2 src/plugins/offline_editing/offline_editing_plugin_gui.cpp
  88. +1 −1 src/plugins/offline_editing/offline_editing_plugin_gui.h
  89. +1 −1 src/plugins/offline_editing/offline_editing_plugin_guibase.ui
  90. +4 −3 src/plugins/plugin_template/plugingui.cpp
  91. +1 −1 src/plugins/plugin_template/plugingui.h
  92. +4 −3 src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp
  93. +1 −1 src/providers/arcgisrest/qgsarcgisservicesourceselect.h
  94. +6 −1 src/providers/db2/qgsdb2newconnection.cpp
  95. +1 −1 src/providers/db2/qgsdb2newconnection.h
  96. +7 −1 src/providers/db2/qgsdb2sourceselect.cpp
  97. +3 −2 src/providers/db2/qgsdb2sourceselect.h
  98. +6 −1 src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp
  99. +1 −4 src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
  100. +5 −1 src/providers/mssql/qgsmssqlnewconnection.cpp
  101. +2 −1 src/providers/mssql/qgsmssqlnewconnection.h
  102. +6 −1 src/providers/mssql/qgsmssqlsourceselect.cpp
  103. +3 −2 src/providers/mssql/qgsmssqlsourceselect.h
  104. +5 −1 src/providers/ogr/qgsogrsourceselect.cpp
  105. +1 −1 src/providers/ogr/qgsogrsourceselect.h
  106. +7 −1 src/providers/oracle/qgsoraclenewconnection.cpp
  107. +1 −1 src/providers/oracle/qgsoraclenewconnection.h
  108. +6 −1 src/providers/oracle/qgsoraclesourceselect.cpp
  109. +3 −2 src/providers/oracle/qgsoraclesourceselect.h
  110. +6 −1 src/providers/postgres/qgspgnewconnection.cpp
  111. +2 −1 src/providers/postgres/qgspgnewconnection.h
  112. +6 −1 src/providers/postgres/qgspgsourceselect.cpp
  113. +2 −2 src/providers/postgres/qgspgsourceselect.h
  114. +6 −1 src/providers/spatialite/qgsspatialitesourceselect.cpp
  115. +1 −1 src/providers/spatialite/qgsspatialitesourceselect.h
  116. +0 −1 src/providers/wcs/qgswcssourceselect.h
  117. +6 −1 src/providers/wfs/qgswfssourceselect.cpp
  118. +2 −3 src/providers/wfs/qgswfssourceselect.h
  119. +6 −1 src/providers/wms/qgswmssourceselect.cpp
  120. +1 −2 src/providers/wms/qgswmssourceselect.h
  121. +0 −2 src/providers/wms/qgswmtsdimensions.h
  122. +1 −1 src/ui/qgsdb2newconnectionbase.ui
  123. +1 −1 src/ui/qgsdecorationgriddialog.ui
  124. +3 −16 src/ui/qgsstylemanagerdialogbase.ui
  125. +0 −2 tests/code_layout/acceptable_missing_doc.py
  126. +5 −2 tests/src/python/test_console.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("plugins/python_console.html")

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





class QgsNewHttpConnection : QDialog
{
%Docstring
@@ -27,13 +29,9 @@ Constructor
public slots:
virtual void accept();


void on_txtName_textChanged( const QString & );

void on_txtUrl_textChanged( const QString & );

void on_buttonBox_helpRequested();

};

/************************************************************************
@@ -65,7 +65,11 @@ Returns the file format for storage
void on_mRemoveAttributeButton_clicked();
void on_mFileFormatComboBox_currentIndexChanged( int index );
void on_mTypeBox_currentIndexChanged( int index );
void on_buttonBox_helpRequested();

void showHelp();
%Docstring
Open the associated help
%End
void nameChanged( const QString & );
void selectionChanged();

@@ -68,8 +68,6 @@ class QgsQueryBuilder : QDialog
void on_btnNot_clicked();
void on_btnOr_clicked();

void on_buttonBox_helpRequested();

void test();
%Docstring
Test the constructed sql statement to see if the vector layer data provider likes it.
@@ -78,8 +78,6 @@ change search string shown in text field
are inserted into the values list box.
%End

void on_buttonBox_helpRequested();

void saveQuery();
void loadQuery();

@@ -77,7 +77,6 @@ class QgsSublayersDialog : QDialog
%End

public slots:
void on_buttonBox_helpRequested();
int exec();
%Docstring
:rtype: int
@@ -47,7 +47,15 @@ adds symbols of some type to list
called when the dialog is going to be closed
%End

void on_buttonBox_helpRequested();
void onClose();
%Docstring
Close the dialog
%End

void showHelp();
%Docstring
Open the associated help
%End

void itemChanged( QStandardItem *item );

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

@@ -13,7 +13,6 @@ ADD_SUBDIRECTORY(test)

IF (WITH_DESKTOP)
ADD_SUBDIRECTORY(app)
ADD_SUBDIRECTORY(helpviewer)
ADD_SUBDIRECTORY(plugins)
ENDIF(WITH_DESKTOP)

@@ -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"
@@ -67,6 +67,7 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
mPythonUtils = nullptr;

setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsPluginManager::showHelp );

// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
@@ -1576,4 +1577,7 @@ void QgsPluginManager::pushMessage( const QString &text, QgsMessageBar::MessageL
msgBar->pushMessage( text, level, duration );
}


void QgsPluginManager::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html" ) );
}
@@ -155,7 +155,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
void on_ckbDeprecated_toggled( bool state );

//! Open help browser
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html" ) ); }
void showHelp();

//! Reimplement QgsOptionsDialogBase method to prevent modifying the tab list by signals from the stacked widget
void optionsStackedWidget_CurrentChanged( int indx ) { Q_UNUSED( indx ) }
@@ -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"
@@ -47,6 +47,7 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::Windo
: QDialog( parent, fl )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsCustomProjectionDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/CustomProjection/geometry" ) ).toByteArray() );
@@ -531,3 +532,7 @@ QString QgsCustomProjectionDialog::quotedValue( QString value )
return value.prepend( '\'' ).append( '\'' );
}

void QgsCustomProjectionDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html" ) );
}
@@ -41,8 +41,6 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
void on_pbnRemove_clicked();
void on_pbnCopyCRS_clicked();
void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );

void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html" ) ); }
void on_buttonBox_accepted();

private:
@@ -53,6 +51,7 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
bool deleteCrs( const QString &id );
bool saveCrs( QgsCoordinateReferenceSystem myParameters, const QString &myName, QString myId, bool newEntry );
void insertProjection( const QString &myProjectionAcronym );
void showHelp();

//These two QMap store the values as they are on the database when loading
QMap <QString, QString> existingCRSparameters;
@@ -28,6 +28,7 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
, mDeco( deco )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationCopyrightDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationCopyright/geometry" ) ).toByteArray() );
@@ -99,7 +100,7 @@ void QgsDecorationCopyrightDialog::apply()
mDeco.update();
}

void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
void QgsDecorationCopyrightDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#copyright-label" ) );
}
@@ -31,7 +31,7 @@ class APP_EXPORT QgsDecorationCopyrightDialog : public QDialog, private Ui::QgsD
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_pbnColorChooser_colorChanged( const QColor &c );
void apply();

@@ -33,6 +33,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
, mDeco( deco )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationGridDialog::showHelp );

mMarkerSymbolButton->setSymbolType( QgsSymbol::Marker );
mLineSymbolButton->setSymbolType( QgsSymbol::Line );
@@ -157,7 +158,7 @@ QgsDecorationGridDialog::~QgsDecorationGridDialog()
settings.setValue( QStringLiteral( "/Windows/DecorationGrid/geometry" ), saveGeometry() );
}

void QgsDecorationGridDialog::on_buttonBox_helpRequested()
void QgsDecorationGridDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#grid" ) );
}
@@ -38,7 +38,7 @@ class APP_EXPORT QgsDecorationGridDialog : public QDialog, private Ui::QgsDecora
void apply();
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_mGridTypeComboBox_currentIndexChanged( int index );
void on_mPbtnUpdateFromExtents_clicked();
void on_mPbtnUpdateFromLayer_clicked();
@@ -34,6 +34,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth

QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationNorthArrowDialog::apply );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationNorthArrowDialog::showHelp );

// signal/slot connection defined in 'designer' causes the slider to
// be moved to reflect the change in the spinbox.
@@ -78,7 +79,7 @@ QgsDecorationNorthArrowDialog::~QgsDecorationNorthArrowDialog()
settings.setValue( QStringLiteral( "Windows/DecorationNorthArrow/geometry" ), saveGeometry() );
}

void QgsDecorationNorthArrowDialog::on_buttonBox_helpRequested()
void QgsDecorationNorthArrowDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#north-arrow" ) );
}
@@ -32,7 +32,7 @@ class APP_EXPORT QgsDecorationNorthArrowDialog : public QDialog, private Ui::Qgs
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_spinAngle_valueChanged( int spinAngle );
void on_sliderRotation_valueChanged( int rotationValue );
void apply();

0 comments on commit 55cdc89

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