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 55cdc89
Show file tree
Hide file tree
Showing 126 changed files with 387 additions and 851 deletions.
@@ -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();