From May 30th to July 4th we had a YaST workshop in Nuremberg. The workshop was basically a hackshop as we wanted to work on cool and new things for YaST during this week.
There is one big change in YaST in openSUSE 11.0 – yea, we found out that there are even more colors than gray, ok – but there is one that is not really visible to the end-user. Stefan Hundhammer, maintainer our YaST UI, completely separated the UI from the rest of the YaST infrastructure. This now makes it possible to use the UI directly, from anywhere, independent from our YaST-own-language YCP. So with a team of four hackers we wanted to prove that we can write a YaST module in plain C++ using the new modularized UI directly. And here is the outcome:
We went for rewriting the registration module (well, we chose it because I know it well, as I am the maintainer, and it will change anyhow for the next release). This module is not that integrated in the overall YCP world, so it should be feasible. First we had to find an alternative way to access system configuration files, as this is done by so-called SCR agents in YCP. To make life easier (and future development faster) we had to look for a replacement of our YCP Wizard Seqencer. And of course we redesigned all dialogs to make them more intuitive.
We solved all the issues and now have
- a wrapper class for accessing different configuration files (currently only ini files)
- an automatic wizard sequencer equivalent (using the advantages of an object oriented language, btw YCP is not)
- three clear and intuitive dialogs, every user should understand
And as everybody wants to see screenshots, here they are:
The code is just a proof of concept and not yet reusable for new YaST modules but everything we wanted to show works great. We will continue to work on such kind of modules and in that process move the generic parts out into single libraries so that they can be reused and even may be exposed to scripting languages.
Writing YaST module this way has lots of advantages
- YaST modules evolved into the object oriented world and can make use of it (the automatic sequencer is the first benefit)
- the code is reusable
- a huge bunch of documentation and lots of tools exist for C++
- its a compiled language and has a better performance than an interpreted one
- we can bind automatically to the most important scripting languages and give them access to the modules logic
If you are interested in the source code, have a look at my svn repo and if you want to help join the team and contact us on our mailinglist.