diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /languages/cpp/app_templates/kicker/applet.cpp | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/kicker/applet.cpp')
-rw-r--r-- | languages/cpp/app_templates/kicker/applet.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/languages/cpp/app_templates/kicker/applet.cpp b/languages/cpp/app_templates/kicker/applet.cpp new file mode 100644 index 00000000..5345ac0c --- /dev/null +++ b/languages/cpp/app_templates/kicker/applet.cpp @@ -0,0 +1,72 @@ +%{CPP_TEMPLATE} + +#include <qlcdnumber.h> +#include <kglobal.h> +#include <klocale.h> +#include <kconfig.h> +#include <kapplication.h> +#include <kmessagebox.h> + +#include "%{APPNAMELC}.h" + + +%{APPNAME}::%{APPNAME}(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) + : KPanelApplet(configFile, type, actions, parent, name) +{ + // Get the current application configuration handle + ksConfig = config(); + QLCDNumber *w = new QLCDNumber(this); + w->display(42); + + mainView = w; + mainView->show(); +} + + +%{APPNAME}::~%{APPNAME}() +{ +} + + +void %{APPNAME}::about() +{ + KMessageBox::information(0, i18n("This is an about box")); +} + + +void %{APPNAME}::help() +{ + KMessageBox::information(0, i18n("This is a help box")); +} + + +void %{APPNAME}::preferences() +{ + KMessageBox::information(0, i18n("This is a preferences box")); +} + +int %{APPNAME}::widthForHeight(int height) const +{ + return width(); +} + +int %{APPNAME}::heightForWidth(int width) const +{ + return height(); +} + +void %{APPNAME}::resizeEvent(QResizeEvent *e) +{ +} + + +extern "C" +{ + KPanelApplet* init( QWidget *parent, const QString& configFile) + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}(configFile, KPanelApplet::Normal, + KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences, + parent, "%{APPNAMELC}"); + } +} |