summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clockapplet/clock.cpp46
-rw-r--r--core/applets/clockapplet/clock.h2
2 files changed, 42 insertions, 6 deletions
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index 7d396e7..d7d326d 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -2,2 +2,3 @@
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** Copyright (C) 2002 Trolltech AS. All rights reserved.
3** 4**
@@ -19,2 +20,4 @@
19**********************************************************************/ 20**********************************************************************/
21// merged in the StyleFix. Applets should raise Popup!
22// by zecke@handhelds.org 6th of may 2004
20 23
@@ -25,2 +28,3 @@
25#include <opie2/otaskbarapplet.h> 28#include <opie2/otaskbarapplet.h>
29
26#include <qpe/qpeapplication.h> 30#include <qpe/qpeapplication.h>
@@ -28,2 +32,5 @@
28#include <qpe/config.h> 32#include <qpe/config.h>
33#include <qpe/resource.h>
34
35#include <qpopupmenu.h>
29 36
@@ -59,7 +66,36 @@ void LauncherClock::readConfig() {
59 66
60void LauncherClock::mouseReleaseEvent( QMouseEvent * ) 67void LauncherClock::mousePressEvent( QMouseEvent * )
61{ 68{
62 QCString setTimeApp; 69 QPopupMenu *menu = new QPopupMenu(this);
63 setTimeApp="systemtime"; 70 menu->insertItem(tr("Set time..."), 0);
64 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()"); 71 menu->insertSeparator();
72 menu->insertItem(tr("Clock.."), 1);
73
74
75 Config config( "Clock" );
76 config.setGroup( "Daily Alarm" );
77 bool alarmOn = config.readBoolEntry("Enabled", FALSE);
78 menu->insertItem(Resource::loadIconSet(alarmOn?"clockapplet/smallalarm":"clockapplet/smallalarm_off" ),
79 tr("Alarm..."), 2);
80
81
82 /* FIXME use OTaskBarApplet ### */
83 QPoint curPos = mapToGlobal( QPoint(0,0) );
84 QSize sh = menu->sizeHint();
85 switch (menu->exec( curPos-QPoint((sh.width()-width())/2,sh.height()) )) {
86 case 0:
87 Global::execute( "systemtime" );
88 break;
89 case 1: {
90 QCopEnvelope e("QPE/Application/clock", "showClock()" );
91 }
92 break;
93 case 2: {
94 QCopEnvelope e("QPE/Application/clock", "editDailyAlarm()" );
95 }
96 break;
97 default:
98 break;
99 }
100 delete menu;
65} 101}
@@ -115,3 +151,3 @@ void LauncherClock::changeTime( void )
115 151
116void LauncherClock::slotClockChanged( bool pm ) 152void LauncherClock::slotClockChanged( bool )
117{ 153{
diff --git a/core/applets/clockapplet/clock.h b/core/applets/clockapplet/clock.h
index 996fb56..43639bb 100644
--- a/core/applets/clockapplet/clock.h
+++ b/core/applets/clockapplet/clock.h
@@ -38,3 +38,3 @@ protected slots:
38protected: 38protected:
39 void mouseReleaseEvent( QMouseEvent * ); 39 void mousePressEvent( QMouseEvent * );
40 void timerEvent( QTimerEvent * ); 40 void timerEvent( QTimerEvent * );