4 files changed, 11 insertions, 11 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp index 35a11db..e7891c8 100644 --- a/noncore/applets/autorotateapplet/autorotate.cpp +++ b/noncore/applets/autorotateapplet/autorotate.cpp | |||
@@ -1,98 +1,98 @@ | |||
1 | /* | 1 | /* |
2 | * copyright : (c) 2003 by Greg Gilbert | 2 | * copyright : (c) 2003 by Greg Gilbert |
3 | * email : greg@treke.net | 3 | * email : greg@treke.net |
4 | * based on the cardmon applet by Max Reiss | 4 | * based on the cardmon applet by Max Reiss |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License as published by * | 7 | * it under the terms of the GNU General Public License as published by * |
8 | * the Free Software Foundation; either version 2 of the License, or * | 8 | * the Free Software Foundation; either version 2 of the License, or * |
9 | * (at your option) any later version. * | 9 | * (at your option) any later version. * |
10 | * * | 10 | * * |
11 | *************************************************************************/ | 11 | *************************************************************************/ |
12 | 12 | ||
13 | #include "autorotate.h" | 13 | #include "autorotate.h" |
14 | 14 | ||
15 | /* OPIE */ | 15 | /* OPIE */ |
16 | #include <opie/odevice.h> | 16 | #include <opie2/odevice.h> |
17 | #include <qpe/applnk.h> | 17 | #include <qpe/applnk.h> |
18 | #include <qpe/config.h> | 18 | #include <qpe/config.h> |
19 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
20 | 20 | ||
21 | /* QT */ | 21 | /* QT */ |
22 | #include <qapplication.h> | 22 | #include <qapplication.h> |
23 | #include <qfile.h> | 23 | #include <qfile.h> |
24 | #include <qcopchannel_qws.h> | 24 | #include <qcopchannel_qws.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qpixmap.h> | 27 | #include <qpixmap.h> |
28 | #include <qimage.h> | 28 | #include <qimage.h> |
29 | #include <qtimer.h> | 29 | #include <qtimer.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | 31 | ||
32 | using namespace Opie; | 32 | using namespace Opie; |
33 | 33 | ||
34 | AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) | 34 | AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) |
35 | { | 35 | { |
36 | setFixedWidth( AppLnk::smallIconSize() ); | 36 | setFixedWidth( AppLnk::smallIconSize() ); |
37 | setFixedHeight( AppLnk::smallIconSize() ); | 37 | setFixedHeight( AppLnk::smallIconSize() ); |
38 | 38 | ||
39 | enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); | 39 | enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); |
40 | disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) ); | 40 | disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) ); |
41 | 41 | ||
42 | repaint(true); | 42 | repaint(true); |
43 | popupMenu = 0; | 43 | popupMenu = 0; |
44 | show(); | 44 | show(); |
45 | } | 45 | } |
46 | 46 | ||
47 | AutoRotate::~AutoRotate() | 47 | AutoRotate::~AutoRotate() |
48 | { | 48 | { |
49 | if (popupMenu) { | 49 | if (popupMenu) { |
50 | delete popupMenu; | 50 | delete popupMenu; |
51 | } | 51 | } |
52 | } | 52 | } |
53 | 53 | ||
54 | void AutoRotate::mousePressEvent(QMouseEvent *) | 54 | void AutoRotate::mousePressEvent(QMouseEvent *) |
55 | { | 55 | { |
56 | QPopupMenu *menu = new QPopupMenu(this); | 56 | QPopupMenu *menu = new QPopupMenu(this); |
57 | menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 ); | 57 | menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 ); |
58 | 58 | ||
59 | QPoint p = mapToGlobal(QPoint(0, 0)); | 59 | QPoint p = mapToGlobal(QPoint(0, 0)); |
60 | QSize s = menu->sizeHint(); | 60 | QSize s = menu->sizeHint(); |
61 | int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0); | 61 | int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0); |
62 | 62 | ||
63 | if (opt==1) | 63 | if (opt==1) |
64 | { | 64 | { |
65 | setRotateEnabled( !isRotateEnabled() ); | 65 | setRotateEnabled( !isRotateEnabled() ); |
66 | repaint(true); | 66 | repaint(true); |
67 | } | 67 | } |
68 | 68 | ||
69 | delete menu; | 69 | delete menu; |
70 | } | 70 | } |
71 | 71 | ||
72 | void AutoRotate::paintEvent(QPaintEvent *) | 72 | void AutoRotate::paintEvent(QPaintEvent *) |
73 | { | 73 | { |
74 | QPainter p(this); | 74 | QPainter p(this); |
75 | p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm ); | 75 | p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm ); |
76 | } | 76 | } |
77 | 77 | ||
78 | void AutoRotate::setRotateEnabled(bool status) | 78 | void AutoRotate::setRotateEnabled(bool status) |
79 | { | 79 | { |
80 | Config cfg( "qpe" ); | 80 | Config cfg( "qpe" ); |
81 | cfg.setGroup( "Appearance" ); | 81 | cfg.setGroup( "Appearance" ); |
82 | cfg.writeEntry( "rotateEnabled", status ); | 82 | cfg.writeEntry( "rotateEnabled", status ); |
83 | 83 | ||
84 | } | 84 | } |
85 | bool AutoRotate::isRotateEnabled() | 85 | bool AutoRotate::isRotateEnabled() |
86 | { | 86 | { |
87 | Config cfg( "qpe" ); | 87 | Config cfg( "qpe" ); |
88 | cfg.setGroup( "Appearance" ); | 88 | cfg.setGroup( "Appearance" ); |
89 | 89 | ||
90 | bool res = cfg.readBoolEntry( "rotateEnabled" ); | 90 | bool res = cfg.readBoolEntry( "rotateEnabled" ); |
91 | 91 | ||
92 | if (res ) | 92 | if (res ) |
93 | qDebug("Enabled"); | 93 | qDebug("Enabled"); |
94 | else | 94 | else |
95 | qDebug("Disabled"); | 95 | qDebug("Disabled"); |
96 | return res; | 96 | return res; |
97 | } | 97 | } |
98 | 98 | ||
diff --git a/noncore/applets/autorotateapplet/autorotateapplet.pro b/noncore/applets/autorotateapplet/autorotateapplet.pro index 0b966b0..0ccbeba 100644 --- a/noncore/applets/autorotateapplet/autorotateapplet.pro +++ b/noncore/applets/autorotateapplet/autorotateapplet.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt plugin warn_on release | 2 | CONFIG += qt plugin warn_on release |
3 | HEADERS =autorotate.h autorotateimpl.h | 3 | HEADERS = autorotate.h autorotateimpl.h |
4 | SOURCES =autorotate.cpp autorotateimpl.cpp | 4 | SOURCES = autorotate.cpp autorotateimpl.cpp |
5 | TARGET = autorotateapplet | 5 | TARGET = autorotateapplet |
6 | DESTDIR = $(OPIEDIR)/plugins/applets | 6 | DESTDIR = $(OPIEDIR)/plugins/applets |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include ../launcher | 8 | DEPENDPATH += $(OPIEDIR)/include ../launcher |
9 | LIBS += -lqpe -lopie | 9 | LIBS += -lqpe -lopiecore2 |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | 11 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
13 | target.path = $$prefix/plugins/applets | 13 | target.path = $$prefix/plugins/applets |
diff --git a/noncore/applets/autorotateapplet/config.in b/noncore/applets/autorotateapplet/config.in index 0ddbd59..128d327 100644 --- a/noncore/applets/autorotateapplet/config.in +++ b/noncore/applets/autorotateapplet/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config AUTOROTATEAPPLET | 1 | config AUTOROTATEAPPLET |
2 | boolean "opie-autorotate applet ( disables screen rotation based on the orientation of the device)" | 2 | boolean "opie-autorotate applet ( disables screen rotation based on the orientation of the device)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/applets/autorotateapplet/opie-autorotate.control b/noncore/applets/autorotateapplet/opie-autorotate.control index 9e726e9..47d9805 100644 --- a/noncore/applets/autorotateapplet/opie-autorotate.control +++ b/noncore/applets/autorotateapplet/opie-autorotate.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Package: opie-autorotate | 1 | Package: opie-autorotate |
2 | Files: plugins/applets/libautorotateapplet.so* pics/autorotate/*.png | 2 | Files: plugins/applets/libautorotateapplet.so* pics/autorotate/*.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applets | 4 | Section: opie/applets |
5 | Maintainer: Greg Gilbert <greg@treke.net> | 5 | Maintainer: Greg Gilbert <greg@treke.net> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal, libopie1 | 7 | Depends: task-opie-minimal, libopiecore2 |
8 | Description: Automatic screen rotation applet | 8 | Description: Automatic screen rotation applet |
9 | Taskbar applet for enabled and disabling the automatic rotation | 9 | Taskbar applet for enabled and disabling the automatic rotation |
10 | of the screen based on your devices physical orientation/ | 10 | of the screen based on your devices physical orientation/ |
11 | Version: $QPE_VERSION$EXTRAVERSION | 11 | Version: $QPE_VERSION$EXTRAVERSION |