summaryrefslogtreecommitdiff
path: root/core/applets/logoutapplet
authormickeyl <mickeyl>2005-04-01 23:30:07 (UTC)
committer mickeyl <mickeyl>2005-04-01 23:30:07 (UTC)
commit8a1c307f9dfc26a31d42f29f29a5b1c048b99102 (patch) (unidiff)
tree8e8925baf6a77e01379264afb540f33a3c07bec7 /core/applets/logoutapplet
parent88cc0cc17864de6e36bdeedaae6df0a5cc738c5a (diff)
downloadopie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.zip
opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.gz
opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.bz2
scale O-Menu-Applet pixmaps according to AppLnk::smallIconSize
Diffstat (limited to 'core/applets/logoutapplet') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/logoutapplet/logout.cpp8
-rw-r--r--core/applets/logoutapplet/logout.h1
2 files changed, 5 insertions, 4 deletions
diff --git a/core/applets/logoutapplet/logout.cpp b/core/applets/logoutapplet/logout.cpp
index 0ac0067..0f36f16 100644
--- a/core/applets/logoutapplet/logout.cpp
+++ b/core/applets/logoutapplet/logout.cpp
@@ -1,76 +1,76 @@
1#include "logout.h"
2
3#include <qpe/applnk.h>
1#include <qpe/resource.h> 4#include <qpe/resource.h>
2#include <qpe/qcopenvelope_qws.h> 5#include <qpe/qcopenvelope_qws.h>
3 6
4#include <qapplication.h> 7#include <qapplication.h>
5#include <qmessagebox.h> 8#include <qmessagebox.h>
6 9
7#include <unistd.h> 10#include <unistd.h>
8 11
9#include "logout.h"
10
11
12LogoutApplet::LogoutApplet ( ) 12LogoutApplet::LogoutApplet ( )
13 : QObject ( 0, "LogoutApplet" ) 13 : QObject ( 0, "LogoutApplet" )
14{ 14{
15} 15}
16 16
17LogoutApplet::~LogoutApplet ( ) 17LogoutApplet::~LogoutApplet ( )
18{ 18{
19} 19}
20 20
21int LogoutApplet::position ( ) const 21int LogoutApplet::position ( ) const
22{ 22{
23 return 0; 23 return 0;
24} 24}
25 25
26QString LogoutApplet::name ( ) const 26QString LogoutApplet::name ( ) const
27{ 27{
28 return tr( "Logout shortcut" ); 28 return tr( "Logout shortcut" );
29} 29}
30 30
31QString LogoutApplet::text ( ) const 31QString LogoutApplet::text ( ) const
32{ 32{
33 return tr( "Logout" ); 33 return tr( "Logout" );
34} 34}
35 35
36QString LogoutApplet::tr( const char* s ) const 36QString LogoutApplet::tr( const char* s ) const
37{ 37{
38 return qApp->translate( "LogoutApplet", s, 0 ); 38 return qApp->translate( "LogoutApplet", s, 0 );
39} 39}
40 40
41QString LogoutApplet::tr( const char* s, const char* p ) const 41QString LogoutApplet::tr( const char* s, const char* p ) const
42{ 42{
43 return qApp->translate( "LogoutApplet", s, p ); 43 return qApp->translate( "LogoutApplet", s, p );
44} 44}
45 45
46QIconSet LogoutApplet::icon ( ) const 46QIconSet LogoutApplet::icon ( ) const
47{ 47{
48 QPixmap pix; 48 QPixmap pix;
49 QImage img = Resource::loadImage ( "logout" ); 49 QImage img = Resource::loadImage ( "logout" );
50 50
51 if ( !img. isNull ( )) 51 if ( !img. isNull ( ))
52 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 52 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
53 return pix; 53 return pix;
54} 54}
55 55
56QPopupMenu *LogoutApplet::popup ( QWidget * ) const 56QPopupMenu *LogoutApplet::popup ( QWidget * ) const
57{ 57{
58 return 0; 58 return 0;
59} 59}
60 60
61// This is a workaround for a Qt bug 61// This is a workaround for a Qt bug
62// clipboard applet has to stop its poll timer, or Qt/E 62// clipboard applet has to stop its poll timer, or Qt/E
63// will hang on quit() right before it emits aboutToQuit() 63// will hang on quit() right before it emits aboutToQuit()
64 64
65class HackApplication : public QApplication { 65class HackApplication : public QApplication {
66public: 66public:
67 HackApplication ( ) : QApplication ( dummy, 0 ) 67 HackApplication ( ) : QApplication ( dummy, 0 )
68 { 68 {
69 } 69 }
70 70
71 void emit_about_to_quit ( ) 71 void emit_about_to_quit ( )
72 { 72 {
73 emit aboutToQuit ( ); 73 emit aboutToQuit ( );
74 } 74 }
75 75
76 int dummy; 76 int dummy;
diff --git a/core/applets/logoutapplet/logout.h b/core/applets/logoutapplet/logout.h
index a991f65..3c17278 100644
--- a/core/applets/logoutapplet/logout.h
+++ b/core/applets/logoutapplet/logout.h
@@ -1,47 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef __OPIE_LOGOUT_APPLET_H__ 20#ifndef __OPIE_LOGOUT_APPLET_H__
21#define __OPIE_LOGOUT_APPLET_H__ 21#define __OPIE_LOGOUT_APPLET_H__
22 22
23#include <qpe/menuappletinterface.h> 23#include <qpe/menuappletinterface.h>
24#include <qobject.h>
24 25
25class LogoutApplet : public QObject, public MenuAppletInterface 26class LogoutApplet : public QObject, public MenuAppletInterface
26{ 27{
27public: 28public:
28 LogoutApplet ( ); 29 LogoutApplet ( );
29 virtual ~LogoutApplet ( ); 30 virtual ~LogoutApplet ( );
30 31
31 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 32 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
32 Q_REFCOUNT 33 Q_REFCOUNT
33 34
34 virtual int position() const; 35 virtual int position() const;
35 36
36 virtual QString name ( ) const; 37 virtual QString name ( ) const;
37 virtual QIconSet icon ( ) const; 38 virtual QIconSet icon ( ) const;
38 virtual QString text ( ) const; 39 virtual QString text ( ) const;
39 virtual QString tr( const char* ) const; 40 virtual QString tr( const char* ) const;
40 virtual QString tr( const char*, const char* ) const; 41 virtual QString tr( const char*, const char* ) const;
41 virtual QPopupMenu *popup ( QWidget *parent ) const; 42 virtual QPopupMenu *popup ( QWidget *parent ) const;
42 43
43 virtual void activated ( ); 44 virtual void activated ( );
44 45
45}; 46};
46 47
47#endif 48#endif