Skip navigation.
KDE Developer's Journals

Kommander Gets new new features that make it more powerful

sequitur's picture

If you're not familiar with Kommander maybe you should be. Kommander is a KDE application derived from Qt Designer that allows users to visually create dialogs with the editor and then run them with the executor. What does it do? Think Kdialog on steroids. You can create extensive dialogs and bind text to widgets. So clicking a button on the dialog can generate DCOP, assemble strings to execute in the shell or send a string to the calling program. You sort of have to play with it to see.



So what's new? Recently Andras Mantia added the ability to access the dialog widgets via DCOP with KommanderIf. Marc Britton, who originally authored Kommander interacting with my ideas, made several big commits. First was an update that makes it much easier to add KDE widets, and any widget can be added. This also makes widgets pluggable so you don't have to recompile Kommander to add them. The second change is even cooler.



Kommander now has Kommander Text (formerly "Associated Text") which is the value that can be assigned to the widget as text, widget references and scripts, as well as the new Populate Text. Populate text is used with the signals and slots... think event model. Now you can take an event, like the creation of a widget, and signal a slot with instructions on how to populate that widget. You have to really see it in action to realize how it gets around the static limitations of older versions. The second part of this involves widget persistence. Suppose you want to set a default. You use a @readSettings(name,default) call to read or set the default if there is nothing saved and a @writeSettings(name,@widgetname) in your close button. This gives you total control over what is saved and restored!



What is interesting is what this makes possible. I use tabbed dialogs for PHP classes where each tab or sub tab manages a method (function). This makes large classes managemable. With the new DCOP I set up a script that asks Quanta for the line of of text where the cursor is on the current editor. I then parse this, find the function name and run it through a switch statement to set the correct tab and list the widget names. It then proceeds to populate the dialog for an edit of the text line. This is just excellent!



With the things that have been added we can now look at keeping datasource information in Quanta project files and making it available via DCOP. (Come to think of it... you can do that in Kommander yourself now!) It will be easy to add data widgets like hk_widgets or soon Kexi widgets. We will be making CSS information avaliable via DCOP too. So soon you will be able to create complex dialogs with data widgets, populate regular widgets, save state on widgets, interact with various KDE programs like Quanta where information can be shuttled back and forth... all visually created with a little scripting in the language of your choice.



Kommander still has rough edges and needs work to be more friendly to less technical users (as well as power users) but it has huge potential to extend any KDE app that speaks DCOP. We will be putting some examples in CVS shortly. I hope other developers and users will join us in helping to make this a program that anyone can use without having to pick up a new scripting language to get the features. Look for the latest in the new kdewebdev CVS module.