From 3ea9f2d26d11ad053fb0339b69b513177864f081 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sun, 26 Jun 2011 07:45:57 -0400 Subject: Extensions. Function Plotter. message if nothing selected (Bug 800552) Fixed bugs: - https://launchpad.net/bugs/800552 (bzr r10370) --- share/extensions/funcplot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'share/extensions/funcplot.py') 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() -- cgit v1.2.3