From: Peter L. <pet...@te...> - 2008-03-18 08:47:14
|
There are few places where numeric values with decimal point/comma is used without GTK entryfield. The only place I have found is the Paper Option tab with entries for the margins and the custom paper size. Changing these fields to GTK entryfieds would also make the GUI for report options consistent. How complicated would such a change be? I could volunteer to do it, but I have no experience with GTK programming, so I feel some GUI guy would do better and faster. /Peter > A GTK entryfield that captures what we want would be best indeed. > It removes the number checking from the application, we only need to change > min/max values on change of cm to inch > > Benny > > 2008/3/17, Peter Landgren <pet...@te...>: > > Agreed. My method is not the preferred. It just prevents from generating > > Unhandled exceptions. That's why I posted this question on this list. > > > > In _PaperMeny.py the values custom paper size and margin are input using > > text > > and then doing float(), which causes the problem. However, in > > _GraphvizReportDialog.py the values for "Node spacing" and "Rank spacing" > > are > > correctly shown with decimal comma using the class NumberOption. It's > > impossible to input a decimal point with Swedish locale at least. > > So could not this method be used for all types of numeric inputs? > > > > > > /Peter > > > > > I commented on this in the bug, > > > http://bugs.gramps-project.org/view.php?id=1939 > > > > > > I think we must make GRAMPS aware of the locale of the user, and not > > > > show . > > > > > numbers to locales with , > > > It is not correct to show margin 2.45 to users, who see everywhere else > > > > on > > > > > their PC, eg in openoffice calc, 2,45 > > > > > > Benny > > > > > > 2008/3/15, Peter Landgren <pet...@te...>: > > > > How is this treated in GRAMPS/Python? > > > > > > > > 1. Paper Option tab > > > > > > > > Decimal point is used everywhere. If I by mistake change a margin > > > > using > > > > > > decimal comma, to any value, the value will be converted to 1 inch. > > > > > > > > If I try to change the paper size using "Custom Size" I get: > > > > > > > > 217279: ERROR: gramps.py: line 160: Unhandled exception > > > > > > > > Traceback (most recent call last): > > > > > > > > File > > > > "/home/peter/GRAMPS30/share/gramps/ReportBase/_GraphvizReportDialog.py", > > > > > > line 953, in on_ok_clicked > > > > > > > > self.options.handler.set_custom_paper_size( > > > > self.paper_frame.get_custom_paper_size()) > > > > > > > > File "/home/peter/GRAMPS30/share/gramps/ReportBase/_PaperMenu.py", > > > > line > > > > > > 302, in get_custom_paper_size > > > > > > > > width = float(self.pwidth.get_text() ) * self.paper_unit_multiplier > > > > > > > > ValueError: invalid literal for float(): 21,99 > > > > > > > > 2. GraphVis Option tab > > > > > > > > In "Node spacing/rank spacing" fields, decimal comma is used. > > > > > > > > It is impossible to enter a decimal point in these fields. > > > > > > > > This happens when I run with Swedish locale. > > > > > > > > I will file a bug issue with the exception error above. > > > > > > > > I also have a patch for it by replacing "," with"." > > > > > > > > But I think this had to be treated the same way all over GRAMPS. > > > > > > > > /Peter -- Peter Landgren Talken Hagen 671 94 Brunskog SWEDEN 0570-530 21 070-635 4719 pet...@te... skype:pgl4820.2 |