summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp2
-rw-r--r--noncore/applets/autorotateapplet/autorotateapplet.pro16
-rw-r--r--noncore/applets/autorotateapplet/config.in2
-rw-r--r--noncore/applets/autorotateapplet/opie-autorotate.control2
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
32using namespace Opie; 32using namespace Opie;
33 33
34AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) 34AutoRotate::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
47AutoRotate::~AutoRotate() 47AutoRotate::~AutoRotate()
48{ 48{
49 if (popupMenu) { 49 if (popupMenu) {
50 delete popupMenu; 50 delete popupMenu;
51 } 51 }
52} 52}
53 53
54void AutoRotate::mousePressEvent(QMouseEvent *) 54void 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
72void AutoRotate::paintEvent(QPaintEvent *) 72void 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
78void AutoRotate::setRotateEnabled(bool status) 78void 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}
85bool AutoRotate::isRotateEnabled() 85bool 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 1TEMPLATE = lib
2 CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3 HEADERS =autorotate.h autorotateimpl.h 3HEADERS = autorotate.h autorotateimpl.h
4 SOURCES =autorotate.cpp autorotateimpl.cpp 4SOURCES = autorotate.cpp autorotateimpl.cpp
5 TARGET = autorotateapplet 5TARGET = autorotateapplet
6 DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include ../launcher 8DEPENDPATH += $(OPIEDIR)/include ../launcher
9LIBS += -lqpe -lopie 9LIBS += -lqpe -lopiecore2
10 VERSION = 1.0.0 10VERSION = 1.0.0
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.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 @@
1Package: opie-autorotate 1Package: opie-autorotate
2Files: plugins/applets/libautorotateapplet.so* pics/autorotate/*.png 2Files: plugins/applets/libautorotateapplet.so* pics/autorotate/*.png
3Priority: optional 3Priority: optional
4Section: opie/applets 4Section: opie/applets
5Maintainer: Greg Gilbert <greg@treke.net> 5Maintainer: Greg Gilbert <greg@treke.net>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal, libopie1 7Depends: task-opie-minimal, libopiecore2
8Description: Automatic screen rotation applet 8Description: 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/
11Version: $QPE_VERSION$EXTRAVERSION 11Version: $QPE_VERSION$EXTRAVERSION