summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-27 09:46:04 (UTC)
committer zautrix <zautrix>2005-03-27 09:46:04 (UTC)
commitb170a7414ff72016285ea207caa7ccf786530e77 (patch) (unidiff)
treecb635d155fed20ecb33f877659a00d88bedb309e
parentee6f7d5329658c567882e8e496c65eef8874496e (diff)
downloadkdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.zip
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.gz
kdepimpi-b170a7414ff72016285ea207caa7ccf786530e77.tar.bz2
many fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt12
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt5
-rw-r--r--kalarmd/alarmdialog.cpp48
-rw-r--r--korganizer/calendarview.cpp18
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/mainwindow.cpp17
-rw-r--r--korganizer/mainwindow.h1
7 files changed, 92 insertions, 11 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index d4ec863..4250fb3 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,42 +1,54 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.21 ************ 3********** VERSION 2.0.21 ************
4 4
5Fixed another SMTP problem in OM/Pi. 5Fixed another SMTP problem in OM/Pi.
6Some small changed in the new datenavigator in KO/Pi. 6Some small changed in the new datenavigator in KO/Pi.
7Changed default setting for new filter in KA/Pi to "exclude categories". 7Changed default setting for new filter in KA/Pi to "exclude categories".
8Changed the default font size for 640x480 display . 8Changed the default font size for 640x480 display .
9Changed popup menu behaviour in agenda and list view. 9Changed popup menu behaviour in agenda and list view.
10Fixed some layout problems of the date label size in the month view. 10Fixed some layout problems of the date label size in the month view.
11Made month view update faster. 11Made month view update faster.
12Made first datenavigator repainting faster. 12Made first datenavigator repainting faster.
13Changed the title of the event/todo edit dialogs. 13Changed the title of the event/todo edit dialogs.
14Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). 14Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course).
15Many small usebility fixes in KO/Pi. 15Many small usebility fixes in KO/Pi.
16Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. 16Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi.
17The set of possible "next views" are the views you have toolbar buttons for. 17The set of possible "next views" are the views you have toolbar buttons for.
18 18
19Made alarm sound working on Linux.
20
21KO/Pi alarm applet changed:
22Made buttons in alarm dialog much bigger.
23Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger.
24The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings.
25
26And because this version is realeased at Easter, I added an Easter-egg:
27With a new undocumented command you can get a message box about the next alarm.
28Good luck to find it!
29
30
19 31
20********** VERSION 2.0.20 ************ 32********** VERSION 2.0.20 ************
21 33
22Two small fixes in OM/Pi. 34Two small fixes in OM/Pi.
23 35
24Better resizing of the new datenavigator in KO/Pi. 36Better resizing of the new datenavigator in KO/Pi.
25 37
26********** VERSION 2.0.19 ************ 38********** VERSION 2.0.19 ************
27KO/Pi: 39KO/Pi:
28Enhancements and bugfixes in the new datenavigator. 40Enhancements and bugfixes in the new datenavigator.
29Bugfix in this changelog: 41Bugfix in this changelog:
30The datenavigator was changed in version 2.0.18, not the datepicker. 42The datenavigator was changed in version 2.0.18, not the datepicker.
31 43
32********** VERSION 2.0.18 ************ 44********** VERSION 2.0.18 ************
33KO/Pi: 45KO/Pi:
34Fixed some minor problems. 46Fixed some minor problems.
35Cleaned up the KO/Pi config dialog. 47Cleaned up the KO/Pi config dialog.
36Fixed problem moving events in aganda view. 48Fixed problem moving events in aganda view.
37Made datepicker scaleable, i.e. if the datenavigator shows now a 49Made datepicker scaleable, i.e. if the datenavigator shows now a
38datenavigator matrix depending on its size. 50datenavigator matrix depending on its size.
39Birthdays are now displayed green in the datenavigator. 51Birthdays are now displayed green in the datenavigator.
40What'sThis Help in datenavigator shows all events of the day. 52What'sThis Help in datenavigator shows all events of the day.
41 53
42OM/Pi: 54OM/Pi:
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index b6293b5..ce55780 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1283,31 +1283,34 @@
1283{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1283{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1284{ "View Options","Anzeige Optionen" }, 1284{ "View Options","Anzeige Optionen" },
1285{ "<b>Created: ","<b>Erstellt am: " }, 1285{ "<b>Created: ","<b>Erstellt am: " },
1286{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1286{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1287{ "Journal: ","Journal: " }, 1287{ "Journal: ","Journal: " },
1288{ "yearly","jährlich" }, 1288{ "yearly","jährlich" },
1289{ "(%1) ","%1-" }, 1289{ "(%1) ","%1-" },
1290{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1290{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1291{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1291{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1292{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1292{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1293{ "Summary/Loc.","Titel/Ort" }, 1293{ "Summary/Loc.","Titel/Ort" },
1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1294{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1295{ "Week Number","Wochennummer" }, 1295{ "Week Number","Wochennummer" },
1296{ "Import","Importiere" }, 1296{ "Import","Importiere" },
1297{ "Export","Exportiere" }, 1297{ "Export","Exportiere" },
1298{ "Beam","Beame" }, 1298{ "Beam","Beame" },
1299{ "Export selected","Exportiere Selektierte" }, 1299{ "Export selected","Exportiere Selektierte" },
1300{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1300{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1301{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1301{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1302{ "Journal/Details...","Journale/Details..." }, 1302{ "Journal/Details...","Journale/Details..." },
1303{ "Agenda View","Agenda Ansicht" }, 1303{ "Agenda View","Agenda Ansicht" },
1304{ "Show current time","Zeige aktuelle Zeit" }, 1304{ "Show current time","Zeige aktuelle Zeit" },
1305{ "Edit new item","Bearbeite neuen Eintrag" }, 1305{ "Edit new item","Bearbeite neuen Eintrag" },
1306{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, 1306{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" },
1307{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1308{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1309{ "The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)","Der nächste Alarm in am:\n%1\num: %2\n\n%3\n(%4)" },
1307{ "","" }, 1310{ "","" },
1308{ "","" }, 1311{ "","" },
1309{ "","" }, 1312{ "","" },
1310{ "","" }, 1313{ "","" },
1311{ "","" }, 1314{ "","" },
1312{ "","" }, 1315{ "","" },
1313{ "","" }, 1316 \ No newline at end of file
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp
index c939ae0..7ead3b9 100644
--- a/kalarmd/alarmdialog.cpp
+++ b/kalarmd/alarmdialog.cpp
@@ -26,114 +26,123 @@
26#include <qhbox.h> 26#include <qhbox.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qapp.h> 28#include <qapp.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qsound.h> 33#include <qsound.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#define protected public 35#define protected public
36#include <qspinbox.h> 36#include <qspinbox.h>
37#undef protected 37#undef protected
38#include <stdlib.h> 38#include <stdlib.h>
39#ifndef _WIN32_ 39#ifndef _WIN32_
40#include <unistd.h> 40#include <unistd.h>
41#include <sys/ioctl.h> 41#include <sys/ioctl.h>
42#endif 42#endif
43#include <stdio.h> 43#include <stdio.h>
44#include <fcntl.h> 44#include <fcntl.h>
45 45
46#ifndef DESKTOP_VERSION 46#ifndef DESKTOP_VERSION
47#include <qtopia/alarmserver.h> 47#include <qtopia/alarmserver.h>
48#include <qpe/resource.h> 48#include <qpe/resource.h>
49#include <qtopia/sound.h> 49#include <qtopia/sound.h>
50
50#endif 51#endif
51 52
52#include "alarmdialog.h" 53#include "alarmdialog.h"
53 54
54 55
55AlarmDialog::AlarmDialog(QWidget *parent,const char *name) 56AlarmDialog::AlarmDialog(QWidget *parent,const char *name)
56 : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) 57 : QDialog (parent, name, true, Qt::WStyle_StaysOnTop )
57{ 58{
58 setCaption( "KO/Pi Alarm!" ); 59 setCaption( "KO/Pi Alarm!" );
59 QVBoxLayout* layout = new QVBoxLayout( this); 60 QVBoxLayout* layout = new QVBoxLayout( this);
60 QLabel* l = new QLabel("The following event triggered alarm:",this); 61 QLabel* l = new QLabel("The following event triggered alarm:",this);
61 layout->addWidget ( l ); 62 layout->addWidget ( l );
62 l->setAlignment( AlignCenter); 63 l->setAlignment( AlignCenter);
63 mMessage = new QLabel ( " ", this ); 64 mMessage = new QLabel ( " ", this );
64 int fs = 18; 65 int fs = 18;
65 int fs2 = 12; 66 int fs2 = 12;
66 if ( QApplication::desktop()->width() < 480 ) { 67 if ( QApplication::desktop()->width() < 480 ) {
67 setMaximumSize(220, 260); 68 setMaximumSize(220, 260);
68 fs2 = 10; 69 fs2 = 10;
69 } 70 }
70 else { 71 else {
71 setMaximumSize(440, 440); 72 setMaximumSize(440, 440);
72 } 73 }
73 layout->setSpacing( 3 ); 74 layout->setSpacing( 3 );
74 layout->setMargin( 3 ); 75 layout->setMargin( 3 );
75 QFont fo = QApplication::font(); 76 QFont fo = QApplication::font();
76 fo.setBold( true ); 77 fo.setBold( true );
77 fo.setPointSize( fs2 ); 78 fo.setPointSize( fs2 );
78 l->setFont( fo ); 79 l->setFont( fo );
79 fo.setPointSize( fs ); 80 fo.setPointSize( fs );
80 mMessage->setFont(fo ); 81 mMessage->setFont(fo );
81 mMessage->setAlignment( AlignCenter); 82 mMessage->setAlignment( AlignCenter);
82 layout->addWidget ( mMessage ); 83 layout->addWidget ( mMessage );
83 mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); 84 mMissedAlarms= new QLabel ( "(No missed Alarms)", this );
84 mMissedAlarms->setAlignment( AlignCenter); 85 mMissedAlarms->setAlignment( AlignCenter);
85 86
86 playSoundTimer = new QTimer( this ); 87 playSoundTimer = new QTimer( this );
87 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); 88 connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) );
88 89
89 playSoundTimer->stop(); 90 playSoundTimer->stop();
90 91
91 layout->addWidget ( mMissedAlarms ); 92 layout->addWidget ( mMissedAlarms );
92 mMissedAlarmsCombo = new QComboBox ( this ); 93 mMissedAlarmsCombo = new QComboBox ( this );
93 layout->addWidget ( mMissedAlarmsCombo ); 94 layout->addWidget ( mMissedAlarmsCombo );
94 QVBox *suspendBox = new QVBox( this ); 95
95 suspendBox->setSpacing(3); 96 QLabel* labb = new QLabel("Suspend duration (minutes):",this);
96 layout->addWidget ( suspendBox );
97 QLabel* labb = new QLabel("Suspend duration (minutes):",suspendBox);
98 labb->setAlignment(AlignCenter); 97 labb->setAlignment(AlignCenter);
98 layout->addWidget ( labb );
99 fo = font(); 99 fo = font();
100 fo.setPointSize( 36 ); 100 int pointSize = 36;
101 mSuspendSpin = new QSpinBox(1,1440,1,suspendBox); 101 if ( QApplication::desktop()->width() <= 320 )
102 pointSize = 24;
103 fo.setPointSize( pointSize );
104 mSuspendSpin = new QSpinBox(1,1440,1,this);
102 mSuspendSpin->setFont( fo ); 105 mSuspendSpin->setFont( fo );
103 mSuspendSpin->setValue(7); // default suspend duration 106 mSuspendSpin->setValue(7); // default suspend duration
104 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 107 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
105 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 108 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
106#if QT_VERSION < 0x030000 109#if QT_VERSION < 0x030000
107 mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); 110 mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 ));
108 mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); 111 mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 ));
109#endif 112#endif
110 mSuspendSpin->setFixedSize( 100,62 ); 113 mSuspendSpin->setFixedSize( 100,62 );
111 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); 114 mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus );
115 QHBoxLayout* layoutSpin = new QHBoxLayout( layout );
116 layoutSpin->addStretch ();
117 layoutSpin->addWidget ( mSuspendSpin );
118 layoutSpin->addStretch ();
112 119
113 QVBox * bbox = new QVBox ( this ); 120 QVBox * bbox = new QVBox ( this );
114 layout->addWidget ( bbox ); 121 layout->addWidget ( bbox );
115 bbox->layout()->setSpacing( 2 ); 122 bbox->layout()->setSpacing( 2 );
123 labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox);
124 labb->setAlignment(AlignCenter);
116 mSuspendButton = new QPushButton( "Suspend", bbox); 125 mSuspendButton = new QPushButton( "Suspend", bbox);
117 QPushButton* silen = new QPushButton( " Stop sound ", bbox); 126 QPushButton* silen = new QPushButton( " Stop sound ", bbox);
118 QPushButton* okbut = new QPushButton( "Ok", bbox); 127 QPushButton* okbut = new QPushButton( "Ok", bbox);
119 mSuspendButton->setFont( fo ); 128 mSuspendButton->setFont( fo );
120 silen->setFont( fo ); 129 silen->setFont( fo );
121 okbut->setFont( fo ); 130 okbut->setFont( fo );
122 okbut->setDefault( true ); 131 okbut->setDefault( true );
123 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); 132 connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) );
124 connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); 133 connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) );
125 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); 134 connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) );
126#ifndef _WIN32_ 135#ifndef _WIN32_
127 if ( QFile::exists ( "/dev/sharp_led" ) ) 136 if ( QFile::exists ( "/dev/sharp_led" ) )
128 fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); 137 fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK );
129 else 138 else
130#endif 139#endif
131 fd_led = 0; 140 fd_led = 0;
132 statusLED.which = SHARP_LED_SALARM; 141 statusLED.which = SHARP_LED_SALARM;
133 mSilent = false; 142 mSilent = false;
134 mSuspendCounter = 0; 143 mSuspendCounter = 0;
135 setServerNotification( true ); 144 setServerNotification( true );
136} 145}
137void AlarmDialog::reject () 146void AlarmDialog::reject ()
138{ 147{
139 QTimer::singleShot ( 3000, this, SLOT (suspend()) ); 148 QTimer::singleShot ( 3000, this, SLOT (suspend()) );
@@ -238,43 +247,66 @@ bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, boo
238#ifndef _WIN32_ 247#ifndef _WIN32_
239 if ( fd_led > 0 ) { 248 if ( fd_led > 0 ) {
240 statusLED.status = LED_SALARM_ON ; 249 statusLED.status = LED_SALARM_ON ;
241 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); 250 ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED);
242 } 251 }
243#endif 252#endif
244 playSoundTimer->start( 1000, true ); 253 playSoundTimer->start( 1000, true );
245 return true; 254 return true;
246 255
247} 256}
248 257
249 258
250void AlarmDialog::playSound () 259void AlarmDialog::playSound ()
251{ 260{
252 if (mStopAlarm ) 261 if (mStopAlarm )
253 return; 262 return;
254 showNormal(); 263 showNormal();
255 setActiveWindow(); 264 setActiveWindow();
256 mSuspendSpin->setFocus(); 265 mSuspendSpin->setFocus();
257 raise(); 266 raise();
258 267
259 qApp->processEvents(); 268 qApp->processEvents();
260 if ( alarmCounter < maxAlarmReplay && ! mSilent) { 269 if ( alarmCounter < maxAlarmReplay && ! mSilent) {
261 ++alarmCounter; 270 ++alarmCounter;
271#ifdef DESKTOP_VERSION
272 mPlayWav = true;
273#endif
262 if ( !mPlayWav || mFileName.length() < 2 ) { 274 if ( !mPlayWav || mFileName.length() < 2 ) {
263 275
264#ifndef DESKTOP_VERSION 276#ifdef DESKTOP_VERSION
277 qDebug("Sound play not possible - file not found");
278#else
265 Sound::soundAlarm (); 279 Sound::soundAlarm ();
266#endif 280#endif
267 } else { 281 } else
282
283 {
284#ifdef DESKTOP_VERSION
285#ifdef _WIN32_
268 QSound::play ( mFileName ); 286 QSound::play ( mFileName );
287#else
288
289 QString command = "playwave -r 22050 " + mFileName;
290 qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() );
291 int ret = system ( command.latin1() );
292 if ( ret != 0 ) {
293 qDebug("Sound play command failed: %s ",command.latin1() );
294 }
295
296#endif
297
298#else
299 QSound::play ( mFileName );
300#endif
269 //qDebug("BEEP!"); 301 //qDebug("BEEP!");
270 } 302 }
271 } else { 303 } else {
272 if ( ! mSilent && mSuspendCounter > 0 ) { 304 if ( ! mSilent && mSuspendCounter > 0 ) {
273 --mSuspendCounter; 305 --mSuspendCounter;
274 reject (); 306 reject ();
275 hide(); 307 hide();
276 return; 308 return;
277 } 309 }
278 } 310 }
279 playSoundTimer->start( mPauseCount * 1000, true ); 311 playSoundTimer->start( mPauseCount * 1000, true );
280} 312}
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 3a16fe6..73aa733 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -214,49 +214,49 @@ CalendarView::CalendarView( CalendarResources *calendar,
214 mCalendar( calendar ), 214 mCalendar( calendar ),
215 mResourceManager( calendar->resourceManager() ) 215 mResourceManager( calendar->resourceManager() )
216{ 216{
217 217
218 mEventEditor = 0; 218 mEventEditor = 0;
219 mTodoEditor = 0; 219 mTodoEditor = 0;
220 220
221 init(); 221 init();
222} 222}
223 223
224CalendarView::CalendarView( Calendar *calendar, 224CalendarView::CalendarView( Calendar *calendar,
225 QWidget *parent, const char *name ) 225 QWidget *parent, const char *name )
226 : CalendarViewBase( parent, name ), 226 : CalendarViewBase( parent, name ),
227 mCalendar( calendar ), 227 mCalendar( calendar ),
228 mResourceManager( 0 ) 228 mResourceManager( 0 )
229{ 229{
230 230
231 mEventEditor = 0; 231 mEventEditor = 0;
232 mTodoEditor = 0; 232 mTodoEditor = 0;
233 init(); 233 init();
234} 234}
235 235
236void CalendarView::init() 236void CalendarView::init()
237{ 237{
238 238 mNextAlarmDateTime = QDateTime::currentDateTime();
239 setFocusPolicy ( WheelFocus ); 239 setFocusPolicy ( WheelFocus );
240 mViewerCallerIsSearchDialog = false; 240 mViewerCallerIsSearchDialog = false;
241 mBlockShowDates = false; 241 mBlockShowDates = false;
242 beamDialog = new KOBeamPrefs(); 242 beamDialog = new KOBeamPrefs();
243 mDatePickerMode = 0; 243 mDatePickerMode = 0;
244 mCurrentSyncDevice = ""; 244 mCurrentSyncDevice = "";
245 writeLocale(); 245 writeLocale();
246 mViewManager = new KOViewManager( this ); 246 mViewManager = new KOViewManager( this );
247 mDialogManager = new KODialogManager( this ); 247 mDialogManager = new KODialogManager( this );
248 mEventViewerDialog = 0; 248 mEventViewerDialog = 0;
249 mModified = false; 249 mModified = false;
250 mReadOnly = false; 250 mReadOnly = false;
251 mSelectedIncidence = 0; 251 mSelectedIncidence = 0;
252 mCalPrinter = 0; 252 mCalPrinter = 0;
253 mFilters.setAutoDelete(true); 253 mFilters.setAutoDelete(true);
254 254
255 mCalendar->registerObserver( this ); 255 mCalendar->registerObserver( this );
256 // TODO: Make sure that view is updated, when calendar is changed. 256 // TODO: Make sure that view is updated, when calendar is changed.
257 257
258 mStorage = new FileStorage( mCalendar ); 258 mStorage = new FileStorage( mCalendar );
259 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 259 mNavigator = new DateNavigator( this, "datevav", mViewManager );
260 260
261 QBoxLayout *topLayout = (QBoxLayout*)layout(); 261 QBoxLayout *topLayout = (QBoxLayout*)layout();
262#ifndef KORG_NOSPLITTER 262#ifndef KORG_NOSPLITTER
@@ -621,48 +621,49 @@ void CalendarView::computeAlarm( QString msg )
621 //qDebug("audio file command %s ",tempfilename.latin1() ); 621 //qDebug("audio file command %s ",tempfilename.latin1() );
622 } 622 }
623 if ( mess.left( 9 ) == "cal_alarm") { 623 if ( mess.left( 9 ) == "cal_alarm") {
624 mAlarmMessage = mess.mid( 9 ) ; 624 mAlarmMessage = mess.mid( 9 ) ;
625 } 625 }
626 626
627 startAlarm( mAlarmMessage, filename ); 627 startAlarm( mAlarmMessage, filename );
628 628
629 629
630} 630}
631 631
632void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 632void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
633{ 633{
634 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 634 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
635 635
636 mSuspendAlarmNotification = noti; 636 mSuspendAlarmNotification = noti;
637 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 637 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
638 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 638 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
639 mSuspendTimer->start( ms , true ); 639 mSuspendTimer->start( ms , true );
640 640
641} 641}
642 642
643void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 643void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
644{ 644{
645 mNextAlarmDateTime = qdt;
645 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 646 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
646 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 647 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
647#ifndef DESKTOP_VERSION 648#ifndef DESKTOP_VERSION
648 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); 649 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() );
649#endif 650#endif
650 return; 651 return;
651 } 652 }
652 int maxSec; 653 int maxSec;
653 //maxSec = 5; //testing only 654 //maxSec = 5; //testing only
654 maxSec = 86400+3600; // one day+1hour 655 maxSec = 86400+3600; // one day+1hour
655 mAlarmNotification = noti; 656 mAlarmNotification = noti;
656 int sec = QDateTime::currentDateTime().secsTo( qdt ); 657 int sec = QDateTime::currentDateTime().secsTo( qdt );
657 if ( sec > maxSec ) { 658 if ( sec > maxSec ) {
658 mRecheckAlarmTimer->start( maxSec * 1000 ); 659 mRecheckAlarmTimer->start( maxSec * 1000 );
659 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 660 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
660 return; 661 return;
661 } else { 662 } else {
662 mRecheckAlarmTimer->stop(); 663 mRecheckAlarmTimer->stop();
663 } 664 }
664 //qDebug("Alarm timer started with secs: %d ", sec); 665 //qDebug("Alarm timer started with secs: %d ", sec);
665 mAlarmTimer->start( sec *1000 , true ); 666 mAlarmTimer->start( sec *1000 , true );
666 667
667} 668}
668// called by mRecheckAlarmTimer to get next alarm 669// called by mRecheckAlarmTimer to get next alarm
@@ -4043,24 +4044,39 @@ void CalendarView::undo_delete()
4043void CalendarView::slotViewerClosed() 4044void CalendarView::slotViewerClosed()
4044{ 4045{
4045 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4046 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4046} 4047}
4047 4048
4048void CalendarView::resetFocus() 4049void CalendarView::resetFocus()
4049{ 4050{
4050 if ( mViewerCallerIsSearchDialog ) { 4051 if ( mViewerCallerIsSearchDialog ) {
4051 if ( mDialogManager->getSearchDialog()->isVisible() ){ 4052 if ( mDialogManager->getSearchDialog()->isVisible() ){
4052 mDialogManager->getSearchDialog()->raise(); 4053 mDialogManager->getSearchDialog()->raise();
4053 mDialogManager->getSearchDialog()->setActiveWindow(); 4054 mDialogManager->getSearchDialog()->setActiveWindow();
4054 mDialogManager->getSearchDialog()->listview()->resetFocus(); 4055 mDialogManager->getSearchDialog()->listview()->resetFocus();
4055 } else 4056 } else
4056 mViewerCallerIsSearchDialog = false; 4057 mViewerCallerIsSearchDialog = false;
4057 } 4058 }
4058 if ( !mViewerCallerIsSearchDialog ) { 4059 if ( !mViewerCallerIsSearchDialog ) {
4059 //mViewManager->currentView()->setFocus(); 4060 //mViewManager->currentView()->setFocus();
4060 //qDebug("sssssssssssssssset focus "); 4061 //qDebug("sssssssssssssssset focus ");
4061 topLevelWidget()->raise(); 4062 topLevelWidget()->raise();
4062 setActiveWindow(); 4063 setActiveWindow();
4063 //setFocus(); 4064 //setFocus();
4064 } 4065 }
4065 mViewerCallerIsSearchDialog = false; 4066 mViewerCallerIsSearchDialog = false;
4066} 4067}
4068
4069void CalendarView::showNextAlarms()
4070{
4071 QString message;
4072 if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) {
4073 QString sum = mCalendar->nextSummary();
4074 QDateTime nextA = mNextAlarmDateTime;
4075 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
4076 message = i18n("The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)").arg( KGlobal::locale()->formatDate(nextA.date() , false)).arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
4077 } else {
4078 message = i18n("There is no next alarm.");
4079
4080 }
4081 KMessageBox::information( this, message);
4082}
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 16e671f..9782ffe 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -155,48 +155,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
155 void incidenceSelected( Incidence * ); 155 void incidenceSelected( Incidence * );
156 /** Emitted, when a todoitem is selected or deselected. */ 156 /** Emitted, when a todoitem is selected or deselected. */
157 void todoSelected( bool ); 157 void todoSelected( bool );
158 158
159 /** 159 /**
160 Emitted, when clipboard content changes. Parameter indicates if paste 160 Emitted, when clipboard content changes. Parameter indicates if paste
161 is possible or not. 161 is possible or not.
162 */ 162 */
163 void pasteEnabled(bool); 163 void pasteEnabled(bool);
164 164
165 /** Emitted, when the number of incoming messages has changed. */ 165 /** Emitted, when the number of incoming messages has changed. */
166 void numIncomingChanged(int); 166 void numIncomingChanged(int);
167 167
168 /** Emitted, when the number of outgoing messages has changed. */ 168 /** Emitted, when the number of outgoing messages has changed. */
169 void numOutgoingChanged(int); 169 void numOutgoingChanged(int);
170 170
171 /** Send status message, which can e.g. be displayed in the status bar. */ 171 /** Send status message, which can e.g. be displayed in the status bar. */
172 void statusMessage(const QString &); 172 void statusMessage(const QString &);
173 173
174 void calendarViewExpanded( bool ); 174 void calendarViewExpanded( bool );
175 void updateSearchDialog(); 175 void updateSearchDialog();
176 176
177 177
178 public slots: 178 public slots:
179 void showNextAlarms();
179 void showOpenError(); 180 void showOpenError();
180 void watchSavedFile(); 181 void watchSavedFile();
181 void recheckTimerAlarm(); 182 void recheckTimerAlarm();
182 void checkNextTimerAlarm(); 183 void checkNextTimerAlarm();
183 void addAlarm(const QDateTime &qdt, const QString &noti ); 184 void addAlarm(const QDateTime &qdt, const QString &noti );
184 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 185 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
185 void removeAlarm(const QDateTime &qdt, const QString &noti ); 186 void removeAlarm(const QDateTime &qdt, const QString &noti );
186 187
187 /** options dialog made a changed to the configuration. we catch this 188 /** options dialog made a changed to the configuration. we catch this
188 * and notify all widgets which need to update their configuration. */ 189 * and notify all widgets which need to update their configuration. */
189 void updateConfig(); 190 void updateConfig();
190 191
191 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 192 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
192 const QStringList& anniversaryList, const QStringList& realNameList, 193 const QStringList& anniversaryList, const QStringList& realNameList,
193 const QStringList& emailList, const QStringList& assembledNameList, 194 const QStringList& emailList, const QStringList& assembledNameList,
194 const QStringList& uidList); 195 const QStringList& uidList);
195 196
196 /** 197 /**
197 Load calendar from file \a filename. If \a merge is true, load 198 Load calendar from file \a filename. If \a merge is true, load
198 calendar into existing one, if it is false, clear calendar, before 199 calendar into existing one, if it is false, clear calendar, before
199 loading. Return true, if calendar could be successfully loaded. 200 loading. Return true, if calendar could be successfully loaded.
200 */ 201 */
201 bool openCalendar(QString filename, bool merge=false); 202 bool openCalendar(QString filename, bool merge=false);
202 bool syncCalendar(QString filename,int mode = 0 ); 203 bool syncCalendar(QString filename,int mode = 0 );
@@ -478,48 +479,49 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
478 void setSyncManager(KSyncManager* manager); 479 void setSyncManager(KSyncManager* manager);
479 void setLoadedFileVersion(QDateTime); 480 void setLoadedFileVersion(QDateTime);
480 bool checkFileVersion(QString fn); 481 bool checkFileVersion(QString fn);
481 bool checkFileChanged(QString fn); 482 bool checkFileChanged(QString fn);
482 Event* getLastSyncEvent(); 483 Event* getLastSyncEvent();
483 /** Adapt navigation units correpsonding to step size of navigation of the 484 /** Adapt navigation units correpsonding to step size of navigation of the
484 * current view. 485 * current view.
485 */ 486 */
486 void adaptNavigationUnits(); 487 void adaptNavigationUnits();
487 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 488 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
488 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 489 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
489 //Attendee* getYourAttendee(Event *event); 490 //Attendee* getYourAttendee(Event *event);
490 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 491 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
491 protected: 492 protected:
492 void schedule(Scheduler::Method, Incidence *incidence = 0); 493 void schedule(Scheduler::Method, Incidence *incidence = 0);
493 494
494 // returns KMsgBox::OKCandel() 495 // returns KMsgBox::OKCandel()
495 int msgItemDelete(const QString name); 496 int msgItemDelete(const QString name);
496 void showEventEditor(); 497 void showEventEditor();
497 void showTodoEditor(); 498 void showTodoEditor();
498 void writeLocale(); 499 void writeLocale();
499 Todo *selectedTodo(); 500 Todo *selectedTodo();
500 501
501 private: 502 private:
503 QDateTime mNextAlarmDateTime;
502 bool mViewerCallerIsSearchDialog; 504 bool mViewerCallerIsSearchDialog;
503 bool mBlockShowDates; 505 bool mBlockShowDates;
504 KSyncManager* mSyncManager; 506 KSyncManager* mSyncManager;
505 AlarmDialog * mAlarmDialog; 507 AlarmDialog * mAlarmDialog;
506 QString mAlarmNotification; 508 QString mAlarmNotification;
507 QString mSuspendAlarmNotification; 509 QString mSuspendAlarmNotification;
508 QTimer* mSuspendTimer; 510 QTimer* mSuspendTimer;
509 QTimer* mAlarmTimer; 511 QTimer* mAlarmTimer;
510 QTimer* mRecheckAlarmTimer; 512 QTimer* mRecheckAlarmTimer;
511 void computeAlarm( QString ); 513 void computeAlarm( QString );
512 void startAlarm( QString, QString ); 514 void startAlarm( QString, QString );
513 void setSyncEventsReadOnly(); 515 void setSyncEventsReadOnly();
514 516
515 QDateTime loadedFileVersion; 517 QDateTime loadedFileVersion;
516 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 518 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
517 void checkExternalId( Incidence * inc ); 519 void checkExternalId( Incidence * inc );
518 int mGlobalSyncMode; 520 int mGlobalSyncMode;
519 QString mCurrentSyncDevice; 521 QString mCurrentSyncDevice;
520 QString mCurrentSyncName; 522 QString mCurrentSyncName;
521 KOBeamPrefs* beamDialog; 523 KOBeamPrefs* beamDialog;
522 void init(); 524 void init();
523 int mDatePickerMode; 525 int mDatePickerMode;
524 bool mFlagEditDescription; 526 bool mFlagEditDescription;
525 QDateTime mLastCalendarSync; 527 QDateTime mLastCalendarSync;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 95b836c..7a4275b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -569,49 +569,49 @@ void MainWindow::initActions()
569 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 569 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
570 menuBar->insertItem( i18n("Help"), helpMenu ); 570 menuBar->insertItem( i18n("Help"), helpMenu );
571 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 571 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
572 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 572 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
573 } 573 }
574 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 574 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
575 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 575 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
576 mWeekBgColor = iconToolBar->backgroundColor(); 576 mWeekBgColor = iconToolBar->backgroundColor();
577 mWeekPixmap.resize( pixWid , pixHei ); 577 mWeekPixmap.resize( pixWid , pixHei );
578 mWeekPixmap.fill( mWeekBgColor ); 578 mWeekPixmap.fill( mWeekBgColor );
579 icon = mWeekPixmap; 579 icon = mWeekPixmap;
580 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 580 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
581 if ( p-> mShowIconWeekNum ) 581 if ( p-> mShowIconWeekNum )
582 mWeekAction->addTo( iconToolBar ); 582 mWeekAction->addTo( iconToolBar );
583 mWeekFont = font(); 583 mWeekFont = font();
584 584
585 int fontPoint = mWeekFont.pointSize(); 585 int fontPoint = mWeekFont.pointSize();
586 QFontMetrics f( mWeekFont ); 586 QFontMetrics f( mWeekFont );
587 int fontWid = f.width( "30" ); 587 int fontWid = f.width( "30" );
588 while ( fontWid > pixWid ) { 588 while ( fontWid > pixWid ) {
589 --fontPoint; 589 --fontPoint;
590 mWeekFont.setPointSize( fontPoint ); 590 mWeekFont.setPointSize( fontPoint );
591 QFontMetrics f( mWeekFont ); 591 QFontMetrics f( mWeekFont );
592 fontWid = f.width( "30" ); 592 fontWid = f.width( "30" );
593 qDebug("dec-- "); 593 //qDebug("dec-- ");
594 } 594 }
595 595
596 connect( mWeekAction, SIGNAL( activated() ), 596 connect( mWeekAction, SIGNAL( activated() ),
597 this, SLOT( weekAction() ) ); 597 this, SLOT( weekAction() ) );
598 598
599 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 599 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
600 600
601 //#endif 601 //#endif
602 // ****************** 602 // ******************
603 QAction *action; 603 QAction *action;
604 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 604 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
605 configureToolBarMenu->setCheckable( true ); 605 configureToolBarMenu->setCheckable( true );
606 606
607 607
608 configureAgendaMenu->setCheckable( true ); 608 configureAgendaMenu->setCheckable( true );
609 int iii ; 609 int iii ;
610 for ( iii = 1;iii<= 10 ;++iii ){ 610 for ( iii = 1;iii<= 10 ;++iii ){
611 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 611 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
612 } 612 }
613 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 613 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
614 614
615 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 615 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
616 this, SLOT( showConfigureAgenda( ) ) ); 616 this, SLOT( showConfigureAgenda( ) ) );
617 617
@@ -1727,48 +1727,51 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1727 showSelectedDates = true; 1727 showSelectedDates = true;
1728 break; 1728 break;
1729 case Qt::Key_V: 1729 case Qt::Key_V:
1730 mView->viewManager()->showTodoView(); 1730 mView->viewManager()->showTodoView();
1731 break; 1731 break;
1732 case Qt::Key_C: 1732 case Qt::Key_C:
1733 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1733 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1734 break; 1734 break;
1735 case Qt::Key_P: 1735 case Qt::Key_P:
1736 mView->showDatePicker( ); 1736 mView->showDatePicker( );
1737 break; 1737 break;
1738 case Qt::Key_F: 1738 case Qt::Key_F:
1739 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1739 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1740 mView->editFilters(); 1740 mView->editFilters();
1741 else 1741 else
1742 mView->toggleFilter(); 1742 mView->toggleFilter();
1743 break; 1743 break;
1744 case Qt::Key_X: 1744 case Qt::Key_X:
1745 mView->toggleDateNavigatorWidget(); 1745 mView->toggleDateNavigatorWidget();
1746 break; 1746 break;
1747 case Qt::Key_Space: 1747 case Qt::Key_Space:
1748 mView->toggleExpand(); 1748 mView->toggleExpand();
1749 break; 1749 break;
1750 case Qt::Key_A: 1750 case Qt::Key_A:
1751 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
1752 mView->showNextAlarms();
1753 else
1751 mView->toggleAllDaySize(); 1754 mView->toggleAllDaySize();
1752 break; 1755 break;
1753 case Qt::Key_T: 1756 case Qt::Key_T:
1754 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1757 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1755 mView->newTodo(); 1758 mView->newTodo();
1756 else { 1759 else {
1757 mView->goToday(); 1760 mView->goToday();
1758 showSelectedDates = true; 1761 showSelectedDates = true;
1759 } 1762 }
1760 break; 1763 break;
1761 case Qt::Key_J: 1764 case Qt::Key_J:
1762 mView->viewManager()->showJournalView(); 1765 mView->viewManager()->showJournalView();
1763 break; 1766 break;
1764 case Qt::Key_B: 1767 case Qt::Key_B:
1765 mView->editIncidenceDescription();; 1768 mView->editIncidenceDescription();;
1766 break; 1769 break;
1767 // case Qt::Key_Return: 1770 // case Qt::Key_Return:
1768 case Qt::Key_E: 1771 case Qt::Key_E:
1769 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1772 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1770 mView->newEvent(); 1773 mView->newEvent();
1771 else 1774 else
1772 mView->editIncidence(); 1775 mView->editIncidence();
1773 break; 1776 break;
1774 case Qt::Key_Plus: 1777 case Qt::Key_Plus:
@@ -2112,24 +2115,36 @@ void MainWindow::weekAction()
2112 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2115 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2113 if ( iconToolBar->y() > height()/2 ) { 2116 if ( iconToolBar->y() > height()/2 ) {
2114 dY = picker->sizeHint().height()+8; 2117 dY = picker->sizeHint().height()+8;
2115 y = 0; 2118 y = 0;
2116 } 2119 }
2117 } else { 2120 } else {
2118 if ( iconToolBar->x() > width()/2 ) { // right side 2121 if ( iconToolBar->x() > width()/2 ) { // right side
2119 x=0; 2122 x=0;
2120 dX= picker->sizeHint().width()+8; 2123 dX= picker->sizeHint().width()+8;
2121 y = 0; 2124 y = 0;
2122 } else { 2125 } else {
2123 x= iconToolBar->width(); 2126 x= iconToolBar->width();
2124 y = 0; 2127 y = 0;
2125 } 2128 }
2126 } 2129 }
2127 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2130 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2128 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2131 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2129 { 2132 {
2130 month = picker->getResult(); 2133 month = picker->getResult();
2131 emit selectWeek ( month ); 2134 emit selectWeek ( month );
2132 //qDebug("weekSelected %d ", month); 2135 //qDebug("weekSelected %d ", month);
2133 } 2136 }
2134 delete popup; 2137 delete popup;
2135} 2138}
2139
2140void MainWindow::hideEvent ( QHideEvent * )
2141{
2142 QString message;
2143 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2144 if ( nextA.isValid() ) {
2145 QString sum = mCalendar->nextSummary();
2146
2147 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2148 setCaption( message );
2149 }
2150}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 7604529..b3041dc 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -83,48 +83,49 @@ class MainWindow : public QMainWindow
83 83
84 void slotModifiedChanged( bool ); 84 void slotModifiedChanged( bool );
85 85
86 void save(); 86 void save();
87 void saveStopTimer(); 87 void saveStopTimer();
88 void configureToolBar( int ); 88 void configureToolBar( int );
89 void printSel(); 89 void printSel();
90 void printCal(); 90 void printCal();
91 void saveCalendar(); 91 void saveCalendar();
92 void loadCalendar(); 92 void loadCalendar();
93 void exportVCalendar(); 93 void exportVCalendar();
94 void fillFilterMenu(); 94 void fillFilterMenu();
95 void selectFilter( int ); 95 void selectFilter( int );
96 void exportToPhone( int ); 96 void exportToPhone( int );
97 void toggleBeamReceive(); 97 void toggleBeamReceive();
98 void disableBR(bool); 98 void disableBR(bool);
99 signals: 99 signals:
100 void selectWeek ( int ); 100 void selectWeek ( int );
101 private slots: 101 private slots:
102 void showConfigureAgenda(); 102 void showConfigureAgenda();
103 void getFile( bool ); 103 void getFile( bool );
104 void syncFileRequest(); 104 void syncFileRequest();
105 105
106 protected: 106 protected:
107 void hideEvent ( QHideEvent * );
107 QString sentSyncFile(); 108 QString sentSyncFile();
108 void displayText( QString, QString); 109 void displayText( QString, QString);
109 void enableIncidenceActions( bool ); 110 void enableIncidenceActions( bool );
110 111
111 private: 112 private:
112 bool mBRdisabled; 113 bool mBRdisabled;
113#ifndef DESKTOP_VERSION 114#ifndef DESKTOP_VERSION
114 QCopChannel* infrared; 115 QCopChannel* infrared;
115#endif 116#endif
116 QAction* brAction; 117 QAction* brAction;
117 KSyncManager* mSyncManager; 118 KSyncManager* mSyncManager;
118 bool mClosed; 119 bool mClosed;
119 void saveOnClose(); 120 void saveOnClose();
120 bool mFlagKeyPressed; 121 bool mFlagKeyPressed;
121 bool mBlockAtStartup; 122 bool mBlockAtStartup;
122 QPEToolBar *iconToolBar; 123 QPEToolBar *iconToolBar;
123 void initActions(); 124 void initActions();
124 void setDefaultPreferences(); 125 void setDefaultPreferences();
125 void keyPressEvent ( QKeyEvent * ) ; 126 void keyPressEvent ( QKeyEvent * ) ;
126 void keyReleaseEvent ( QKeyEvent * ) ; 127 void keyReleaseEvent ( QKeyEvent * ) ;
127 QPopupMenu *configureToolBarMenu; 128 QPopupMenu *configureToolBarMenu;
128 QPopupMenu *selectFilterMenu; 129 QPopupMenu *selectFilterMenu;
129 QPopupMenu *configureAgendaMenu, *syncMenu; 130 QPopupMenu *configureAgendaMenu, *syncMenu;
130 CalendarLocal *mCalendar; 131 CalendarLocal *mCalendar;