Diffstat (limited to 'core/applets/logoutapplet/logout.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/logoutapplet/logout.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/applets/logoutapplet/logout.cpp b/core/applets/logoutapplet/logout.cpp index 0f36f16..dc0c67c 100644 --- a/core/applets/logoutapplet/logout.cpp +++ b/core/applets/logoutapplet/logout.cpp | |||
@@ -1,76 +1,73 @@ | |||
1 | #include "logout.h" | 1 | #include "logout.h" |
2 | 2 | ||
3 | #include <opie2/oresource.h> | ||
4 | |||
3 | #include <qpe/applnk.h> | 5 | #include <qpe/applnk.h> |
4 | #include <qpe/resource.h> | ||
5 | #include <qpe/qcopenvelope_qws.h> | 6 | #include <qpe/qcopenvelope_qws.h> |
6 | 7 | ||
7 | #include <qapplication.h> | 8 | #include <qapplication.h> |
8 | #include <qmessagebox.h> | 9 | #include <qmessagebox.h> |
9 | 10 | ||
10 | #include <unistd.h> | 11 | #include <unistd.h> |
11 | 12 | ||
12 | LogoutApplet::LogoutApplet ( ) | 13 | LogoutApplet::LogoutApplet ( ) |
13 | : QObject ( 0, "LogoutApplet" ) | 14 | : QObject ( 0, "LogoutApplet" ) |
14 | { | 15 | { |
15 | } | 16 | } |
16 | 17 | ||
17 | LogoutApplet::~LogoutApplet ( ) | 18 | LogoutApplet::~LogoutApplet ( ) |
18 | { | 19 | { |
19 | } | 20 | } |
20 | 21 | ||
21 | int LogoutApplet::position ( ) const | 22 | int LogoutApplet::position ( ) const |
22 | { | 23 | { |
23 | return 0; | 24 | return 0; |
24 | } | 25 | } |
25 | 26 | ||
26 | QString LogoutApplet::name ( ) const | 27 | QString LogoutApplet::name ( ) const |
27 | { | 28 | { |
28 | return tr( "Logout shortcut" ); | 29 | return tr( "Logout shortcut" ); |
29 | } | 30 | } |
30 | 31 | ||
31 | QString LogoutApplet::text ( ) const | 32 | QString LogoutApplet::text ( ) const |
32 | { | 33 | { |
33 | return tr( "Logout" ); | 34 | return tr( "Logout" ); |
34 | } | 35 | } |
35 | 36 | ||
36 | QString LogoutApplet::tr( const char* s ) const | 37 | QString LogoutApplet::tr( const char* s ) const |
37 | { | 38 | { |
38 | return qApp->translate( "LogoutApplet", s, 0 ); | 39 | return qApp->translate( "LogoutApplet", s, 0 ); |
39 | } | 40 | } |
40 | 41 | ||
41 | QString LogoutApplet::tr( const char* s, const char* p ) const | 42 | QString LogoutApplet::tr( const char* s, const char* p ) const |
42 | { | 43 | { |
43 | return qApp->translate( "LogoutApplet", s, p ); | 44 | return qApp->translate( "LogoutApplet", s, p ); |
44 | } | 45 | } |
45 | 46 | ||
46 | QIconSet LogoutApplet::icon ( ) const | 47 | QIconSet LogoutApplet::icon ( ) const |
47 | { | 48 | { |
48 | QPixmap pix; | 49 | QPixmap pix = Opie::Core::OResource::loadPixmap("logout", Opie::Core::OResource::SmallIcon ); |
49 | QImage img = Resource::loadImage ( "logout" ); | ||
50 | |||
51 | if ( !img. isNull ( )) | ||
52 | pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
53 | return pix; | 50 | return pix; |
54 | } | 51 | } |
55 | 52 | ||
56 | QPopupMenu *LogoutApplet::popup ( QWidget * ) const | 53 | QPopupMenu *LogoutApplet::popup ( QWidget * ) const |
57 | { | 54 | { |
58 | return 0; | 55 | return 0; |
59 | } | 56 | } |
60 | 57 | ||
61 | // This is a workaround for a Qt bug | 58 | // This is a workaround for a Qt bug |
62 | // clipboard applet has to stop its poll timer, or Qt/E | 59 | // clipboard applet has to stop its poll timer, or Qt/E |
63 | // will hang on quit() right before it emits aboutToQuit() | 60 | // will hang on quit() right before it emits aboutToQuit() |
64 | 61 | ||
65 | class HackApplication : public QApplication { | 62 | class HackApplication : public QApplication { |
66 | public: | 63 | public: |
67 | HackApplication ( ) : QApplication ( dummy, 0 ) | 64 | HackApplication ( ) : QApplication ( dummy, 0 ) |
68 | { | 65 | { |
69 | } | 66 | } |
70 | 67 | ||
71 | void emit_about_to_quit ( ) | 68 | void emit_about_to_quit ( ) |
72 | { | 69 | { |
73 | emit aboutToQuit ( ); | 70 | emit aboutToQuit ( ); |
74 | } | 71 | } |
75 | 72 | ||
76 | int dummy; | 73 | int dummy; |