widgetGen widgetGen 0 0 470 267 Kommander Widget Source Generator unnamed 11 6 Layout12 unnamed 0 24 Spacer2 Horizontal Expanding 30 0 ExecButton1 &Save classNameLower=$(echo '@className' | tr "A-Z" "a-z") classNameUpper=$(echo '@className' | tr "a-z" "A-Z") inheritClassHeader=$(echo '@inheritClassName' | tr "A-Z" "a-z") headerContent="/*************************************************************************** $classNameLower.h - @description ------------------- begin : @dateStarted copyright : (C) @author email : @email ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _HAVE_${classNameUpper}_H_ #define _HAVE_${classNameUpper}_H_ /* KDE INCLUDES */ /* QT INCLUDES */ #include <$inheritClassHeader.h> #include <qstring.h> #include <qstringlist.h> /* OTHER INCLUDES */ #include <kommanderwidget.h> class QWidget; class QShowEvent; class @className : public @inheritClassName, public KommanderWidget { Q_OBJECT Q_PROPERTY(QString populationText READ populationText WRITE setPopulationText DESIGNABLE false) Q_PROPERTY(QStringList associations READ associatedText WRITE setAssociatedText DESIGNABLE false) Q_PROPERTY(bool KommanderWidget READ isKommanderWidget) public: @className(QWidget *a_parent, const char *a_name); ~@className(); virtual QString widgetText() const; virtual bool isKommanderWidget() const; virtual void setAssociatedText(QStringList); virtual QStringList associatedText() const; virtual QString currentState() const; virtual QString populationText() const; virtual void setPopulationText(QString); public Q_SLOTS: virtual void setWidgetText(const QString &); virtual void populate(); Q_SIGNALS: void widgetOpened(); void widgetTextChanged(const QString &); protected: void showEvent( QShowEvent *e ); private: }; #endif" cppContent="/*************************************************************************** $classNameLower.cpp - @description ------------------- begin : @dateStarted copyright : (C) @author email : @email ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /* KDE INCLUDES */ #include <klocale.h> /* QT INCLUDES */ #include <qstring.h> #include <qwidget.h> #include <qstringlist.h> #include <$inheritClassHeader.h> #include <qevent.h> /* OTHER INCLUDES */ #include <kommanderwidget.h> #include \"$classNameLower.h\" @className::@className(QWidget *a_parent, const char *a_name) : @inheritClassName(a_parent, a_name), KommanderWidget(this) { QStringList states; states << \"default\"; setStates(states); setDisplayStates(states); } @className::~@className() { } QString @className::currentState() const { return QString(\"default\"); } bool @className::isKommanderWidget() const { return TRUE; } QStringList @className::associatedText() const { return KommanderWidget::associatedText(); } void @className::setAssociatedText(QStringList a_at) { KommanderWidget::setAssociatedText(a_at); } void @className::populate() { QString txt = KommanderWidget::evalAssociatedText( populationText() ); setWidgetText( txt ); } QString @className::populationText() const { return KommanderWidget::populationText(); } void @className::setPopulationText(QString a_text) { KommanderWidget::setPopulationText(a_text); } void @className::setWidgetText(const QString &a_text) { //set the widget text of your widget here emit widgetTextChanged(a_text); } QString @className::widgetText() const { // implement your widget text here return QString::null; } void @className::showEvent( QShowEvent *e ) { @inheritClassName::showEvent( e ); emit widgetOpened(); } #include \"$classNameLower.moc\" " echo "$headerContent" > @directory/$classNameLower.h echo "$cppContent" > @directory/$classNameLower.cpp true CloseButton1 &Close Spacer3 Horizontal Expanding 30 0 Layout37 unnamed 0 6 TextLabel1 Author: TextLabel6 Email: TextLabel2 Description: TextLabel3 Date started: TextLabel4 Class name: TextLabel7 Base class name: TextLabel5 Directory to save in: Layout36 unnamed 0 6 author @widgetText email @widgetText description @widgetText dateStarted @widgetText className @widgetText inheritClassName @widgetText directory @widgetText