[Qgis-developer] Using app MessageBar from providers ?

Denis Rouzaud denis.rouzaud at gmail.com
Sun Apr 10 22:19:17 PDT 2016


Hi,

That sounds a bit weird to me.

Shouldn't it be the application which decide (filter) what to show from
core log messages?
Couldn't we use some error levels or tags to achieve this?

That just doesn't sound like a good API to have core function with
displayMessage as argument.

But maybe I'm missing a part of the picture.

Denis



On 04/11/2016 01:33 AM, Nathan Woodrow wrote:
> Hey Even,
>
> I think this solution is fine. The other option I thought of in the
> past was to have some kind of signal on the provider that gets passed
> up and connected at a higher level.  
> Using QgsMessageLog is a good idea as it's generic and can be used by
> everyone.
>
> Regards,
>
> On Sun, Apr 10, 2016 at 11:25 PM, Even Rouault
> <even.rouault at spatialys.com <mailto:even.rouault at spatialys.com>> wrote:
>
>     Le dimanche 10 avril 2016 15:21:14, Luigi Pirelli a écrit :
>     > a provider does not need necessarily an iface where to send GUI
>     > messages (e.g pyqgis scripts).... IMHO is one reason.
>
>     Yes I know. Hence my proposal. The provider would continue using
>     the message
>     log interface, so with its current behaviour still preserved, but
>     with an
>     extra hint when the message is also aimed at being prominently
>     displayed, if
>     possible. In the case qgis_app is started it would listen for that and
>     redirect the message to the message bar too.
>
>     >
>     > regards
>     > Luigi Pirelli
>     >
>     >
>     ***************************************************************************
>     > *********************** * Boundless QGIS Support/Development:
>     lpirelli AT
>     > boundlessgeo DOT com * LinkedIn:
>     https://www.linkedin.com/in/luigipirelli
>     > * Stackexchange:
>     http://gis.stackexchange.com/users/19667/luigi-pirelli
>     > * GitHub: https://github.com/luipir
>     > * Mastering QGIS:
>     > https://www.packtpub.com/application-development/mastering-qgis
>     >
>     ***************************************************************************
>     > ***********************
>     >
>     > On 10 April 2016 at 15:12, Even Rouault
>     <even.rouault at spatialys.com <mailto:even.rouault at spatialys.com>>
>     wrote:
>     > > Hi,
>     > >
>     > > For the WFS provider, I'd like some messages, like a partial
>     feature
>     > > download, to be emitted in a more prominent way than just in
>     the message
>     > > log. The MessageBar would be appropriate for that, but from
>     what I can
>     > > see, it is not currently possible for a provider to use it. A
>     search in
>     > > src/providers shows that the same need was at least
>     encountered once in
>     > > the GRASS provider but the code is commented out as the
>     provider doesn't
>     > > link against qgis_app.
>     > >
>     > > So unless there's a good reason for a provider not to be able
>     to use the
>     > > message bar, I was thinking to the following mechanism to
>     implement it :
>     > > - QgsMessageLog would be extended to have 2 extra arguments bool
>     > > displayInMessagerBar = false, int duration = 0 in logMessage() /
>     > > messageReceived()
>     > > - QgisApp would connect on messageReceived() and when the
>     boolean is set,
>     > > it would push the message to the main message bar.
>     > >
>     > > Any thoughts ?
>     > >
>     > > Even
>     > >
>     > > --
>     > > Spatialys - Geospatial professional services
>     > > http://www.spatialys.com
>     > > _______________________________________________
>     > > Qgis-developer mailing list
>     > > Qgis-developer at lists.osgeo.org
>     <mailto:Qgis-developer at lists.osgeo.org>
>     > > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>     > > Unsubscribe:
>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>     --
>     Spatialys - Geospatial professional services
>     http://www.spatialys.com
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>     Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160411/facb29fe/attachment.html>


More information about the Qgis-developer mailing list