Skip to content

Commit

Permalink
Merge pull request #5004 from jgrocha/helpviewer
Browse files Browse the repository at this point in the history
[needs-docs] Refactoring of all help calls, deprecating QgsContextHelp+Helpviewer
  • Loading branch information
m-kuhn committed Aug 16, 2017
2 parents 0be0a4e + 32c81a0 commit 55cdc89
Show file tree
Hide file tree
Showing 126 changed files with 387 additions and 851 deletions.
8 changes: 4 additions & 4 deletions python/console/console.py
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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_():
Expand Down
1 change: 0 additions & 1 deletion python/core/core_auto.sip
Expand Up @@ -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
Expand Down
41 changes: 0 additions & 41 deletions python/core/qgscontexthelp.sip

This file was deleted.

6 changes: 2 additions & 4 deletions python/gui/qgsnewhttpconnection.sip
Expand Up @@ -8,6 +8,8 @@





class QgsNewHttpConnection : QDialog
{
%Docstring
Expand All @@ -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();

};

/************************************************************************
Expand Down
6 changes: 5 additions & 1 deletion python/gui/qgsnewvectorlayerdialog.sip
Expand Up @@ -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();

Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgsquerybuilder.sip
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgssearchquerybuilder.sip
Expand Up @@ -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();

Expand Down
1 change: 0 additions & 1 deletion python/gui/qgssublayersdialog.sip
Expand Up @@ -77,7 +77,6 @@ class QgsSublayersDialog : QDialog
%End

public slots:
void on_buttonBox_helpRequested();
int exec();
%Docstring
:rtype: int
Expand Down
10 changes: 9 additions & 1 deletion python/gui/symbology/qgsstylemanagerdialog.sip
Expand Up @@ -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 );

Expand Down
37 changes: 37 additions & 0 deletions scripts/chkdoclink.sh
@@ -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

27 changes: 0 additions & 27 deletions scripts/process_contexthelp.py

This file was deleted.

1 change: 1 addition & 0 deletions scripts/update_ts_files.sh
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -13,7 +13,6 @@ ADD_SUBDIRECTORY(test)

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

Expand Down
1 change: 0 additions & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion src/app/pluginmanager/qgspluginmanager.cpp
Expand Up @@ -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),
Expand Down Expand Up @@ -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" ) );
}
2 changes: 1 addition & 1 deletion src/app/pluginmanager/qgspluginmanager.h
Expand Up @@ -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 ) }
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsbookmarks.cpp
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -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" ) );
}
3 changes: 1 addition & 2 deletions src/app/qgscustomprojectiondialog.h
Expand Up @@ -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:
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationcopyrightdialog.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -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" ) );
}
2 changes: 1 addition & 1 deletion src/app/qgsdecorationcopyrightdialog.h
Expand Up @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationgriddialog.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationgriddialog.h
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationnortharrowdialog.cpp
Expand Up @@ -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.
Expand Down Expand Up @@ -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" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationnortharrowdialog.h
Expand Up @@ -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();
Expand Down

0 comments on commit 55cdc89

Please sign in to comment.