RfD: Support for layer specific resources
bh at intevation.de
Fri Apr 16 17:02:28 CEST 2004
Martin Schulze <joey at infodrom.org> writes:
> In the past, Thuban supported mostly local layers. As a result,
> several dialogs were not classified layer-specific and hence
> controlled through a general control within Thuban. This poses a
> problem since the general control of Thuban which also creates menus
> and legends thinks that all layers are "normal" layers.
Well, the issue is that there are different types of layers, not whether
they're local or remote. Thuban already comes with two different layer
types, both of which are local. Raster layers, just like wms layers,
don't have tables, for instance. The way Thuban currently deals with
different layer types in e.g. the properties dialog could be improved,
> I guess that we should start to discuss how we could move
> layer-specfic dialogs into the control of the dialog and add global
> hooks where the layer can registrate features (dialog boxes and the
> like) in the menu, legend (context menu), icon box, and main menu.
> For this particular problem the source is in
> Thuban/UI/legend.py for the Properties dialog
> Thuban/UI/mainwindow.py for the Show Table dialog
Actually, all the relevant code is in mainwindow.py. The code in
legend.py simply calls the appropriate mainwindow method.
The main problem with the Show Table command is that it's not grayed out
in the context menu for non-shape layers. It is grayed out in the main
menu, so it should be easy to do it in the context menu too. Jan is
already looking into that.
For the properties dialog, a registry like that for the renderer would
be an easy way to define new layer type specific properties dialogs.
The existing properties dialog should perhaps be split in two, one for
the shape layers and one for raster layers, instead of having one which
simply doesn't have some of the widgets of the other. It might be a
good idea ot have a common base class for the property dialogs which has
the widgets for the common base class BaseLayer.
Intevation GmbH http://intevation.de/
More information about the Thuban-devel