Hi, I updated the gui code in several ways (cvs log is broken right now because of a disc space problem at sf). I'm very happy with the current gui module, only small things are missing.
I removed all imports in gui/__init__.py. To access the submodules you must now import the submodules, like import gui.windows to get to the popup boxes. The reason is simple: on gui import, __init__ imports for example the popup boxes in windows. They import gui again (while the gui import from the beginning is still running) and import gui widgets. They again import gui. This is a very ugly recursive import and I don't want any recursive imports in Freevo. So I also changed the parts in freevo were the gui code is used (a simple replace, I hope I didn't break anything). By that I also replaced PopupBox with WaitBox and AlertBox with MessageBox. This are the new names for some time now, the old ones were only aliases and gone now. And theme_engine is renamed to theme and the get_* functions inside don't have the 'get_' it the names anymore. E.g. to get an icon From the theme, use gui.theme.icon('name') now. What needs to be done before I'm 100% happy with the gui code? First of all, doc in the Wiki. If we want people to write plugins, we need to have a good gui doc. There is a lot of doc in gui/__init__.py and the classes in gui also have a good documentation. It would be great if someone can merge all this into the Freevo 2.0 Wiki. Are not afraid of misstakes. I will fix wrong documentation later and if there is something unclear, just add a note inside the Wiki. Anyone willing to help here? Second: the code itself. Maybe we need more popup boxes and maybe this results in more widgets. I'm not sure, but this may happen. Also the theme engine needs some cleanup, it's an ugly piece of code. I also don't want anything else in Freevo import mevas or Imlib2, everything should go through the gui subsystem. So replaces at some points are needed. About recursive imports: there are more problems in the code right now. One major is config importing plugin and plugin import config (and eventhandler which also imports config). The only way to solve this is to create a fake plugin class in config to avoid importing plugin there at all. Or does someone has a better idea? Goal at the end is to have no recursive imports anymore and make freevo a real python module. Right now we change the python path to do stuff like import gui in image/viewer.py. The new correct way would be to import freevo.gui. Comments? Dischi -- Time is a drug. Too much of it kills you. -- in Small Gods (Terry Pratchett)
pgpdwfqU1qTXi.pgp
Description: PGP signature