Diffstat (limited to 'core/applets/logoutapplet/logout.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/logoutapplet/logout.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/applets/logoutapplet/logout.cpp b/core/applets/logoutapplet/logout.cpp index 9470401..1769ae6 100644 --- a/core/applets/logoutapplet/logout.cpp +++ b/core/applets/logoutapplet/logout.cpp | |||
@@ -14,48 +14,58 @@ | |||
14 | LogoutApplet::LogoutApplet ( ) | 14 | LogoutApplet::LogoutApplet ( ) |
15 | : QObject ( 0, "LogoutApplet" ), ref ( 0 ) | 15 | : QObject ( 0, "LogoutApplet" ), ref ( 0 ) |
16 | { | 16 | { |
17 | } | 17 | } |
18 | 18 | ||
19 | LogoutApplet::~LogoutApplet ( ) | 19 | LogoutApplet::~LogoutApplet ( ) |
20 | { | 20 | { |
21 | } | 21 | } |
22 | 22 | ||
23 | int LogoutApplet::position ( ) const | 23 | int LogoutApplet::position ( ) const |
24 | { | 24 | { |
25 | return 0; | 25 | return 0; |
26 | } | 26 | } |
27 | 27 | ||
28 | QString LogoutApplet::name ( ) const | 28 | QString LogoutApplet::name ( ) const |
29 | { | 29 | { |
30 | return tr( "Logout shortcut" ); | 30 | return tr( "Logout shortcut" ); |
31 | } | 31 | } |
32 | 32 | ||
33 | QString LogoutApplet::text ( ) const | 33 | QString LogoutApplet::text ( ) const |
34 | { | 34 | { |
35 | return tr( "Logout" ); | 35 | return tr( "Logout" ); |
36 | } | 36 | } |
37 | 37 | ||
38 | QString LogoutApplet::tr( const char* s ) const | ||
39 | { | ||
40 | return qApp->translate( "LogoutApplet", s, 0 ); | ||
41 | } | ||
42 | |||
43 | QString LogoutApplet::tr( const char* s, const char* p ) const | ||
44 | { | ||
45 | return qApp->translate( "LogoutApplet", s, p ); | ||
46 | } | ||
47 | |||
38 | QIconSet LogoutApplet::icon ( ) const | 48 | QIconSet LogoutApplet::icon ( ) const |
39 | { | 49 | { |
40 | QPixmap pix; | 50 | QPixmap pix; |
41 | QImage img = Resource::loadImage ( "logout" ); | 51 | QImage img = Resource::loadImage ( "logout" ); |
42 | 52 | ||
43 | if ( !img. isNull ( )) | 53 | if ( !img. isNull ( )) |
44 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); | 54 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); |
45 | return pix; | 55 | return pix; |
46 | } | 56 | } |
47 | 57 | ||
48 | QPopupMenu *LogoutApplet::popup ( QWidget * ) const | 58 | QPopupMenu *LogoutApplet::popup ( QWidget * ) const |
49 | { | 59 | { |
50 | return 0; | 60 | return 0; |
51 | } | 61 | } |
52 | 62 | ||
53 | // This is a workaround for a Qt bug | 63 | // This is a workaround for a Qt bug |
54 | // clipboard applet has to stop its poll timer, or Qt/E | 64 | // clipboard applet has to stop its poll timer, or Qt/E |
55 | // will hang on quit() right before it emits aboutToQuit() | 65 | // will hang on quit() right before it emits aboutToQuit() |
56 | 66 | ||
57 | class HackApplication : public QApplication { | 67 | class HackApplication : public QApplication { |
58 | public: | 68 | public: |
59 | HackApplication ( ) : QApplication ( dummy, 0 ) | 69 | HackApplication ( ) : QApplication ( dummy, 0 ) |
60 | { | 70 | { |
61 | } | 71 | } |
@@ -91,25 +101,24 @@ void LogoutApplet::activated ( ) | |||
91 | ((HackApplication *) qApp )-> emit_about_to_quit ( ); | 101 | ((HackApplication *) qApp )-> emit_about_to_quit ( ); |
92 | qApp-> quit(); | 102 | qApp-> quit(); |
93 | } | 103 | } |
94 | } | 104 | } |
95 | 105 | ||
96 | 106 | ||
97 | QRESULT LogoutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 107 | QRESULT LogoutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
98 | { | 108 | { |
99 | *iface = 0; | 109 | *iface = 0; |
100 | if ( uuid == IID_QUnknown ) | 110 | if ( uuid == IID_QUnknown ) |
101 | *iface = this; | 111 | *iface = this; |
102 | else if ( uuid == IID_MenuApplet ) | 112 | else if ( uuid == IID_MenuApplet ) |
103 | *iface = this; | 113 | *iface = this; |
104 | 114 | ||
105 | if ( *iface ) | 115 | if ( *iface ) |
106 | (*iface)-> addRef ( ); | 116 | (*iface)-> addRef ( ); |
107 | return QS_OK; | 117 | return QS_OK; |
108 | } | 118 | } |
109 | 119 | ||
110 | Q_EXPORT_INTERFACE( ) | 120 | Q_EXPORT_INTERFACE( ) |
111 | { | 121 | { |
112 | Q_CREATE_INSTANCE( LogoutApplet ) | 122 | Q_CREATE_INSTANCE( LogoutApplet ) |
113 | } | 123 | } |
114 | 124 | ||
115 | |||