summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/restartapplet2/.cvsignore5
-rw-r--r--core/applets/restartapplet2/opie-restartapplet2.control9
-rw-r--r--core/applets/restartapplet2/restart.cpp107
-rw-r--r--core/applets/restartapplet2/restart.h37
-rw-r--r--core/applets/restartapplet2/restartapplet.pro12
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 @@
1moc_*
2*.moc
3Makefile*
4*.~
5opieobj \ 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 @@
1Files: plugins/applets/librestartapplet.so*
2Priority: optional
3Section: opie/system
4Maintainer: L. J. Potter <ljp@llornkcor.com>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION.1
7Depends: opie-base ($QPE_VERSION)
8Description: Restart Applet
9 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 @@
1// coptright Mon 10-21-2002 01:14:03 by L. Potter <ljp@llornkcor.com>
2
3#include <qpe/qpeapplication.h>
4#include <qpe/resource.h>
5#include <qpe/qcopenvelope_qws.h>
6
7#include "restart.h"
8
9// #include <stdlib.h>
10// #include <unistd.h>
11// #include <sys/stat.h>
12//#include <dirent.h>
13/* XPM */
14static char *restart_xpm[] = {
15"16 16 11 1",
16" c None",
17". c #000000",
18"+ c #DCDCDC",
19"@ c #A0A0A0",
20"# c #C3C3C3",
21"$ c #808080",
22"% c #FFA858",
23"& c #FFDCA8",
24"* c #FFFFC0",
25"= c #FFFFFF",
26"- c #585858",
27" .. ",
28" .. .++. .. ",
29" .+@.@##@.@+. ",
30" .@+$@%%@$+@. ",
31" .$%%&%&%$. ",
32" ..+@%&$$%&@+.. ",
33".+#@%&%@@&*%@#+.",
34".$@+$&*&&=*$+@$.",
35" .--+$&*=&$+--. ",
36" .$#++$$++#$. ",
37" .@=$-$++$-$=@. ",
38" .+@-..@@..-@+. ",
39" ... .+=. ... ",
40" .-$. ",
41" .. ",
42" "};
43
44RestartApplet::RestartApplet ( )
45 : QObject ( 0, "RestartApplet" ), ref ( 0 )
46{
47}
48
49RestartApplet::~RestartApplet ( )
50{
51}
52
53int RestartApplet::position ( ) const
54{
55 return 4;
56}
57
58QString RestartApplet::name ( ) const
59{
60 return tr( "Restart" );
61}
62
63QString RestartApplet::text ( ) const
64{
65 return tr( "Restart Opie" );
66}
67
68QIconSet RestartApplet::icon ( ) const
69{
70 QPixmap pix;
71 QImage img = ( const char** ) restart_xpm ;//Resource::loadImage ( "Run" );
72
73 if ( !img. isNull ( ))
74 pix. convertFromImage ( img. smoothScale ( 14, 14 ));
75 return pix;
76}
77
78QPopupMenu *RestartApplet::popup ( QWidget * ) const
79{
80 return 0;
81}
82
83void RestartApplet::activated ( )
84{
85 QCopEnvelope e("QPE/System", "restart()");
86}
87
88
89QRESULT RestartApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
90{
91 *iface = 0;
92 if ( uuid == IID_QUnknown )
93 *iface = this;
94 else if ( uuid == IID_MenuApplet )
95 *iface = this;
96
97 if ( *iface )
98 (*iface)-> addRef ( );
99 return QS_OK;
100}
101
102Q_EXPORT_INTERFACE( )
103{
104 Q_CREATE_INSTANCE( RestartApplet )
105}
106
107
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 @@
1/**********************************************************************
2** Copyright (C) 2002 ljp <llornkcor@handhelds.org>
3
4** This file may be distributed and/or modified under the terms of the
5** GNU General Public License version 2 as published by the Free Software
6** Foundation and appearing in the file LICENSE.GPL included in the
7** packaging of this file.
8**
9**********************************************************************/
10#ifndef __OPIE_RESTART_APPLET_H__
11#define __OPIE_RESTART_APPLET_H__
12
13#include <qpe/menuappletinterface.h>
14
15class RestartApplet : public QObject, public MenuAppletInterface
16{
17public:
18 RestartApplet ( );
19 virtual ~RestartApplet ( );
20
21 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
22 Q_REFCOUNT
23
24 virtual int position() const;
25
26 virtual QString name ( ) const;
27 virtual QIconSet icon ( ) const;
28 virtual QString text ( ) const;
29 virtual QPopupMenu *popup ( QWidget *parent ) const;
30
31 virtual void activated ( );
32
33private:
34 ulong ref;
35};
36
37#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 @@
1TEMPLATE = lib
2CONFIG += qt warn_on release
3HEADERS = restart.h
4SOURCES = restart.cpp
5TARGET = restartapplet
6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe
10VERSION = 1.0.0
11MOC_DIR=opieobj
12OBJECTS_DIR=opieobj