summaryrefslogtreecommitdiff
path: root/core/applets/restartapplet2/restart.cpp
Unidiff
Diffstat (limited to 'core/applets/restartapplet2/restart.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/restartapplet2/restart.cpp107
1 files changed, 107 insertions, 0 deletions
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