Comment 24 for bug 722285

Revision history for this message
Joseph Eoff (joseph-eoff) wrote :

Class Override patch for 1.4.3Alpha1
I've figured out how to do a class override cleanly with PyDev with Eclipse and Glade. . If I had any say in the final fix, I'd vote to do it this way. Anything else runs the risk of confusing developers sometime in the future.

All it took was to create a widgets folder with a catalog file in xml for Glade together with the class override. Then, I setup an external program runner in Eclipse to start Glade with a couple of environment variables telling Glade where to look for the new widget. Now I start Glade from Eclipse, and it can see the new widget. Additional widgets can be created in the same folder and added to the catalog withjust a couple of lines of xml.

This fix is clean - it requires a single import import added to MainGTK.py and of course the widgets folder. It doesn't confuse Glade and the developers don't have to remember to use some special functions instead of the object methods. On top of that, it leaves you with things setup for future custom widgets

If you'd like to try this out, it applies to the current development version (1.4.3Alpha1.) The patch has been made such that it will create the new files. I'm not so sure about the folder, though. You may need to create openshot/widgets by hand.

Once you apply the patch, you can start Glade from the command line like this:
export GLADE_CATALOG_PATH="/home/joseph/workspace/OpenShot Video Editor/openshot/widgets/"&&export GLADE_MODULE_PATH="/home/joseph/workspace/OpenShot Video Editor/openshot/widgets/"&&glade-3

You'll of course have to modify the paths to fit your setup. If you are using Glade above 3.10 then you will need to change the environment variables to "GLADE_CATALOG_SEARCH_PATH" and "GLADE_MODULE_SEARCH_PATH" Iam using Glade 3.7 (which is older than Glade 3.10) so the Glade 3.10 settings are what I've gleaned from the Internet.

Glade will have an "OpenShot Widgets" group on the left side with all the other widgets. It'll be way down at the bottom.

You can integrate this into Eclipse as shown in the attached picture. Do NOT use the ~ (tilde) for your home directory. Eclipse doesn't seem to like it.