diff options
| author | Alvin Penner <penner@vaxxine.com> | 2011-06-26 11:45:57 +0000 |
|---|---|---|
| committer | apenner <penner@vaxxine.com> | 2011-06-26 11:45:57 +0000 |
| commit | 3ea9f2d26d11ad053fb0339b69b513177864f081 (patch) | |
| tree | c52809cbaf0e2cf7f9c9c368174c06d2e3e41d3d /share/extensions/funcplot.py | |
| parent | Documentation. Keys and mouse reference translations update. (diff) | |
| download | inkscape-3ea9f2d26d11ad053fb0339b69b513177864f081.tar.gz inkscape-3ea9f2d26d11ad053fb0339b69b513177864f081.zip | |
Extensions. Function Plotter. message if nothing selected (Bug 800552)
Fixed bugs:
- https://launchpad.net/bugs/800552
(bzr r10370)
Diffstat (limited to 'share/extensions/funcplot.py')
| -rw-r--r-- | share/extensions/funcplot.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/extensions/funcplot.py b/share/extensions/funcplot.py index 0beaf3946..a868e92a4 100644 --- a/share/extensions/funcplot.py +++ b/share/extensions/funcplot.py @@ -28,6 +28,8 @@ Changes: import inkex, simplepath, simplestyle from math import * from random import * +import gettext +_ = gettext.gettext def drawfunction(xstart, xend, ybottom, ytop, samples, width, height, left, bottom, fx = "sin(x)", fpx = "cos(x)", fponum = True, times2pi = False, polar = False, isoscale = True, drawaxis = True, endpts = False): @@ -235,6 +237,7 @@ class FuncPlot(inkex.Effect): help="dummy") def effect(self): + newpath = None for id, node in self.selected.iteritems(): if node.tag == inkex.addNS('rect','svg'): # create new path with basic dimensions of selected rectangle @@ -283,7 +286,9 @@ class FuncPlot(inkex.Effect): # option wether to remove the rectangle or not. if self.options.remove: node.getparent().remove(node) - + if newpath is None: + inkex.errormsg(_("Please select a rectangle")) + if __name__ == '__main__': e = FuncPlot() e.affect() |
