Skip to content

Commit

Permalink
doxymentation and better wording
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 28, 2018
1 parent b957e17 commit 95ab3d0
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 25 deletions.
12 changes: 9 additions & 3 deletions python/core/qgsproject.sip.in
Expand Up @@ -911,12 +911,18 @@ Emitted when a layer from a projects was read.
%End

void loadingLayer( const QString &layerName );
%Docstring
Emitted when a layer is loaded
%End

void loadingLayerMessages( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
%Docstring
Emitted when loading layers has produced some messages
@param layerName the layer name
@param messages a list of pairs of Qgis.MessageLevel and messages

:param layerName: the layer name
:param messages: a list of pairs of Qgis.MessageLevel and messages

.. versionadded:: 3.2
%End

void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgsreadwritecontext.sip.in
Expand Up @@ -24,7 +24,7 @@ The class is used as a container of context for various read/write operations on

struct ReadWriteMessage
{
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, QStringList categories = QStringList() );
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() );
%Docstring
Construct a container for QgsReadWriteContext error or warning messages
%End
Expand Down Expand Up @@ -65,7 +65,7 @@ Sets up path resolver for conversion between relative and absolute paths

void pushMessage( const QString &message, Qgis::MessageLevel level );
%Docstring
append a message to the context
Append a message to the context

.. versionadded:: 3.2
%End
Expand All @@ -86,7 +86,7 @@ Pop the last category

QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();
%Docstring
return the stored messages and remove them
Return the stored messages and remove them

.. versionadded:: 3.2
%End
Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgsmessagebar.sip.in
Expand Up @@ -83,8 +83,6 @@ convenience method for pushing a message with title to the bar
convenience method for pushing a message to the bar with a detail text which be shown when pressing a "more" button
%End



QgsMessageBarItem *currentItem();

signals:
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -3230,7 +3230,7 @@ void QgisApp::setupConnections()
this, &QgisApp::showProgress );
connect( QgsProject::instance(), &QgsProject::loadingLayer,
this, &QgisApp::showStatusMessage );
connect( QgsProject::instance(), &QgsProject::loadingLayerMessages,
connect( QgsProject::instance(), &QgsProject::loadingLayerMessageReceived,
this, &QgisApp::loadingLayerMessages );
connect( QgsProject::instance(), &QgsProject::readProject,
this, &QgisApp::readProject );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgseditformconfig.cpp
Expand Up @@ -260,7 +260,7 @@ void QgsEditFormConfig::setSuppress( QgsEditFormConfig::FeatureFormSuppress s )

void QgsEditFormConfig::readXml( const QDomNode &node, QgsReadWriteContext &context )
{
context.enterCategory( QString( "Edit form config" ) );
context.enterCategory( QObject::tr( "Edit form config" ) );
d.detach();

QDomNode editFormNode = node.namedItem( QStringLiteral( "editform" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsproject.cpp
Expand Up @@ -719,7 +719,7 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
const auto messages = context.takeMessages();
if ( messages.count() )
{
emit loadingLayerMessages( tr( "Loading layer %1" ).arg( name ), messages );
emit loadingLayerMessageReceived( tr( "Loading layer %1" ).arg( name ), messages );
}
}
emit layerLoaded( i + 1, nl.count() );
Expand Down
10 changes: 6 additions & 4 deletions src/core/qgsproject.h
Expand Up @@ -888,14 +888,16 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
*/
void layerLoaded( int i, int n );

//! Emitted when a layer is loaded
void loadingLayer( const QString &layerName );

/**
* @brief Emitted when loading layers has produced some messages
* @param layerName the layer name
* @param messages a list of pairs of Qgis::MessageLevel and messages
* \brief Emitted when loading layers has produced some messages
* \param layerName the layer name
* \param messages a list of pairs of Qgis::MessageLevel and messages
* \since 3.2
*/
void loadingLayerMessages( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );
void loadingLayerMessageReceived( const QString &layerName, const QList<QgsReadWriteContext::ReadWriteMessage> &messages );

//! Emitted when the list of layer which are excluded from map identification changes
void nonIdentifiableLayersChanged( QStringList nonIdentifiableLayers );
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsreadwritecontext.h
Expand Up @@ -38,7 +38,7 @@ class CORE_EXPORT QgsReadWriteContext
struct ReadWriteMessage
{
//! Construct a container for QgsReadWriteContext error or warning messages
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, QStringList categories = QStringList() )
ReadWriteMessage( const QString &message, Qgis::MessageLevel level = Qgis::Warning, const QStringList &categories = QStringList() )
: mMessage( message )
, mLevel( level )
, mCategories( categories )
Expand All @@ -54,9 +54,9 @@ class CORE_EXPORT QgsReadWriteContext
QStringList categories() const {return mCategories;}

private:
QString mMessage = QString();
Qgis::MessageLevel mLevel = Qgis::Warning;
QStringList mCategories = QStringList();
QString mMessage;
Qgis::MessageLevel mLevel;
QStringList mCategories;
};

/**
Expand All @@ -73,7 +73,7 @@ class CORE_EXPORT QgsReadWriteContext
void setPathResolver( const QgsPathResolver &resolver );

/**
* append a message to the context
* Append a message to the context
* \since QGIS 3.2
*/
void pushMessage( const QString &message, Qgis::MessageLevel level );
Expand All @@ -91,7 +91,7 @@ class CORE_EXPORT QgsReadWriteContext
void leaveCategory();

/**
* return the stored messages and remove them
* Return the stored messages and remove them
* \since QGIS 3.2
*/
QList<QgsReadWriteContext::ReadWriteMessage> takeMessages();
Expand Down
4 changes: 0 additions & 4 deletions src/gui/qgsmessagebar.h
Expand Up @@ -92,10 +92,6 @@ class GUI_EXPORT QgsMessageBar: public QFrame
//! convenience method for pushing a message to the bar with a detail text which be shown when pressing a "more" button
void pushMessage( const QString &title, const QString &text, const QString &showMore, Qgis::MessageLevel level = Qgis::Info, int duration = 5 );

// //! make out a widget containing a message to be displayed on the bar with a detail text which be shown when pressing a "more" button
// QgsMessageBarItem( const QString &title, const QString &text, const QString &showMore, Qgis::MessageLevel level = Qgis::Info, int duration = 0, QWidget *parent SIP_TRANSFERTHIS = nullptr );


QgsMessageBarItem *currentItem() { return mCurrentItem; }

signals:
Expand Down

0 comments on commit 95ab3d0

Please sign in to comment.