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 /core/applets/restartapplet2/restart.cpp | |
parent | 52e4c4a45922c9344c3db7e0a433be66a75d00e0 (diff) | |
download | opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.zip opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.tar.gz opie-4ad1fa6d01c9de96d309cd662e658bcb1bb899a5.tar.bz2 |
add new restart applet- for opie menu
Diffstat (limited to 'core/applets/restartapplet2/restart.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/restartapplet2/restart.cpp | 107 |
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 */ | ||
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 | |||