# HG changeset patch # User chewie@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1247296644 0 # Node ID a33576d94f3201295d2304143b51bc090e3fc5c7 # Parent 94470d79576f2a428a1e52fdbaeb2cfb1c0a308a - eliminated magic number - updated some doc strings diff -r 94470d79576f -r a33576d94f32 clients/editor/plugins/LayerTool.py --- a/clients/editor/plugins/LayerTool.py Fri Jul 10 11:08:32 2009 +0000 +++ b/clients/editor/plugins/LayerTool.py Sat Jul 11 07:17:24 2009 +0000 @@ -62,6 +62,7 @@ #--- Plugin function ---# def enable(self): + """ """ if self._enabled is True: return @@ -78,6 +79,7 @@ events.postMapShown.connect(self.update) def disable(self): + """ """ if self._enabled is False: return self.container.setDocked(False) @@ -89,9 +91,11 @@ self._editor._toolsMenu.removeAction(self._showAction) def isEnabled(self): + """ """ return self._enabled; def getName(self): + """ """ return u"Layertool" #--- End plugin functions ---# @@ -206,11 +210,7 @@ def select_no_layer(self): - """ the exception approach - as soon as the user hides a layer, the mapedit module should stop to use this - one, too. - - A bunch of exceptions is the result (each click on the map will result in a exception as no layer is set etc...) - """ + """ Resets the current active layer (widget + editor) """ previous_active_layer = self.getActiveLayer() if previous_active_layer is not None: previous_layer_id = previous_active_layer.getId() @@ -243,7 +243,7 @@ self.select_no_layer() - layerid = widget.name[7:] + layerid = widget.name[len(_LABEL_NAME_PREFIX):] widget.background_color = _HIGHLIGHT_BACKGROUND_COLOR widget.foreground_color = _HIGHLIGHT_BACKGROUND_COLOR @@ -253,6 +253,9 @@ self._mapview.getController().selectLayer(layerid) def toggle(self): + """ toggles the layertool visible / invisible and sets + dock status + """ if self.container.isVisible() or self.container.isDocked(): self.container.setDocked(False) self.container.hide()