On 28/09/11 20:42, [email protected] wrote:
In the getPrewiev member I read the first part of my file where the
stored columns are defined, so now I know their names and I'd like to
put them in the textfield so that the user can chose or modify them
without having to write all by hand.
I tried simply to use this in the getPreview member:
field.FieldText("columns", descr=u"Columns to import (comma separared
list)", default=", ".join(foundColumnNames)
At first It seems to work but, if I click on browse and select different
files the getPreview is called, but the shown value doesn't change
reflecting the new column names.
Hmmm... I don't think this is possible with the current code. The field
widgets get constructed when the plugin object is created, but the
plugin.fields object doesn't get linked to the widgets themselves.
One issue is that thanks to a mistake, I made the import plugins be
instances of a class rather than the class itself (unlike the other
plugin), so it doesn't make a lot of sense to change defaults when
multiple import dialogs might be using that plugin. I've just made
registered import plugins become classes, retaining backward compatiblity.
Then, I wonder what would be the best way to correct this? Some sort of
"rebuildWidgets" call, or for the widgets to get updated if the default
changes. The 2nd option would be nicer but would require some
substantial changes to the code.
Jeremy
_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss