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.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index 3b13d74..7d396e7 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -11,30 +11,34 @@
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/* OPIE */
24#include <opie2/odebug.h>
23#include <opie2/otaskbarapplet.h> 25#include <opie2/otaskbarapplet.h>
24#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
26#include <qpe/config.h> 28#include <qpe/config.h>
27 29
30using namespace Opie::Core;
28using namespace Opie::Ui; 31using namespace Opie::Ui;
32
29LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent ) 33LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
30{ 34{
31 // If you want a sunken border around the clock do this: 35 // If you want a sunken border around the clock do this:
32 // setFrameStyle( QFrame::Panel | QFrame::Sunken ); 36 // setFrameStyle( QFrame::Panel | QFrame::Sunken );
33 //setFont( QFont( "Helvetica", , QFont::Normal ) ); 37 //setFont( QFont( "Helvetica", , QFont::Normal ) );
34 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) ); 38 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) );
35 connect( qApp, SIGNAL( clockChanged(bool) ), 39 connect( qApp, SIGNAL( clockChanged(bool) ),
36 this, SLOT( slotClockChanged(bool) ) ); 40 this, SLOT( slotClockChanged(bool) ) );
37 readConfig(); 41 readConfig();
38 timerId = 0; 42 timerId = 0;
39 timerEvent( 0 ); 43 timerEvent( 0 );
40 show(); 44 show();
@@ -46,27 +50,27 @@ int LauncherClock::position()
46} 50}
47 51
48void LauncherClock::readConfig() { 52void LauncherClock::readConfig() {
49 Config config( "qpe" ); 53 Config config( "qpe" );
50 config.setGroup( "Time" ); 54 config.setGroup( "Time" );
51 ampmFormat = config.readBoolEntry( "AMPM", TRUE ); 55 ampmFormat = config.readBoolEntry( "AMPM", TRUE );
52 config.setGroup( "Date" ); 56 config.setGroup( "Date" );
53 format = config.readNumEntry("ClockApplet",0); 57 format = config.readNumEntry("ClockApplet",0);
54} 58}
55 59
56void LauncherClock::mouseReleaseEvent( QMouseEvent * ) 60void LauncherClock::mouseReleaseEvent( QMouseEvent * )
57{ 61{
58 QCString setTimeApp; 62 QCString setTimeApp;
59 setTimeApp="systemtime"; 63 setTimeApp="systemtime";
60 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()"); 64 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()");
61} 65}
62 66
63 67
64void LauncherClock::timerEvent( QTimerEvent *e ) 68void LauncherClock::timerEvent( QTimerEvent *e )
65{ 69{
66 if ( !e || e->timerId() == timerId ) { 70 if ( !e || e->timerId() == timerId ) {
67 killTimer( timerId ); 71 killTimer( timerId );
68 changeTime(); 72 changeTime();
69 QTime t = QTime::currentTime(); 73 QTime t = QTime::currentTime();
70 int ms = (60 - t.second())*1000 - t.msec(); 74 int ms = (60 - t.second())*1000 - t.msec();
71 timerId = startTimer( ms ); 75 timerId = startTimer( ms );
72 } else { 76 } else {