Skip to content

Commit 55cdc89

Browse files
authored
Merge pull request #5004 from jgrocha/helpviewer
[needs-docs] Refactoring of all help calls, deprecating QgsContextHelp+Helpviewer
2 parents 0be0a4e + 32c81a0 commit 55cdc89

File tree

126 files changed

+387
-851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+387
-851
lines changed

python/console/console.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
from .console_output import ShellOutputScintilla
3232
from .console_editor import EditorTabWidget
3333
from .console_settings import optionsDialog
34-
from qgis.core import QgsApplication, QgsContextHelp, QgsSettings
35-
from qgis.gui import QgsFilterLineEdit
34+
from qgis.core import QgsApplication, QgsSettings
35+
from qgis.gui import QgsFilterLineEdit, QgsHelp
3636
from functools import partial
3737

3838
import sys
@@ -59,7 +59,7 @@ def show_console():
5959
# Shows help on first launch of the console
6060
settings = QgsSettings()
6161
if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool):
62-
QgsContextHelp.run("PythonConsole")
62+
QgsHelp.openHelp("../pyqgis_developer_cookbook/intro.html#python-console")
6363
settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)
6464

6565
return _console
@@ -657,7 +657,7 @@ def saveAsScriptFile(self, index=None):
657657
self.updateTabListScript(pathFileName, action='remove')
658658

659659
def openHelp(self):
660-
QgsContextHelp.run("PythonConsole")
660+
QgsHelp.openHelp("plugins/python_console.html")
661661

662662
def openSettings(self):
663663
if optionsDialog(self).exec_():

python/core/core_auto.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
%Include qgscolorramp.sip
2020
%Include qgscolorscheme.sip
2121
%Include qgscolorschemeregistry.sip
22-
%Include qgscontexthelp.sip
2322
%Include qgsconditionalstyle.sip
2423
%Include qgscoordinatetransform.sip
2524
%Include qgscrscache.sip

python/core/qgscontexthelp.sip

Lines changed: 0 additions & 41 deletions
This file was deleted.

python/gui/qgsnewhttpconnection.sip

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99

1010

11+
12+
1113
class QgsNewHttpConnection : QDialog
1214
{
1315
%Docstring
@@ -27,13 +29,9 @@ Constructor
2729
public slots:
2830
virtual void accept();
2931

30-
3132
void on_txtName_textChanged( const QString & );
32-
3333
void on_txtUrl_textChanged( const QString & );
3434

35-
void on_buttonBox_helpRequested();
36-
3735
};
3836

3937
/************************************************************************

python/gui/qgsnewvectorlayerdialog.sip

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ Returns the file format for storage
6565
void on_mRemoveAttributeButton_clicked();
6666
void on_mFileFormatComboBox_currentIndexChanged( int index );
6767
void on_mTypeBox_currentIndexChanged( int index );
68-
void on_buttonBox_helpRequested();
68+
69+
void showHelp();
70+
%Docstring
71+
Open the associated help
72+
%End
6973
void nameChanged( const QString & );
7074
void selectionChanged();
7175

python/gui/qgsquerybuilder.sip

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ class QgsQueryBuilder : QDialog
6868
void on_btnNot_clicked();
6969
void on_btnOr_clicked();
7070

71-
void on_buttonBox_helpRequested();
72-
7371
void test();
7472
%Docstring
7573
Test the constructed sql statement to see if the vector layer data provider likes it.

python/gui/qgssearchquerybuilder.sip

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ change search string shown in text field
7878
are inserted into the values list box.
7979
%End
8080

81-
void on_buttonBox_helpRequested();
82-
8381
void saveQuery();
8482
void loadQuery();
8583

python/gui/qgssublayersdialog.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ class QgsSublayersDialog : QDialog
7777
%End
7878

7979
public slots:
80-
void on_buttonBox_helpRequested();
8180
int exec();
8281
%Docstring
8382
:rtype: int

python/gui/symbology/qgsstylemanagerdialog.sip

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@ adds symbols of some type to list
4747
called when the dialog is going to be closed
4848
%End
4949

50-
void on_buttonBox_helpRequested();
50+
void onClose();
51+
%Docstring
52+
Close the dialog
53+
%End
54+
55+
void showHelp();
56+
%Docstring
57+
Open the associated help
58+
%End
5159

5260
void itemChanged( QStandardItem *item );
5361

scripts/chkdoclink.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/bin/bash
2+
###########################################################################
3+
# chkdoclink.sh
4+
# ---------------------
5+
# Date : August 2017
6+
# Copyright : (C) 2017 by Jorge Gustavo Rocha
7+
# Email : jgr at geomaster dot pt
8+
###########################################################################
9+
# #
10+
# This program is free software; you can redistribute it and/or modify #
11+
# it under the terms of the GNU General Public License as published by #
12+
# the Free Software Foundation; either version 2 of the License, or #
13+
# (at your option) any later version. #
14+
# #
15+
###########################################################################
16+
17+
# This script is used to check missing links to the documentation
18+
# This script only reports missing links
19+
# An option argument can be used to indicate the base URL of the documentation, for example:
20+
#
21+
# scripts/chkdoclink.sh http://docs.qgis.org/2.18/en/docs/user_manual/
22+
#
23+
# When no link is indicated, the link used is:
24+
# http://docs.qgis.org/testing/en/docs/user_manual/
25+
#
26+
# Nødebo, August 2017
27+
28+
prefix=${1:-http://docs.qgis.org/testing/en/docs/user_manual/}
29+
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
30+
file=${line%;*}
31+
suffix=${line##*;}
32+
link=$prefix$suffix
33+
if ! wget --spider $link 2>/dev/null; then
34+
echo "Documentation missing for: $file Key: $suffix"
35+
fi
36+
done
37+

0 commit comments

Comments
 (0)