summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonapplet.cpp1
-rw-r--r--kalarmd/simplealarmdaemonapplet.h1
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp18
-rw-r--r--korganizer/koprefs.cpp3
-rw-r--r--korganizer/koprefs.h1
-rw-r--r--korganizer/koprefsdialog.cpp38
-rw-r--r--korganizer/kowhatsnextview.cpp79
7 files changed, 78 insertions, 63 deletions
diff --git a/kalarmd/simplealarmdaemonapplet.cpp b/kalarmd/simplealarmdaemonapplet.cpp
index 7e8125d..94d8428 100644
--- a/kalarmd/simplealarmdaemonapplet.cpp
+++ b/kalarmd/simplealarmdaemonapplet.cpp
@@ -1,57 +1,58 @@
1#include "simplealarmdaemonapplet.h" 1#include "simplealarmdaemonapplet.h"
2 2
3#include "simplealarmdaemonimpl.h" 3#include "simplealarmdaemonimpl.h"
4 4
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qlabel.h> 6#include <qlabel.h>
7#include <qapp.h> 7#include <qapp.h>
8#include <qpe/resource.h> 8#include <qpe/resource.h>
9SimpleAlarmDaemonApplet::SimpleAlarmDaemonApplet() 9SimpleAlarmDaemonApplet::SimpleAlarmDaemonApplet()
10 : mApplet( 0 ), ref( 0 ) 10 : mApplet( 0 ), ref( 0 )
11{ 11{
12 12
13} 13}
14 14
15SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet() 15SimpleAlarmDaemonApplet::~SimpleAlarmDaemonApplet()
16{ 16{
17 delete mApplet; 17 delete mApplet;
18 mApplet = 0;
18} 19}
19 20
20 21
21QWidget *SimpleAlarmDaemonApplet::applet( QWidget *parent ) 22QWidget *SimpleAlarmDaemonApplet::applet( QWidget *parent )
22{ 23{
23 if ( !mApplet ) { 24 if ( !mApplet ) {
24 mApplet = new SimpleAlarmDaemonImpl( parent ); 25 mApplet = new SimpleAlarmDaemonImpl( parent );
25 if ( QApplication::desktop()->width() < 480 ) 26 if ( QApplication::desktop()->width() < 480 )
26 mApplet->setPixmap( Resource::loadPixmap( "ko16" ) ); 27 mApplet->setPixmap( Resource::loadPixmap( "ko16" ) );
27 else 28 else
28 mApplet->setPixmap( Resource::loadPixmap( "ko24" ) ); 29 mApplet->setPixmap( Resource::loadPixmap( "ko24" ) );
29 QCopChannel* c = new QCopChannel("koalarm",mApplet , "channel" ) ; 30 QCopChannel* c = new QCopChannel("koalarm",mApplet , "channel" ) ;
30 QObject::connect( c, SIGNAL (received ( const QCString &, const QByteArray & )),mApplet, SLOT(recieve( const QCString&, const QByteArray& ))); 31 QObject::connect( c, SIGNAL (received ( const QCString &, const QByteArray & )),mApplet, SLOT(recieve( const QCString&, const QByteArray& )));
31 mApplet->show(); 32 mApplet->show();
32 } 33 }
33 return mApplet; 34 return mApplet;
34} 35}
35 36
36int SimpleAlarmDaemonApplet::position() const 37int SimpleAlarmDaemonApplet::position() const
37{ 38{
38 return 7; 39 return 7;
39} 40}
40 41
41QRESULT SimpleAlarmDaemonApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 42QRESULT SimpleAlarmDaemonApplet::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
42{ 43{
43 *iface = 0; 44 *iface = 0;
44 if ( uuid == IID_QUnknown ) 45 if ( uuid == IID_QUnknown )
45 *iface = this; 46 *iface = this;
46 else if ( uuid == IID_TaskbarApplet ) 47 else if ( uuid == IID_TaskbarApplet )
47 *iface = this; 48 *iface = this;
48 49
49 if ( *iface ) 50 if ( *iface )
50 (*iface)->addRef(); 51 (*iface)->addRef();
51 return QS_OK; 52 return QS_OK;
52} 53}
53 54
54Q_EXPORT_INTERFACE() 55Q_EXPORT_INTERFACE()
55{ 56{
56 Q_CREATE_INSTANCE( SimpleAlarmDaemonApplet ) 57 Q_CREATE_INSTANCE( SimpleAlarmDaemonApplet )
57} 58}
diff --git a/kalarmd/simplealarmdaemonapplet.h b/kalarmd/simplealarmdaemonapplet.h
index a4cbee4..1787bf3 100644
--- a/kalarmd/simplealarmdaemonapplet.h
+++ b/kalarmd/simplealarmdaemonapplet.h
@@ -1,26 +1,25 @@
1#ifndef SIMPLEALARMDAEMONAPPLET_H 1#ifndef SIMPLEALARMDAEMONAPPLET_H
2#define SIMPLEALARMDAEMONAPPLET_H 2#define SIMPLEALARMDAEMONAPPLET_H
3 3
4#include <qpe/taskbarappletinterface.h> 4#include <qpe/taskbarappletinterface.h>
5 5
6class SimpleAlarmDaemonImpl; 6class SimpleAlarmDaemonImpl;
7class ScreenshotApplet;
8 7
9class SimpleAlarmDaemonApplet : public TaskbarAppletInterface 8class SimpleAlarmDaemonApplet : public TaskbarAppletInterface
10{ 9{
11 public: 10 public:
12 SimpleAlarmDaemonApplet(); 11 SimpleAlarmDaemonApplet();
13 virtual ~SimpleAlarmDaemonApplet(); 12 virtual ~SimpleAlarmDaemonApplet();
14 13
15 QRESULT queryInterface( const QUuid&, QUnknownInterface** ); 14 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
16 Q_REFCOUNT 15 Q_REFCOUNT
17 16
18 virtual QWidget *applet( QWidget *parent ); 17 virtual QWidget *applet( QWidget *parent );
19 virtual int position() const; 18 virtual int position() const;
20 19
21 private: 20 private:
22 SimpleAlarmDaemonImpl *mApplet; 21 SimpleAlarmDaemonImpl *mApplet;
23 ulong ref; 22 ulong ref;
24}; 23};
25 24
26#endif 25#endif
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 4ff6861..50c4605 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -1,241 +1,241 @@
1/* 1/*
2 This file is part of the KOrganizer alarm daemon. 2 This file is part of the KOrganizer alarm daemon.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include "simplealarmdaemonimpl.h" 24#include "simplealarmdaemonimpl.h"
25 25
26#include "alarmdialog.h" 26#include "alarmdialog.h"
27#include <qpopupmenu.h> 27#include <qpopupmenu.h>
28#include <qapp.h> 28#include <qapp.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qfile.h> 30#include <qfile.h>
31#include <qhbox.h> 31#include <qhbox.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qlineedit.h> 35#include <qlineedit.h>
36#include <qdialog.h> 36#include <qdialog.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qtextstream.h> 38#include <qtextstream.h>
39#include <qtopia/qcopenvelope_qws.h> 39#include <qtopia/qcopenvelope_qws.h>
40#include <qtopia/alarmserver.h> 40#include <qtopia/alarmserver.h>
41 41
42#include <stdlib.h> 42#include <stdlib.h>
43#include <stdio.h> 43#include <stdio.h>
44#include <unistd.h> 44#include <unistd.h>
45 45
46 46
47SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) 47SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
48 : QLabel( parent ) 48 : QLabel( parent )
49{ 49{
50 mAlarmDialog = new AlarmDialog( 0 ); 50 mAlarmDialog = new AlarmDialog( 0 );
51 mPopUp = new QPopupMenu( 0 ); 51 mPopUp = new QPopupMenu( this );
52 mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); 52 mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) );
53 mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); 53 mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) );
54 mPopUp->insertSeparator(); 54 mPopUp->insertSeparator();
55 mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) ); 55 mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) );
56 mPopUp->insertSeparator(); 56 mPopUp->insertSeparator();
57 mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); 57 mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) );
58 mPopUp->insertSeparator(); 58 mPopUp->insertSeparator();
59 mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); 59 mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) );
60 mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); 60 mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) );
61 mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); 61 mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) );
62 mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); 62 mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) );
63 mPopUp->insertSeparator(); 63 mPopUp->insertSeparator();
64 mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); 64 mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) );
65 mTimerPopUp = new QPopupMenu( mPopUp ); 65 mTimerPopUp = new QPopupMenu( this );
66 66
67 mBeepPopUp = new QPopupMenu( mPopUp ); 67 mBeepPopUp = new QPopupMenu( this );
68 mSoundPopUp = new QPopupMenu( mBeepPopUp ); 68 mSoundPopUp = new QPopupMenu( this );
69 mPausePopUp = new QPopupMenu( mBeepPopUp ); 69 mPausePopUp = new QPopupMenu( this );
70 QPopupMenu* savePopUp = new QPopupMenu( mBeepPopUp ); 70 QPopupMenu* savePopUp = new QPopupMenu( this );
71 savePopUp->insertItem( "Save", 0 ); 71 savePopUp->insertItem( "Save", 0 );
72 savePopUp->insertItem( "Load", 1 ); 72 savePopUp->insertItem( "Load", 1 );
73 mSoundPopUp->insertItem( "Buzzer", 0 ); 73 mSoundPopUp->insertItem( "Buzzer", 0 );
74 mSoundPopUp->insertItem( "Wav file", 1 ); 74 mSoundPopUp->insertItem( "Wav file", 1 );
75 mPausePopUp->insertItem( " 1 sec", 1 ); 75 mPausePopUp->insertItem( " 1 sec", 1 );
76 mPausePopUp->insertItem( " 2 sec", 2 ); 76 mPausePopUp->insertItem( " 2 sec", 2 );
77 mPausePopUp->insertItem( " 3 sec", 3 ); 77 mPausePopUp->insertItem( " 3 sec", 3 );
78 mPausePopUp->insertItem( " 5 sec", 5 ); 78 mPausePopUp->insertItem( " 5 sec", 5 );
79 mPausePopUp->insertItem( "10 sec", 10 ); 79 mPausePopUp->insertItem( "10 sec", 10 );
80 mPausePopUp->insertItem( "30 sec", 30 ); 80 mPausePopUp->insertItem( "30 sec", 30 );
81 mPausePopUp->insertItem( " 1 min", 60 ); 81 mPausePopUp->insertItem( " 1 min", 60 );
82 mPausePopUp->insertItem( " 5 min", 300 ); 82 mPausePopUp->insertItem( " 5 min", 300 );
83 mPausePopUp->insertItem( "10 min", 600 ); 83 mPausePopUp->insertItem( "10 min", 600 );
84 mSuspendPopUp = new QPopupMenu( mBeepPopUp ); 84 mSuspendPopUp = new QPopupMenu( this );
85 mSuspendPopUp->insertItem( "Off", 0 ); 85 mSuspendPopUp->insertItem( "Off", 0 );
86 mSuspendPopUp->insertItem( " 1x", 1 ); 86 mSuspendPopUp->insertItem( " 1x", 1 );
87 mSuspendPopUp->insertItem( " 2x", 2 ); 87 mSuspendPopUp->insertItem( " 2x", 2 );
88 mSuspendPopUp->insertItem( " 3x", 3 ); 88 mSuspendPopUp->insertItem( " 3x", 3 );
89 mSuspendPopUp->insertItem( " 5x", 5 ); 89 mSuspendPopUp->insertItem( " 5x", 5 );
90 mSuspendPopUp->insertItem( "10x", 10 ); 90 mSuspendPopUp->insertItem( "10x", 10 );
91 mSuspendPopUp->insertItem( "20x", 20 ); 91 mSuspendPopUp->insertItem( "20x", 20 );
92 mSuspendPopUp->insertItem( "30x", 30 ); 92 mSuspendPopUp->insertItem( "30x", 30 );
93 mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp ); 93 mBeepPopUp->insertItem( "Auto suspend",mSuspendPopUp );
94 mBeepPopUp->insertItem( "Beep interval",mPausePopUp ); 94 mBeepPopUp->insertItem( "Beep interval",mPausePopUp );
95 mBeepPopUp->insertItem( "Replay",mSoundPopUp ); 95 mBeepPopUp->insertItem( "Replay",mSoundPopUp );
96 mBeepPopUp->insertItem( "Config",savePopUp ); 96 mBeepPopUp->insertItem( "Config",savePopUp );
97 mBeepPopUp->insertItem( "300", 300 ); 97 mBeepPopUp->insertItem( "300", 300 );
98 mBeepPopUp->insertItem( "180", 180 ); 98 mBeepPopUp->insertItem( "180", 180 );
99 mBeepPopUp->insertItem( "60", 60 ); 99 mBeepPopUp->insertItem( "60", 60 );
100 mBeepPopUp->insertItem( "30", 30 ); 100 mBeepPopUp->insertItem( "30", 30 );
101 mBeepPopUp->insertItem( "10", 10 ); 101 mBeepPopUp->insertItem( "10", 10 );
102 mBeepPopUp->insertItem( "3", 3 ); 102 mBeepPopUp->insertItem( "3", 3 );
103 mBeepPopUp->insertItem( "1", 1 ); 103 mBeepPopUp->insertItem( "1", 1 );
104 mBeepPopUp->insertItem( "Off", 0 ); 104 mBeepPopUp->insertItem( "Off", 0 );
105 mBeepPopUp->setCheckable( true ); 105 mBeepPopUp->setCheckable( true );
106 mPopUp->insertSeparator(); 106 mPopUp->insertSeparator();
107 mPopUp->insertItem( "Play beeps", mBeepPopUp ); 107 mPopUp->insertItem( "Play beeps", mBeepPopUp );
108 mPopUp->insertSeparator(); 108 mPopUp->insertSeparator();
109 mPopUp->insertItem( "Timer", mTimerPopUp ); 109 mPopUp->insertItem( "Timer", mTimerPopUp );
110 mPopUp->insertSeparator(); 110 mPopUp->insertSeparator();
111 mPopUp->insertItem( "Simulate", this, SLOT ( simulate() ) ); 111 mPopUp->insertItem( "Simulate", this, SLOT ( simulate() ) );
112 112
113 mPopUp->resize( mPopUp->sizeHint() ); 113 mPopUp->resize( mPopUp->sizeHint() );
114 mPlayBeeps = 60; 114 mPlayBeeps = 60;
115 mBeepPopUp->setItemChecked ( mPlayBeeps, true ); 115 mBeepPopUp->setItemChecked ( mPlayBeeps, true );
116 connect ( mBeepPopUp, SIGNAL( activated ( int ) ), this, SLOT (slotPlayBeep( int ) ) ); 116 connect ( mBeepPopUp, SIGNAL( activated ( int ) ), this, SLOT (slotPlayBeep( int ) ) );
117 connect ( mTimerPopUp, SIGNAL( activated ( int ) ), this, SLOT (confTimer( int ) ) ); 117 connect ( mTimerPopUp, SIGNAL( activated ( int ) ), this, SLOT (confTimer( int ) ) );
118 connect ( mTimerPopUp, SIGNAL(aboutToShow() ), this, SLOT ( showTimer( ) ) ); 118 connect ( mTimerPopUp, SIGNAL(aboutToShow() ), this, SLOT ( showTimer( ) ) );
119 connect ( mSoundPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSound( int ) ) ); 119 connect ( mSoundPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSound( int ) ) );
120 connect ( mPausePopUp, SIGNAL( activated ( int ) ), this, SLOT (confPause( int ) ) ); 120 connect ( mPausePopUp, SIGNAL( activated ( int ) ), this, SLOT (confPause( int ) ) );
121 connect ( mSuspendPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSuspend( int ) ) ); 121 connect ( mSuspendPopUp, SIGNAL( activated ( int ) ), this, SLOT (confSuspend( int ) ) );
122 connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) ); 122 connect ( savePopUp, SIGNAL( activated ( int ) ), this, SLOT (saveSlot( int ) ) );
123 mTimerTime = 0; 123 mTimerTime = 0;
124 mCustomText = "Custom Text"; 124 mCustomText = "Custom Text";
125 mCustomMinutes = 7; 125 mCustomMinutes = 7;
126 mTimerPopupConf = 1; 126 mTimerPopupConf = 1;
127 fillTimerPopUp(); 127 fillTimerPopUp();
128 mPausePlay = 0; 128 mPausePlay = 0;
129 confPause( 1 ); 129 confPause( 1 );
130 mSuspend = 0; 130 mSuspend = 0;
131 confSuspend( 0 ); 131 confSuspend( 0 );
132 if ( QApplication::desktop()->width() < 480 ) { 132 if ( QApplication::desktop()->width() < 480 ) {
133 wavAlarm = false; 133 wavAlarm = false;
134 mSoundPopUp->setItemChecked ( 0, true ); 134 mSoundPopUp->setItemChecked ( 0, true );
135 } 135 }
136 else { 136 else {
137 wavAlarm = true; 137 wavAlarm = true;
138 mSoundPopUp->setItemChecked ( 1, true ); 138 mSoundPopUp->setItemChecked ( 1, true );
139 } 139 }
140 saveSlot( 1 ); 140 saveSlot( 1 );
141} 141}
142 142
143SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl() 143SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl()
144{ 144{
145 delete mPopUp; 145 //delete mPopUp;
146 delete mAlarmDialog; 146 delete mAlarmDialog;
147} 147}
148void SimpleAlarmDaemonImpl::saveSlot( int load ) 148void SimpleAlarmDaemonImpl::saveSlot( int load )
149{ 149{
150 QString fileName = QDir::homeDirPath() +"/.kopialarmrc"; 150 QString fileName = QDir::homeDirPath() +"/.kopialarmrc";
151 //qDebug("save %d ", load ); 151 //qDebug("save %d ", load );
152 QFile file( fileName ); 152 QFile file( fileName );
153 if ( load ) { 153 if ( load ) {
154 if( !QFile::exists( fileName) ) 154 if( !QFile::exists( fileName) )
155 return; 155 return;
156 if (!file.open( IO_ReadOnly ) ) { 156 if (!file.open( IO_ReadOnly ) ) {
157 return ; 157 return ;
158 } 158 }
159 QString line; 159 QString line;
160 bool ok; 160 bool ok;
161 int val; 161 int val;
162 int len; 162 int len;
163 while ( file.readLine( line, 1024 ) > 0 ) { 163 while ( file.readLine( line, 1024 ) > 0 ) {
164 //qDebug("read %s ", line.latin1()); 164 //qDebug("read %s ", line.latin1());
165 len = line.length(); 165 len = line.length();
166 if ( line.left(4 ) == "PPAU" ) { 166 if ( line.left(4 ) == "PPAU" ) {
167 val = line.mid( 4,len-5).toInt( &ok ); 167 val = line.mid( 4,len-5).toInt( &ok );
168 if ( ok ) { 168 if ( ok ) {
169 confPause( val ); 169 confPause( val );
170 } 170 }
171 } 171 }
172 if ( line.left(4 ) == "SUCO" ) { 172 if ( line.left(4 ) == "SUCO" ) {
173 val = line.mid( 4,len-5).toInt( &ok ); 173 val = line.mid( 4,len-5).toInt( &ok );
174 if ( ok ) 174 if ( ok )
175 confSuspend ( val ); 175 confSuspend ( val );
176 } 176 }
177 if ( line.left(4 ) == "WAAL" ) { 177 if ( line.left(4 ) == "WAAL" ) {
178 val = line.mid( 4,len-5).toInt( &ok ); 178 val = line.mid( 4,len-5).toInt( &ok );
179 if ( ok ) 179 if ( ok )
180 confSound( val ); 180 confSound( val );
181 181
182 } 182 }
183 if ( line.left(4 ) == "PLBE" ) { 183 if ( line.left(4 ) == "PLBE" ) {
184 val = line.mid( 4,len-5).toInt( &ok ); 184 val = line.mid( 4,len-5).toInt( &ok );
185 if ( ok ) 185 if ( ok )
186 slotPlayBeep( val ); 186 slotPlayBeep( val );
187 187
188 } 188 }
189 if ( line.left(4 ) == "CUTE" ) { 189 if ( line.left(4 ) == "CUTE" ) {
190 mCustomText = line.mid( 5,len-6); 190 mCustomText = line.mid( 5,len-6);
191 // qDebug("text ***%s*** ",mCustomText.latin1() ); 191 // qDebug("text ***%s*** ",mCustomText.latin1() );
192 192
193 } 193 }
194 if ( line.left(4 ) == "CUMI" ) { 194 if ( line.left(4 ) == "CUMI" ) {
195 val = line.mid( 4,len-5).toInt( &ok ); 195 val = line.mid( 4,len-5).toInt( &ok );
196 if ( ok ) 196 if ( ok )
197 mCustomMinutes = val; 197 mCustomMinutes = val;
198 198
199 } 199 }
200 if ( line.left(4 ) == "SUTI" ) { 200 if ( line.left(4 ) == "SUTI" ) {
201 val = line.mid( 4,len-5).toInt( &ok ); 201 val = line.mid( 4,len-5).toInt( &ok );
202 if ( ok ) 202 if ( ok )
203 mAlarmDialog->setSuspendTime( val );; 203 mAlarmDialog->setSuspendTime( val );;
204 204
205 } 205 }
206 } 206 }
207 file.close(); 207 file.close();
208 } else { 208 } else {
209 if (!file.open( IO_WriteOnly ) ) { 209 if (!file.open( IO_WriteOnly ) ) {
210 return; 210 return;
211 } 211 }
212 QString configString ; 212 QString configString ;
213 configString += "PPAU " + QString::number( mPausePlay ) + "\n"; 213 configString += "PPAU " + QString::number( mPausePlay ) + "\n";
214 configString += "SUCO " + QString::number( mSuspend ) + "\n"; 214 configString += "SUCO " + QString::number( mSuspend ) + "\n";
215 configString += "WAAL " + QString::number( wavAlarm ) + "\n"; 215 configString += "WAAL " + QString::number( wavAlarm ) + "\n";
216 configString += "PLBE " + QString::number( mPlayBeeps ) + "\n"; 216 configString += "PLBE " + QString::number( mPlayBeeps ) + "\n";
217 configString += "CUTE " + mCustomText + "\n"; 217 configString += "CUTE " + mCustomText + "\n";
218 configString += "CUMI " + QString::number( mCustomMinutes ) + "\n"; 218 configString += "CUMI " + QString::number( mCustomMinutes ) + "\n";
219 configString += "SUTI " + QString::number( mAlarmDialog->getSuspendTime( )) + "\n"; 219 configString += "SUTI " + QString::number( mAlarmDialog->getSuspendTime( )) + "\n";
220 QTextStream ts( &file ); 220 QTextStream ts( &file );
221 ts << configString ; 221 ts << configString ;
222 file.close(); 222 file.close();
223 } 223 }
224 224
225} 225}
226void SimpleAlarmDaemonImpl::confSuspend( int num ) 226void SimpleAlarmDaemonImpl::confSuspend( int num )
227{ 227{
228 mSuspendPopUp->setItemChecked ( mSuspend,false ); 228 mSuspendPopUp->setItemChecked ( mSuspend,false );
229 mSuspend = num; 229 mSuspend = num;
230 mSuspendPopUp->setItemChecked ( mSuspend,true ); 230 mSuspendPopUp->setItemChecked ( mSuspend,true );
231} 231}
232void SimpleAlarmDaemonImpl::confPause( int num ) 232void SimpleAlarmDaemonImpl::confPause( int num )
233{ 233{
234 mPausePopUp->setItemChecked ( mPausePlay,false ); 234 mPausePopUp->setItemChecked ( mPausePlay,false );
235 mPausePlay = num; 235 mPausePlay = num;
236 mPausePopUp->setItemChecked ( mPausePlay,true ); 236 mPausePopUp->setItemChecked ( mPausePlay,true );
237} 237}
238void SimpleAlarmDaemonImpl::confSound( int num ) 238void SimpleAlarmDaemonImpl::confSound( int num )
239{ 239{
240 if ( num == 0 ) { 240 if ( num == 0 ) {
241 wavAlarm = false; 241 wavAlarm = false;
@@ -471,137 +471,137 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
471 lay.setSpacing(5); 471 lay.setSpacing(5);
472 lay.addWidget( &lab); 472 lay.addWidget( &lab);
473 dia.resize( 200, dia.sizeHint().height() ); 473 dia.resize( 200, dia.sizeHint().height() );
474 474
475 if ( !dia.exec() ) 475 if ( !dia.exec() )
476 return; 476 return;
477 477
478 AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.latin1() ); 478 AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.latin1() );
479 mTimerTime = 0; 479 mTimerTime = 0;
480 return; 480 return;
481 } 481 }
482 if ( mTimerTime ) 482 if ( mTimerTime )
483 return; 483 return;
484 if ( minutes == 1 ) { 484 if ( minutes == 1 ) {
485 return; 485 return;
486 } 486 }
487 QString mess = "timer_alarm"; 487 QString mess = "timer_alarm";
488 mess += ("Timer Alarm!\n"); 488 mess += ("Timer Alarm!\n");
489 if ( minutes == 22 ) 489 if ( minutes == 22 )
490 mess += ( "Pizza is ready"); 490 mess += ( "Pizza is ready");
491 else if ( minutes == 45 ) 491 else if ( minutes == 45 )
492 mess += ( "Please wake up!"); 492 mess += ( "Please wake up!");
493 else if ( minutes == 5 ) 493 else if ( minutes == 5 )
494 mess += ( "Tea is ready"); 494 mess += ( "Tea is ready");
495 else if ( minutes == 3 ) { 495 else if ( minutes == 3 ) {
496 mess += mCustomText; 496 mess += mCustomText;
497 minutes = mCustomMinutes ; 497 minutes = mCustomMinutes ;
498 } 498 }
499 else { 499 else {
500 if ( minutes == 2 ) { 500 if ( minutes == 2 ) {
501 // ask time 501 // ask time
502 QDialog dia ( 0, ("Customize Timer" ), true ); 502 QDialog dia ( 0, ("Customize Timer" ), true );
503 QLabel lab (("Message Text:"), &dia ); 503 QLabel lab (("Message Text:"), &dia );
504 dia.setCaption(("KO/Pi Timer" )); 504 dia.setCaption(("KO/Pi Timer" ));
505 QVBoxLayout lay( &dia ); 505 QVBoxLayout lay( &dia );
506 lay.setMargin(5); 506 lay.setMargin(5);
507 lay.setSpacing(5); 507 lay.setSpacing(5);
508 lay.addWidget( &lab); 508 lay.addWidget( &lab);
509 QLineEdit lEdit( mCustomText, &dia ); 509 QLineEdit lEdit( mCustomText, &dia );
510 lay.addWidget( &lEdit); 510 lay.addWidget( &lEdit);
511 QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia ); 511 QLabel lab2 (("Countdown time (1 min - 24 h):"), &dia );
512 lay.addWidget( &lab2); 512 lay.addWidget( &lab2);
513 QHBox hbox ( &dia ); 513 QHBox hbox ( &dia );
514 QLabel lab3 (("h:"), &hbox ); 514 QLabel lab3 (("h:"), &hbox );
515 QSpinBox spinh( 0, 24, 1,& hbox ); 515 QSpinBox spinh( 0, 24, 1,& hbox );
516 QLabel lab4 ((" min:"), &hbox ); 516 QLabel lab4 ((" min:"), &hbox );
517 QSpinBox spinm( 0, 59, 1,&hbox ); 517 QSpinBox spinm( 0, 59, 1,&hbox );
518 spinh.setValue( mCustomMinutes/60 ); 518 spinh.setValue( mCustomMinutes/60 );
519 spinm.setValue( mCustomMinutes%60 ); 519 spinm.setValue( mCustomMinutes%60 );
520 lay.addWidget( &hbox); 520 lay.addWidget( &hbox);
521 dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); 521 dia.resize( dia.sizeHint().width(), dia.sizeHint().height() );
522 if ( !dia.exec() ) 522 if ( !dia.exec() )
523 return; 523 return;
524 mCustomText = lEdit.text(); 524 mCustomText = lEdit.text();
525 mCustomMinutes = spinh.value()*60+spinm.value(); 525 mCustomMinutes = spinh.value()*60+spinm.value();
526 if ( mCustomMinutes == 0 ) 526 if ( mCustomMinutes == 0 )
527 mCustomMinutes = 1; 527 mCustomMinutes = 1;
528 if ( mCustomMinutes > 1440 ) 528 if ( mCustomMinutes > 1440 )
529 mCustomMinutes = 1440; 529 mCustomMinutes = 1440;
530 mess += mCustomText; 530 mess += mCustomText;
531 minutes = mCustomMinutes; 531 minutes = mCustomMinutes;
532 } 532 }
533 else 533 else
534 mess+= QString::number ( minutes ) + ( " minutes are past!"); 534 mess+= QString::number ( minutes ) + ( " minutes are past!");
535 } 535 }
536 //minutes = 1; 536 //minutes = 1;
537 mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); 537 mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 );
538 timerMesssage = mess; 538 timerMesssage = mess;
539 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.latin1()); 539 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.latin1());
540 mTimerTime = 1; 540 mTimerTime = 1;
541} 541}
542 542
543void SimpleAlarmDaemonImpl::writeFile() 543void SimpleAlarmDaemonImpl::writeFile()
544{ 544{
545 QCopEnvelope e("QPE/Application/kopi", "-writeFile"); 545 QCopEnvelope e("QPE/Application/kopi", "-writeFile");
546} 546}
547void SimpleAlarmDaemonImpl::showWN() 547void SimpleAlarmDaemonImpl::showWN()
548{ 548{
549 QCopEnvelope e("QPE/Application/kopi", "-showWN"); 549 QCopEnvelope e("QPE/Application/kopi", "-showWN");
550} 550}
551void SimpleAlarmDaemonImpl::newTodo() 551void SimpleAlarmDaemonImpl::newTodo()
552{ 552{
553 QCopEnvelope e("QPE/Application/kopi", "-newTodo"); 553 QCopEnvelope e("QPE/Application/kopi", "-newTodo");
554} 554}
555 555
556void SimpleAlarmDaemonImpl::newEvent() 556void SimpleAlarmDaemonImpl::newEvent()
557{ 557{
558 QCopEnvelope e("QPE/Application/kopi", "-newEvent"); 558 QCopEnvelope e("QPE/Application/kopi", "-newEvent");
559 559
560} 560}
561void SimpleAlarmDaemonImpl::newMail() 561void SimpleAlarmDaemonImpl::newMail()
562{ 562{
563 QCopEnvelope e("QPE/Application/ompi", "newMail()"); 563 QCopEnvelope e("QPE/Application/ompi", "newMail()");
564} 564}
565void SimpleAlarmDaemonImpl::showAdd() 565void SimpleAlarmDaemonImpl::showAdd()
566{ 566{
567 QCopEnvelope e("QPE/Application/kapi", " "); 567 QCopEnvelope e("QPE/Application/kapi", "raise()");
568} 568}
569void SimpleAlarmDaemonImpl::ringSync() 569void SimpleAlarmDaemonImpl::ringSync()
570{ 570{
571 QCopEnvelope e("QPE/Application/kopi", "-ringSync"); 571 QCopEnvelope e("QPE/Application/kopi", "-ringSync");
572 572
573} 573}
574void SimpleAlarmDaemonImpl::newCountdown() 574void SimpleAlarmDaemonImpl::newCountdown()
575{ 575{
576 //recieve("cal_alarm", 10 ); 576 //recieve("cal_alarm", 10 );
577} 577}
578void SimpleAlarmDaemonImpl::simulate() 578void SimpleAlarmDaemonImpl::simulate()
579{ 579{
580 writeFile(); 580 writeFile();
581 QString filename = getenv("QPEDIR") ; 581 QString filename = getenv("QPEDIR") ;
582 filename += "/pics/kdepim/korganizer/koalarm.wav"; 582 filename += "/pics/kdepim/korganizer/koalarm.wav";
583 startAlarm("Alarm simulation", filename ); 583 startAlarm("Alarm simulation", filename );
584} 584}
585void SimpleAlarmDaemonImpl::showKO() 585void SimpleAlarmDaemonImpl::showKO()
586{ 586{
587 QCopEnvelope e("QPE/Application/kopi", "-showKO"); 587 QCopEnvelope e("QPE/Application/kopi", "-showKO");
588 588
589} 589}
590void SimpleAlarmDaemonImpl::showTodo() 590void SimpleAlarmDaemonImpl::showTodo()
591{ 591{
592 QCopEnvelope e("QPE/Application/kopi", "-showTodo"); 592 QCopEnvelope e("QPE/Application/kopi", "-showTodo");
593 593
594} 594}
595void SimpleAlarmDaemonImpl::writeJournal() 595void SimpleAlarmDaemonImpl::writeJournal()
596{ 596{
597 QCopEnvelope e("QPE/Application/kopi", "-showJournal"); 597 QCopEnvelope e("QPE/Application/kopi", "-showJournal");
598 598
599} 599}
600 600
601void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) 601void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * )
602{ 602{
603 603
604 mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() ))); 604 mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() )));
605 605
606} 606}
607 607
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 8dca3ae..1cdb2fb 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -136,193 +136,194 @@ KOPrefs::KOPrefs() :
136 addItemBool("Bcc",&mBcc,false); 136 addItemBool("Bcc",&mBcc,false);
137 137
138 KPrefs::setCurrentGroup("Time & Date"); 138 KPrefs::setCurrentGroup("Time & Date");
139 139
140 140
141 addItemInt("Default Start Time",&mStartTime,10); 141 addItemInt("Default Start Time",&mStartTime,10);
142 addItemInt("Default Duration",&mDefaultDuration,2); 142 addItemInt("Default Duration",&mDefaultDuration,2);
143 addItemInt("Default Alarm Time",&mAlarmTime,3); 143 addItemInt("Default Alarm Time",&mAlarmTime,3);
144 KPrefs::setCurrentGroup("AlarmSettings"); 144 KPrefs::setCurrentGroup("AlarmSettings");
145 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 145 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
146 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 146 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
147 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 147 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
148 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 148 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
149 149
150 150
151 KPrefs::setCurrentGroup("Calendar"); 151 KPrefs::setCurrentGroup("Calendar");
152 152
153 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 153 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
154 154
155 KPrefs::setCurrentGroup("Fonts"); 155 KPrefs::setCurrentGroup("Fonts");
156 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 156 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
157 addItemFont("TimeBar Font",&mTimeBarFont); 157 addItemFont("TimeBar Font",&mTimeBarFont);
158 addItemFont("MonthView Font",&mMonthViewFont); 158 addItemFont("MonthView Font",&mMonthViewFont);
159 addItemFont("AgendaView Font",&mAgendaViewFont); 159 addItemFont("AgendaView Font",&mAgendaViewFont);
160 addItemFont("MarcusBains Font",&mMarcusBainsFont); 160 addItemFont("MarcusBains Font",&mMarcusBainsFont);
161 addItemFont("TimeLabels Font",&mTimeLabelsFont); 161 addItemFont("TimeLabels Font",&mTimeLabelsFont);
162 addItemFont("TodoView Font",&mTodoViewFont); 162 addItemFont("TodoView Font",&mTodoViewFont);
163 addItemFont("ListView Font",&mListViewFont); 163 addItemFont("ListView Font",&mListViewFont);
164 addItemFont("DateNavigator Font",&mDateNavigatorFont); 164 addItemFont("DateNavigator Font",&mDateNavigatorFont);
165 addItemFont("EditBox Font",&mEditBoxFont); 165 addItemFont("EditBox Font",&mEditBoxFont);
166 addItemFont("JournalView Font",&mJornalViewFont); 166 addItemFont("JournalView Font",&mJornalViewFont);
167 addItemFont("WhatsNextView Font",&mWhatsNextFont); 167 addItemFont("WhatsNextView Font",&mWhatsNextFont);
168 addItemFont("EventView Font",&mEventViewFont); 168 addItemFont("EventView Font",&mEventViewFont);
169 169
170 KPrefs::setCurrentGroup("RemoteSyncing"); 170 KPrefs::setCurrentGroup("RemoteSyncing");
171 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 171 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
172 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 172 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
173 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 173 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
174 addItemInt("LastSyncTime",&mLastSyncTime,0); 174 addItemInt("LastSyncTime",&mLastSyncTime,0);
175 175
176#ifdef _WIN32_ 176#ifdef _WIN32_
177 QString hdp= locateLocal("data","korganizer")+"\\\\"; 177 QString hdp= locateLocal("data","korganizer")+"\\\\";
178#else 178#else
179 QString hdp= locateLocal("data","korganizer")+"/"; 179 QString hdp= locateLocal("data","korganizer")+"/";
180#endif 180#endif
181 181
182 KPrefs::setCurrentGroup("LoadSaveFileNames"); 182 KPrefs::setCurrentGroup("LoadSaveFileNames");
183 183
184 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 184 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
185 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 185 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
186 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 186 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
187 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 187 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
188 188
189 189
190 KPrefs::setCurrentGroup("Locale"); 190 KPrefs::setCurrentGroup("Locale");
191 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 191 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
192 192
193 193
194 KPrefs::setCurrentGroup("Colors"); 194 KPrefs::setCurrentGroup("Colors");
195 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 195 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
196 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 196 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
197 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 197 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
198 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 198 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
199 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 199 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
200 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 200 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
201 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 201 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
202 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 202 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
203 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 203 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
204 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 204 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
205 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 205 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
206 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 206 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
207 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 207 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
208 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 208 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
209 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 209 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
210 addItemBool("UseAppColors",&mUseAppColors,false); 210 addItemBool("UseAppColors",&mUseAppColors,false);
211 211
212 212
213 213
214 KPrefs::setCurrentGroup("Views"); 214 KPrefs::setCurrentGroup("Views");
215 addItemInt("Hour Size",&mHourSize,8); 215 addItemInt("Hour Size",&mHourSize,8);
216 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 216 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
217 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 217 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
218 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 218 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
219 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 219 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
220 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 220 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
221 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 221 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
222 addItemBool("Enable ToolTips",&mEnableToolTips,false); 222 addItemBool("Enable ToolTips",&mEnableToolTips,false);
223 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 223 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
224 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 224 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
225 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 225 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
226 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 226 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
227 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 227 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
228 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 228 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
229 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 229 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
230 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 230 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
231 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 231 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
232 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); 232 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
233 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
233 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 234 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
234 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 235 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
235 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 236 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
236 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 237 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
237 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 238 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
238 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 239 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
239 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 240 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
240 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 241 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
241#ifdef DESKTOP_VERSION 242#ifdef DESKTOP_VERSION
242 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 243 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
243#else 244#else
244 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 245 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
245#endif 246#endif
246 addItemInt("Day Begins",&mDayBegins,7); 247 addItemInt("Day Begins",&mDayBegins,7);
247 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 248 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
248 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 249 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
249 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 250 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
250 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 251 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
251 252
252 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 253 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
253 addItemBool("Full View Month",&mFullViewMonth,true); 254 addItemBool("Full View Month",&mFullViewMonth,true);
254 addItemBool("Full View Todo",&mFullViewTodo,true); 255 addItemBool("Full View Todo",&mFullViewTodo,true);
255 addItemBool("Quick Todo",&mEnableQuickTodo,false); 256 addItemBool("Quick Todo",&mEnableQuickTodo,false);
256 257
257 addItemInt("Next X Days",&mNextXDays,3); 258 addItemInt("Next X Days",&mNextXDays,3);
258 259
259 KPrefs::setCurrentGroup("Printer"); 260 KPrefs::setCurrentGroup("Printer");
260 261
261 KPrefs::setCurrentGroup("Layout"); 262 KPrefs::setCurrentGroup("Layout");
262 263
263 addItemBool("CompactDialogs",&mCompactDialogs,false); 264 addItemBool("CompactDialogs",&mCompactDialogs,false);
264 addItemBool("VerticalScreen",&mVerticalScreen,true); 265 addItemBool("VerticalScreen",&mVerticalScreen,true);
265 266
266 KPrefs::setCurrentGroup("KOrganizer Plugins"); 267 KPrefs::setCurrentGroup("KOrganizer Plugins");
267 268
268 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 269 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
269 270
270 KPrefs::setCurrentGroup("Group Scheduling"); 271 KPrefs::setCurrentGroup("Group Scheduling");
271 272
272 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 273 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
273 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 274 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
274 addItemStringList("AdditionalMails",&mAdditionalMails,""); 275 addItemStringList("AdditionalMails",&mAdditionalMails,"");
275 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 276 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
276 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 277 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
277 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 278 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
278 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 279 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
279 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 280 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
280 281
281 KPrefs::setCurrentGroup( "Editors" ); 282 KPrefs::setCurrentGroup( "Editors" );
282 283
283 addItemStringList( "EventTemplates", &mEventTemplates ); 284 addItemStringList( "EventTemplates", &mEventTemplates );
284 addItemStringList( "TodoTemplates", &mTodoTemplates ); 285 addItemStringList( "TodoTemplates", &mTodoTemplates );
285 286
286 addItemInt("DestinationPolicy",&mDestination,standardDestination); 287 addItemInt("DestinationPolicy",&mDestination,standardDestination);
287 288
288 289
289 290
290} 291}
291 292
292 293
293KOPrefs::~KOPrefs() 294KOPrefs::~KOPrefs()
294{ 295{
295 if (mInstance == this) 296 if (mInstance == this)
296 mInstance = insd.setObject(0); 297 mInstance = insd.setObject(0);
297 298
298 //qDebug("KOPrefs::~KOPrefs() "); 299 //qDebug("KOPrefs::~KOPrefs() ");
299} 300}
300 301
301 302
302KOPrefs *KOPrefs::instance() 303KOPrefs *KOPrefs::instance()
303{ 304{
304 if (!mInstance) { 305 if (!mInstance) {
305 mInstance = insd.setObject(new KOPrefs()); 306 mInstance = insd.setObject(new KOPrefs());
306 mInstance->readConfig(); 307 mInstance->readConfig();
307 } 308 }
308 309
309 return mInstance; 310 return mInstance;
310} 311}
311 312
312void KOPrefs::usrSetDefaults() 313void KOPrefs::usrSetDefaults()
313{ 314{
314 315
315} 316}
316 317
317void KOPrefs::fillMailDefaults() 318void KOPrefs::fillMailDefaults()
318{ 319{
319 if (mName.isEmpty()) mName = i18n("Anonymous"); 320 if (mName.isEmpty()) mName = i18n("Anonymous");
320 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 321 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
321} 322}
322 323
323void KOPrefs::setTimeZoneIdDefault() 324void KOPrefs::setTimeZoneIdDefault()
324{ 325{
325 ; 326 ;
326} 327}
327 328
328void KOPrefs::setCategoryDefaults() 329void KOPrefs::setCategoryDefaults()
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 0656644..f2fe77a 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -139,135 +139,136 @@ class KOPrefs : public KPimPrefs
139 int mDayBegins; 139 int mDayBegins;
140 int mHourSize; 140 int mHourSize;
141 int mAllDaySize; 141 int mAllDaySize;
142 bool mShowFullMenu; 142 bool mShowFullMenu;
143 bool mDailyRecur; 143 bool mDailyRecur;
144 bool mWeeklyRecur; 144 bool mWeeklyRecur;
145 bool mMonthDailyRecur; 145 bool mMonthDailyRecur;
146 bool mMonthWeeklyRecur; 146 bool mMonthWeeklyRecur;
147 bool mMonthShowIcons; 147 bool mMonthShowIcons;
148 bool mMonthShowShort; 148 bool mMonthShowShort;
149 bool mEnableToolTips; 149 bool mEnableToolTips;
150 bool mEnableMonthScroll; 150 bool mEnableMonthScroll;
151 bool mFullViewMonth; 151 bool mFullViewMonth;
152 bool mMonthViewUsesCategoryColor; 152 bool mMonthViewUsesCategoryColor;
153 bool mFullViewTodo; 153 bool mFullViewTodo;
154 bool mShowCompletedTodo; 154 bool mShowCompletedTodo;
155 bool mMarcusBainsEnabled; 155 bool mMarcusBainsEnabled;
156 int mNextXDays; 156 int mNextXDays;
157 int mWhatsNextDays; 157 int mWhatsNextDays;
158 int mWhatsNextPrios; 158 int mWhatsNextPrios;
159 bool mEnableQuickTodo; 159 bool mEnableQuickTodo;
160 160
161 bool mCompactDialogs; 161 bool mCompactDialogs;
162 bool mVerticalScreen; 162 bool mVerticalScreen;
163 163
164 bool mShowIconNewTodo; 164 bool mShowIconNewTodo;
165 bool mShowIconNewEvent; 165 bool mShowIconNewEvent;
166 bool mShowIconSearch; 166 bool mShowIconSearch;
167 bool mShowIconList; 167 bool mShowIconList;
168 bool mShowIconDay1; 168 bool mShowIconDay1;
169 bool mShowIconDay5; 169 bool mShowIconDay5;
170 bool mShowIconDay7; 170 bool mShowIconDay7;
171 bool mShowIconMonth; 171 bool mShowIconMonth;
172 bool mShowIconTodoview; 172 bool mShowIconTodoview;
173 bool mShowIconBackFast; 173 bool mShowIconBackFast;
174 bool mShowIconBack; 174 bool mShowIconBack;
175 bool mShowIconToday; 175 bool mShowIconToday;
176 bool mShowIconForward; 176 bool mShowIconForward;
177 bool mShowIconForwardFast; 177 bool mShowIconForwardFast;
178 bool mShowIconWhatsThis; 178 bool mShowIconWhatsThis;
179 bool mShowIconNextDays; 179 bool mShowIconNextDays;
180 bool mShowIconNext; 180 bool mShowIconNext;
181 bool mShowIconJournal; 181 bool mShowIconJournal;
182 182
183 bool mShowIconStretch; 183 bool mShowIconStretch;
184 184
185 bool mToolBarHor; 185 bool mToolBarHor;
186 bool mToolBarUp; 186 bool mToolBarUp;
187 bool mToolBarMiniIcons; 187 bool mToolBarMiniIcons;
188 188
189 bool mAskForQuit; 189 bool mAskForQuit;
190 bool mUsePassWd; 190 bool mUsePassWd;
191 bool mShowSyncEvents; 191 bool mShowSyncEvents;
192 bool mShowTodoInAgenda; 192 bool mShowTodoInAgenda;
193 193
194 int mLastSyncTime; 194 int mLastSyncTime;
195 void setCategoryColor(QString cat,const QColor & color); 195 void setCategoryColor(QString cat,const QColor & color);
196 QColor *categoryColor(QString cat); 196 QColor *categoryColor(QString cat);
197 197
198 QString mArchiveFile; 198 QString mArchiveFile;
199 QString mHtmlExportFile; 199 QString mHtmlExportFile;
200 bool mHtmlWithSave; 200 bool mHtmlWithSave;
201 201
202 QStringList mSelectedPlugins; 202 QStringList mSelectedPlugins;
203 203
204 QString mLastImportFile; 204 QString mLastImportFile;
205 QString mLastVcalFile; 205 QString mLastVcalFile;
206 QString mLastSaveFile; 206 QString mLastSaveFile;
207 QString mLastLoadFile; 207 QString mLastLoadFile;
208 208
209 209
210 QString mDefaultAlarmFile; 210 QString mDefaultAlarmFile;
211 int mIMIPScheduler; 211 int mIMIPScheduler;
212 int mIMIPSend; 212 int mIMIPSend;
213 QStringList mAdditionalMails; 213 QStringList mAdditionalMails;
214 int mIMIPAutoRefresh; 214 int mIMIPAutoRefresh;
215 int mIMIPAutoInsertReply; 215 int mIMIPAutoInsertReply;
216 int mIMIPAutoInsertRequest; 216 int mIMIPAutoInsertRequest;
217 int mIMIPAutoFreeBusy; 217 int mIMIPAutoFreeBusy;
218 int mIMIPAutoFreeBusyReply; 218 int mIMIPAutoFreeBusyReply;
219 219
220 QStringList mTodoTemplates; 220 QStringList mTodoTemplates;
221 QStringList mEventTemplates; 221 QStringList mEventTemplates;
222 222
223 int mDestination; 223 int mDestination;
224 224
225 225
226 bool mEditOnDoubleClick; 226 bool mEditOnDoubleClick;
227 bool mViewChangeHoldFullscreen; 227 bool mViewChangeHoldFullscreen;
228 bool mViewChangeHoldNonFullscreen; 228 bool mViewChangeHoldNonFullscreen;
229 bool mCenterOnCurrentTime; 229 bool mCenterOnCurrentTime;
230 bool mSetTimeToDayStartAt; 230 bool mSetTimeToDayStartAt;
231 bool mHighlightCurrentDay; 231 bool mHighlightCurrentDay;
232 bool mUseHighlightLightColor; 232 bool mUseHighlightLightColor;
233 bool mListViewMonthTimespan; 233 bool mListViewMonthTimespan;
234 bool mWNViewShowsParents; 234 bool mWNViewShowsParents;
235 bool mWNViewShowsPast;
235 bool mWNViewShowLocation; 236 bool mWNViewShowLocation;
236 bool mTodoViewShowsPercentage; 237 bool mTodoViewShowsPercentage;
237 bool mTodoViewUsesCatColors; 238 bool mTodoViewUsesCatColors;
238 bool mTodoViewUsesSmallFont; 239 bool mTodoViewUsesSmallFont;
239 bool mTodoViewUsesForegroundColor; 240 bool mTodoViewUsesForegroundColor;
240 bool mMonthViewUsesForegroundColor; 241 bool mMonthViewUsesForegroundColor;
241 242
242 bool mHightlightDateTimeEdit; 243 bool mHightlightDateTimeEdit;
243 bool mShortDateInViewer; 244 bool mShortDateInViewer;
244 245
245 QStringList mLocationDefaults; 246 QStringList mLocationDefaults;
246 QStringList mEventSummaryUser; 247 QStringList mEventSummaryUser;
247 QStringList mTodoSummaryUser; 248 QStringList mTodoSummaryUser;
248 249
249 bool mUseInternalAlarmNotification; 250 bool mUseInternalAlarmNotification;
250 int mAlarmPlayBeeps; 251 int mAlarmPlayBeeps;
251 int mAlarmSuspendTime; 252 int mAlarmSuspendTime;
252 int mAlarmSuspendCount; 253 int mAlarmSuspendCount;
253 int mAlarmBeepInterval; 254 int mAlarmBeepInterval;
254 int mOldLanguage; 255 int mOldLanguage;
255 int mOldLoadedLanguage; 256 int mOldLoadedLanguage;
256 257
257 258
258 QString mActiveSyncPort; 259 QString mActiveSyncPort;
259 QString mActiveSyncIP; 260 QString mActiveSyncIP;
260 261
261 private: 262 private:
262 QDict<QColor> mCategoryColors; 263 QDict<QColor> mCategoryColors;
263 QColor mDefaultCategoryColor; 264 QColor mDefaultCategoryColor;
264 265
265 QFont mDefaultTimeBarFont; 266 QFont mDefaultTimeBarFont;
266 QFont mDefaultViewFont; 267 QFont mDefaultViewFont;
267 QFont mDefaultMonthViewFont; 268 QFont mDefaultMonthViewFont;
268 269
269 QString mName; 270 QString mName;
270 QString mEmail; 271 QString mEmail;
271}; 272};
272 273
273#endif 274#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 393e6e6..578c0e9 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -691,224 +691,232 @@ void KOPrefsDialog::setupViewsTab()
691 dummy = 691 dummy =
692 addWidBool(i18n("Highlight selection in Time Edit"), 692 addWidBool(i18n("Highlight selection in Time Edit"),
693 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 693 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
694 topLayout->addWidget( dummy->checkBox(), ii++,0); 694 topLayout->addWidget( dummy->checkBox(), ii++,0);
695 695
696 696
697 697
698 698
699 699
700 topFrame = addPage(i18n("Month View"),0,0); 700 topFrame = addPage(i18n("Month View"),0,0);
701 // DesktopIcon("viewmag",KIcon::SizeMedium)); 701 // DesktopIcon("viewmag",KIcon::SizeMedium));
702 702
703 topLayout = new QGridLayout(topFrame,5,1); 703 topLayout = new QGridLayout(topFrame,5,1);
704 topLayout->setSpacing(spacingHint()); 704 topLayout->setSpacing(spacingHint());
705 topLayout->setMargin(marginHint()); 705 topLayout->setMargin(marginHint());
706 ii = 0; 706 ii = 0;
707 QLabel *lab; 707 QLabel *lab;
708 QHBox *habo = new QHBox( topFrame ); 708 QHBox *habo = new QHBox( topFrame );
709 if ( QApplication::desktop()->width() < 320 ) { 709 if ( QApplication::desktop()->width() < 320 ) {
710 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 710 lab = new QLabel ( i18n("Show events that recur "), topFrame );
711 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 711 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
712 ii++; 712 ii++;
713 713
714 } else { 714 } else {
715 new QLabel ( i18n("Show events that recur "), habo ); 715 new QLabel ( i18n("Show events that recur "), habo );
716 716
717 } 717 }
718 dailyRecur = 718 dailyRecur =
719 addWidBool(i18n("daily"), 719 addWidBool(i18n("daily"),
720 &(KOPrefs::instance()->mMonthDailyRecur),habo); 720 &(KOPrefs::instance()->mMonthDailyRecur),habo);
721 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 721 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
722 722
723 weeklyRecur = 723 weeklyRecur =
724 addWidBool(i18n("weekly"), 724 addWidBool(i18n("weekly"),
725 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 725 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
726 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 726 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
727 ii++; 727 ii++;
728 728
729 729
730 habo = new QHBox( topFrame ); 730 habo = new QHBox( topFrame );
731 if ( QApplication::desktop()->width() < 320 ) { 731 if ( QApplication::desktop()->width() < 320 ) {
732 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 732 lab = new QLabel (i18n("Show in every cell ") , topFrame );
733 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 733 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
734 ii++; 734 ii++;
735 735
736 } else { 736 } else {
737 new QLabel ( i18n("Show in every cell "), habo ); 737 new QLabel ( i18n("Show in every cell "), habo );
738 } 738 }
739 weeklyRecur = 739 weeklyRecur =
740 addWidBool(i18n("short month"), 740 addWidBool(i18n("short month"),
741 &(KOPrefs::instance()->mMonthShowShort),habo); 741 &(KOPrefs::instance()->mMonthShowShort),habo);
742 weeklyRecur = 742 weeklyRecur =
743 addWidBool(i18n("icons"), 743 addWidBool(i18n("icons"),
744 &(KOPrefs::instance()->mMonthShowIcons),habo); 744 &(KOPrefs::instance()->mMonthShowIcons),habo);
745 745
746 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 746 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
747 ii++; 747 ii++;
748#ifdef DESKTOP_VERSION 748#ifdef DESKTOP_VERSION
749 KPrefsDialogWidBool *enableMonthScroll = 749 KPrefsDialogWidBool *enableMonthScroll =
750 addWidBool(i18n("Enable scrollbars in month view cells"), 750 addWidBool(i18n("Enable scrollbars in month view cells"),
751 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 751 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
752 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 752 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
753#endif 753#endif
754 754
755 dummy = 755 dummy =
756 addWidBool(i18n("Show Sat/Sun together"), 756 addWidBool(i18n("Show Sat/Sun together"),
757 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 757 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
758 topLayout->addWidget(dummy->checkBox(),ii++,0); 758 topLayout->addWidget(dummy->checkBox(),ii++,0);
759 759
760 KPrefsDialogWidBool *coloredCategoriesInMonthView = 760 KPrefsDialogWidBool *coloredCategoriesInMonthView =
761 addWidBool(i18n("Month view uses category colors"), 761 addWidBool(i18n("Month view uses category colors"),
762 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 762 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
763 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 763 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
764 764
765 dummy = 765 dummy =
766 addWidBool(i18n("Categorie colors are applied to text"), 766 addWidBool(i18n("Categorie colors are applied to text"),
767 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 767 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
768 topLayout->addWidget(dummy->checkBox(),ii++,0); 768 topLayout->addWidget(dummy->checkBox(),ii++,0);
769 coloredCategoriesInMonthView = 769 coloredCategoriesInMonthView =
770 addWidBool(i18n("Month view uses day colors"), 770 addWidBool(i18n("Month view uses day colors"),
771 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 771 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
772 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 772 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
773 773
774 KPrefsDialogWidColor *holidayColor = 774 KPrefsDialogWidColor *holidayColor =
775 addWidColor(i18n("Day color odd months"), 775 addWidColor(i18n("Day color odd months"),
776 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 776 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
777 topLayout->addWidget(holidayColor->label(),ii,0); 777 topLayout->addWidget(holidayColor->label(),ii,0);
778 topLayout->addWidget(holidayColor->button(),ii++,1); 778 topLayout->addWidget(holidayColor->button(),ii++,1);
779 779
780 holidayColor = 780 holidayColor =
781 addWidColor(i18n("Day color even months"), 781 addWidColor(i18n("Day color even months"),
782 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 782 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
783 topLayout->addWidget(holidayColor->label(),ii,0); 783 topLayout->addWidget(holidayColor->label(),ii,0);
784 topLayout->addWidget(holidayColor->button(),ii++,1); 784 topLayout->addWidget(holidayColor->button(),ii++,1);
785 785
786 786
787 holidayColor = 787 holidayColor =
788 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 788 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
789 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 789 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
790 topLayout->addWidget(holidayColor->label(),ii,0); 790 topLayout->addWidget(holidayColor->label(),ii,0);
791 topLayout->addWidget(holidayColor->button(),ii++,1); 791 topLayout->addWidget(holidayColor->button(),ii++,1);
792 // *********************** What'sNext View 792 // *********************** What'sNext View
793 topFrame = addPage(i18n("What's Next View"),0,0); 793 topFrame = addPage(i18n("What's Next View"),0,0);
794 // DesktopIcon("viewmag",KIcon::SizeMedium)); 794 // DesktopIcon("viewmag",KIcon::SizeMedium));
795 795
796 topLayout = new QGridLayout(topFrame,4,1); 796 topLayout = new QGridLayout(topFrame,4,1);
797 topLayout->setSpacing(spacingHint()); 797 topLayout->setSpacing(spacingHint());
798 topLayout->setMargin(marginHint()); 798 topLayout->setMargin(marginHint());
799 ii = 0; 799 ii = 0;
800 KPrefsDialogWidBool *passwdk = 800 KPrefsDialogWidBool *passwdk =
801 addWidBool(i18n("Show parent To-Do's in What's Next view"), 801
802 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 802 addWidBool(i18n("Show events, that are done in \nWhat's Next view"),
803 topLayout->addWidget(passwdk->checkBox(), ii++,0); 803 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
804 topLayout->addWidget(passwdk->checkBox(), ii++,0);
805 passwdk =
806 addWidBool(i18n("Show parent To-Do's in What's Next view"),
807 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
808 topLayout->addWidget(passwdk->checkBox(), ii++,0);
804 809
805 passwdk = 810 passwdk =
806 addWidBool(i18n("Show location in What's Next view"), 811 addWidBool(i18n("Show location in What's Next view"),
807 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 812 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
808 topLayout->addWidget(passwdk->checkBox(), ii++,0); 813 topLayout->addWidget(passwdk->checkBox(), ii++,0);
809 814
810 passwdk = 815 passwdk =
811 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), 816 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
812 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 817 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
813 topLayout->addWidget(passwdk->checkBox(), ii++,0); 818 topLayout->addWidget(passwdk->checkBox(), ii++,0);
814 passwdk = 819 passwdk =
815 addWidBool(i18n("Use short date in \nWhat's Next/Event view"), 820 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
816 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 821 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
817 topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1); 822 topLayout->addWidget(passwdk->checkBox(), ii++,0);
818 823
824
825
826
819 // *********************** Todo View 827 // *********************** Todo View
820 828
821 topFrame = addPage(i18n("Todo View"),0,0); 829 topFrame = addPage(i18n("Todo View"),0,0);
822 // DesktopIcon("viewmag",KIcon::SizeMedium)); 830 // DesktopIcon("viewmag",KIcon::SizeMedium));
823 831
824 topLayout = new QGridLayout(topFrame,4,1); 832 topLayout = new QGridLayout(topFrame,4,1);
825 topLayout->setSpacing(spacingHint()); 833 topLayout->setSpacing(spacingHint());
826 topLayout->setMargin(marginHint()); 834 topLayout->setMargin(marginHint());
827 ii = 0; 835 ii = 0;
828 836
829 KPrefsDialogWidBool *showCompletedTodo = 837 KPrefsDialogWidBool *showCompletedTodo =
830 addWidBool(i18n("To-do view shows completed Todos"), 838 addWidBool(i18n("To-do view shows completed Todos"),
831 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 839 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
832 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 840 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
833 dummy = 841 dummy =
834 addWidBool(i18n("To-do view shows complete as 'xx %'"), 842 addWidBool(i18n("To-do view shows complete as 'xx %'"),
835 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 843 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
836 topLayout->addWidget(dummy->checkBox(),ii++,0); 844 topLayout->addWidget(dummy->checkBox(),ii++,0);
837 845
838 dummy = 846 dummy =
839 addWidBool(i18n("Small To-do view uses smaller font"), 847 addWidBool(i18n("Small To-do view uses smaller font"),
840 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 848 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
841 topLayout->addWidget(dummy->checkBox(),ii++,0); 849 topLayout->addWidget(dummy->checkBox(),ii++,0);
842 850
843 851
844 852
845 dummy = 853 dummy =
846 addWidBool(i18n("Todo view uses category colors"), 854 addWidBool(i18n("Todo view uses category colors"),
847 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 855 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
848 topLayout->addWidget(dummy->checkBox(),ii++,0); 856 topLayout->addWidget(dummy->checkBox(),ii++,0);
849 857
850 858
851 QWidget* wid = new QWidget( topFrame ); 859 QWidget* wid = new QWidget( topFrame );
852 // Todo due today color 860 // Todo due today color
853 KPrefsDialogWidColor *todoDueTodayColor = 861 KPrefsDialogWidColor *todoDueTodayColor =
854 addWidColor(i18n("Todo due today color:"), 862 addWidColor(i18n("Todo due today color:"),
855 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 863 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
856 QHBoxLayout *widLayout = new QHBoxLayout(wid); 864 QHBoxLayout *widLayout = new QHBoxLayout(wid);
857 widLayout->addWidget( todoDueTodayColor->label() ); 865 widLayout->addWidget( todoDueTodayColor->label() );
858 widLayout->addWidget( todoDueTodayColor->button() ); 866 widLayout->addWidget( todoDueTodayColor->button() );
859 topLayout->addWidget(wid,ii++,0); 867 topLayout->addWidget(wid,ii++,0);
860 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 868 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
861 869
862 // Todo overdue color 870 // Todo overdue color
863 wid = new QWidget( topFrame ); 871 wid = new QWidget( topFrame );
864 widLayout = new QHBoxLayout(wid); 872 widLayout = new QHBoxLayout(wid);
865 KPrefsDialogWidColor *todoOverdueColor = 873 KPrefsDialogWidColor *todoOverdueColor =
866 addWidColor(i18n("Todo overdue color:"), 874 addWidColor(i18n("Todo overdue color:"),
867 &(KOPrefs::instance()->mTodoOverdueColor),wid); 875 &(KOPrefs::instance()->mTodoOverdueColor),wid);
868 widLayout->addWidget(todoOverdueColor->label()); 876 widLayout->addWidget(todoOverdueColor->label());
869 widLayout->addWidget(todoOverdueColor->button()); 877 widLayout->addWidget(todoOverdueColor->button());
870 topLayout->addWidget(wid,ii++,0); 878 topLayout->addWidget(wid,ii++,0);
871 879
872 dummy = 880 dummy =
873 addWidBool(i18n("Colors are applied to text"), 881 addWidBool(i18n("Colors are applied to text"),
874 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 882 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
875 topLayout->addWidget(dummy->checkBox(),ii++,0); 883 topLayout->addWidget(dummy->checkBox(),ii++,0);
876 884
877 dummy = 885 dummy =
878 addWidBool(i18n("Allday Agenda view shows todos"), 886 addWidBool(i18n("Allday Agenda view shows todos"),
879 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 887 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
880 topLayout->addWidget(dummy->checkBox(),ii++,0); 888 topLayout->addWidget(dummy->checkBox(),ii++,0);
881 889
882 890
883 891
884 892
885 topFrame = addPage(i18n("Alarm"),0,0); 893 topFrame = addPage(i18n("Alarm"),0,0);
886 // DesktopIcon("viewmag",KIcon::SizeMedium)); 894 // DesktopIcon("viewmag",KIcon::SizeMedium));
887 895
888 topLayout = new QGridLayout(topFrame,2,1); 896 topLayout = new QGridLayout(topFrame,2,1);
889 topLayout->setSpacing(spacingHint()); 897 topLayout->setSpacing(spacingHint());
890 topLayout->setMargin(marginHint()); 898 topLayout->setMargin(marginHint());
891 int iii = 0; 899 int iii = 0;
892 900
893 dummy = 901 dummy =
894 addWidBool(i18n("Use internal alarm notification"), 902 addWidBool(i18n("Use internal alarm notification"),
895 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 903 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
896 topLayout->addWidget(dummy->checkBox(),iii++,0); 904 topLayout->addWidget(dummy->checkBox(),iii++,0);
897 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 905 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
898 906
899 topLayout->addWidget(lab ,iii++,0); 907 topLayout->addWidget(lab ,iii++,0);
900#ifndef DESKTOP_VERSION 908#ifndef DESKTOP_VERSION
901 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 909 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
902#else 910#else
903 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 911 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
904 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 912 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
905#endif 913#endif
906 914
907 QHBox* dummyBox = new QHBox(topFrame); 915 QHBox* dummyBox = new QHBox(topFrame);
908 new QLabel(i18n("Play beeps count:"),dummyBox); 916 new QLabel(i18n("Play beeps count:"),dummyBox);
909 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 917 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
910 topLayout->addWidget(dummyBox,iii++,0); 918 topLayout->addWidget(dummyBox,iii++,0);
911 919
912 dummyBox = new QHBox(topFrame); 920 dummyBox = new QHBox(topFrame);
913 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 921 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
914 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 922 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 0f0bf11..aa33588 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -264,405 +264,410 @@ void KOWhatsNextView::updateView()
264 // mText += i18n("Overdue To-Do:") + "</h2>\n"; 264 // mText += i18n("Overdue To-Do:") + "</h2>\n";
265 265
266 //mText += "<ul>\n"; 266 //mText += "<ul>\n";
267 bool gotone = false; 267 bool gotone = false;
268 int priority = 1; 268 int priority = 1;
269 int priosFound = 0; 269 int priosFound = 0;
270#ifdef DESKTOP_VERSION 270#ifdef DESKTOP_VERSION
271 mText +="<p></p>"; 271 mText +="<p></p>";
272#endif 272#endif
273 273
274 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; 274 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
275 mText += "<ul>\n"; 275 mText += "<ul>\n";
276 while (!gotone && priority<6) { 276 while (!gotone && priority<6) {
277 todo = todos.first(); 277 todo = todos.first();
278 while(todo) { 278 while(todo) {
279 if (!todo->isCompleted() && (todo->priority() == priority) ) { 279 if (!todo->isCompleted() && (todo->priority() == priority) ) {
280 if ( appendTodo(todo) ) 280 if ( appendTodo(todo) )
281 gotone = true; 281 gotone = true;
282 } 282 }
283 todo = todos.next(); 283 todo = todos.next();
284 } 284 }
285 if ( gotone ) { 285 if ( gotone ) {
286 gotone = false; 286 gotone = false;
287 ++priosFound; 287 ++priosFound;
288 if ( priosFound == topmostPrios ) 288 if ( priosFound == topmostPrios )
289 break; 289 break;
290 } 290 }
291 priority++; 291 priority++;
292 // kdDebug() << "adding the todos..." << endl; 292 // kdDebug() << "adding the todos..." << endl;
293 } 293 }
294 mText += "</ul>\n"; 294 mText += "</ul>\n";
295 } 295 }
296 296
297 int replys = 0; 297 int replys = 0;
298 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); 298 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6));
299 if (events.count() > 0) { 299 if (events.count() > 0) {
300 Event *ev = events.first(); 300 Event *ev = events.first();
301 while(ev) { 301 while(ev) {
302 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 302 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
303 if (me!=0) { 303 if (me!=0) {
304 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 304 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
305 if (replys == 0) { 305 if (replys == 0) {
306 mText += "<p></p>"; 306 mText += "<p></p>";
307 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 307 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
308 //mText += "<h2>"; 308 //mText += "<h2>";
309 //<img src=\""; 309 //<img src=\"";
310 // mText += ipath; 310 // mText += ipath;
311 // mText += "\">"; 311 // mText += "\">";
312 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; 312 //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n";
313 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 313 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
314 mText += "<table>\n"; 314 mText += "<table>\n";
315 } 315 }
316 replys++; 316 replys++;
317 appendEvent(ev,true); 317 appendEvent(ev,true);
318 } 318 }
319 } 319 }
320 ev = events.next(); 320 ev = events.next();
321 } 321 }
322 } 322 }
323 todos = calendar()->todos(); 323 todos = calendar()->todos();
324 if (todos.count() > 0) { 324 if (todos.count() > 0) {
325 Todo *to = todos.first(); 325 Todo *to = todos.first();
326 while(to) { 326 while(to) {
327 if ( !to->isCompleted() ){ 327 if ( !to->isCompleted() ){
328 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 328 Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
329 if (me!=0) { 329 if (me!=0) {
330 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 330 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
331 if (replys == 0) { 331 if (replys == 0) {
332 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; 332 mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n";
333 mText += "<table>\n"; 333 mText += "<table>\n";
334 } 334 }
335 replys++; 335 replys++;
336 appendEvent(to, true); 336 appendEvent(to, true);
337 } 337 }
338 } 338 }
339 } 339 }
340 to = todos.next(); 340 to = todos.next();
341 } 341 }
342 } 342 }
343 if (replys > 0 ) mText += "</table>\n"; 343 if (replys > 0 ) mText += "</table>\n";
344 344
345 345
346 mText += "</td></tr>\n</table></qt>\n"; 346 mText += "</td></tr>\n</table></qt>\n";
347 347
348 mView->setText(mText); 348 mView->setText(mText);
349 mView->setFocus(); 349 mView->setFocus();
350 350
351 // QPixmap bPix = SmallIcon( "back" ); 351 // QPixmap bPix = SmallIcon( "back" );
352 // qDebug("xxxxxxxxxxxxxxxxxxxxx "); 352 // qDebug("xxxxxxxxxxxxxxxxxxxxx ");
353 // QWidget* test = new QWidget(); 353 // QWidget* test = new QWidget();
354 // test->setBackgroundMode(FixedPixmap ); 354 // test->setBackgroundMode(FixedPixmap );
355 // test->setBackgroundPixmap ( bPix ); 355 // test->setBackgroundPixmap ( bPix );
356 // test->resize( 300, 400 ); 356 // test->resize( 300, 400 );
357 // test->show(); 357 // test->show();
358 // mView->setBackgroundMode(FixedPixmap ); 358 // mView->setBackgroundMode(FixedPixmap );
359 // mView->setBackgroundPixmap ( bPix ); 359 // mView->setBackgroundPixmap ( bPix );
360 qDebug("%s ",mText.latin1()); 360 // qDebug("%s ",mText.latin1());
361} 361}
362 362
363void KOWhatsNextView::appendDay( int i, QDate eventDate ) 363void KOWhatsNextView::appendDay( int i, QDate eventDate )
364{ 364{
365 QString date; 365 QString date;
366 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); 366 QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer);
367 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { 367 if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) {
368 if ( i == 0 ) { 368 if ( i == 0 ) {
369 mText += "<table>\n"; 369 mText += "<table>\n";
370 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; 370 return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>";
371 } 371 }
372 else if ( i == 1 ) 372 else if ( i == 1 )
373 date = "<em><font color=\"#000080\">" + day + "</font></em>" ; 373 date = "<em><font color=\"#000080\">" + day + "</font></em>" ;
374 else date = "<em><font color=\"#000080\">" + day + "</font></em>"; 374 else date = "<em><font color=\"#000080\">" + day + "</font></em>";
375 mText += "<h2>" + date + "</h2>\n"; 375 mText += "<h2>" + date + "</h2>\n";
376 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 376 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
377 mText += "<table>\n"; 377 mText += "<table>\n";
378 378
379 379
380 380
381 } else { 381 } else {
382 if ( i == 0 ) { 382 if ( i == 0 ) {
383 mText += "<table>\n"; 383 mText += "<table>\n";
384 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; 384 return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>";
385 } 385 }
386 386
387#ifdef DESKTOP_VERSION 387#ifdef DESKTOP_VERSION
388 else if ( i == 1 ) { 388 else if ( i == 1 ) {
389 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; 389 date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ;
390 } 390 }
391 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; 391 else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>";
392#else 392#else
393 else if ( i == 1 ) { 393 else if ( i == 1 ) {
394 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; 394 date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ;
395 } 395 }
396 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; 396 else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>";
397 397
398#endif 398#endif
399 mText += "<h2>" + date + "</h2>\n"; 399 mText += "<h2>" + date + "</h2>\n";
400 //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; 400 //mText += "<big><big><strong>" + date + "</strong></big></big>\n";
401 mText += "<table>\n"; 401 mText += "<table>\n";
402 } 402 }
403} 403}
404 404
405 405
406void KOWhatsNextView::showDates(const QDate &, const QDate &) 406void KOWhatsNextView::showDates(const QDate &, const QDate &)
407{ 407{
408 updateView(); 408 updateView();
409} 409}
410 410
411void KOWhatsNextView::showEvents(QPtrList<Event>) 411void KOWhatsNextView::showEvents(QPtrList<Event>)
412{ 412{
413} 413}
414 414
415void KOWhatsNextView::changeEventDisplay(Event *, int action) 415void KOWhatsNextView::changeEventDisplay(Event *, int action)
416{ 416{
417 switch(action) { 417 switch(action) {
418 case KOGlobals::EVENTADDED: 418 case KOGlobals::EVENTADDED:
419 updateView(); 419 updateView();
420 break; 420 break;
421 case KOGlobals::EVENTEDITED: 421 case KOGlobals::EVENTEDITED:
422 updateView(); 422 updateView();
423 break; 423 break;
424 case KOGlobals::EVENTDELETED: 424 case KOGlobals::EVENTDELETED:
425 updateView(); 425 updateView();
426 break; 426 break;
427 default: 427 default:
428 updateView(); 428 updateView();
429 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; 429 kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl;
430 } 430 }
431} 431}
432 432
433void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed ) 433void KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed )
434{ 434{
435 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) 435 if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") )
436 return; 436 return;
437 QDateTime cdt = QDateTime::currentDateTime(); 437 QDateTime cdt = QDateTime::currentDateTime();
438 QDateTime noc; 438 QDateTime noc;
439 QString tempText;
439 bool ok = true; 440 bool ok = true;
440 if ( reply ) { 441 if ( reply ) {
441 noc = ev->getNextOccurence( cdt, &ok ); 442 noc = ev->getNextOccurence( cdt, &ok );
442 if (! ok && ev->type() == "Event") 443 if (! ok && ev->type() == "Event")
443 return; 444 return;
444 } 445 }
445 mText += "<tr><td><b>"; 446 tempText += "<tr><td><b>";
446 if (ev->type()=="Event") { 447 if (ev->type()=="Event") {
447 if (reply) { 448 if (reply) {
448 if (!ev->doesFloat()) 449 if (!ev->doesFloat())
449 mText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; 450 tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": ";
450 else 451 else
451 mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 452 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
452 453
453 } else { 454 } else {
454 if (!ev->doesFloat()) { 455 if (!ev->doesFloat()) {
455 Event *event = static_cast<Event *>(ev); 456 Event *event = static_cast<Event *>(ev);
456 QDateTime st,end; 457 QDateTime st,end;
457 if ( event->recurrence()->doesRecur() ) { 458 if ( event->recurrence()->doesRecur() ) {
458 QDate recDate= mEventDate; 459 QDate recDate= mEventDate;
459 int days = event->dtStart().date().daysTo (event->dtEnd().date() ); 460 int days = event->dtStart().date().daysTo (event->dtEnd().date() );
460 while ( ! event->recursOn( recDate ) ) { 461 while ( ! event->recursOn( recDate ) ) {
461 recDate = recDate.addDays( -1 ); 462 recDate = recDate.addDays( -1 );
462 463
463 } 464 }
464 st = QDateTime ( recDate, event->dtStart().time() ); 465 st = QDateTime ( recDate, event->dtStart().time() );
465 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); 466 end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() );
466 } 467 }
467 else { 468 else {
468 st = event->dtStart(); 469 st = event->dtStart();
469 end = event->dtEnd(); 470 end = event->dtEnd();
470 } 471 }
471 472
472 473
473 QString dateText; 474 QString dateText;
474 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); 475 // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() );
475 if ( st.date() < mEventDate ) 476 if ( st.date() < mEventDate )
476 dateText = "++:++-"; 477 dateText = "++:++-";
477 else 478 else
478 dateText = event->dtStartTimeStr() + "-"; 479 dateText = event->dtStartTimeStr() + "-";
479 if ( end.date() > mEventDate ) 480 if ( end.date() > mEventDate )
480 dateText += "++:++"; 481 dateText += "++:++";
481 else 482 else
482 dateText += event->dtEndTimeStr(); 483 dateText += event->dtEndTimeStr();
483 if ( notRed ) 484 if ( notRed )
484 mText += dateText; 485 tempText += dateText;
485 else { 486 else {
486 if ( end < cdt ) 487 if ( end < cdt ) {
487 mText += "<font color=\"#F00000\">" + dateText + "</font>"; 488 if ( !KOPrefs::instance()->mWNViewShowsPast )
489 return;
490 tempText += "<font color=\"#F00000\">" + dateText + "</font>";
491 }
488 else if ( st < cdt ) 492 else if ( st < cdt )
489 mText += "<font color=\"#008000\">" + dateText + "</font>"; 493 tempText += "<font color=\"#008000\">" + dateText + "</font>";
490 else 494 else
491 mText += dateText; 495 tempText += dateText;
492 496
493 } 497 }
494 498
495 } else { 499 } else {
496 mText += i18n("Allday:"); 500 tempText += i18n("Allday:");
497 501
498 } 502 }
499 } 503 }
500 } else { 504 } else {
501 mTodos.append( ev ); 505 mTodos.append( ev );
502 mText += i18n("ToDo:"); 506 tempText += i18n("ToDo:");
503 if (reply) { 507 if (reply) {
504 mText += " "; 508 tempText += " ";
505 if ( noc != cdt ) { 509 if ( noc != cdt ) {
506 mText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 510 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
507 } 511 }
508 } else { 512 } else {
509 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 513 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
510 // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 514 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
511 QString dfs = KGlobal::locale()->dateFormatShort(); 515 QString dfs = KGlobal::locale()->dateFormatShort();
512 KGlobal::locale()->setDateFormatShort("%d.%b"); 516 KGlobal::locale()->setDateFormatShort("%d.%b");
513 mText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 517 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
514 KGlobal::locale()->setDateFormatShort(dfs); 518 KGlobal::locale()->setDateFormatShort(dfs);
515 } else { 519 } else {
516 if (!ev->doesFloat() ) 520 if (!ev->doesFloat() )
517 if( ( (Todo*)ev)->dtDue() < cdt ) { 521 if( ( (Todo*)ev)->dtDue() < cdt ) {
518 mText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 522 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
519 523
520 524
521 } else 525 } else
522 mText +=((Todo*)ev)->dtDueTimeStr(); 526 tempText +=((Todo*)ev)->dtDueTimeStr();
523 mTodos.append( ev ); 527 mTodos.append( ev );
524 } 528 }
525 } 529 }
526 } 530 }
527 mText += "</b></td><td>"; 531 tempText += "</b></td><td>";
528 bool needClose = false; 532 bool needClose = false;
529 if ( ev->cancelled() ) { 533 if ( ev->cancelled() ) {
530 mText += "<font color=\"#F00000\">[c"; 534 tempText += "<font color=\"#F00000\">[c";
531 needClose =true; 535 needClose =true;
532 536
533 } 537 }
534 if ( ev->isAlarmEnabled() ) { 538 if ( ev->isAlarmEnabled() ) {
535 if ( !needClose) 539 if ( !needClose)
536 mText +="["; 540 tempText +="[";
537 mText += "a"; 541 tempText += "a";
538 needClose =true; 542 needClose =true;
539 543
540 } 544 }
541 if ( ev->description().length() > 0 ) { 545 if ( ev->description().length() > 0 ) {
542 if ( !needClose) 546 if ( !needClose)
543 mText +="["; 547 tempText +="[";
544 mText += "i"; 548 tempText += "i";
545 needClose =true; 549 needClose =true;
546 } 550 }
547 if ( ev->recurrence()->doesRecur() ) { 551 if ( ev->recurrence()->doesRecur() ) {
548 if ( !needClose) 552 if ( !needClose)
549 mText +="["; 553 tempText +="[";
550 mText += "r"; 554 tempText += "r";
551 needClose =true; 555 needClose =true;
552 } 556 }
553 if ( needClose ) { 557 if ( needClose ) {
554 mText += "] "; 558 tempText += "] ";
555 } 559 }
556 if ( ev->cancelled() ) 560 if ( ev->cancelled() )
557 mText += "</font>"; 561 tempText += "</font>";
558 mText += "<a "; 562 tempText += "<a ";
559 if (ev->type()=="Event") mText += "href=\"event:"; 563 if (ev->type()=="Event") tempText += "href=\"event:";
560 if (ev->type()=="Todo") mText += "href=\"todo:"; 564 if (ev->type()=="Todo") tempText += "href=\"todo:";
561 mText += ev->uid() + "\">"; 565 tempText += ev->uid() + "\">";
562 if ( ev->summary().length() > 0 ) 566 if ( ev->summary().length() > 0 )
563 mText += ev->summary(); 567 tempText += ev->summary();
564 else 568 else
565 mText += i18n("-no summary-"); 569 tempText += i18n("-no summary-");
566 mText += "</a>"; 570 tempText += "</a>";
567 if ( KOPrefs::instance()->mWNViewShowLocation ) 571 if ( KOPrefs::instance()->mWNViewShowLocation )
568 if ( !ev->location().isEmpty() ) 572 if ( !ev->location().isEmpty() )
569 mText += " ("+ev->location() +")"; 573 tempText += " ("+ev->location() +")";
570 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) 574 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
571 mText += " ["+ev->relatedTo()->summary() +"]"; 575 tempText += " ["+ev->relatedTo()->summary() +"]";
572 mText += "</td></tr>\n"; 576 tempText += "</td></tr>\n";
577 mText += tempText;
573} 578}
574 579
575bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 580bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
576{ 581{
577 if ( mTodos.find( ev ) != mTodos.end() ) return false; 582 if ( mTodos.find( ev ) != mTodos.end() ) return false;
578 583
579 mTodos.append( ev ); 584 mTodos.append( ev );
580 if ( !isSub ) 585 if ( !isSub )
581 mText += "<p>"; 586 mText += "<p>";
582 else 587 else
583 mText += "<li>"; 588 mText += "<li>";
584 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 589 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
585 590
586 591
587 mText += ind; 592 mText += ind;
588 bool needClose = false; 593 bool needClose = false;
589 if ( ev->cancelled() ) { 594 if ( ev->cancelled() ) {
590 mText += "<font color=\"#F00000\">[c"; 595 mText += "<font color=\"#F00000\">[c";
591 needClose =true; 596 needClose =true;
592 597
593 } 598 }
594 if ( ev->isAlarmEnabled() ) { 599 if ( ev->isAlarmEnabled() ) {
595 if ( !needClose) 600 if ( !needClose)
596 mText +="["; 601 mText +="[";
597 mText += "a"; 602 mText += "a";
598 needClose =true; 603 needClose =true;
599 604
600 } 605 }
601 606
602 if ( ev->description().length() > 0 ) { 607 if ( ev->description().length() > 0 ) {
603 if ( !needClose) 608 if ( !needClose)
604 mText +="["; 609 mText +="[";
605 mText += "i"; 610 mText += "i";
606 needClose =true; 611 needClose =true;
607 } 612 }
608 // if ( ev->recurrence()->doesRecur() ) { 613 // if ( ev->recurrence()->doesRecur() ) {
609 // if ( !needClose) 614 // if ( !needClose)
610 // mText +="("; 615 // mText +="(";
611 // mText += "r"; 616 // mText += "r";
612 // needClose =true; 617 // needClose =true;
613 // } 618 // }
614 if ( needClose ) 619 if ( needClose )
615 mText += "] "; 620 mText += "] ";
616 if ( ev->cancelled() ) 621 if ( ev->cancelled() )
617 mText += "</font>"; 622 mText += "</font>";
618 mText += "<a href=\"todo:" + ev->uid() + "\">"; 623 mText += "<a href=\"todo:" + ev->uid() + "\">";
619 mText += ev->summary(); 624 mText += ev->summary();
620 mText += "</a>"; 625 mText += "</a>";
621 if ( ((Todo*)ev)->hasDueDate () ) { 626 if ( ((Todo*)ev)->hasDueDate () ) {
622 QString year = ""; 627 QString year = "";
623 int ye = ((Todo*)ev)->dtDue().date().year(); 628 int ye = ((Todo*)ev)->dtDue().date().year();
624 if ( QDateTime::currentDateTime().date().year() != ye ) 629 if ( QDateTime::currentDateTime().date().year() != ye )
625 year = QString::number( ye ); 630 year = QString::number( ye );
626 QString dfs = KGlobal::locale()->dateFormatShort(); 631 QString dfs = KGlobal::locale()->dateFormatShort();
627 KGlobal::locale()->setDateFormatShort("%d.%b"); 632 KGlobal::locale()->setDateFormatShort("%d.%b");
628 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; 633 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
629 KGlobal::locale()->setDateFormatShort(dfs); 634 KGlobal::locale()->setDateFormatShort(dfs);
630 } 635 }
631 if ( KOPrefs::instance()->mWNViewShowLocation ) 636 if ( KOPrefs::instance()->mWNViewShowLocation )
632 if ( !ev->location().isEmpty() ) 637 if ( !ev->location().isEmpty() )
633 mText += " ("+ev->location() +")"; 638 mText += " ("+ev->location() +")";
634 if ( !isSub ) { 639 if ( !isSub ) {
635 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) 640 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
636 mText += " ["+ev->relatedTo()->summary() +"]"; 641 mText += " ["+ev->relatedTo()->summary() +"]";
637 mText += "</p>\n"; 642 mText += "</p>\n";
638 } 643 }
639 else { 644 else {
640 ind += "-"; 645 ind += "-";
641 mText += "</li>\n"; 646 mText += "</li>\n";
642 } 647 }
643 QPtrList<Incidence> Relations = ev->relations(); 648 QPtrList<Incidence> Relations = ev->relations();
644 Incidence *to; 649 Incidence *to;
645 for (to=Relations.first();to;to=Relations.next()) { 650 for (to=Relations.first();to;to=Relations.next()) {
646 if (!((Todo*)to)->isCompleted()) 651 if (!((Todo*)to)->isCompleted())
647 appendTodo( to, ind , true ); 652 appendTodo( to, ind , true );
648 } 653 }
649 654
650 return true; 655 return true;
651} 656}
652 657
653/* 658/*
654 void KOWhatsNextView::createEventViewer() 659 void KOWhatsNextView::createEventViewer()
655 { 660 {
656 if (!mEventViewer) { 661 if (!mEventViewer) {
657 662
658 mEventViewer = new KOEventViewerDialog(this); 663 mEventViewer = new KOEventViewerDialog(this);
659 } 664 }
660 } 665 }
661*/ 666*/
662void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) 667void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
663{ 668{
664 mEventViewer = v; 669 mEventViewer = v;
665} 670}
666 671
667// TODO: Create this function in CalendarView and remove it from here 672// TODO: Create this function in CalendarView and remove it from here
668void KOWhatsNextView::showIncidence(const QString &uid) 673void KOWhatsNextView::showIncidence(const QString &uid)