author | mickeyl <mickeyl> | 2005-04-01 23:30:07 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-04-01 23:30:07 (UTC) |
commit | 8a1c307f9dfc26a31d42f29f29a5b1c048b99102 (patch) (unidiff) | |
tree | 8e8925baf6a77e01379264afb540f33a3c07bec7 | |
parent | 88cc0cc17864de6e36bdeedaae6df0a5cc738c5a (diff) | |
download | opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.zip opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.gz opie-8a1c307f9dfc26a31d42f29f29a5b1c048b99102.tar.bz2 |
scale O-Menu-Applet pixmaps according to AppLnk::smallIconSize
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | core/applets/aboutapplet/about.cpp | 7 | ||||
-rw-r--r-- | core/applets/homeapplet/home.cpp | 8 | ||||
-rw-r--r-- | core/applets/homeapplet/home.h | 1 | ||||
-rw-r--r-- | core/applets/logoutapplet/logout.cpp | 8 | ||||
-rw-r--r-- | core/applets/logoutapplet/logout.h | 1 | ||||
-rw-r--r-- | core/applets/restartapplet2/restart.cpp | 11 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 6 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspend.cpp | 8 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspend.h | 1 | ||||
-rw-r--r-- | core/applets/vtapplet/vt.cpp | 3 |
11 files changed, 30 insertions, 27 deletions
@@ -1,46 +1,47 @@ | |||
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) |
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,82 +1,83 @@ | |||
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 | ||
10 | AboutApplet::AboutApplet ( ) | 11 | AboutApplet::AboutApplet ( ) |
11 | : QObject ( 0, "AboutApplet" ), m_ad( 0l ) | 12 | : QObject ( 0, "AboutApplet" ), m_ad( 0l ) |
12 | {} | 13 | {} |
13 | 14 | ||
14 | AboutApplet::~AboutApplet ( ) | 15 | AboutApplet::~AboutApplet ( ) |
15 | { | 16 | { |
16 | delete m_ad; | 17 | delete m_ad; |
17 | } | 18 | } |
18 | 19 | ||
19 | int AboutApplet::position ( ) const | 20 | int AboutApplet::position ( ) const |
20 | { | 21 | { |
21 | return 1; | 22 | return 1; |
22 | } | 23 | } |
23 | 24 | ||
24 | QString AboutApplet::name ( ) const | 25 | QString AboutApplet::name ( ) const |
25 | { | 26 | { |
26 | return tr( "About shortcut" ); | 27 | return tr( "About shortcut" ); |
27 | } | 28 | } |
28 | 29 | ||
29 | QString AboutApplet::text ( ) const | 30 | QString AboutApplet::text ( ) const |
30 | { | 31 | { |
31 | return tr( "About" ); | 32 | return tr( "About" ); |
32 | } | 33 | } |
33 | 34 | ||
34 | QString AboutApplet::tr( const char* s ) const | 35 | QString 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 | ||
39 | QString AboutApplet::tr( const char* s, const char* p ) const | 40 | QString 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 | ||
44 | QIconSet AboutApplet::icon ( ) const | 45 | QIconSet 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 | ||
54 | QPopupMenu *AboutApplet::popup ( QWidget * ) const | 55 | QPopupMenu *AboutApplet::popup ( QWidget * ) const |
55 | { | 56 | { |
56 | return 0; | 57 | return 0; |
57 | } | 58 | } |
58 | 59 | ||
59 | void AboutApplet::activated() | 60 | void 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 | ||
67 | QRESULT AboutApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 68 | QRESULT 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 | ||
82 | Q_EXPORT_INTERFACE( ) | 83 | Q_EXPORT_INTERFACE( ) |
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,81 +1,81 @@ | |||
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 | |||
9 | HomeApplet::HomeApplet ( ) | 9 | HomeApplet::HomeApplet ( ) |
10 | : QObject ( 0, "HomeApplet" ) | 10 | : QObject ( 0, "HomeApplet" ) |
11 | { | 11 | { |
12 | } | 12 | } |
13 | 13 | ||
14 | HomeApplet::~HomeApplet ( ) | 14 | HomeApplet::~HomeApplet ( ) |
15 | { | 15 | { |
16 | } | 16 | } |
17 | 17 | ||
18 | int HomeApplet::position ( ) const | 18 | int HomeApplet::position ( ) const |
19 | { | 19 | { |
20 | return 4; | 20 | return 4; |
21 | } | 21 | } |
22 | 22 | ||
23 | QString HomeApplet::name ( ) const | 23 | QString HomeApplet::name ( ) const |
24 | { | 24 | { |
25 | return tr( "Home shortcut" ); | 25 | return tr( "Home shortcut" ); |
26 | } | 26 | } |
27 | 27 | ||
28 | QString HomeApplet::text ( ) const | 28 | QString HomeApplet::text ( ) const |
29 | { | 29 | { |
30 | return tr( "Desktop" ); | 30 | return tr( "Desktop" ); |
31 | } | 31 | } |
32 | 32 | ||
33 | QString HomeApplet::tr( const char* s ) const | 33 | QString 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 | ||
38 | QString HomeApplet::tr( const char* s, const char* p ) const | 38 | QString 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 | ||
43 | QIconSet HomeApplet::icon ( ) const | 43 | QIconSet 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 | ||
53 | QPopupMenu *HomeApplet::popup ( QWidget * ) const | 53 | QPopupMenu *HomeApplet::popup ( QWidget * ) const |
54 | { | 54 | { |
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | void HomeApplet::activated ( ) | 58 | void 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 | ||
65 | QRESULT HomeApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 65 | QRESULT 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 | ||
80 | Q_EXPORT_INTERFACE( ) | 80 | Q_EXPORT_INTERFACE( ) |
81 | { | 81 | { |
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 | ||
25 | class HomeApplet : public QObject, public MenuAppletInterface | 26 | class HomeApplet : public QObject, public MenuAppletInterface |
26 | { | 27 | { |
27 | public: | 28 | public: |
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,84 +1,84 @@ | |||
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 | |||
12 | LogoutApplet::LogoutApplet ( ) | 12 | LogoutApplet::LogoutApplet ( ) |
13 | : QObject ( 0, "LogoutApplet" ) | 13 | : QObject ( 0, "LogoutApplet" ) |
14 | { | 14 | { |
15 | } | 15 | } |
16 | 16 | ||
17 | LogoutApplet::~LogoutApplet ( ) | 17 | LogoutApplet::~LogoutApplet ( ) |
18 | { | 18 | { |
19 | } | 19 | } |
20 | 20 | ||
21 | int LogoutApplet::position ( ) const | 21 | int LogoutApplet::position ( ) const |
22 | { | 22 | { |
23 | return 0; | 23 | return 0; |
24 | } | 24 | } |
25 | 25 | ||
26 | QString LogoutApplet::name ( ) const | 26 | QString LogoutApplet::name ( ) const |
27 | { | 27 | { |
28 | return tr( "Logout shortcut" ); | 28 | return tr( "Logout shortcut" ); |
29 | } | 29 | } |
30 | 30 | ||
31 | QString LogoutApplet::text ( ) const | 31 | QString LogoutApplet::text ( ) const |
32 | { | 32 | { |
33 | return tr( "Logout" ); | 33 | return tr( "Logout" ); |
34 | } | 34 | } |
35 | 35 | ||
36 | QString LogoutApplet::tr( const char* s ) const | 36 | QString 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 | ||
41 | QString LogoutApplet::tr( const char* s, const char* p ) const | 41 | QString 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 | ||
46 | QIconSet LogoutApplet::icon ( ) const | 46 | QIconSet 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 | ||
56 | QPopupMenu *LogoutApplet::popup ( QWidget * ) const | 56 | QPopupMenu *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 | ||
65 | class HackApplication : public QApplication { | 65 | class HackApplication : public QApplication { |
66 | public: | 66 | public: |
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 | ||
80 | void LogoutApplet::activated ( ) | 80 | void 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, |
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 | ||
25 | class LogoutApplet : public QObject, public MenuAppletInterface | 26 | class LogoutApplet : public QObject, public MenuAppletInterface |
26 | { | 27 | { |
27 | public: | 28 | public: |
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,106 +1,103 @@ | |||
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 */ |
14 | static char *restart_xpm[] = { | 11 | static 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 | ||
44 | RestartApplet::RestartApplet ( ) | 41 | RestartApplet::RestartApplet ( ) |
45 | : QObject ( 0, "RestartApplet" ) | 42 | : QObject ( 0, "RestartApplet" ) |
46 | { | 43 | { |
47 | } | 44 | } |
48 | 45 | ||
49 | RestartApplet::~RestartApplet ( ) | 46 | RestartApplet::~RestartApplet ( ) |
50 | { | 47 | { |
51 | } | 48 | } |
52 | 49 | ||
53 | int RestartApplet::position ( ) const | 50 | int RestartApplet::position ( ) const |
54 | { | 51 | { |
55 | return 4; | 52 | return 4; |
56 | } | 53 | } |
57 | 54 | ||
58 | QString RestartApplet::name ( ) const | 55 | QString RestartApplet::name ( ) const |
59 | { | 56 | { |
60 | return tr( "Restart" ); | 57 | return tr( "Restart" ); |
61 | } | 58 | } |
62 | 59 | ||
63 | QString RestartApplet::text ( ) const | 60 | QString RestartApplet::text ( ) const |
64 | { | 61 | { |
65 | return tr( "Restart Opie" ); | 62 | return tr( "Restart Opie" ); |
66 | } | 63 | } |
67 | 64 | ||
68 | QIconSet RestartApplet::icon ( ) const | 65 | QIconSet 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 | ||
78 | QPopupMenu *RestartApplet::popup ( QWidget * ) const | 75 | QPopupMenu *RestartApplet::popup ( QWidget * ) const |
79 | { | 76 | { |
80 | return 0; | 77 | return 0; |
81 | } | 78 | } |
82 | 79 | ||
83 | void RestartApplet::activated ( ) | 80 | void RestartApplet::activated ( ) |
84 | { | 81 | { |
85 | QCopEnvelope e("QPE/System", "restart()"); | 82 | QCopEnvelope e("QPE/System", "restart()"); |
86 | } | 83 | } |
87 | 84 | ||
88 | 85 | ||
89 | QRESULT RestartApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 86 | QRESULT 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 | ||
104 | Q_EXPORT_INTERFACE( ) | 101 | Q_EXPORT_INTERFACE( ) |
105 | { | 102 | { |
106 | Q_CREATE_INSTANCE( RestartApplet ) | 103 | Q_CREATE_INSTANCE( RestartApplet ) |
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 | |||
@@ -4,72 +4,72 @@ | |||
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> |
40 | using namespace Opie::Core; | 41 | using namespace Opie::Core; |
41 | 42 | ||
42 | /* QT */ | 43 | /* STD */ |
43 | |||
44 | #include <time.h> | 44 | #include <time.h> |
45 | 45 | ||
46 | RotateApplet::RotateApplet() | 46 | RotateApplet::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 | ||
58 | RotateApplet::~RotateApplet ( ) | 58 | RotateApplet::~RotateApplet ( ) |
59 | {} | 59 | {} |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Qcop receive method. | 62 | * Qcop receive method. |
63 | */ | 63 | */ |
64 | void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) | 64 | void 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(); |
@@ -113,65 +113,65 @@ void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data | |||
113 | 113 | ||
114 | int RotateApplet::position() const | 114 | int RotateApplet::position() const |
115 | { | 115 | { |
116 | return 3; | 116 | return 3; |
117 | } | 117 | } |
118 | 118 | ||
119 | QString RotateApplet::name() const | 119 | QString RotateApplet::name() const |
120 | { | 120 | { |
121 | return tr( "Rotate shortcut" ); | 121 | return tr( "Rotate shortcut" ); |
122 | } | 122 | } |
123 | 123 | ||
124 | QString RotateApplet::text() const | 124 | QString 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 | ||
134 | QString RotateApplet::tr( const char* s, const char* p ) const | 134 | QString 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 | ||
140 | QIconSet RotateApplet::icon() const | 140 | QIconSet 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 | ||
149 | QPopupMenu* RotateApplet::popup(QWidget*) const | 149 | QPopupMenu* RotateApplet::popup(QWidget*) const |
150 | { | 150 | { |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |
153 | 153 | ||
154 | void RotateApplet::rotateDefault() | 154 | void 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)" ); |
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,81 +1,81 @@ | |||
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 | |||
9 | SuspendApplet::SuspendApplet ( ) | 9 | SuspendApplet::SuspendApplet ( ) |
10 | : QObject ( 0, "SuspendApplet" ) | 10 | : QObject ( 0, "SuspendApplet" ) |
11 | { | 11 | { |
12 | } | 12 | } |
13 | 13 | ||
14 | SuspendApplet::~SuspendApplet ( ) | 14 | SuspendApplet::~SuspendApplet ( ) |
15 | { | 15 | { |
16 | } | 16 | } |
17 | 17 | ||
18 | int SuspendApplet::position ( ) const | 18 | int SuspendApplet::position ( ) const |
19 | { | 19 | { |
20 | return 2; | 20 | return 2; |
21 | } | 21 | } |
22 | 22 | ||
23 | QString SuspendApplet::name ( ) const | 23 | QString SuspendApplet::name ( ) const |
24 | { | 24 | { |
25 | return tr( "Suspend shortcut" ); | 25 | return tr( "Suspend shortcut" ); |
26 | } | 26 | } |
27 | 27 | ||
28 | QString SuspendApplet::text ( ) const | 28 | QString SuspendApplet::text ( ) const |
29 | { | 29 | { |
30 | return tr( "Suspend" ); | 30 | return tr( "Suspend" ); |
31 | } | 31 | } |
32 | 32 | ||
33 | QString SuspendApplet::tr( const char* s ) const | 33 | QString 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 | ||
38 | QString SuspendApplet::tr( const char* s, const char* p ) const | 38 | QString 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 | ||
43 | QIconSet SuspendApplet::icon ( ) const | 43 | QIconSet 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 | ||
53 | QPopupMenu *SuspendApplet::popup ( QWidget * ) const | 53 | QPopupMenu *SuspendApplet::popup ( QWidget * ) const |
54 | { | 54 | { |
55 | return 0; | 55 | return 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | void SuspendApplet::activated ( ) | 58 | void SuspendApplet::activated ( ) |
59 | { | 59 | { |
60 | // suspend | 60 | // suspend |
61 | QCopEnvelope ( "QPE/System", "suspend()" ); | 61 | QCopEnvelope ( "QPE/System", "suspend()" ); |
62 | } | 62 | } |
63 | 63 | ||
64 | 64 | ||
65 | QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 65 | QRESULT 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 | ||
80 | Q_EXPORT_INTERFACE( ) | 80 | Q_EXPORT_INTERFACE( ) |
81 | { | 81 | { |
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 | ||
25 | class SuspendApplet : public QObject, public MenuAppletInterface | 26 | class SuspendApplet : public QObject, public MenuAppletInterface |
26 | { | 27 | { |
27 | public: | 28 | public: |
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,106 +1,107 @@ | |||
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> |
19 | using namespace Opie::Core; | 20 | using 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 | ||
32 | VTApplet::VTApplet ( ) | 33 | VTApplet::VTApplet ( ) |
33 | : QObject ( 0, "VTApplet" ) | 34 | : QObject ( 0, "VTApplet" ) |
34 | { | 35 | { |
35 | } | 36 | } |
36 | 37 | ||
37 | VTApplet::~VTApplet ( ) | 38 | VTApplet::~VTApplet ( ) |
38 | { | 39 | { |
39 | } | 40 | } |
40 | 41 | ||
41 | int VTApplet::position ( ) const | 42 | int VTApplet::position ( ) const |
42 | { | 43 | { |
43 | return 2; | 44 | return 2; |
44 | } | 45 | } |
45 | 46 | ||
46 | QString VTApplet::name ( ) const | 47 | QString VTApplet::name ( ) const |
47 | { | 48 | { |
48 | return tr( "VT shortcut" ); | 49 | return tr( "VT shortcut" ); |
49 | } | 50 | } |
50 | 51 | ||
51 | QString VTApplet::text ( ) const | 52 | QString VTApplet::text ( ) const |
52 | { | 53 | { |
53 | return tr( "Terminal" ); | 54 | return tr( "Terminal" ); |
54 | } | 55 | } |
55 | 56 | ||
56 | /* | 57 | /* |
57 | QString VTApplet::tr( const char* s ) const | 58 | QString 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 | ||
62 | QString VTApplet::tr( const char* s, const char* p ) const | 63 | QString 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 | ||
68 | QIconSet VTApplet::icon ( ) const | 69 | QIconSet 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 | ||
78 | QPopupMenu *VTApplet::popup ( QWidget* parent ) const | 79 | QPopupMenu *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 | ||