author | llornkcor <llornkcor> | 2002-07-24 17:24:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-24 17:24:49 (UTC) |
commit | 2d9c74a4995a949378b36469ae5c6ab77963bead (patch) (unidiff) | |
tree | 2c304cddd6eeaee35d887d2fc9e52241c24abcf5 /core/applets/restartapplet/restart.cpp | |
parent | 9e126f7ed2f73b26ef440c1cc54d0dc0e6308f68 (diff) | |
download | opie-2d9c74a4995a949378b36469ae5c6ab77963bead.zip opie-2d9c74a4995a949378b36469ae5c6ab77963bead.tar.gz opie-2d9c74a4995a949378b36469ae5c6ab77963bead.tar.bz2 |
simple developers tool for a taskbar icon to restart opie
Diffstat (limited to 'core/applets/restartapplet/restart.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/restartapplet/restart.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/core/applets/restartapplet/restart.cpp b/core/applets/restartapplet/restart.cpp new file mode 100644 index 0000000..9ecba04 --- a/dev/null +++ b/core/applets/restartapplet/restart.cpp | |||
@@ -0,0 +1,77 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com | ||
3 | ** All rights reserved. | ||
4 | ** | ||
5 | ** This file may be distributed and/or modified under the terms of the | ||
6 | ** GNU General Public License version 2 as published by the Free Software | ||
7 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
8 | ** packaging of this file. | ||
9 | ** | ||
10 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
11 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
12 | ** | ||
13 | **********************************************************************/ | ||
14 | |||
15 | #include "restart.h" | ||
16 | |||
17 | #include <qpe/resource.h> | ||
18 | #include <qpe/qpeapplication.h> | ||
19 | |||
20 | #include <qpe/qcopenvelope_qws.h> | ||
21 | #include <qpe/resource.h> | ||
22 | #include <qpainter.h> | ||
23 | #include <qpixmap.h> | ||
24 | #include <qdatastream.h> | ||
25 | |||
26 | |||
27 | /* XPM */ | ||
28 | static char *restart_xpm[] = { | ||
29 | "16 16 11 1", | ||
30 | " c None", | ||
31 | ". c #000000", | ||
32 | "+ c #DCDCDC", | ||
33 | "@ c #A0A0A0", | ||
34 | "# c #C3C3C3", | ||
35 | "$ c #808080", | ||
36 | "% c #FFA858", | ||
37 | "& c #FFDCA8", | ||
38 | "* c #FFFFC0", | ||
39 | "= c #FFFFFF", | ||
40 | "- c #585858", | ||
41 | " .. ", | ||
42 | " .. .++. .. ", | ||
43 | " .+@.@##@.@+. ", | ||
44 | " .@+$@%%@$+@. ", | ||
45 | " .$%%&%&%$. ", | ||
46 | " ..+@%&$$%&@+.. ", | ||
47 | ".+#@%&%@@&*%@#+.", | ||
48 | ".$@+$&*&&=*$+@$.", | ||
49 | " .--+$&*=&$+--. ", | ||
50 | " .$#++$$++#$. ", | ||
51 | " .@=$-$++$-$=@. ", | ||
52 | " .+@-..@@..-@+. ", | ||
53 | " ... .+=. ... ", | ||
54 | " .-$. ", | ||
55 | " .. ", | ||
56 | " "}; | ||
57 | RestartApplet::RestartApplet( QWidget *parent, const char *name ) | ||
58 | : QWidget( parent, name ) { | ||
59 | setFixedHeight( 18 ); | ||
60 | setFixedWidth( 16 ); | ||
61 | qDebug("new restartapplet"); | ||
62 | show(); | ||
63 | } | ||
64 | |||
65 | RestartApplet::~RestartApplet() { | ||
66 | } | ||
67 | |||
68 | void RestartApplet::mousePressEvent( QMouseEvent *) { | ||
69 | QCopEnvelope e("QPE/System", "restart()"); | ||
70 | } | ||
71 | |||
72 | void RestartApplet::paintEvent( QPaintEvent* ) { | ||
73 | QPainter p(this); | ||
74 | qDebug("paint RESTART pixmap"); | ||
75 | p.drawPixmap( 0, 1, ( const char** ) restart_xpm ); | ||
76 | } | ||
77 | |||