author | llornkcor <llornkcor> | 2002-10-27 15:18:24 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-27 15:18:24 (UTC) |
commit | 4ad1fa6d01c9de96d309cd662e658bcb1bb899a5 (patch) (unidiff) | |
tree | 1d63d25459fd476f296bf877aaffadc3c7e519fe | |
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 @@ | |||
1 | moc_* | ||
2 | *.moc | ||
3 | Makefile* | ||
4 | *.~ | ||
5 | 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 @@ | |||
1 | Files: plugins/applets/librestartapplet.so* | ||
2 | Priority: optional | ||
3 | Section: opie/system | ||
4 | Maintainer: L. J. Potter <ljp@llornkcor.com> | ||
5 | Architecture: arm | ||
6 | Version: $QPE_VERSION-$SUB_VERSION.1 | ||
7 | Depends: opie-base ($QPE_VERSION) | ||
8 | Description: 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 */ | ||
14 | static 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 | |||
44 | RestartApplet::RestartApplet ( ) | ||
45 | : QObject ( 0, "RestartApplet" ), ref ( 0 ) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | RestartApplet::~RestartApplet ( ) | ||
50 | { | ||
51 | } | ||
52 | |||
53 | int RestartApplet::position ( ) const | ||
54 | { | ||
55 | return 4; | ||
56 | } | ||
57 | |||
58 | QString RestartApplet::name ( ) const | ||
59 | { | ||
60 | return tr( "Restart" ); | ||
61 | } | ||
62 | |||
63 | QString RestartApplet::text ( ) const | ||
64 | { | ||
65 | return tr( "Restart Opie" ); | ||
66 | } | ||
67 | |||
68 | QIconSet 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 | |||
78 | QPopupMenu *RestartApplet::popup ( QWidget * ) const | ||
79 | { | ||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | void RestartApplet::activated ( ) | ||
84 | { | ||
85 | QCopEnvelope e("QPE/System", "restart()"); | ||
86 | } | ||
87 | |||
88 | |||
89 | QRESULT 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 | |||
102 | Q_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 | |||
15 | class RestartApplet : public QObject, public MenuAppletInterface | ||
16 | { | ||
17 | public: | ||
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 | |||
33 | private: | ||
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 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on release | ||
3 | HEADERS = restart.h | ||
4 | SOURCES = restart.cpp | ||
5 | TARGET = restartapplet | ||
6 | DESTDIR = $(OPIEDIR)/plugins/applets | ||
7 | INCLUDEPATH += $(OPIEDIR)/include | ||
8 | DEPENDPATH += $(OPIEDIR)/include | ||
9 | LIBS += -lqpe | ||
10 | VERSION = 1.0.0 | ||
11 | MOC_DIR=opieobj | ||
12 | OBJECTS_DIR=opieobj | ||