summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-03 23:10:45 (UTC)
committer zautrix <zautrix>2005-06-03 23:10:45 (UTC)
commit858b047efb5627824438cb3877e7bec0cebb3751 (patch) (unidiff)
tree7b36963344d4f5019f3a1ecb5eb9290f27c3b3c7 /korganizer
parent0207d193bdb6c66201562a17e68872e018ec223c (diff)
downloadkdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.zip
kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.gz
kdepimpi-858b047efb5627824438cb3877e7bec0cebb3751.tar.bz2
fixxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp167
-rw-r--r--korganizer/calendarview.h20
-rw-r--r--korganizer/kotodoview.cpp2
-rw-r--r--korganizer/mainwindow.cpp4
4 files changed, 191 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 503ef12..36db9c4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -129,24 +129,142 @@
129#include <qprocess.h> 129#include <qprocess.h>
130#endif 130#endif
131 131
132#ifdef DESKTOP_VERSION 132#ifdef DESKTOP_VERSION
133#include <kabc/stdaddressbook.h> 133#include <kabc/stdaddressbook.h>
134#endif 134#endif
135using namespace KOrg; 135using namespace KOrg;
136using namespace KCal; 136using namespace KCal;
137extern int globalFlagBlockAgenda; 137extern int globalFlagBlockAgenda;
138extern int globalFlagBlockStartup; 138extern int globalFlagBlockStartup;
139 139
140 140
141MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
142
143{
144 mAlarms = alarms;
145 setBackgroundColor( QColor( 86, 153, 205 ) );
146 QString mText = "<table width=\"100%\">\n";
147 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
148#ifdef DESKTOP_VERSION
149 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
150#else
151 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
152#endif
153 // mText += "<img src=\"";
154 // mText += ipath;
155 // mText += "\">";
156 //mEventDate = QDate::currentDate();
157#ifdef DESKTOP_VERSION
158 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h1>";
159#else
160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
161#endif
162 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
163
164 Incidence * inc = getNextInc( start );
165 int time = 0;
166 mText += "<table>";
167 while ( inc ) {
168 QDateTime dt ;
169 QString tempText = "<a ";
170 bool ok;
171 dt = inc->getNextOccurence( start, &ok );
172 if ( !ok ) continue;
173 if ( inc->type() == "Event" ) {
174 tempText += "href=\"event:";
175 } else if ( inc->type() == "Todo" ) {
176 tempText += "href=\"todo:";
177 }
178 tempText += inc->uid() + "\">";
179 if ( inc->type() == "Todo" )
180 tempText += i18n("Todo: ");
181 if ( inc->summary().length() > 0 )
182 tempText += inc->summary();
183 else
184 tempText += i18n("-no summary-");
185 QString timestr;
186 if (!inc->doesFloat())
187 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
188 else
189 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
190 if ( dt.date() == QDate::currentDate() && time == 0 ) {
191 time = 1;
192 mText +="</table>";
193 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
194 mText += "<table>";
195
196 }
197 if ( dt.date() > QDate::currentDate() && time != 2 ) {
198 time = 2;
199 mText +="</table>";
200 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
201 mText += "<table>";
202 }
203 mText +="<tr><td><b>";
204 mText += timestr;
205 mText += "</b></td><td>";
206 mText += tempText;
207 mText += "</td></tr>\n";
208 inc = getNextInc( start );
209 }
210 mText +="</table>";
211 setText( mText );
212}
213
214Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
215{
216 QDateTime dt ;
217 Incidence * retInc;
218 Incidence * inc = mAlarms.first();
219 if ( inc == 0 )
220 return 0;
221 bool ok;
222 dt = inc->getNextOccurence( start, &ok );
223 if ( ! ok ) return 0;
224 QDateTime dtn ;
225 retInc = inc;
226 inc = mAlarms.next();
227 while ( inc ) {
228 dtn = inc->getNextOccurence( start, &ok );
229 if ( ! ok ) return 0;
230 if ( dtn < dt ) {
231 dt = dtn;
232 retInc = inc;
233 }
234 inc = mAlarms.next();
235 }
236 mAlarms.remove( retInc );
237 return retInc;
238
239}
240void MissedAlarmTextBrowser::setSource(const QString & n)
241{
242 if (n.startsWith("event:")) {
243#ifdef DESKTOP_VERSION
244 emit showIncidence(n.mid(8));
245#else
246 emit showIncidence(n.mid(6));
247#endif
248 return;
249 } else if (n.startsWith("todo:")) {
250#ifdef DESKTOP_VERSION
251 emit showIncidence(n.mid(7));
252#else
253 emit showIncidence(n.mid(5));
254#endif
255 return;
256 }
257}
258
141 259
142class KOBeamPrefs : public QDialog 260class KOBeamPrefs : public QDialog
143{ 261{
144 public: 262 public:
145 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 263 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
146 QDialog( parent, name, true ) 264 QDialog( parent, name, true )
147 { 265 {
148 setCaption( i18n("Beam Options") ); 266 setCaption( i18n("Beam Options") );
149 QVBoxLayout* lay = new QVBoxLayout( this ); 267 QVBoxLayout* lay = new QVBoxLayout( this );
150 lay->setSpacing( 3 ); 268 lay->setSpacing( 3 );
151 lay->setMargin( 3 ); 269 lay->setMargin( 3 );
152 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 270 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
@@ -497,25 +615,63 @@ void CalendarView::init()
497CalendarView::~CalendarView() 615CalendarView::~CalendarView()
498{ 616{
499 // kdDebug() << "~CalendarView()" << endl; 617 // kdDebug() << "~CalendarView()" << endl;
500 //qDebug("CalendarView::~CalendarView() "); 618 //qDebug("CalendarView::~CalendarView() ");
501 delete mDialogManager; 619 delete mDialogManager;
502 delete mViewManager; 620 delete mViewManager;
503 delete mStorage; 621 delete mStorage;
504 delete mDateFrame ; 622 delete mDateFrame ;
505 delete beamDialog; 623 delete beamDialog;
506 delete mEventViewerDialog; 624 delete mEventViewerDialog;
507 //kdDebug() << "~CalendarView() done" << endl; 625 //kdDebug() << "~CalendarView() done" << endl;
508} 626}
627void CalendarView::checkAlarms()
628{
629 KConfig *config = KOGlobals::config();
630 config->setGroup( "AppRun" );
631 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
632 int secs = config->readNumEntry( "LatestProgramStop" ) - 30;
633 //secs -= ( 3600 * 24*3 ); // debug only
634 QDateTime latest = dt.addSecs ( secs );
635 qDebug("KO: Last termination on %s ", latest.toString().latin1());
636 QPtrList<Incidence> el = mCalendar->rawIncidences();
637 QPtrList<Incidence> al;
638 Incidence* inL = el.first();
639 while ( inL ) {
640 bool ok = false;
641 int offset = 0;
642 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
643 if ( ok ) {
644 //qDebug("OK %s",next.toString().latin1());
645 if ( next < QDateTime::currentDateTime() ) {
646 al.append( inL );
647 qDebug("found missed alarm: %s ", inL->summary().latin1() );
648 }
649 }
650 inL = el.next();
651 }
652 if ( al.count() ) {
653 QDialog dia ( this, "huhu", true );
654 dia.setCaption( i18n("KO/Pi: Missing alarm notification!") );
655 QVBoxLayout* lay = new QVBoxLayout( &dia );
656 lay->setSpacing( 3 );
657 lay->setMargin( 3 );
658 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( &dia, al, latest );
659 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
660 lay->addWidget( matb );
661 dia.resize(240,240);
662 dia.exec();
509 663
664 }
665}
510void CalendarView::showDay( QDate d ) 666void CalendarView::showDay( QDate d )
511{ 667{
512 dateNavigator()->blockSignals( true ); 668 dateNavigator()->blockSignals( true );
513 dateNavigator()->selectDate( d ); 669 dateNavigator()->selectDate( d );
514 dateNavigator()->blockSignals( false ); 670 dateNavigator()->blockSignals( false );
515 mViewManager->showDayView(); 671 mViewManager->showDayView();
516 //dateNavigator()->selectDate( d ); 672 //dateNavigator()->selectDate( d );
517} 673}
518void CalendarView::timerAlarm() 674void CalendarView::timerAlarm()
519{ 675{
520 //qDebug("CalendarView::timerAlarm() "); 676 //qDebug("CalendarView::timerAlarm() ");
521 computeAlarm(mAlarmNotification ); 677 computeAlarm(mAlarmNotification );
@@ -1960,25 +2116,27 @@ void CalendarView::writeSettings()
1960{ 2116{
1961 // kdDebug() << "CalendarView::writeSettings" << endl; 2117 // kdDebug() << "CalendarView::writeSettings" << endl;
1962 2118
1963 KConfig *config = KOGlobals::config(); 2119 KConfig *config = KOGlobals::config();
1964 2120
1965 mViewManager->writeSettings( config ); 2121 mViewManager->writeSettings( config );
1966 mTodoList->saveLayout(config,QString("Todo Layout")); 2122 mTodoList->saveLayout(config,QString("Todo Layout"));
1967 mDialogManager->writeSettings( config ); 2123 mDialogManager->writeSettings( config );
1968 //KOPrefs::instance()->usrWriteConfig(); 2124 //KOPrefs::instance()->usrWriteConfig();
1969 KOPrefs::instance()->writeConfig(); 2125 KOPrefs::instance()->writeConfig();
1970 2126
1971 writeFilterSettings(config); 2127 writeFilterSettings(config);
1972 2128 config->setGroup( "AppRun" );
2129 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2130 config->writeEntry( "LatestProgramStop", dt.secsTo( QDateTime::currentDateTime() ) );
1973 config->setGroup( "Views" ); 2131 config->setGroup( "Views" );
1974 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2132 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1975 2133
1976 QValueList<int> listINT = mLeftFrame->sizes(); 2134 QValueList<int> listINT = mLeftFrame->sizes();
1977 config->writeEntry("Left Splitter Frame",listINT); 2135 config->writeEntry("Left Splitter Frame",listINT);
1978 QValueList<int> listINT2 = mMainFrame->sizes(); 2136 QValueList<int> listINT2 = mMainFrame->sizes();
1979 config->writeEntry("Main Splitter Frame",listINT2); 2137 config->writeEntry("Main Splitter Frame",listINT2);
1980#ifdef DESKTOP_VERSION 2138#ifdef DESKTOP_VERSION
1981 config->setGroup("WidgetLayout"); 2139 config->setGroup("WidgetLayout");
1982 QStringList list ;//= config->readListEntry("MainLayout"); 2140 QStringList list ;//= config->readListEntry("MainLayout");
1983 int x,y,w,h; 2141 int x,y,w,h;
1984 QWidget* wid; 2142 QWidget* wid;
@@ -3912,25 +4070,30 @@ void CalendarView::editIncidence()
3912 v.act( incidence, this ); 4070 v.act( incidence, this );
3913 } 4071 }
3914} 4072}
3915 4073
3916void CalendarView::deleteIncidence() 4074void CalendarView::deleteIncidence()
3917{ 4075{
3918 Incidence *incidence = currentSelection(); 4076 Incidence *incidence = currentSelection();
3919 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4077 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3920 if ( incidence ) { 4078 if ( incidence ) {
3921 deleteIncidence(incidence); 4079 deleteIncidence(incidence);
3922 } 4080 }
3923} 4081}
3924 4082void CalendarView::showIncidence(QString uid)
4083{
4084 Incidence *inc = mCalendar->incidence( uid );
4085 if ( inc )
4086 showIncidence( inc );
4087}
3925void CalendarView::showIncidence(Incidence *incidence) 4088void CalendarView::showIncidence(Incidence *incidence)
3926{ 4089{
3927 mViewerCallerIsSearchDialog = false; 4090 mViewerCallerIsSearchDialog = false;
3928 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); 4091 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
3929 if ( sender() && mDialogManager->getSearchDialog() ) { 4092 if ( sender() && mDialogManager->getSearchDialog() ) {
3930 if ( sender () == mDialogManager->getSearchDialog()->listview() ) { 4093 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
3931 mViewerCallerIsSearchDialog = true; 4094 mViewerCallerIsSearchDialog = true;
3932 } 4095 }
3933 } 4096 }
3934 if ( incidence ) { 4097 if ( incidence ) {
3935 ShowIncidenceVisitor v; 4098 ShowIncidenceVisitor v;
3936 v.act( incidence, this ); 4099 v.act( incidence, this );
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 05a34b4..1eca905 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -71,24 +71,42 @@ namespace KCal { class FileStorage; }
71 71
72using namespace KCal; 72using namespace KCal;
73 73
74/** 74/**
75 This is the main calendar widget. It provides the different vies on t he 75 This is the main calendar widget. It provides the different vies on t he
76 calendar data as well as the date navigator. It also handles synchronisation 76 calendar data as well as the date navigator. It also handles synchronisation
77 of the different views and controls the different dialogs like preferences, 77 of the different views and controls the different dialogs like preferences,
78 event editor, search dialog etc. 78 event editor, search dialog etc.
79 79
80 @short main calendar view widget 80 @short main calendar view widget
81 @author Cornelius Schumacher 81 @author Cornelius Schumacher
82*/ 82*/
83
84#include <qtextbrowser.h>
85#include <qtextcodec.h>
86
87class MissedAlarmTextBrowser : public QTextBrowser {
88 Q_OBJECT
89 public:
90 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start);
91 void setSource(const QString & n);
92
93 private:
94 Incidence * getNextInc(QDateTime start );
95 QPtrList<Incidence> mAlarms;
96 signals:
97 void showIncidence( QString uid);
98};
99
100
83class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 101class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
84{ 102{
85 Q_OBJECT 103 Q_OBJECT
86 public: 104 public:
87 /** 105 /**
88 Constructs a new calendar view widget. 106 Constructs a new calendar view widget.
89 107
90 @param calendar calendar document 108 @param calendar calendar document
91 @param parent parent window 109 @param parent parent window
92 @param name Qt internal widget object name 110 @param name Qt internal widget object name
93 */ 111 */
94 CalendarView( CalendarResources *calendar, QWidget *parent = 0, 112 CalendarView( CalendarResources *calendar, QWidget *parent = 0,
@@ -167,24 +185,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
167 185
168 /** Emitted, when the number of outgoing messages has changed. */ 186 /** Emitted, when the number of outgoing messages has changed. */
169 void numOutgoingChanged(int); 187 void numOutgoingChanged(int);
170 188
171 /** Send status message, which can e.g. be displayed in the status bar. */ 189 /** Send status message, which can e.g. be displayed in the status bar. */
172 void statusMessage(const QString &); 190 void statusMessage(const QString &);
173 191
174 void calendarViewExpanded( bool ); 192 void calendarViewExpanded( bool );
175 void updateSearchDialog(); 193 void updateSearchDialog();
176 194
177 195
178 public slots: 196 public slots:
197 void checkAlarms();
179 void slotprintSelInc(); 198 void slotprintSelInc();
180 void showNextAlarms(); 199 void showNextAlarms();
181 void showOpenError(); 200 void showOpenError();
182 void watchSavedFile(); 201 void watchSavedFile();
183 void recheckTimerAlarm(); 202 void recheckTimerAlarm();
184 void checkNextTimerAlarm(); 203 void checkNextTimerAlarm();
185 void addAlarm(const QDateTime &qdt, const QString &noti ); 204 void addAlarm(const QDateTime &qdt, const QString &noti );
186 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 205 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
187 void removeAlarm(const QDateTime &qdt, const QString &noti ); 206 void removeAlarm(const QDateTime &qdt, const QString &noti );
188 207
189 /** options dialog made a changed to the configuration. we catch this 208 /** options dialog made a changed to the configuration. we catch this
190 * and notify all widgets which need to update their configuration. */ 209 * and notify all widgets which need to update their configuration. */
@@ -231,24 +250,25 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
231 * make the event take all day. */ 250 * make the event take all day. */
232 void newEvent(QDateTime, QDateTime, bool allDay ); 251 void newEvent(QDateTime, QDateTime, bool allDay );
233 void newEvent(QDateTime, QDateTime); 252 void newEvent(QDateTime, QDateTime);
234 void newEvent(QDateTime fh); 253 void newEvent(QDateTime fh);
235 void newEvent(QDate dt); 254 void newEvent(QDate dt);
236 /** create new event without having a date hint. Takes current date as 255 /** create new event without having a date hint. Takes current date as
237 default hint. */ 256 default hint. */
238 void newEvent(); 257 void newEvent();
239 void newFloatingEvent(); 258 void newFloatingEvent();
240 259
241 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ 260 /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/
242 void showIncidence(Incidence *); 261 void showIncidence(Incidence *);
262 void showIncidence(QString uid);
243 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ 263 /** Create an editor for the supplied incidence. It calls the correct editXXX method*/
244 void editIncidence(Incidence *); 264 void editIncidence(Incidence *);
245 /** Delete the supplied incidence. It calls the correct deleteXXX method*/ 265 /** Delete the supplied incidence. It calls the correct deleteXXX method*/
246 void deleteIncidence(Incidence *); 266 void deleteIncidence(Incidence *);
247 void cloneIncidence(Incidence *); 267 void cloneIncidence(Incidence *);
248 void cancelIncidence(Incidence *); 268 void cancelIncidence(Incidence *);
249 /** Create an editor for the supplied event. */ 269 /** Create an editor for the supplied event. */
250 void editEvent(Event *); 270 void editEvent(Event *);
251 /** Delete the supplied event. */ 271 /** Delete the supplied event. */
252 void deleteEvent(Event *); 272 void deleteEvent(Event *);
253 /** Delete the event with the given unique ID. Returns false, if event wasn't 273 /** Delete the event with the given unique ID. Returns false, if event wasn't
254 found. */ 274 found. */
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 8fe9999..5aaf360 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -468,26 +468,28 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
468 468
469 mItemPopupMenu = new QPopupMenu(this); 469 mItemPopupMenu = new QPopupMenu(this);
470 mItemPopupMenu->insertItem(i18n("Show..."), this, 470 mItemPopupMenu->insertItem(i18n("Show..."), this,
471 SLOT (showTodo())); 471 SLOT (showTodo()));
472 mItemPopupMenu->insertItem(i18n("Edit..."), this, 472 mItemPopupMenu->insertItem(i18n("Edit..."), this,
473 SLOT (editTodo())); 473 SLOT (editTodo()));
474 mItemPopupMenu->insertItem( i18n("Delete"), this, 474 mItemPopupMenu->insertItem( i18n("Delete"), this,
475 SLOT (deleteTodo())); 475 SLOT (deleteTodo()));
476 mItemPopupMenu->insertItem( i18n("Clone..."), this, 476 mItemPopupMenu->insertItem( i18n("Clone..."), this,
477 SLOT (cloneTodo())); 477 SLOT (cloneTodo()));
478 mItemPopupMenu->insertItem( i18n("Move..."), this, 478 mItemPopupMenu->insertItem( i18n("Move..."), this,
479 SLOT (moveTodo())); 479 SLOT (moveTodo()));
480#ifndef DESKTOP_VERSION
480 mItemPopupMenu->insertItem( i18n("Beam..."), this, 481 mItemPopupMenu->insertItem( i18n("Beam..."), this,
481 SLOT (beamTodo())); 482 SLOT (beamTodo()));
483#endif
482 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 484 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
483 SLOT (cancelTodo())); 485 SLOT (cancelTodo()));
484 mItemPopupMenu->insertSeparator(); 486 mItemPopupMenu->insertSeparator();
485 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 487 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
486 SLOT (toggleRunningItem())); 488 SLOT (toggleRunningItem()));
487 mItemPopupMenu->insertSeparator(); 489 mItemPopupMenu->insertSeparator();
488 /* 490 /*
489 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 491 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
490 SLOT (newTodo())); 492 SLOT (newTodo()));
491 */ 493 */
492 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 494 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
493 SLOT (newSubTodo())); 495 SLOT (newSubTodo()));
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 94d7293..1320231 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -363,24 +363,26 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
363#ifndef DESKTOP_VERSION 363#ifndef DESKTOP_VERSION
364 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 364 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
365#endif 365#endif
366#ifndef DESKTOP_VERSION 366#ifndef DESKTOP_VERSION
367 infrared = 0; 367 infrared = 0;
368#endif 368#endif
369 updateFilterToolbar(); 369 updateFilterToolbar();
370 updateWeek( mView->startDate() ); 370 updateWeek( mView->startDate() );
371 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 371 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
372 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 372 SLOT( updateWeekNum( const KCal::DateList & ) ) );
373 mBRdisabled = false; 373 mBRdisabled = false;
374 //toggleBeamReceive(); 374 //toggleBeamReceive();
375
376 QTimer::singleShot( 1000, mView, SLOT ( checkAlarms() ));
375} 377}
376MainWindow::~MainWindow() 378MainWindow::~MainWindow()
377{ 379{
378 //qDebug("MainWindow::~MainWindow() "); 380 //qDebug("MainWindow::~MainWindow() ");
379 //save toolbar location 381 //save toolbar location
380 delete mCalendar; 382 delete mCalendar;
381 delete mSyncManager; 383 delete mSyncManager;
382#ifndef DESKTOP_VERSION 384#ifndef DESKTOP_VERSION
383 if ( infrared ) 385 if ( infrared )
384 delete infrared; 386 delete infrared;
385#endif 387#endif
386 388
@@ -788,24 +790,26 @@ void MainWindow::initActions()
788 action->addTo( viewMenu ); 790 action->addTo( viewMenu );
789 connect( action, SIGNAL( activated() ), 791 connect( action, SIGNAL( activated() ),
790 mView, SLOT( toggleAllDaySize() ) ); 792 mView, SLOT( toggleAllDaySize() ) );
791 mToggleAllday = action; 793 mToggleAllday = action;
792 794
793 795
794 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 796 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
795 mToggleNav, SLOT( setEnabled ( bool ) ) ); 797 mToggleNav, SLOT( setEnabled ( bool ) ) );
796 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 798 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
797 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 799 mToggleFilter, SLOT( setEnabled ( bool ) ) );
798 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 800 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
799 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 801 mToggleAllday, SLOT( setEnabled ( bool ) ) );
802 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
803 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
800 804
801 viewMenu->insertSeparator(); 805 viewMenu->insertSeparator();
802 icon = loadPixmap( pathString + "picker" ); 806 icon = loadPixmap( pathString + "picker" );
803 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 807 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
804 action->addTo( viewMenu ); 808 action->addTo( viewMenu );
805 connect( action, SIGNAL( activated() ), 809 connect( action, SIGNAL( activated() ),
806 mView, SLOT( showDatePicker() ) ); 810 mView, SLOT( showDatePicker() ) );
807 action->addTo( iconToolBar ); 811 action->addTo( iconToolBar );
808 viewMenu->insertSeparator(); 812 viewMenu->insertSeparator();
809 813
810 if ( p-> mShowIconToggleFull ) 814 if ( p-> mShowIconToggleFull )
811 FSaction->addTo( iconToolBar ); 815 FSaction->addTo( iconToolBar );