OpenConfigBox - Project report Brendan Johan Lee (brendajl) October 31, 2008 Abstract Report on used time. Short description of what got done, and what didn’t get done. Short description of files and directory structure. Short description of the vmware image. Features implemented • If config files don’t exist on start up, make them after asking user for permission. • Main GUI. • GUI for keyboard shortcuts (including actions and settings) • GUI for mouse bindings • GUI for start up settings • GUI for app settings • methods for reading and parsing rc.xml and autoload.sh • methods for extracting keyboard shortcuts (including actions and settings), app settings, mouse bindings and start up settings • methods for saving, editing, and creating keyboard shortcuts (including actions and settings) • methods for saving, editing, and creating app settings • methods for saving, editing, and creating mouse bindings (not included in original spec) • methods for saving, editing, and creating start up settings • automatic backup system for rc.xml and autoload.sh (backups for each save created in .backup sub folder in OpenBox config folder • methods for handling errors while saving, reading, etc. • GUI front end methods for deleting, creating, and editing keyboard shortcuts (including actions and settings) • GUI front end methods for deleting, creating, and editing start up commands and comments • Method for telling OpenBox to reload config file (rc.xml) • save methods for both rc.xml and autoload.sh • method for asking user if he wants to save files when quiting, if unsaved changes have been made Features not (yet) implemented • GUI front end methods for deleting, creating and editing mouse bindings (not included in original spec) • GUI front end methods for deleting, creating and editing application settings 1 • Support for settings with sub settings in keyboard shortcut actions. This is supported in the back end, but not the GUI front end. Should be simple enough, but hasn’t been implemented yet, since I already have gone way over the 64 hours. Skipped because it’s a time consuming feature to implement, and only a couple of settings are allowed to have sub settings. • The rest of the planed feature (that I said I didn’t realistically think was possible to complete in the allotted time. I have however completed more features that I had though was possible while writing the project description. • See also todo-index.html in docs/code for minors Description of files and directory structure Directories project root docs docs/www docs/code OpenBoxConfig OpenBoxConfig/default-files OpenBoxConfig/ui OpenBoxConfig/ui/gfx contains the main file contains the documentation contains the web page (also available at http://folk.uio.no/brendajl/) code documentation in html format contains the modules representing rc.xml and autoload.sh contains default rc.xml and autoload.sh files for systems without them contains all of the different GUI modules contains the artwork 2 Files OpenConfigBox.py generate-docs.sh OpenConfigBox/Autostart.py OpenConfigBox/OpenBoxConfig.py OpenConfigBox/ui/ActionsGUI.py OpenConfigBox/ui/MainWindow.py OpenConfigBox/ui/SettingsGUI.py OpenConfigBox/ui/Ui openconfigbox.py main project file shell script to generate the code docs (just to save myself some time) classes and methods representing the autostart.sh classes and methods representing the rc.xml classes and methods for GUI for actions class for the main GUI. Subclasses Ui openconfigbox.py classes and methods for GUI for settings GUI class generated from the openconfigbox.ui XML file. Auto-generated, except for a fix for the artwork. All of the artwork had to be inserted manually due to a bug in the generator. vmware image Boot the image. Log on with user-name/password test/test. Should automatically start an OpenBox standalone session. Right-click on the desktop. Choose terminal emulator form the menu. Issue the command ’openconfigbox’. The application starts and since there aren’t any default config files installed it asks if you wish to create them. Enjoy. PS! There is a bug on the system on the vmware image that isn’t present on my own computer. For some reason it is impossible to deselect a list, so you can only add a top level keyboard shortcut right after starting the program, and before selecting anything in the list. 3 Time usage 22.09 4 22.10 17:15-20:30 3.25 23.10 12:00-16:00 4 23.10 16:30-21:00 4.5 24.10 09:00-15:30 6.5 24.10 16:30-18:00 1.5 25.10 12:30-17:00 4.5 25.10 21:00-04:00 7 26.10 15:00-21:00 6 27.10 09:30-11:30 2 27.10 16:30-22:00 5.5 Looked into XML-solutions for the project. Decided to use minidom. Looked into the best solution for integrating with Qt4. Decided to use Eric Ide to help generate the GUI skeleton. The rest of the project will be done in Emacs. Started making classes representing the keyboard shortcuts and parsing XML-file. Started making the XML-parser from scratch in a much better way The new parser for keyboard shortcuts was completed. Stated adding functions, and spent lots of time trying to get the XML-output to be formated correctly. Finally found out that the problem was the prettyprint method of minidom. Switches to the prettyprint method xml.dom.ext, and everything was fine. the ext module is however not included in newer python distros, so I had to do a little “hack” to get it included. The keyboard shortcut module was almost completed. The functions for writing to file, writing to backup file, reading from file for the autostart module got completed. Parsing autostart file is completed. Writing to autostart file is almost completed. Class representing the autostart commands is almost complete Fixed some bugs. Methods for parsing autostart file is complete. Autostart module nearly complete. Started reading a tutorial on creating the GUI in a smart way Created the application class. Created the position class. Updated the RC class to handle the applications part of the config. Started making classes representing mouse bindings. (Not included in the project description). MouseContext class finished. MouseBind class finsihed. Updated the RC class to handle mouse stuff. Re-wrote all of the classes to include forefather so that we can have safe prettyprint indenting with multiple instance running. (Prettyprint for debugging) Created a subversion for the project. Started making the GUI. Continued with the GUI. Created methods for grabbing keyboard shortcuts. Spent a lot of time on this since when grabbing shortcuts the application grabbed the keyboard focus, so any time there was an error in the code, the system lost keyboard control completely and needed X restarted. System for adding keyboard shortcuts complete. Started making system for updating keyboard shortcuts. Added methods for adding keyboard shortcuts at top level. Started the 4 long, dull job of making it possible to add actions to shortcuts Continued with the adding shortcut functions. This function is going to take much longer than planed. 28.10 13:30-21:00 8.5 29.10 13:10-22:30 9.5 30.10 14:30-10:00 19.5 Continued with adding shortcut function. Finished with add actions method except for sub settings of settings. (Skipped for now, because it will take a lot of time and effort, and is only used for a couple of settings). Started the change settings functions. Realized that the whole settings method had to be changed to be able to do this in a smart way. Continued changing the methods for settings. (Seems like I did some bad planning here. Wasted a lot of time on this rewriting. I probably should have done this in a much smarter way, like saving the settings in a XML-file and writing a parser instead.) Fixed some bugs. Started doing small leftover bits of the GUI programing (save methods, error messages, etc.) Finished the saving GUI methods. Tested that all changes got saved. Created a system for asking user if he wants to save changes if unsaved changes when quiting. Fixed the “main-menu buttons”. Added SettingGUIStringWithSelect, a subtype of SettingGUIString that has a file selection dialog. Added the help messages to the single setting change GUI (the same messages that are shown when “mousing over” a setting in add action. Started making GUI for start-up settings. Made Command a subclass of WListWidgetItem. Finished the GUI for start-up commands. Finished GUI for saving all files and error-messages. Tested that changes to start-up commands got saved. Added the main list to mousebindings and app settings (I don’t have time to make routines for adding, editing, etc.) Made a sensible directory structure. Finished the source-code documentation. Created the web-page. Grabbed screen shots. Created vmware image. Wrote this document. 86.25 Conclusion I spent a fair amount of extra time compared to the estimated 64 hours. 22.25 hours more to be exact. But I also managed to complete a whole lot more than expected. It’s amazing how quick one can implement things in python, even compared to Perl. 3720 lines of code including comments in 86 hours is very close to a personal record. The project will continue. And I should be able to release a first version with 2-3 more weeks of work. (So now I know what I’m going to do during my Christmas vacation). The only regrets I have is that I didn’t have an extra day for documentation. I would have liked to document my code a little bit better. 5