summaryrefslogtreecommitdiff
path: root/core/applets/clockapplet/clock.cpp
Unidiff
Diffstat (limited to 'core/applets/clockapplet/clock.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clockapplet/clock.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index 9fead03..120a019 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -1,83 +1,83 @@
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 20
21#include "clock.h" 21#include "clock.h"
22 22
23#include <opie2/otaskbarapplet.h> 23#include <opie2/otaskbarapplet.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27 27
28LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent ) 28LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
29{ 29{
30 // If you want a sunken border around the clock do this: 30 // If you want a sunken border around the clock do this:
31 // setFrameStyle( QFrame::Panel | QFrame::Sunken ); 31 // setFrameStyle( QFrame::Panel | QFrame::Sunken );
32 //setFont( QFont( "Helvetica", , QFont::Normal ) ); 32 //setFont( QFont( "Helvetica", , QFont::Normal ) );
33 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime( ) ) ); 33 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) );
34 connect( qApp, SIGNAL( clockChanged( bool ) ), 34 connect( qApp, SIGNAL( clockChanged(bool) ),
35 this, SLOT( slotClockChanged( bool ) ) ); 35 this, SLOT( slotClockChanged(bool) ) );
36 readConfig(); 36 readConfig();
37 timerId = 0; 37 timerId = 0;
38 timerEvent( 0 ); 38 timerEvent( 0 );
39 show(); 39 show();
40} 40}
41 41
42int LauncherClock::position() 42int LauncherClock::position()
43{ 43{
44 return 10; 44 return 10;
45} 45}
46 46
47void LauncherClock::readConfig() { 47void LauncherClock::readConfig() {
48 Config config( "qpe" ); 48 Config config( "qpe" );
49 config.setGroup( "Time" ); 49 config.setGroup( "Time" );
50 ampmFormat = config.readBoolEntry( "AMPM", TRUE ); 50 ampmFormat = config.readBoolEntry( "AMPM", TRUE );
51 config.setGroup( "Date" ); 51 config.setGroup( "Date" );
52 format = config.readNumEntry("ClockApplet",0); 52 format = config.readNumEntry("ClockApplet",0);
53} 53}
54 54
55void LauncherClock::mouseReleaseEvent( QMouseEvent * ) 55void LauncherClock::mouseReleaseEvent( QMouseEvent * )
56{ 56{
57 QCString setTimeApp; 57 QCString setTimeApp;
58 setTimeApp="systemtime"; 58 setTimeApp="systemtime";
59 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()"); 59 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()");
60} 60}
61 61
62 62
63void LauncherClock::timerEvent( QTimerEvent *e ) 63void LauncherClock::timerEvent( QTimerEvent *e )
64{ 64{
65 if ( !e || e->timerId() == timerId ) { 65 if ( !e || e->timerId() == timerId ) {
66 killTimer( timerId ); 66 killTimer( timerId );
67 changeTime(); 67 changeTime();
68 QTime t = QTime::currentTime(); 68 QTime t = QTime::currentTime();
69 int ms = (60 - t.second())*1000 - t.msec(); 69 int ms = (60 - t.second())*1000 - t.msec();
70 timerId = startTimer( ms ); 70 timerId = startTimer( ms );
71 } else { 71 } else {
72 QLabel::timerEvent( e ); 72 QLabel::timerEvent( e );
73 } 73 }
74} 74}
75 75
76void LauncherClock::updateTime( void ) 76void LauncherClock::updateTime( void )
77{ 77{
78 changeTime(); 78 changeTime();
79} 79}
80 80
81void LauncherClock::changeTime( void ) 81void LauncherClock::changeTime( void )
82{ 82{
83 QTime tm = QDateTime::currentDateTime().time(); 83 QTime tm = QDateTime::currentDateTime().time();