author | llornkcor <llornkcor> | 2002-10-27 15:18:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-27 15:18:24 (UTC) |
commit | 4ad1fa6d01c9de96d309cd662e658bcb1bb899a5 (patch) (side-by-side diff) | |
tree | 1d63d25459fd476f296bf877aaffadc3c7e519fe /core | |
parent | 52e4c4a45922c9344c3db7e0a433be66a75d00e0 (diff) | |
download | opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.zip opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.tar.gz opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.tar.bz2 |
add new restart applet- for opie menu
-rw-r--r-- | core/applets/restartapplet2/.cvsignore | 5 | ||||
-rw-r--r-- | core/applets/restartapplet2/opie-restartapplet2.control | 9 | ||||
-rw-r--r-- | core/applets/restartapplet2/restart.cpp | 107 | ||||
-rw-r--r-- | core/applets/restartapplet2/restart.h | 37 | ||||
-rw-r--r-- | core/applets/restartapplet2/restartapplet.pro | 12 |
5 files changed, 170 insertions, 0 deletions
diff --git a/core/applets/restartapplet2/.cvsignore b/core/applets/restartapplet2/.cvsignore new file mode 100644 index 0000000..7c4a217 --- a/dev/null +++ b/core/applets/restartapplet2/.cvsignore @@ -0,0 +1,5 @@ +moc_* +*.moc +Makefile* +*.~ +opieobj
\ No newline at end of file diff --git a/core/applets/restartapplet2/opie-restartapplet2.control b/core/applets/restartapplet2/opie-restartapplet2.control new file mode 100644 index 0000000..49eb743 --- a/dev/null +++ b/core/applets/restartapplet2/opie-restartapplet2.control @@ -0,0 +1,9 @@ +Files: plugins/applets/librestartapplet.so* +Priority: optional +Section: opie/system +Maintainer: L. J. Potter <ljp@llornkcor.com> +Architecture: arm +Version: $QPE_VERSION-$SUB_VERSION.1 +Depends: opie-base ($QPE_VERSION) +Description: Restart Applet + A simple taskbar applet to restart the Opie environment diff --git a/core/applets/restartapplet2/restart.cpp b/core/applets/restartapplet2/restart.cpp new file mode 100644 index 0000000..caed9e5 --- a/dev/null +++ b/core/applets/restartapplet2/restart.cpp @@ -0,0 +1,107 @@ +// coptright Mon 10-21-2002 01:14:03 by L. Potter <ljp@llornkcor.com> + +#include <qpe/qpeapplication.h> +#include <qpe/resource.h> +#include <qpe/qcopenvelope_qws.h> + +#include "restart.h" + +// #include <stdlib.h> +// #include <unistd.h> +// #include <sys/stat.h> +//#include <dirent.h> +/* XPM */ +static char *restart_xpm[] = { +"16 16 11 1", +" c None", +". c #000000", +"+ c #DCDCDC", +"@ c #A0A0A0", +"# c #C3C3C3", +"$ c #808080", +"% c #FFA858", +"& c #FFDCA8", +"* c #FFFFC0", +"= c #FFFFFF", +"- c #585858", +" .. ", +" .. .++. .. ", +" .+@.@##@.@+. ", +" .@+$@%%@$+@. ", +" .$%%&%&%$. ", +" ..+@%&$$%&@+.. ", +".+#@%&%@@&*%@#+.", +".$@+$&*&&=*$+@$.", +" .--+$&*=&$+--. ", +" .$#++$$++#$. ", +" .@=$-$++$-$=@. ", +" .+@-..@@..-@+. ", +" ... .+=. ... ", +" .-$. ", +" .. ", +" "}; + +RestartApplet::RestartApplet ( ) + : QObject ( 0, "RestartApplet" ), ref ( 0 ) +{ +} + +RestartApplet::~RestartApplet ( ) +{ +} + +int RestartApplet::position ( ) const +{ + return 4; +} + +QString RestartApplet::name ( ) const +{ + return tr( "Restart" ); +} + +QString RestartApplet::text ( ) const +{ + return tr( "Restart Opie" ); +} + +QIconSet RestartApplet::icon ( ) const +{ + QPixmap pix; + QImage img = ( const char** ) restart_xpm ;//Resource::loadImage ( "Run" ); + + if ( !img. isNull ( )) + pix. convertFromImage ( img. smoothScale ( 14, 14 )); + return pix; +} + +QPopupMenu *RestartApplet::popup ( QWidget * ) const +{ + return 0; +} + +void RestartApplet::activated ( ) +{ + QCopEnvelope e("QPE/System", "restart()"); +} + + +QRESULT RestartApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_MenuApplet ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + return QS_OK; +} + +Q_EXPORT_INTERFACE( ) +{ + Q_CREATE_INSTANCE( RestartApplet ) +} + + diff --git a/core/applets/restartapplet2/restart.h b/core/applets/restartapplet2/restart.h new file mode 100644 index 0000000..9536886 --- a/dev/null +++ b/core/applets/restartapplet2/restart.h @@ -0,0 +1,37 @@ +/********************************************************************** +** Copyright (C) 2002 ljp <llornkcor@handhelds.org> + +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +**********************************************************************/ +#ifndef __OPIE_RESTART_APPLET_H__ +#define __OPIE_RESTART_APPLET_H__ + +#include <qpe/menuappletinterface.h> + +class RestartApplet : public QObject, public MenuAppletInterface +{ +public: + RestartApplet ( ); + virtual ~RestartApplet ( ); + + QRESULT queryInterface( const QUuid&, QUnknownInterface** ); + Q_REFCOUNT + + virtual int position() const; + + virtual QString name ( ) const; + virtual QIconSet icon ( ) const; + virtual QString text ( ) const; + virtual QPopupMenu *popup ( QWidget *parent ) const; + + virtual void activated ( ); + +private: + ulong ref; +}; + +#endif diff --git a/core/applets/restartapplet2/restartapplet.pro b/core/applets/restartapplet2/restartapplet.pro new file mode 100644 index 0000000..19ab381 --- a/dev/null +++ b/core/applets/restartapplet2/restartapplet.pro @@ -0,0 +1,12 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +HEADERS = restart.h +SOURCES = restart.cpp +TARGET = restartapplet +DESTDIR = $(OPIEDIR)/plugins/applets +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe +VERSION = 1.0.0 +MOC_DIR=opieobj +OBJECTS_DIR=opieobj |