[Qgis-developer] Python support in project file

Larry Shaffer larrys at dakotacarto.com
Wed Aug 22 17:31:25 PDT 2012


Hi Giuseppe,

On Wed, Aug 22, 2012 at 4:58 PM, Giuseppe Sucameli <sucameli at faunalia.it> wrote:
> Hi Larry, Nathan
>
> On Tue, Aug 21, 2012 at 9:58 PM, Larry Shaffer <larrys at dakotacarto.com> wrote:
>> For a cleaner look for the message bar, I created two svg icons output to
>> png, one for the warning and one for close [0]. Also, the Enable action is
>> more of a link. Basically, removing the tool button backgrounds via a
>> stylesheet and having the cursor change as expected for web page links
>> allows for the focus of the bar to be the message, not the button actions.
>
> I like those changes!
> I've just forced the "Enable" text color to black (it's dark blue-gray
> here) and added the tooltip to the "Close" button.
>
> In addition, I've added a enable macros setting with values:
> Never, Ask (default), Just for this session, Always.
>
> Feel free to add other options, enable macros for the recently
> opened projects or a way to define a list of trusted projects.

I have a small suggestion concerning the default code for the macros.
It should have 4 spaces for the indention, as per PEP8. I realize it's
merely a matter of preference, but probably best to present Python
code in a standardized manner.


I really like the QgsMessageBar class. Definite improvement to the
GUI. It will be very useful and unobtrusive, compared to dialogs
popping up all the time. Nice work making it non-blocking and so the
canvas doesn't have to re-draw.

I can see several changes to the message bar that might help, for more
general app use:

- Simple means to 'scroll' (maybe just one way) through multi-line
messages, with close button only for total close of message(s).
- Easy means of passing QAction(s) to one or two buttons (like your
Enable button).
- Customize icon, background color, height, etc. via calls.


> I'll push it to master if nobody enter objections.
>
> Regards.
>
>> [0] http://dl.dropbox.com/u/4058089/qgis/message-bar.png
>>
>>> Opinions are welcome!
>>
>>
>> The order of QgsMessageBar instance being created comes before the theme
>> (soon to be deprecated anyway?) is set.
>>
>> The changes I have suggested are available as an addition to your branch
>> uploaded to my github repository [1].
>>
>> [1]
>> https://github.com/dakcarto/Quantum-GIS/commit/5a1500cc6e0d8a8965d17884e107bb3e22b77182
>>
>> T
>>
>>
>>>
>>> Regards.
>>>
>>> > - Nathan
>>> >
>>> >
>>> > On Tue, Aug 21, 2012 at 5:54 PM, Nathan Woodrow <madmanwoo at gmail.com>
>>> > wrote:
>>> >> Very nice Giiseppe. Will test soon.
>>> >>
>>> >> Sent from some fancy phone looking thingo
>>> >> From: Giuseppe Sucameli
>>> >> Sent: 21/08/2012 5:24 PM
>>> >> To: qgis-developer ML
>>> >> Subject: Re: [Qgis-developer] Python support in project file
>>> >> Hi all,
>>> >>
>>> >> I've pushed the code on the branch project_macros on my
>>> >> QGis fork [1].
>>> >>
>>> >> The macros python code is loaded into a dummy module,
>>> >> in this manner it can be unloaded when needed.
>>> >>
>>> >> On Thu, May 31, 2012 at 8:30 AM, Martin Dobias <wonder.sk at gmail.com>
>>> >> wrote:
>>> >>> On Thu, May 31, 2012 at 2:49 AM, Giuseppe Sucameli
>>> >>> <sucameli at faunalia.it> wrote:
>>> >>>> I would save it into the project (embedded in the XML) until we will
>>> >>>> have a different way to pack project and related stuff together.
>>> >>>
>>> >>> Ok - hopefully XML will not choke python indentation :)
>>> >>
>>> >> It seems conversion to XML doesn't break anything.
>>> >>
>>> >>>> BTW one popup only would be needed, i.e. the project is loaded.
>>> >>>> If the user trust macros then they become active and ready to be
>>> >>>> executed.
>>> >>>
>>> >>> See Nathan's post - he better explains what I have meant.
>>> >>
>>> >> I developed a QgsMessageBar class to display information
>>> >> to the user using a non-blocking widget.
>>> >>
>>> >> The bar allows to push more messages as in a queue, then
>>> >> displays them one by one beside to a close button.
>>> >> The button remove the current message or the bar when the
>>> >> message queue is empty.
>>> >>
>>> >> The QgisApp instance creates a object of that class and
>>> >> puts it above the canvas and also on the top of it (so the canvas
>>> >> is not refreshed when the bar is shown or hidden as no resize
>>> >> event occurs).
>>> >>
>>> >> Please, could you test it and report here?
>>> >>
>>> >> Regards.
>>> >>
>>> >> --
>>> >> Giuseppe Sucameli - Faunalia
>>> >> _______________________________________________
>>> >> Qgis-developer mailing list
>>> >> Qgis-developer at lists.osgeo.org
>>> >> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>> > _______________________________________________
>>> > Qgis-developer mailing list
>>> > Qgis-developer at lists.osgeo.org
>>> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>>
>>>
>>>
>>> --
>>> Giuseppe Sucameli - Faunalia
>>> _______________________________________________
>>> Qgis-developer mailing list
>>> Qgis-developer at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>>
>>
>> --
>>
>> Larry Shaffer
>> Dakota Cartography
>> Black Hills, South Dakota
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
>
> --
> Giuseppe Sucameli - Faunalia


More information about the Qgis-developer mailing list