summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-04-01 23:30:07 (UTC)
committer mickeyl <mickeyl>2005-04-01 23:30:07 (UTC)
commit8a1c307f9dfc26a31d42f29f29a5b1c048b99102 (patch) (unidiff)
tree8e8925baf6a77e01379264afb540f33a3c07bec7
parent88cc0cc17864de6e36bdeedaae6df0a5cc738c5a (diff)
downloadopie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.zip
opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.gz
opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.bz2
scale O-Menu-Applet pixmaps according to AppLnk::smallIconSize
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog3
-rw-r--r--core/applets/aboutapplet/about.cpp7
-rw-r--r--core/applets/homeapplet/home.cpp8
-rw-r--r--core/applets/homeapplet/home.h1
-rw-r--r--core/applets/logoutapplet/logout.cpp8
-rw-r--r--core/applets/logoutapplet/logout.h1
-rw-r--r--core/applets/restartapplet2/restart.cpp11
-rw-r--r--core/applets/rotateapplet/rotate.cpp6
-rw-r--r--core/applets/suspendapplet/suspend.cpp8
-rw-r--r--core/applets/suspendapplet/suspend.h1
-rw-r--r--core/applets/vtapplet/vt.cpp3
11 files changed, 30 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index 378ebf8..967e68a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,62 +1,63 @@
1 2005-??-??Opie 1.2.1 1 2005-??-??Opie 1.2.1
2 2
3 Fixed Bugs 3 Fixed Bugs
4 ---------- 4 ----------
5 * n.a.- scale O-Menu-Applets appropriately (mickeyl)
5 6
6 2005-03-25Opie 1.2.0 7 2005-03-25Opie 1.2.0
7 8
8 Fixed Bugs 9 Fixed Bugs
9 ---------- 10 ----------
10 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw) 11 * #1613 - AdvancedFM - scale toolbar icons appropriately (drw)
11 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin) 12 * #1620 - OFileSelector - show the button on press and not on press on hold (alwin)
12 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke) 13 * #1473 - Opie-Eye - Same as #1620 but we lack a common FileSystem Button class (zecke)
13 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw) 14 * n.a. - PackageManager - fix bug where messages show up multiple times in install dialog (drw)
14 * n.a - make qpeglobal.h include qglobal.h (zecke) 15 * n.a. - make qpeglobal.h include qglobal.h (zecke)
15 16
16 2005-03-20Opie 1.2.0-rc1 17 2005-03-20Opie 1.2.0-rc1
17 18
18 19
19 New Features 20 New Features
20 ------------ 21 ------------
21 * Launcher: Support a static background pixmap (mickeyl) 22 * Launcher: Support a static background pixmap (mickeyl)
22 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl) 23 * LauncherSettings: Choose whether to have a static background pixmap (mickeyl)
23 * PackageManager supports the 'lists_dir' ipkg configuration option (drw) 24 * PackageManager supports the 'lists_dir' ipkg configuration option (drw)
24 * Added hi-res inline images for large resolution devices (drw) 25 * Added hi-res inline images for large resolution devices (drw)
25 * Improved launcher icons for consistency (ar) 26 * Improved launcher icons for consistency (ar)
26 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin) 27 * Datebook: Added plugin system to datebook so holidays and birthdays from contacts may displayed in datebook (alwin)
27 28
28 Fixed Bugs 29 Fixed Bugs
29 ---------- 30 ----------
30 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers) 31 * #1236 - VCards contained empty home and work address entries causing Palms to crash (eilers)
31 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw) 32 * #1412 - Launcher Settings - fixed default settings for background in Edit tab dialog (drw)
32 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp) 33 * #1472 - Opie textedit now check for unsaved changes on ESC key (ljp)
33 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke) 34 * #1474 - Implement GUI for Scrollbars on the Left in Appearance (zecke)
34 * #1482 - Fix double '/' in paths (zecke) 35 * #1482 - Fix double '/' in paths (zecke)
35 * #1536 - Autosave of custom locations in opie backup (ar) 36 * #1536 - Autosave of custom locations in opie backup (ar)
36 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke) 37 * #1539 - Fixed displaying too long path in the delete dialog in opie-eye (zecke)
37 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke) 38 * #1540 - Implemented deletion of DocLnks in opie-eye (zecke)
38 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw) 39 * #1542 - Fixed Todo crash when priority < 1 or > 5 (drw)
39 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke) 40 * #1550 - Browse for alarm sound start in QPEDIR/sounds/ (zecke)
40 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl) 41 * #1554 - Fixed Opie-Console name in .desktop file (mickeyl)
41 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke) 42 * #1556 - Start to look for sound files in /opt/QtPalmtop/sounds (zecke)
42 * #1558 - Fixed opie-login breaking opie startup (mickeyl) 43 * #1558 - Fixed opie-login breaking opie startup (mickeyl)
43 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning) 44 * #1560 - Fixed Opie-Console picking up the wrong shell (bluelightning)
44 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar) 45 * #1570 - Confirmation needed befor Restore a backup and overwrite local data (ar)
45 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers) 46 * #1591 - Addressbook sortorder changed by clicking on column 0 (eilers)
46 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints) 47 * #1599 - Security - change recommendation for opie-multiauth to opie-securityplugin (gints)
47 * #1604 - Checkbook crashed on startup (drw) 48 * #1604 - Checkbook crashed on startup (drw)
48 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers) 49 * #1608 - Addressbook crashed after search, which may caused by not initialzed member variable (eilers)
49 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers) 50 * #1608 - QueryByExampe-Datediff on SQL database did not worked properly (eilers)
50 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw) 51 * n.a. - Netsystemtime - fixed UI to prevent error dialog from displaying when it shouldn't, get rid of some compiler warnings (drw)
51 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) 52 * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw)
52 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw) 53 * n.a. - PackageManager - fixed bug where lists_dir was not being honored at startup (drw)
53 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw) 54 * n.a. - PackageManager - provided default value for lists_dir when none is entered in configuration dialog (drw)
54 * n.a. - OTabWidget - fixed scroll buttons, fix display position of tabs (drw) 55 * n.a. - OTabWidget - fixed scroll buttons, fix display position of tabs (drw)
55 * n.a. - AddressBook - fixed sorting by 'File As' name (drw) 56 * n.a. - AddressBook - fixed sorting by 'File As' name (drw)
56 * n.a. - AddressBook - fixed category handling for 'All' and 'Unfiled' (eilers) 57 * n.a. - AddressBook - fixed category handling for 'All' and 'Unfiled' (eilers)
57 * n.a. - AddressBook - fixed letter picker record selection and sort records afterwards (drw) 58 * n.a. - AddressBook - fixed letter picker record selection and sort records afterwards (drw)
58 59
59 Internal 60 Internal
60 -------- 61 --------
61 * Worked around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl) 62 * Worked around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl)
62 * Killed the need for weak symbols in QtE (zecke) 63 * Killed the need for weak symbols in QtE (zecke)
diff --git a/core/applets/aboutapplet/about.cpp b/core/applets/aboutapplet/about.cpp
index 1dbd4c4..ec214f3 100644
--- a/core/applets/aboutapplet/about.cpp
+++ b/core/applets/aboutapplet/about.cpp
@@ -1,87 +1,88 @@
1#include "about.h" 1#include "about.h"
2#include "widget.h" 2#include "widget.h"
3 3
4#include <qpe/applnk.h>
4#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
5#include <qpe/resource.h> 6#include <qpe/resource.h>
6#include <qpe/qcopenvelope_qws.h> 7#include <qpe/qcopenvelope_qws.h>
7 8
8#include <qlabel.h> 9#include <qlabel.h>
9 10
10AboutApplet::AboutApplet ( ) 11AboutApplet::AboutApplet ( )
11 : QObject ( 0, "AboutApplet" ), m_ad( 0l ) 12 : QObject ( 0, "AboutApplet" ), m_ad( 0l )
12{} 13{}
13 14
14AboutApplet::~AboutApplet ( ) 15AboutApplet::~AboutApplet ( )
15{ 16{
16 delete m_ad; 17 delete m_ad;
17} 18}
18 19
19int AboutApplet::position ( ) const 20int AboutApplet::position ( ) const
20{ 21{
21 return 1; 22 return 1;
22} 23}
23 24
24QString AboutApplet::name ( ) const 25QString AboutApplet::name ( ) const
25{ 26{
26 return tr( "About shortcut" ); 27 return tr( "About shortcut" );
27} 28}
28 29
29QString AboutApplet::text ( ) const 30QString AboutApplet::text ( ) const
30{ 31{
31 return tr( "About" ); 32 return tr( "About" );
32} 33}
33 34
34QString AboutApplet::tr( const char* s ) const 35QString AboutApplet::tr( const char* s ) const
35{ 36{
36 return qApp->translate( "AboutApplet", s, 0 ); 37 return qApp->translate( "AboutApplet", s, 0 );
37} 38}
38 39
39QString AboutApplet::tr( const char* s, const char* p ) const 40QString AboutApplet::tr( const char* s, const char* p ) const
40{ 41{
41 return qApp->translate( "AboutApplet", s, p ); 42 return qApp->translate( "AboutApplet", s, p );
42} 43}
43 44
44QIconSet AboutApplet::icon ( ) const 45QIconSet AboutApplet::icon() const
45{ 46{
46 QPixmap pix; 47 QPixmap pix;
47 QImage img = Resource::loadImage ( "logo/opielogo" ); 48 QImage img = Resource::loadImage ( "logo/opielogo" );
48 49
49 if ( !img. isNull ( ) ) 50 if ( !img.isNull() )
50 pix. convertFromImage ( img. smoothScale ( 14, 14 ) ); 51 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
51 return pix; 52 return pix;
52} 53}
53 54
54QPopupMenu *AboutApplet::popup ( QWidget * ) const 55QPopupMenu *AboutApplet::popup ( QWidget * ) const
55{ 56{
56 return 0; 57 return 0;
57} 58}
58 59
59void AboutApplet::activated() 60void AboutApplet::activated()
60{ 61{
61 if ( !m_ad ) 62 if ( !m_ad )
62 m_ad = new AboutWidget( 0, "aboutDialog" ); 63 m_ad = new AboutWidget( 0, "aboutDialog" );
63 64
64 QPEApplication::showWidget( m_ad ); 65 QPEApplication::showWidget( m_ad );
65} 66}
66 67
67QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 68QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
68{ 69{
69 *iface = 0; 70 *iface = 0;
70 if ( uuid == IID_QUnknown ) 71 if ( uuid == IID_QUnknown )
71 * iface = this; 72 * iface = this;
72 else if ( uuid == IID_MenuApplet ) 73 else if ( uuid == IID_MenuApplet )
73 * iface = this; 74 * iface = this;
74 else 75 else
75 return QS_FALSE; 76 return QS_FALSE;
76 77
77 if ( *iface ) 78 if ( *iface )
78 ( *iface ) -> addRef ( ); 79 ( *iface ) -> addRef ( );
79 return QS_OK; 80 return QS_OK;
80} 81}
81 82
82Q_EXPORT_INTERFACE( ) 83Q_EXPORT_INTERFACE( )
83{ 84{
84 Q_CREATE_INSTANCE( AboutApplet ) 85 Q_CREATE_INSTANCE( AboutApplet )
85} 86}
86 87
87 88
diff --git a/core/applets/homeapplet/home.cpp b/core/applets/homeapplet/home.cpp
index 8a930be..02d1265 100644
--- a/core/applets/homeapplet/home.cpp
+++ b/core/applets/homeapplet/home.cpp
@@ -1,85 +1,85 @@
1#include "home.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 8
6#include "home.h"
7
8
9HomeApplet::HomeApplet ( ) 9HomeApplet::HomeApplet ( )
10 : QObject ( 0, "HomeApplet" ) 10 : QObject ( 0, "HomeApplet" )
11{ 11{
12} 12}
13 13
14HomeApplet::~HomeApplet ( ) 14HomeApplet::~HomeApplet ( )
15{ 15{
16} 16}
17 17
18int HomeApplet::position ( ) const 18int HomeApplet::position ( ) const
19{ 19{
20 return 4; 20 return 4;
21} 21}
22 22
23QString HomeApplet::name ( ) const 23QString HomeApplet::name ( ) const
24{ 24{
25 return tr( "Home shortcut" ); 25 return tr( "Home shortcut" );
26} 26}
27 27
28QString HomeApplet::text ( ) const 28QString HomeApplet::text ( ) const
29{ 29{
30 return tr( "Desktop" ); 30 return tr( "Desktop" );
31} 31}
32 32
33QString HomeApplet::tr( const char* s ) const 33QString HomeApplet::tr( const char* s ) const
34{ 34{
35 return qApp->translate( "HomeApplet", s, 0 ); 35 return qApp->translate( "HomeApplet", s, 0 );
36} 36}
37 37
38QString HomeApplet::tr( const char* s, const char* p ) const 38QString HomeApplet::tr( const char* s, const char* p ) const
39{ 39{
40 return qApp->translate( "HomeApplet", s, p ); 40 return qApp->translate( "HomeApplet", s, p );
41} 41}
42 42
43QIconSet HomeApplet::icon ( ) const 43QIconSet HomeApplet::icon ( ) const
44{ 44{
45 QPixmap pix; 45 QPixmap pix;
46 QImage img = Resource::loadImage ( "home" ); 46 QImage img = Resource::loadImage ( "home" );
47 47
48 if ( !img. isNull ( )) 48 if ( !img. isNull ( ))
49 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 49 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
50 return pix; 50 return pix;
51} 51}
52 52
53QPopupMenu *HomeApplet::popup ( QWidget * ) const 53QPopupMenu *HomeApplet::popup ( QWidget * ) const
54{ 54{
55 return 0; 55 return 0;
56} 56}
57 57
58void HomeApplet::activated ( ) 58void HomeApplet::activated ( )
59{ 59{
60 // to desktop (home) 60 // to desktop (home)
61 QCopEnvelope ( "QPE/Application/qpe", "raise()" ); 61 QCopEnvelope ( "QPE/Application/qpe", "raise()" );
62} 62}
63 63
64 64
65QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 65QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
66{ 66{
67 *iface = 0; 67 *iface = 0;
68 if ( uuid == IID_QUnknown ) 68 if ( uuid == IID_QUnknown )
69 *iface = this; 69 *iface = this;
70 else if ( uuid == IID_MenuApplet ) 70 else if ( uuid == IID_MenuApplet )
71 *iface = this; 71 *iface = this;
72 else 72 else
73 return QS_FALSE; 73 return QS_FALSE;
74 74
75 if ( *iface ) 75 if ( *iface )
76 (*iface)-> addRef ( ); 76 (*iface)-> addRef ( );
77 return QS_OK; 77 return QS_OK;
78} 78}
79 79
80Q_EXPORT_INTERFACE( ) 80Q_EXPORT_INTERFACE( )
81{ 81{
82 Q_CREATE_INSTANCE( HomeApplet ) 82 Q_CREATE_INSTANCE( HomeApplet )
83} 83}
84 84
85 85
diff --git a/core/applets/homeapplet/home.h b/core/applets/homeapplet/home.h
index 22ecd47..7f1f006 100644
--- a/core/applets/homeapplet/home.h
+++ b/core/applets/homeapplet/home.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_HOME_APPLET_H__ 20#ifndef __OPIE_HOME_APPLET_H__
21#define __OPIE_HOME_APPLET_H__ 21#define __OPIE_HOME_APPLET_H__
22 22
23#include <qpe/menuappletinterface.h> 23#include <qpe/menuappletinterface.h>
24#include <qobject.h>
24 25
25class HomeApplet : public QObject, public MenuAppletInterface 26class HomeApplet : public QObject, public MenuAppletInterface
26{ 27{
27public: 28public:
28 HomeApplet ( ); 29 HomeApplet ( );
29 virtual ~HomeApplet ( ); 30 virtual ~HomeApplet ( );
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
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,100 +1,100 @@
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;
77}; 77};
78 78
79 79
80void LogoutApplet::activated ( ) 80void LogoutApplet::activated ( )
81{ 81{
82 QMessageBox mb ( tr( "Logout" ), 82 QMessageBox mb ( tr( "Logout" ),
83 tr( "Do you really want to\nend this session ?" ), 83 tr( "Do you really want to\nend this session ?" ),
84 QMessageBox::NoIcon, 84 QMessageBox::NoIcon,
85 QMessageBox::Yes | QMessageBox::Default, 85 QMessageBox::Yes | QMessageBox::Default,
86 QMessageBox::No | QMessageBox::Escape, 86 QMessageBox::No | QMessageBox::Escape,
87 QMessageBox::NoButton ); 87 QMessageBox::NoButton );
88 88
89 mb. setButtonText ( QMessageBox::Yes, "Yes" ); 89 mb. setButtonText ( QMessageBox::Yes, "Yes" );
90 mb. setButtonText ( QMessageBox::No, "No" ); 90 mb. setButtonText ( QMessageBox::No, "No" );
91 mb. setIconPixmap ( icon ( ). pixmap ( )); 91 mb. setIconPixmap ( icon ( ). pixmap ( ));
92 92
93 if ( mb. exec ( ) == QMessageBox::Yes ) { 93 if ( mb. exec ( ) == QMessageBox::Yes ) {
94 { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); } 94 { QCopEnvelope envelope( "QPE/System", "forceQuit()" ); }
95 95
96 qApp-> processEvents ( ); // ensure the message goes out. 96 qApp-> processEvents ( ); // ensure the message goes out.
97 sleep ( 1 ); // You have 1 second to comply. 97 sleep ( 1 ); // You have 1 second to comply.
98 98
99 ((HackApplication *) qApp )-> emit_about_to_quit ( ); 99 ((HackApplication *) qApp )-> emit_about_to_quit ( );
100 qApp-> quit(); 100 qApp-> quit();
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
diff --git a/core/applets/restartapplet2/restart.cpp b/core/applets/restartapplet2/restart.cpp
index a169505..eda0005 100644
--- a/core/applets/restartapplet2/restart.cpp
+++ b/core/applets/restartapplet2/restart.cpp
@@ -1,109 +1,106 @@
1// coptright Mon 10-21-2002 01:14:03 by L. Potter <ljp@llornkcor.com> 1// coptright Mon 10-21-2002 01:14:03 by L. Potter <ljp@llornkcor.com>
2 2
3#include "restart.h"
4
5#include <qpe/applnk.h>
3#include <qpe/qpeapplication.h> 6#include <qpe/qpeapplication.h>
4#include <qpe/resource.h> 7#include <qpe/resource.h>
5#include <qpe/qcopenvelope_qws.h> 8#include <qpe/qcopenvelope_qws.h>
6 9
7#include "restart.h"
8
9// #include <stdlib.h>
10// #include <unistd.h>
11// #include <sys/stat.h>
12//#include <dirent.h>
13/* XPM */ 10/* XPM */
14static char *restart_xpm[] = { 11static char *restart_xpm[] = {
15"16 16 11 1", 12"16 16 11 1",
16" c None", 13" c None",
17". c #000000", 14". c #000000",
18"+ c #DCDCDC", 15"+ c #DCDCDC",
19"@ c #A0A0A0", 16"@ c #A0A0A0",
20"# c #C3C3C3", 17"# c #C3C3C3",
21"$ c #808080", 18"$ c #808080",
22"% c #FFA858", 19"% c #FFA858",
23"& c #FFDCA8", 20"& c #FFDCA8",
24"* c #FFFFC0", 21"* c #FFFFC0",
25"= c #FFFFFF", 22"= c #FFFFFF",
26"- c #585858", 23"- c #585858",
27" .. ", 24" .. ",
28" .. .++. .. ", 25" .. .++. .. ",
29" .+@.@##@.@+. ", 26" .+@.@##@.@+. ",
30" .@+$@%%@$+@. ", 27" .@+$@%%@$+@. ",
31" .$%%&%&%$. ", 28" .$%%&%&%$. ",
32" ..+@%&$$%&@+.. ", 29" ..+@%&$$%&@+.. ",
33".+#@%&%@@&*%@#+.", 30".+#@%&%@@&*%@#+.",
34".$@+$&*&&=*$+@$.", 31".$@+$&*&&=*$+@$.",
35" .--+$&*=&$+--. ", 32" .--+$&*=&$+--. ",
36" .$#++$$++#$. ", 33" .$#++$$++#$. ",
37" .@=$-$++$-$=@. ", 34" .@=$-$++$-$=@. ",
38" .+@-..@@..-@+. ", 35" .+@-..@@..-@+. ",
39" ... .+=. ... ", 36" ... .+=. ... ",
40" .-$. ", 37" .-$. ",
41" .. ", 38" .. ",
42" "}; 39" "};
43 40
44RestartApplet::RestartApplet ( ) 41RestartApplet::RestartApplet ( )
45 : QObject ( 0, "RestartApplet" ) 42 : QObject ( 0, "RestartApplet" )
46{ 43{
47} 44}
48 45
49RestartApplet::~RestartApplet ( ) 46RestartApplet::~RestartApplet ( )
50{ 47{
51} 48}
52 49
53int RestartApplet::position ( ) const 50int RestartApplet::position ( ) const
54{ 51{
55 return 4; 52 return 4;
56} 53}
57 54
58QString RestartApplet::name ( ) const 55QString RestartApplet::name ( ) const
59{ 56{
60 return tr( "Restart" ); 57 return tr( "Restart" );
61} 58}
62 59
63QString RestartApplet::text ( ) const 60QString RestartApplet::text ( ) const
64{ 61{
65 return tr( "Restart Opie" ); 62 return tr( "Restart Opie" );
66} 63}
67 64
68QIconSet RestartApplet::icon ( ) const 65QIconSet RestartApplet::icon ( ) const
69{ 66{
70 QPixmap pix; 67 QPixmap pix;
71 QImage img = ( const char** ) restart_xpm ;//Resource::loadImage ( "Run" ); 68 QImage img = ( const char** ) restart_xpm ;//Resource::loadImage ( "Run" );
72 69
73 if ( !img. isNull ( )) 70 if ( !img. isNull ( ))
74 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 71 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
75 return pix; 72 return pix;
76} 73}
77 74
78QPopupMenu *RestartApplet::popup ( QWidget * ) const 75QPopupMenu *RestartApplet::popup ( QWidget * ) const
79{ 76{
80 return 0; 77 return 0;
81} 78}
82 79
83void RestartApplet::activated ( ) 80void RestartApplet::activated ( )
84{ 81{
85 QCopEnvelope e("QPE/System", "restart()"); 82 QCopEnvelope e("QPE/System", "restart()");
86} 83}
87 84
88 85
89QRESULT RestartApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 86QRESULT RestartApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
90{ 87{
91 *iface = 0; 88 *iface = 0;
92 if ( uuid == IID_QUnknown ) 89 if ( uuid == IID_QUnknown )
93 *iface = this; 90 *iface = this;
94 else if ( uuid == IID_MenuApplet ) 91 else if ( uuid == IID_MenuApplet )
95 *iface = this; 92 *iface = this;
96 else 93 else
97 return QS_FALSE; 94 return QS_FALSE;
98 95
99 if ( *iface ) 96 if ( *iface )
100 (*iface)-> addRef ( ); 97 (*iface)-> addRef ( );
101 return QS_OK; 98 return QS_OK;
102} 99}
103 100
104Q_EXPORT_INTERFACE( ) 101Q_EXPORT_INTERFACE( )
105{ 102{
106 Q_CREATE_INSTANCE( RestartApplet ) 103 Q_CREATE_INSTANCE( RestartApplet )
107} 104}
108 105
109 106
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index f23423d..d13c2c0 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -1,91 +1,91 @@
1/* 1/*
2 This file is part of the OPIE Project 2 This file is part of the OPIE Project
3 Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> 3 Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
4 Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net> 4 Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net>
5� � � � � � � �=. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de> 5� � � � � � � �=. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de>
6� � � � � � �.=l. 6� � � � � � �.=l.
7� � � � � �.>+-= 7� � � � � �.>+-=
8�_;:, � � .> � �:=|. This library is free software; you can 8�_;:, � � .> � �:=|. This library is free software; you can
9.> <, � > �. � <= redistribute it and/or modify it under 9.> <, � > �. � <= redistribute it and/or modify it under
10:=1 )Y*s>-.-- � : the terms of the GNU Library General Public 10:=1 )Y*s>-.-- � : the terms of the GNU Library General Public
11.="- .-=="i, � � .._ License as published by the Free Software 11.="- .-=="i, � � .._ License as published by the Free Software
12�- . � .-<_> � � .<> Foundation; either version 2 of the License, 12�- . � .-<_> � � .<> Foundation; either version 2 of the License,
13� � �._= =} � � � : or (at your option) any later version. 13� � �._= =} � � � : or (at your option) any later version.
14� � .%+i> � � � _;_. 14� � .%+i> � � � _;_.
15� � .i_,=:_. � � �-<s. This library is distributed in the hope that 15� � .i_,=:_. � � �-<s. This library is distributed in the hope that
16� � �+ �. �-:. � � � = it will be useful, but WITHOUT ANY WARRANTY; 16� � �+ �. �-:. � � � = it will be useful, but WITHOUT ANY WARRANTY;
17� � : .. � �.:, � � . . . without even the implied warranty of 17� � : .. � �.:, � � . . . without even the implied warranty of
18� � =_ � � � �+ � � =;=| MERCHANTABILITY or FITNESS FOR A 18� � =_ � � � �+ � � =;=| MERCHANTABILITY or FITNESS FOR A
19� _.=:. � � � : � �:=>: PARTICULAR PURPOSE. See the GNU 19� _.=:. � � � : � �:=>: PARTICULAR PURPOSE. See the GNU
20..}^=.= � � � = � � � ; Library General Public License for more 20..}^=.= � � � = � � � ; Library General Public License for more
21++= � -. � � . � � .: details. 21++= � -. � � . � � .: details.
22�: � � = �...= . :.=- 22�: � � = �...= . :.=-
23�-. � .:....=;==+<; You should have received a copy of the GNU 23�-. � .:....=;==+<; You should have received a copy of the GNU
24� -_. . . � )=. �= Library General Public License along with 24� -_. . . � )=. �= Library General Public License along with
25� � -- � � � �:-= this library; see the file COPYING.LIB. 25� � -- � � � �:-= this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include "rotate.h" 31#include "rotate.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35#include <opie2/odevice.h> 35#include <opie2/odevice.h>
36#include <qpe/applnk.h>
36#include <qpe/config.h> 37#include <qpe/config.h>
37#include <qpe/power.h> 38#include <qpe/power.h>
38#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
39#include <qpe/resource.h> 40#include <qpe/resource.h>
40using namespace Opie::Core; 41using namespace Opie::Core;
41 42
42/* QT */ 43/* STD */
43
44#include <time.h> 44#include <time.h>
45 45
46RotateApplet::RotateApplet() 46RotateApplet::RotateApplet()
47 :QObject( 0, "RotateApplet" ), m_flipped( false ) 47 :QObject( 0, "RotateApplet" ), m_flipped( false )
48{ 48{
49 49
50#if !defined(QT_NO_COP) 50#if !defined(QT_NO_COP)
51 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); 51 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this );
52 connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ), 52 connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
53 this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); 53 this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
54#endif 54#endif
55 55
56} 56}
57 57
58RotateApplet::~RotateApplet ( ) 58RotateApplet::~RotateApplet ( )
59{} 59{}
60 60
61/** 61/**
62 * Qcop receive method. 62 * Qcop receive method.
63 */ 63 */
64void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) 64void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data )
65{ 65{
66 odebug << "RotateApplet::channelReceived( '" << msg << "' )" << oendl; 66 odebug << "RotateApplet::channelReceived( '" << msg << "' )" << oendl;
67 67
68 if ( ODevice::inst()->hasHingeSensor() ) 68 if ( ODevice::inst()->hasHingeSensor() )
69 { 69 {
70 struct timespec interval; 70 struct timespec interval;
71 struct timespec remain; 71 struct timespec remain;
72 interval.tv_sec = 0; 72 interval.tv_sec = 0;
73 interval.tv_nsec = 600000; 73 interval.tv_nsec = 600000;
74 ::nanosleep( &interval, &remain ); 74 ::nanosleep( &interval, &remain );
75 OHingeStatus status = ODevice::inst()->readHingeSensor(); 75 OHingeStatus status = ODevice::inst()->readHingeSensor();
76 odebug << "RotateApplet::readHingeSensor = " << (int) status << "" << oendl; 76 odebug << "RotateApplet::readHingeSensor = " << (int) status << "" << oendl;
77 77
78 Config cfg( "apm" ); 78 Config cfg( "apm" );
79 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); 79 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" );
80 int action = cfg.readNumEntry( "CloseHingeAction", 0 ); 80 int action = cfg.readNumEntry( "CloseHingeAction", 0 );
81 81
82 if ( status == CASE_CLOSED ) 82 if ( status == CASE_CLOSED )
83 { 83 {
84 switch ( action ) 84 switch ( action )
85 { 85 {
86 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break; 86 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break;
87 case 2: /* SUSPEND */ ODevice::inst()->suspend(); break; 87 case 2: /* SUSPEND */ ODevice::inst()->suspend(); break;
88 default: /* IGNORE */ break; 88 default: /* IGNORE */ break;
89 } 89 }
90 } 90 }
91 else /* status != CASE_CLOSED */ 91 else /* status != CASE_CLOSED */
@@ -97,97 +97,97 @@ void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data
97 default: /* IGNORE */ break; 97 default: /* IGNORE */ break;
98 } 98 }
99 } 99 }
100 odebug << "RotateApplet::switchAction " << cfg.readNumEntry( "CloseHingeAction" ) << " performed." << oendl; 100 odebug << "RotateApplet::switchAction " << cfg.readNumEntry( "CloseHingeAction" ) << " performed." << oendl;
101 } 101 }
102 102
103 QDataStream stream( data, IO_ReadOnly ); 103 QDataStream stream( data, IO_ReadOnly );
104 if ( msg == "flip()" ) 104 if ( msg == "flip()" )
105 { 105 {
106 activated ( ); 106 activated ( );
107 } 107 }
108 else if ( msg == "rotateDefault()") 108 else if ( msg == "rotateDefault()")
109 { 109 {
110 rotateDefault(); 110 rotateDefault();
111 } 111 }
112} 112}
113 113
114int RotateApplet::position() const 114int RotateApplet::position() const
115{ 115{
116 return 3; 116 return 3;
117} 117}
118 118
119QString RotateApplet::name() const 119QString RotateApplet::name() const
120{ 120{
121 return tr( "Rotate shortcut" ); 121 return tr( "Rotate shortcut" );
122} 122}
123 123
124QString RotateApplet::text() const 124QString RotateApplet::text() const
125{ 125{
126 return tr( "Rotate" ); 126 return tr( "Rotate" );
127} 127}
128 128
129/*QString RotateApplet::tr( const char* s ) const 129/*QString RotateApplet::tr( const char* s ) const
130{ 130{
131 return qApp->translate( "RotateApplet", s, 0 ); 131 return qApp->translate( "RotateApplet", s, 0 );
132} 132}
133 133
134QString RotateApplet::tr( const char* s, const char* p ) const 134QString RotateApplet::tr( const char* s, const char* p ) const
135{ 135{
136 return qApp->translate( "RotateApplet", s, p ); 136 return qApp->translate( "RotateApplet", s, p );
137} 137}
138*/ 138*/
139 139
140QIconSet RotateApplet::icon() const 140QIconSet RotateApplet::icon() const
141{ 141{
142 QPixmap pix; 142 QPixmap pix;
143 QImage img = Resource::loadImage( "Rotation" ); 143 QImage img = Resource::loadImage( "Rotation" );
144 if ( !img.isNull() ) 144 if ( !img.isNull() )
145 pix.convertFromImage( img.smoothScale( 14, 14 ) ); 145 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
146 return pix; 146 return pix;
147} 147}
148 148
149QPopupMenu* RotateApplet::popup(QWidget*) const 149QPopupMenu* RotateApplet::popup(QWidget*) const
150{ 150{
151 return 0; 151 return 0;
152} 152}
153 153
154void RotateApplet::rotateDefault() 154void RotateApplet::rotateDefault()
155{ 155{
156 int rot = ODevice::inst()->rotation(); 156 int rot = ODevice::inst()->rotation();
157 157
158 switch (rot) 158 switch (rot)
159 { 159 {
160 case Rot0: rot=0; break; 160 case Rot0: rot=0; break;
161 case Rot90: rot=90; break; 161 case Rot90: rot=90; break;
162 case Rot180: rot=180; break; 162 case Rot180: rot=180; break;
163 case Rot270: rot=270; break; 163 case Rot270: rot=270; break;
164 default: rot=0; break; 164 default: rot=0; break;
165 } 165 }
166 166
167 Config cfg( "qpe" ); 167 Config cfg( "qpe" );
168 cfg.setGroup( "Appearance" ); 168 cfg.setGroup( "Appearance" );
169 169
170 bool rotateEnabled = cfg.readBoolEntry( "rotateEnabled",true ); 170 bool rotateEnabled = cfg.readBoolEntry( "rotateEnabled",true );
171 171
172 if ( !rotateEnabled) return; 172 if ( !rotateEnabled) return;
173 173
174 // hide inputs methods before rotation 174 // hide inputs methods before rotation
175 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" ); 175 QCopEnvelope en( "QPE/TaskBar", "hideInputMethod()" );
176 176
177 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" ); 177 QCopEnvelope env( "QPE/System", "setCurrentRotation(int)" );
178 env << rot; 178 env << rot;
179 179
180 m_flipped = false; 180 m_flipped = false;
181 181
182} 182}
183void RotateApplet::activated() 183void RotateApplet::activated()
184{ 184{
185 int defaultRotation = QPEApplication::defaultRotation(); 185 int defaultRotation = QPEApplication::defaultRotation();
186 int newRotation = defaultRotation; 186 int newRotation = defaultRotation;
187 187
188 Config cfg( "qpe" ); 188 Config cfg( "qpe" );
189 cfg.setGroup( "Appearance" ); 189 cfg.setGroup( "Appearance" );
190 190
191 int rotDirection = cfg.readNumEntry( "rotatedir" ); 191 int rotDirection = cfg.readNumEntry( "rotatedir" );
192 ODirection rot = CW; 192 ODirection rot = CW;
193 193
diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp
index 0eb94cb..4fbd704 100644
--- a/core/applets/suspendapplet/suspend.cpp
+++ b/core/applets/suspendapplet/suspend.cpp
@@ -1,85 +1,85 @@
1#include "suspend.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 8
6#include "suspend.h"
7
8
9SuspendApplet::SuspendApplet ( ) 9SuspendApplet::SuspendApplet ( )
10 : QObject ( 0, "SuspendApplet" ) 10 : QObject ( 0, "SuspendApplet" )
11{ 11{
12} 12}
13 13
14SuspendApplet::~SuspendApplet ( ) 14SuspendApplet::~SuspendApplet ( )
15{ 15{
16} 16}
17 17
18int SuspendApplet::position ( ) const 18int SuspendApplet::position ( ) const
19{ 19{
20 return 2; 20 return 2;
21} 21}
22 22
23QString SuspendApplet::name ( ) const 23QString SuspendApplet::name ( ) const
24{ 24{
25 return tr( "Suspend shortcut" ); 25 return tr( "Suspend shortcut" );
26} 26}
27 27
28QString SuspendApplet::text ( ) const 28QString SuspendApplet::text ( ) const
29{ 29{
30 return tr( "Suspend" ); 30 return tr( "Suspend" );
31} 31}
32 32
33QString SuspendApplet::tr( const char* s ) const 33QString SuspendApplet::tr( const char* s ) const
34{ 34{
35 return qApp->translate( "SuspendApplet", s, 0 ); 35 return qApp->translate( "SuspendApplet", s, 0 );
36} 36}
37 37
38QString SuspendApplet::tr( const char* s, const char* p ) const 38QString SuspendApplet::tr( const char* s, const char* p ) const
39{ 39{
40 return qApp->translate( "SuspendApplet", s, p ); 40 return qApp->translate( "SuspendApplet", s, p );
41} 41}
42 42
43QIconSet SuspendApplet::icon ( ) const 43QIconSet SuspendApplet::icon ( ) const
44{ 44{
45 QPixmap pix; 45 QPixmap pix;
46 QImage img = Resource::loadImage ( "suspend" ); 46 QImage img = Resource::loadImage ( "suspend" );
47 47
48 if ( !img. isNull ( )) 48 if ( !img. isNull ( ))
49 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 49 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
50 return pix; 50 return pix;
51} 51}
52 52
53QPopupMenu *SuspendApplet::popup ( QWidget * ) const 53QPopupMenu *SuspendApplet::popup ( QWidget * ) const
54{ 54{
55 return 0; 55 return 0;
56} 56}
57 57
58void SuspendApplet::activated ( ) 58void SuspendApplet::activated ( )
59{ 59{
60 // suspend 60 // suspend
61 QCopEnvelope ( "QPE/System", "suspend()" ); 61 QCopEnvelope ( "QPE/System", "suspend()" );
62} 62}
63 63
64 64
65QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) 65QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
66{ 66{
67 *iface = 0; 67 *iface = 0;
68 if ( uuid == IID_QUnknown ) 68 if ( uuid == IID_QUnknown )
69 *iface = this; 69 *iface = this;
70 else if ( uuid == IID_MenuApplet ) 70 else if ( uuid == IID_MenuApplet )
71 *iface = this; 71 *iface = this;
72 else 72 else
73 return QS_FALSE; 73 return QS_FALSE;
74 74
75 if ( *iface ) 75 if ( *iface )
76 (*iface)-> addRef ( ); 76 (*iface)-> addRef ( );
77 return QS_OK; 77 return QS_OK;
78} 78}
79 79
80Q_EXPORT_INTERFACE( ) 80Q_EXPORT_INTERFACE( )
81{ 81{
82 Q_CREATE_INSTANCE( SuspendApplet ) 82 Q_CREATE_INSTANCE( SuspendApplet )
83} 83}
84 84
85 85
diff --git a/core/applets/suspendapplet/suspend.h b/core/applets/suspendapplet/suspend.h
index 8c54cde..c037adc 100644
--- a/core/applets/suspendapplet/suspend.h
+++ b/core/applets/suspendapplet/suspend.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_SUSPEND_APPLET_H__ 20#ifndef __OPIE_SUSPEND_APPLET_H__
21#define __OPIE_SUSPEND_APPLET_H__ 21#define __OPIE_SUSPEND_APPLET_H__
22 22
23#include <qpe/menuappletinterface.h> 23#include <qpe/menuappletinterface.h>
24#include <qobject.h>
24 25
25class SuspendApplet : public QObject, public MenuAppletInterface 26class SuspendApplet : public QObject, public MenuAppletInterface
26{ 27{
27public: 28public:
28 SuspendApplet ( ); 29 SuspendApplet ( );
29 virtual ~SuspendApplet ( ); 30 virtual ~SuspendApplet ( );
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
diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp
index 7832ee0..ae89635 100644
--- a/core/applets/vtapplet/vt.cpp
+++ b/core/applets/vtapplet/vt.cpp
@@ -1,122 +1,123 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2003-2004 Michael 'Mickey' Lauer <mickey@Vanille.de> 2** Copyright (C) 2003-2004 Michael 'Mickey' Lauer <mickey@Vanille.de>
3** 3**
4** This file may be distributed and/or modified under the terms of the 4** This file may be distributed and/or modified under the terms of the
5** GNU General Public License version 2 as published by the Free Software 5** GNU General Public License version 2 as published by the Free Software
6** Foundation and appearing in the file LICENSE.GPL included in the 6** Foundation and appearing in the file LICENSE.GPL included in the
7** packaging of this file. 7** packaging of this file.
8** 8**
9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 9** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 10** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11** 11**
12**********************************************************************/ 12**********************************************************************/
13 13
14#include "vt.h" 14#include "vt.h"
15 15
16/* OPIE */ 16/* OPIE */
17#include <opie2/odebug.h> 17#include <opie2/odebug.h>
18#include <qpe/applnk.h>
18#include <qpe/resource.h> 19#include <qpe/resource.h>
19using namespace Opie::Core; 20using namespace Opie::Core;
20 21
21/* QT */ 22/* QT */
22#include <qpopupmenu.h> 23#include <qpopupmenu.h>
23 24
24/* STD */ 25/* STD */
25#include <fcntl.h> 26#include <fcntl.h>
26#include <unistd.h> 27#include <unistd.h>
27#include <sys/types.h> 28#include <sys/types.h>
28#include <sys/stat.h> 29#include <sys/stat.h>
29#include <sys/ioctl.h> 30#include <sys/ioctl.h>
30#include <linux/vt.h> 31#include <linux/vt.h>
31 32
32VTApplet::VTApplet ( ) 33VTApplet::VTApplet ( )
33 : QObject ( 0, "VTApplet" ) 34 : QObject ( 0, "VTApplet" )
34{ 35{
35} 36}
36 37
37VTApplet::~VTApplet ( ) 38VTApplet::~VTApplet ( )
38{ 39{
39} 40}
40 41
41int VTApplet::position ( ) const 42int VTApplet::position ( ) const
42{ 43{
43 return 2; 44 return 2;
44} 45}
45 46
46QString VTApplet::name ( ) const 47QString VTApplet::name ( ) const
47{ 48{
48 return tr( "VT shortcut" ); 49 return tr( "VT shortcut" );
49} 50}
50 51
51QString VTApplet::text ( ) const 52QString VTApplet::text ( ) const
52{ 53{
53 return tr( "Terminal" ); 54 return tr( "Terminal" );
54} 55}
55 56
56/* 57/*
57QString VTApplet::tr( const char* s ) const 58QString VTApplet::tr( const char* s ) const
58{ 59{
59 return qApp->translate( "VTApplet", s, 0 ); 60 return qApp->translate( "VTApplet", s, 0 );
60} 61}
61 62
62QString VTApplet::tr( const char* s, const char* p ) const 63QString VTApplet::tr( const char* s, const char* p ) const
63{ 64{
64 return qApp->translate( "VTApplet", s, p ); 65 return qApp->translate( "VTApplet", s, p );
65} 66}
66*/ 67*/
67 68
68QIconSet VTApplet::icon ( ) const 69QIconSet VTApplet::icon ( ) const
69{ 70{
70 QPixmap pix; 71 QPixmap pix;
71 QImage img = Resource::loadImage ( "terminal" ); 72 QImage img = Resource::loadImage ( "terminal" );
72 73
73 if ( !img. isNull ( )) 74 if ( !img. isNull ( ))
74 pix. convertFromImage ( img. smoothScale ( 14, 14 )); 75 pix.convertFromImage( img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
75 return pix; 76 return pix;
76} 77}
77 78
78QPopupMenu *VTApplet::popup ( QWidget* parent ) const 79QPopupMenu *VTApplet::popup ( QWidget* parent ) const
79{ 80{
80 odebug << "VTApplet::popup" << oendl; 81 odebug << "VTApplet::popup" << oendl;
81 82
82 struct vt_stat vtstat; 83 struct vt_stat vtstat;
83#ifdef QT_QWS_DEVFS 84#ifdef QT_QWS_DEVFS
84 int fd = ::open( "/dev/vc/0", O_RDWR ); 85 int fd = ::open( "/dev/vc/0", O_RDWR );
85#else 86#else
86 int fd = ::open( "/dev/tty0", O_RDWR ); 87 int fd = ::open( "/dev/tty0", O_RDWR );
87#endif 88#endif
88 if ( fd == -1 ) return 0; 89 if ( fd == -1 ) return 0;
89 if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0; 90 if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0;
90 91
91 m_subMenu = new QPopupMenu( parent ); 92 m_subMenu = new QPopupMenu( parent );
92 m_subMenu->setCheckable( true ); 93 m_subMenu->setCheckable( true );
93 for ( int i = 1; i < 10; ++i ) 94 for ( int i = 1; i < 10; ++i )
94 { 95 {
95 int id = m_subMenu->insertItem( QString::number( i ), 500+i ); 96 int id = m_subMenu->insertItem( QString::number( i ), 500+i );
96 m_subMenu->setItemChecked( id, id-500 == vtstat.v_active ); 97 m_subMenu->setItemChecked( id, id-500 == vtstat.v_active );
97 } 98 }
98 ::close( fd ); 99 ::close( fd );
99 100
100 connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) ); 101 connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) );
101 connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); 102 connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
102 103
103 return m_subMenu; 104 return m_subMenu;
104} 105}
105 106
106 107
107void VTApplet::changeVT( int index ) 108void VTApplet::changeVT( int index )
108{ 109{
109 //odebug << "VTApplet::changeVT( " << index-500 << " )" << oendl; 110 //odebug << "VTApplet::changeVT( " << index-500 << " )" << oendl;
110 111
111#ifdef QT_QWS_DEVFS 112#ifdef QT_QWS_DEVFS
112 int fd = ::open("/dev/vc/0", O_RDWR); 113 int fd = ::open("/dev/vc/0", O_RDWR);
113#else 114#else
114 int fd = ::open("/dev/tty0", O_RDWR); 115 int fd = ::open("/dev/tty0", O_RDWR);
115#endif 116#endif
116 if ( fd == -1 ) return; 117 if ( fd == -1 ) return;
117 ioctl( fd, VT_ACTIVATE, index-500 ); 118 ioctl( fd, VT_ACTIVATE, index-500 );
118} 119}
119 120
120 121
121void VTApplet::updateMenu() 122void VTApplet::updateMenu()
122{ 123{