summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (show 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
@@ -93,96 +93,214 @@
93#include "calprinter.h" 93#include "calprinter.h"
94#endif 94#endif
95#ifndef KORG_NOPLUGINS 95#ifndef KORG_NOPLUGINS
96#include "kocore.h" 96#include "kocore.h"
97#endif 97#endif
98#include "koeventeditor.h" 98#include "koeventeditor.h"
99#include "kotodoeditor.h" 99#include "kotodoeditor.h"
100#include "koprefs.h" 100#include "koprefs.h"
101#include "koeventviewerdialog.h" 101#include "koeventviewerdialog.h"
102#include "publishdialog.h" 102#include "publishdialog.h"
103#include "kofilterview.h" 103#include "kofilterview.h"
104#include "koglobals.h" 104#include "koglobals.h"
105#include "koviewmanager.h" 105#include "koviewmanager.h"
106#include "koagendaview.h" 106#include "koagendaview.h"
107#include "kodialogmanager.h" 107#include "kodialogmanager.h"
108#include "outgoingdialog.h" 108#include "outgoingdialog.h"
109#include "incomingdialog.h" 109#include "incomingdialog.h"
110#include "datenavigatorcontainer.h" 110#include "datenavigatorcontainer.h"
111#include "statusdialog.h" 111#include "statusdialog.h"
112#include "kdatenavigator.h" 112#include "kdatenavigator.h"
113#include "kotodoview.h" 113#include "kotodoview.h"
114#include "datenavigator.h" 114#include "datenavigator.h"
115#include "resourceview.h" 115#include "resourceview.h"
116#include "navigatorbar.h" 116#include "navigatorbar.h"
117#include "searchdialog.h" 117#include "searchdialog.h"
118#include "mainwindow.h" 118#include "mainwindow.h"
119 119
120#include "calendarview.h" 120#include "calendarview.h"
121#ifndef DESKTOP_VERSION 121#ifndef DESKTOP_VERSION
122#include <qtopia/alarmserver.h> 122#include <qtopia/alarmserver.h>
123#endif 123#endif
124#ifndef _WIN32_ 124#ifndef _WIN32_
125#include <stdlib.h> 125#include <stdlib.h>
126#include <stdio.h> 126#include <stdio.h>
127#include <unistd.h> 127#include <unistd.h>
128#else 128#else
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 );
153 lay->addWidget( format ); 271 lay->addWidget( format );
154 format->setExclusive ( true ) ; 272 format->setExclusive ( true ) ;
155 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 273 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
156 lay->addWidget( time ); time->setExclusive ( true ) ; 274 lay->addWidget( time ); time->setExclusive ( true ) ;
157 vcal = new QRadioButton(" vCalendar ", format ); 275 vcal = new QRadioButton(" vCalendar ", format );
158 ical = new QRadioButton(" iCalendar ", format ); 276 ical = new QRadioButton(" iCalendar ", format );
159 vcal->setChecked( true ); 277 vcal->setChecked( true );
160 tz = new QRadioButton(i18n(" With timezone "), time ); 278 tz = new QRadioButton(i18n(" With timezone "), time );
161 local = new QRadioButton(i18n(" Local time "), time ); 279 local = new QRadioButton(i18n(" Local time "), time );
162 tz->setChecked( true ); 280 tz->setChecked( true );
163 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 281 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
164 lay->addWidget( ok ); 282 lay->addWidget( ok );
165 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 283 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
166 lay->addWidget( cancel ); 284 lay->addWidget( cancel );
167 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 285 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
168 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 286 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
169 resize( 200, 200 ); 287 resize( 200, 200 );
170 } 288 }
171 289
172 bool beamVcal() { return vcal->isChecked(); } 290 bool beamVcal() { return vcal->isChecked(); }
173 bool beamLocal() { return local->isChecked(); } 291 bool beamLocal() { return local->isChecked(); }
174private: 292private:
175 QRadioButton* vcal, *ical, *local, *tz; 293 QRadioButton* vcal, *ical, *local, *tz;
176}; 294};
177class KOCatPrefs : public QDialog 295class KOCatPrefs : public QDialog
178{ 296{
179 public: 297 public:
180 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 298 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
181 QDialog( parent, name, true ) 299 QDialog( parent, name, true )
182 { 300 {
183 setCaption( i18n("Manage new Categories") ); 301 setCaption( i18n("Manage new Categories") );
184 QVBoxLayout* lay = new QVBoxLayout( this ); 302 QVBoxLayout* lay = new QVBoxLayout( this );
185 lay->setSpacing( 3 ); 303 lay->setSpacing( 3 );
186 lay->setMargin( 3 ); 304 lay->setMargin( 3 );
187 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 305 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
188 lay->addWidget( lab ); 306 lay->addWidget( lab );
@@ -461,97 +579,135 @@ void CalendarView::init()
461 mDateFrame = new QVBox(0,0,WType_Popup); 579 mDateFrame = new QVBox(0,0,WType_Popup);
462 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 580 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
463 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 581 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
464 mDateFrame->setLineWidth(3); 582 mDateFrame->setLineWidth(3);
465 mDateFrame->hide(); 583 mDateFrame->hide();
466 mDateFrame->setCaption( i18n( "Pick a date to display")); 584 mDateFrame->setCaption( i18n( "Pick a date to display"));
467 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 585 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
468 586
469 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 587 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
470 588
471 mEventEditor = mDialogManager->getEventEditor(); 589 mEventEditor = mDialogManager->getEventEditor();
472 mTodoEditor = mDialogManager->getTodoEditor(); 590 mTodoEditor = mDialogManager->getTodoEditor();
473 591
474 mFlagEditDescription = false; 592 mFlagEditDescription = false;
475 593
476 mSuspendTimer = new QTimer( this ); 594 mSuspendTimer = new QTimer( this );
477 mAlarmTimer = new QTimer( this ); 595 mAlarmTimer = new QTimer( this );
478 mRecheckAlarmTimer = new QTimer( this ); 596 mRecheckAlarmTimer = new QTimer( this );
479 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 597 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
480 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 598 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
481 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 599 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
482 mAlarmDialog = new AlarmDialog( this ); 600 mAlarmDialog = new AlarmDialog( this );
483 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 601 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
484 mAlarmDialog->setServerNotification( false ); 602 mAlarmDialog->setServerNotification( false );
485 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 603 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
486 604
487 605
488#ifndef DESKTOP_VERSION 606#ifndef DESKTOP_VERSION
489//US listen for arriving address resultsets 607//US listen for arriving address resultsets
490 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 608 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
491 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 609 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
492#endif 610#endif
493 mDateNavigator->setCalendar( mCalendar ); 611 mDateNavigator->setCalendar( mCalendar );
494} 612}
495 613
496 614
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 );
522} 678}
523 679
524void CalendarView::suspendAlarm() 680void CalendarView::suspendAlarm()
525{ 681{
526 //qDebug(" CalendarView::suspendAlarm() "); 682 //qDebug(" CalendarView::suspendAlarm() ");
527 computeAlarm(mSuspendAlarmNotification ); 683 computeAlarm(mSuspendAlarmNotification );
528 684
529} 685}
530 686
531void CalendarView::startAlarm( QString mess , QString filename) 687void CalendarView::startAlarm( QString mess , QString filename)
532{ 688{
533 689
534 topLevelWidget()->showNormal(); 690 topLevelWidget()->showNormal();
535 topLevelWidget()->setActiveWindow(); 691 topLevelWidget()->setActiveWindow();
536 topLevelWidget()->raise(); 692 topLevelWidget()->raise();
537 693
538 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 694 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
539 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 695 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
540 696
541} 697}
542 698
543void CalendarView::checkNextTimerAlarm() 699void CalendarView::checkNextTimerAlarm()
544{ 700{
545 mCalendar->checkAlarmForIncidence( 0, true ); 701 mCalendar->checkAlarmForIncidence( 0, true );
546} 702}
547 703
548void CalendarView::computeAlarm( QString msg ) 704void CalendarView::computeAlarm( QString msg )
549{ 705{
550 706
551 QString mess = msg; 707 QString mess = msg;
552 QString mAlarmMessage = mess.mid( 9 ); 708 QString mAlarmMessage = mess.mid( 9 );
553 QString filename = MainWindow::resourcePath(); 709 QString filename = MainWindow::resourcePath();
554 filename += "koalarm.wav"; 710 filename += "koalarm.wav";
555 QString tempfilename; 711 QString tempfilename;
556 if ( mess.left( 13 ) == "suspend_alarm") { 712 if ( mess.left( 13 ) == "suspend_alarm") {
557 bool error = false; 713 bool error = false;
@@ -1924,97 +2080,99 @@ void CalendarView::readSettings()
1924 mLeftFrame->setSizes(sizes); 2080 mLeftFrame->setSizes(sizes);
1925 sizes = config->readIntListEntry("Main Splitter Frame"); 2081 sizes = config->readIntListEntry("Main Splitter Frame");
1926 resetval = 0; 2082 resetval = 0;
1927 maxVal = 0; 2083 maxVal = 0;
1928 if (sizes.count() != 2) { 2084 if (sizes.count() != 2) {
1929 if ( !KOPrefs::instance()->mVerticalScreen ) { 2085 if ( !KOPrefs::instance()->mVerticalScreen ) {
1930 resetval = mDateNavigator->sizeHint().width()+2; 2086 resetval = mDateNavigator->sizeHint().width()+2;
1931 } else { 2087 } else {
1932 resetval = mDateNavigator->sizeHint().height()+2; 2088 resetval = mDateNavigator->sizeHint().height()+2;
1933 } 2089 }
1934 } 2090 }
1935 if ( resetval ) { 2091 if ( resetval ) {
1936 sizes.clear(); 2092 sizes.clear();
1937 if ( !KOPrefs::instance()->mVerticalScreen ) { 2093 if ( !KOPrefs::instance()->mVerticalScreen ) {
1938 maxVal = QApplication::desktop()->width() -10; 2094 maxVal = QApplication::desktop()->width() -10;
1939 } else { 2095 } else {
1940 maxVal = QApplication::desktop()->height()-10; 2096 maxVal = QApplication::desktop()->height()-10;
1941 } 2097 }
1942 sizes << resetval; 2098 sizes << resetval;
1943 if ( maxVal < resetval + resetval) 2099 if ( maxVal < resetval + resetval)
1944 resetval = maxVal - resetval; 2100 resetval = maxVal - resetval;
1945 sizes << resetval; 2101 sizes << resetval;
1946 } 2102 }
1947 mMainFrame->setSizes(sizes); 2103 mMainFrame->setSizes(sizes);
1948 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2104 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
1949 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2105 else if ( dateCount == 7 ) mNavigator->selectWeek();
1950 else mNavigator->selectDates( dateCount ); 2106 else mNavigator->selectDates( dateCount );
1951 // mViewManager->readSettings( config ); 2107 // mViewManager->readSettings( config );
1952 updateConfig(); 2108 updateConfig();
1953 globalFlagBlockAgenda = 2; 2109 globalFlagBlockAgenda = 2;
1954 mViewManager->readSettings( config ); 2110 mViewManager->readSettings( config );
1955 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2111 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
1956} 2112}
1957 2113
1958 2114
1959void CalendarView::writeSettings() 2115void 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;
1985 wid = topLevelWidget(); 2143 wid = topLevelWidget();
1986 x = wid->geometry().x(); 2144 x = wid->geometry().x();
1987 y = wid->geometry().y(); 2145 y = wid->geometry().y();
1988 w = wid->width(); 2146 w = wid->width();
1989 h = wid->height(); 2147 h = wid->height();
1990 list.clear(); 2148 list.clear();
1991 list << QString::number( x ); 2149 list << QString::number( x );
1992 list << QString::number( y ); 2150 list << QString::number( y );
1993 list << QString::number( w ); 2151 list << QString::number( w );
1994 list << QString::number( h ); 2152 list << QString::number( h );
1995 config->writeEntry("MainLayout",list ); 2153 config->writeEntry("MainLayout",list );
1996 2154
1997 wid = mEventEditor; 2155 wid = mEventEditor;
1998 x = wid->geometry().x(); 2156 x = wid->geometry().x();
1999 y = wid->geometry().y(); 2157 y = wid->geometry().y();
2000 w = wid->width(); 2158 w = wid->width();
2001 h = wid->height(); 2159 h = wid->height();
2002 list.clear(); 2160 list.clear();
2003 list << QString::number( x ); 2161 list << QString::number( x );
2004 list << QString::number( y ); 2162 list << QString::number( y );
2005 list << QString::number( w ); 2163 list << QString::number( w );
2006 list << QString::number( h ); 2164 list << QString::number( h );
2007 config->writeEntry("EditEventLayout",list ); 2165 config->writeEntry("EditEventLayout",list );
2008 2166
2009 wid = mTodoEditor; 2167 wid = mTodoEditor;
2010 x = wid->geometry().x(); 2168 x = wid->geometry().x();
2011 y = wid->geometry().y(); 2169 y = wid->geometry().y();
2012 w = wid->width(); 2170 w = wid->width();
2013 h = wid->height(); 2171 h = wid->height();
2014 list.clear(); 2172 list.clear();
2015 list << QString::number( x ); 2173 list << QString::number( x );
2016 list << QString::number( y ); 2174 list << QString::number( y );
2017 list << QString::number( w ); 2175 list << QString::number( w );
2018 list << QString::number( h ); 2176 list << QString::number( h );
2019 config->writeEntry("EditTodoLayout",list ); 2177 config->writeEntry("EditTodoLayout",list );
2020 wid = getEventViewerDialog(); 2178 wid = getEventViewerDialog();
@@ -3876,97 +4034,102 @@ Todo *CalendarView::selectedTodo()
3876 incidence = mTodoList->selectedIncidences().first(); 4034 incidence = mTodoList->selectedIncidences().first();
3877 if ( incidence && incidence->type() == "Todo" ) { 4035 if ( incidence && incidence->type() == "Todo" ) {
3878 return static_cast<Todo *>( incidence ); 4036 return static_cast<Todo *>( incidence );
3879 } 4037 }
3880 4038
3881 return 0; 4039 return 0;
3882} 4040}
3883 4041
3884void CalendarView::dialogClosing(Incidence *in) 4042void CalendarView::dialogClosing(Incidence *in)
3885{ 4043{
3886 // mDialogList.remove(in); 4044 // mDialogList.remove(in);
3887} 4045}
3888 4046
3889void CalendarView::showIncidence() 4047void CalendarView::showIncidence()
3890{ 4048{
3891 mViewerCallerIsSearchDialog = false; 4049 mViewerCallerIsSearchDialog = false;
3892 Incidence *incidence = currentSelection(); 4050 Incidence *incidence = currentSelection();
3893 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4051 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3894 if ( incidence ) { 4052 if ( incidence ) {
3895 ShowIncidenceVisitor v; 4053 ShowIncidenceVisitor v;
3896 v.act( incidence, this ); 4054 v.act( incidence, this );
3897 } 4055 }
3898} 4056}
3899void CalendarView::editIncidenceDescription() 4057void CalendarView::editIncidenceDescription()
3900{ 4058{
3901 mFlagEditDescription = true; 4059 mFlagEditDescription = true;
3902 editIncidence(); 4060 editIncidence();
3903 mFlagEditDescription = false; 4061 mFlagEditDescription = false;
3904} 4062}
3905void CalendarView::editIncidence() 4063void CalendarView::editIncidence()
3906{ 4064{
3907 // qDebug("editIncidence() "); 4065 // qDebug("editIncidence() ");
3908 Incidence *incidence = currentSelection(); 4066 Incidence *incidence = currentSelection();
3909 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4067 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3910 if ( incidence ) { 4068 if ( incidence ) {
3911 EditIncidenceVisitor v; 4069 EditIncidenceVisitor v;
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 );
3937 } 4100 }
3938} 4101}
3939 4102
3940void CalendarView::editIncidence(Incidence *incidence) 4103void CalendarView::editIncidence(Incidence *incidence)
3941{ 4104{
3942 if ( incidence ) { 4105 if ( incidence ) {
3943 4106
3944 EditIncidenceVisitor v; 4107 EditIncidenceVisitor v;
3945 v.act( incidence, this ); 4108 v.act( incidence, this );
3946 4109
3947 } 4110 }
3948} 4111}
3949 4112
3950void CalendarView::deleteIncidence(Incidence *incidence) 4113void CalendarView::deleteIncidence(Incidence *incidence)
3951{ 4114{
3952 //qDebug(" CalendarView::deleteIncidence "); 4115 //qDebug(" CalendarView::deleteIncidence ");
3953 if ( incidence ) { 4116 if ( incidence ) {
3954 DeleteIncidenceVisitor v; 4117 DeleteIncidenceVisitor v;
3955 v.act( incidence, this ); 4118 v.act( incidence, this );
3956 } 4119 }
3957} 4120}
3958 4121
3959 4122
3960void CalendarView::lookForOutgoingMessages() 4123void CalendarView::lookForOutgoingMessages()
3961{ 4124{
3962 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 4125 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
3963 ogd->loadMessages(); 4126 ogd->loadMessages();
3964} 4127}
3965 4128
3966void CalendarView::lookForIncomingMessages() 4129void CalendarView::lookForIncomingMessages()
3967{ 4130{
3968 IncomingDialog *icd = mDialogManager->incomingDialog(); 4131 IncomingDialog *icd = mDialogManager->incomingDialog();
3969 icd->retrieve(); 4132 icd->retrieve();
3970} 4133}
3971 4134
3972bool CalendarView::removeCompletedSubTodos( Todo* t ) 4135bool CalendarView::removeCompletedSubTodos( Todo* t )
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 05a34b4..1eca905 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -35,256 +35,276 @@
35#else 35#else
36#define Ir char 36#define Ir char
37#endif 37#endif
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/scheduler.h> 39#include <libkcal/scheduler.h>
40#include <libkcal/calendarresources.h> 40#include <libkcal/calendarresources.h>
41#include <libkcal/resourcecalendar.h> 41#include <libkcal/resourcecalendar.h>
42#include <KDGanttMinimizeSplitter.h> 42#include <KDGanttMinimizeSplitter.h>
43 43
44#include <korganizer/calendarviewbase.h> 44#include <korganizer/calendarviewbase.h>
45 45
46#include <ksyncmanager.h> 46#include <ksyncmanager.h>
47 47
48class QWidgetStack; 48class QWidgetStack;
49class QSplitter; 49class QSplitter;
50 50
51class CalPrinter; 51class CalPrinter;
52class KOFilterView; 52class KOFilterView;
53class KOViewManager; 53class KOViewManager;
54class KODialogManager; 54class KODialogManager;
55class KOTodoView; 55class KOTodoView;
56class KDateNavigator; 56class KDateNavigator;
57class DateNavigatorContainer; 57class DateNavigatorContainer;
58class DateNavigator; 58class DateNavigator;
59class KOIncidenceEditor; 59class KOIncidenceEditor;
60class KDatePicker; 60class KDatePicker;
61class ResourceView; 61class ResourceView;
62class KOEventEditor; 62class KOEventEditor;
63class KOTodoEditor ; 63class KOTodoEditor ;
64class KOEventViewerDialog; 64class KOEventViewerDialog;
65class KOBeamPrefs; 65class KOBeamPrefs;
66class KSyncProfile; 66class KSyncProfile;
67class AlarmDialog; 67class AlarmDialog;
68class KCal::Attendee; 68class KCal::Attendee;
69 69
70namespace KCal { class FileStorage; } 70namespace 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,
95 const char *name = 0 ); 113 const char *name = 0 );
96 CalendarView( Calendar *calendar, QWidget *parent = 0, 114 CalendarView( Calendar *calendar, QWidget *parent = 0,
97 const char *name = 0 ); 115 const char *name = 0 );
98 virtual ~CalendarView(); 116 virtual ~CalendarView();
99 117
100 Calendar *calendar() { return mCalendar; } 118 Calendar *calendar() { return mCalendar; }
101 119
102 KOViewManager *viewManager(); 120 KOViewManager *viewManager();
103 KODialogManager *dialogManager(); 121 KODialogManager *dialogManager();
104 122
105 QDate startDate(); 123 QDate startDate();
106 QDate endDate(); 124 QDate endDate();
107 125
108 QWidgetStack *viewStack(); 126 QWidgetStack *viewStack();
109 QWidget *leftFrame(); 127 QWidget *leftFrame();
110 128
111 DateNavigator *dateNavigator(); 129 DateNavigator *dateNavigator();
112 KDateNavigator *dateNavigatorWidget(); 130 KDateNavigator *dateNavigatorWidget();
113 131
114 void addView(KOrg::BaseView *); 132 void addView(KOrg::BaseView *);
115 void showView(KOrg::BaseView *); 133 void showView(KOrg::BaseView *);
116 KOEventViewerDialog* getEventViewerDialog(); 134 KOEventViewerDialog* getEventViewerDialog();
117 Incidence *currentSelection(); 135 Incidence *currentSelection();
118 136
119 signals: 137 signals:
120 void save (); 138 void save ();
121 void saveStopTimer (); 139 void saveStopTimer ();
122 void tempDisableBR(bool); 140 void tempDisableBR(bool);
123 /** This todo has been modified */ 141 /** This todo has been modified */
124 void todoModified(Todo *, int); 142 void todoModified(Todo *, int);
125 143
126 /** when change is made to options dialog, the topwidget will catch this 144 /** when change is made to options dialog, the topwidget will catch this
127 * and emit this signal which notifies all widgets which have registered 145 * and emit this signal which notifies all widgets which have registered
128 * for notification to update their settings. */ 146 * for notification to update their settings. */
129 void configChanged(); 147 void configChanged();
130 /** emitted when the topwidget is closing down, so that any attached 148 /** emitted when the topwidget is closing down, so that any attached
131 child windows can also close. */ 149 child windows can also close. */
132 void closingDown(); 150 void closingDown();
133 /** emitted right before we die */ 151 /** emitted right before we die */
134 void closed(QWidget *); 152 void closed(QWidget *);
135 153
136 /** Emitted when state of modified flag changes */ 154 /** Emitted when state of modified flag changes */
137 void modifiedChanged(bool); 155 void modifiedChanged(bool);
138 void signalmodified(); 156 void signalmodified();
139 157
140 /** Emitted when state of read-only flag changes */ 158 /** Emitted when state of read-only flag changes */
141 void readOnlyChanged(bool); 159 void readOnlyChanged(bool);
142 160
143 /** Emitted when the unit of navigation changes */ 161 /** Emitted when the unit of navigation changes */
144 void changeNavStringPrev(const QString &); 162 void changeNavStringPrev(const QString &);
145 void changeNavStringNext(const QString &); 163 void changeNavStringNext(const QString &);
146 164
147 /** Emitted when state of events selection has changed and user is organizer*/ 165 /** Emitted when state of events selection has changed and user is organizer*/
148 void organizerEventsSelected(bool); 166 void organizerEventsSelected(bool);
149 /** Emitted when state of events selection has changed and user is attendee*/ 167 /** Emitted when state of events selection has changed and user is attendee*/
150 void groupEventsSelected(bool); 168 void groupEventsSelected(bool);
151 /** 169 /**
152 Emitted when an incidence gets selected. If the selection is cleared the 170 Emitted when an incidence gets selected. If the selection is cleared the
153 signal is emitted with 0 as argument. 171 signal is emitted with 0 as argument.
154 */ 172 */
155 void incidenceSelected( Incidence * ); 173 void incidenceSelected( Incidence * );
156 /** Emitted, when a todoitem is selected or deselected. */ 174 /** Emitted, when a todoitem is selected or deselected. */
157 void todoSelected( bool ); 175 void todoSelected( bool );
158 176
159 /** 177 /**
160 Emitted, when clipboard content changes. Parameter indicates if paste 178 Emitted, when clipboard content changes. Parameter indicates if paste
161 is possible or not. 179 is possible or not.
162 */ 180 */
163 void pasteEnabled(bool); 181 void pasteEnabled(bool);
164 182
165 /** Emitted, when the number of incoming messages has changed. */ 183 /** Emitted, when the number of incoming messages has changed. */
166 void numIncomingChanged(int); 184 void numIncomingChanged(int);
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. */
191 void updateConfig(); 210 void updateConfig();
192 211
193 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 212 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
194 const QStringList& anniversaryList, const QStringList& realNameList, 213 const QStringList& anniversaryList, const QStringList& realNameList,
195 const QStringList& emailList, const QStringList& assembledNameList, 214 const QStringList& emailList, const QStringList& assembledNameList,
196 const QStringList& uidList); 215 const QStringList& uidList);
197 216
198 /** 217 /**
199 Load calendar from file \a filename. If \a merge is true, load 218 Load calendar from file \a filename. If \a merge is true, load
200 calendar into existing one, if it is false, clear calendar, before 219 calendar into existing one, if it is false, clear calendar, before
201 loading. Return true, if calendar could be successfully loaded. 220 loading. Return true, if calendar could be successfully loaded.
202 */ 221 */
203 bool openCalendar(QString filename, bool merge=false); 222 bool openCalendar(QString filename, bool merge=false);
204 bool syncCalendar(QString filename,int mode = 0 ); 223 bool syncCalendar(QString filename,int mode = 0 );
205 224
206 /** 225 /**
207 Save calendar data to file. Return true if calendar could be 226 Save calendar data to file. Return true if calendar could be
208 successfully saved. 227 successfully saved.
209 */ 228 */
210 bool saveCalendar(QString filename); 229 bool saveCalendar(QString filename);
211 230
212 /** 231 /**
213 Close calendar. Clear calendar data and reset views to display an empty 232 Close calendar. Clear calendar data and reset views to display an empty
214 calendar. 233 calendar.
215 */ 234 */
216 void closeCalendar(); 235 void closeCalendar();
217 236
218 /** Archive old events of calendar */ 237 /** Archive old events of calendar */
219 void archiveCalendar(); 238 void archiveCalendar();
220 239
221 void showIncidence(); 240 void showIncidence();
222 void editIncidence(); 241 void editIncidence();
223 void editIncidenceDescription(); 242 void editIncidenceDescription();
224 void deleteIncidence(); 243 void deleteIncidence();
225 void cloneIncidence(); 244 void cloneIncidence();
226 void moveIncidence(); 245 void moveIncidence();
227 void beamIncidence(); 246 void beamIncidence();
228 void toggleCancelIncidence(); 247 void toggleCancelIncidence();
229 248
230 /** create an editeventwin with supplied date/time, and if bool is true, 249 /** create an editeventwin with supplied date/time, and if bool is true,
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. */
255 bool deleteEvent(const QString &uid); 275 bool deleteEvent(const QString &uid);
256 /** Create a read-only viewer dialog for the supplied event. */ 276 /** Create a read-only viewer dialog for the supplied event. */
257 void showEvent(Event *); 277 void showEvent(Event *);
258 278
259 void editJournal(Journal *); 279 void editJournal(Journal *);
260 void showJournal(Journal *); 280 void showJournal(Journal *);
261 void deleteJournal(Journal *); 281 void deleteJournal(Journal *);
262 /** Create an editor dialog for a todo */ 282 /** Create an editor dialog for a todo */
263 void editTodo(Todo *); 283 void editTodo(Todo *);
264 /** Create a read-only viewer dialog for the supplied todo */ 284 /** Create a read-only viewer dialog for the supplied todo */
265 void showTodo(Todo *); 285 void showTodo(Todo *);
266 /** create new todo */ 286 /** create new todo */
267 void newTodo(); 287 void newTodo();
268 void newTodoDateTime(QDateTime, bool allday); 288 void newTodoDateTime(QDateTime, bool allday);
269 /** create new todo with a parent todo */ 289 /** create new todo with a parent todo */
270 void newSubTodo(); 290 void newSubTodo();
271 /** create new todo with a parent todo */ 291 /** create new todo with a parent todo */
272 void newSubTodo(Todo *); 292 void newSubTodo(Todo *);
273 /** Delete todo */ 293 /** Delete todo */
274 void deleteTodo(Todo *); 294 void deleteTodo(Todo *);
275 295
276 296
277 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is 297 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is
278 * emitted as result. */ 298 * emitted as result. */
279 void checkClipboard(); 299 void checkClipboard();
280 300
281 /** using the KConfig associated with the kapp variable, read in the 301 /** using the KConfig associated with the kapp variable, read in the
282 * settings from the config file. 302 * settings from the config file.
283 */ 303 */
284 void readSettings(); 304 void readSettings();
285 305
286 /** write current state to config file. */ 306 /** write current state to config file. */
287 void writeSettings(); 307 void writeSettings();
288 308
289 /** read settings for calendar filters */ 309 /** read settings for calendar filters */
290 void readFilterSettings(KConfig *config); 310 void readFilterSettings(KConfig *config);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 8fe9999..5aaf360 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -432,98 +432,100 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
432 mTodoListView->addColumn(i18n("Sort Id")); 432 mTodoListView->addColumn(i18n("Sort Id"));
433 mTodoListView->setColumnAlignment(4,AlignHCenter); 433 mTodoListView->setColumnAlignment(4,AlignHCenter);
434#endif 434#endif
435 435
436 mTodoListView->setMinimumHeight( 60 ); 436 mTodoListView->setMinimumHeight( 60 );
437 mTodoListView->setItemsRenameable( true ); 437 mTodoListView->setItemsRenameable( true );
438 mTodoListView->setRenameable( 0 ); 438 mTodoListView->setRenameable( 0 );
439 mTodoListView->setColumnWidth( 0, 120 ); 439 mTodoListView->setColumnWidth( 0, 120 );
440 mTodoListView->setColumnWidthMode(0, QListView::Manual); 440 mTodoListView->setColumnWidthMode(0, QListView::Manual);
441 mTodoListView->setColumnWidthMode(1, QListView::Manual); 441 mTodoListView->setColumnWidthMode(1, QListView::Manual);
442 mTodoListView->setColumnWidthMode(2, QListView::Manual); 442 mTodoListView->setColumnWidthMode(2, QListView::Manual);
443 mTodoListView->setColumnWidthMode(3, QListView::Manual); 443 mTodoListView->setColumnWidthMode(3, QListView::Manual);
444 mTodoListView->setColumnWidthMode(4, QListView::Manual); 444 mTodoListView->setColumnWidthMode(4, QListView::Manual);
445 mTodoListView->setColumnWidthMode(5, QListView::Manual); 445 mTodoListView->setColumnWidthMode(5, QListView::Manual);
446 mTodoListView->setColumnWidthMode(6, QListView::Manual); 446 mTodoListView->setColumnWidthMode(6, QListView::Manual);
447 mTodoListView->setColumnWidthMode(7, QListView::Manual); 447 mTodoListView->setColumnWidthMode(7, QListView::Manual);
448 mTodoListView->setColumnWidthMode(8, QListView::Manual); 448 mTodoListView->setColumnWidthMode(8, QListView::Manual);
449 449
450 450
451 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 451 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
452 452
453 mPriorityPopupMenu = new QPopupMenu(this); 453 mPriorityPopupMenu = new QPopupMenu(this);
454 for (int i = 1; i <= 5; i++) { 454 for (int i = 1; i <= 5; i++) {
455 QString label = QString ("%1").arg (i); 455 QString label = QString ("%1").arg (i);
456 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 456 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
457 } 457 }
458 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 458 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
459 459
460 mPercentageCompletedPopupMenu = new QPopupMenu(this); 460 mPercentageCompletedPopupMenu = new QPopupMenu(this);
461 for (int i = 0; i <= 100; i+=20) { 461 for (int i = 0; i <= 100; i+=20) {
462 QString label = QString ("%1 %").arg (i); 462 QString label = QString ("%1 %").arg (i);
463 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 463 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
464 } 464 }
465 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 465 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
466 466
467 467
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()));
494 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 496 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
495 SLOT (unparentTodo()),0,21); 497 SLOT (unparentTodo()),0,21);
496 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 498 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
497 SLOT (reparentTodo()),0,22); 499 SLOT (reparentTodo()),0,22);
498 mItemPopupMenu->insertSeparator(); 500 mItemPopupMenu->insertSeparator();
499#if 0 501#if 0
500 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), 502 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"),
501 this, SLOT( purgeCompleted() ) ); 503 this, SLOT( purgeCompleted() ) );
502 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 504 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
503 this, SLOT( toggleCompleted() ),0, 33 ); 505 this, SLOT( toggleCompleted() ),0, 33 );
504 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 506 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
505 this, SLOT( toggleQuickTodo() ),0, 34 ); 507 this, SLOT( toggleQuickTodo() ),0, 34 );
506 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 508 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
507 this, SLOT( toggleRunning() ),0, 35 ); 509 this, SLOT( toggleRunning() ),0, 35 );
508 510
509#endif 511#endif
510 mPopupMenu = new QPopupMenu(this); 512 mPopupMenu = new QPopupMenu(this);
511 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 513 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
512 SLOT (newTodo()),0,1); 514 SLOT (newTodo()),0,1);
513 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), 515 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"),
514 this, SLOT(purgeCompleted()),0,2); 516 this, SLOT(purgeCompleted()),0,2);
515 mPopupMenu->insertItem(i18n("Show Completed"), 517 mPopupMenu->insertItem(i18n("Show Completed"),
516 this, SLOT( toggleCompleted() ),0,3 ); 518 this, SLOT( toggleCompleted() ),0,3 );
517 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 519 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
518 this, SLOT( toggleRunning() ),0,5 ); 520 this, SLOT( toggleRunning() ),0,5 );
519 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 521 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
520 this, SLOT( setAllOpen() ),0,6 ); 522 this, SLOT( setAllOpen() ),0,6 );
521 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 523 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
522 this, SLOT( setAllClose() ),0,7 ); 524 this, SLOT( setAllClose() ),0,7 );
523 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 525 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
524 this, SLOT( setAllFlat() ),0,8 ); 526 this, SLOT( setAllFlat() ),0,8 );
525 mPopupMenu->insertSeparator(); 527 mPopupMenu->insertSeparator();
526 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 528 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
527 this, SLOT( toggleQuickTodo() ),0,4 ); 529 this, SLOT( toggleQuickTodo() ),0,4 );
528 mDocPrefs = new DocPrefs( name ); 530 mDocPrefs = new DocPrefs( name );
529 531
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 94d7293..1320231 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -327,96 +327,98 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
327 SLOT( disableBR(bool) ) ); 327 SLOT( disableBR(bool) ) );
328 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 328 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
329 mView->setModified( false ); 329 mView->setModified( false );
330 mBlockAtStartup = false; 330 mBlockAtStartup = false;
331 mView->setModified( false ); 331 mView->setModified( false );
332 setCentralWidget( mView ); 332 setCentralWidget( mView );
333 globalFlagBlockStartup = 0; 333 globalFlagBlockStartup = 0;
334 mView->show(); 334 mView->show();
335 delete splash; 335 delete splash;
336 if ( newFile ) 336 if ( newFile )
337 mView->updateConfig(); 337 mView->updateConfig();
338 // qApp->processEvents(); 338 // qApp->processEvents();
339 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 339 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
340 //fillSyncMenu(); 340 //fillSyncMenu();
341 341
342 342
343 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 343 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
344 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 344 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
345 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 345 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
346 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 346 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
347 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 347 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
348 mSyncManager->setDefaultFileName( sentSyncFile()); 348 mSyncManager->setDefaultFileName( sentSyncFile());
349 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 349 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
350 mSyncManager->fillSyncMenu(); 350 mSyncManager->fillSyncMenu();
351 351
352 352
353 353
354 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 354 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
355 if ( showWarning ) { 355 if ( showWarning ) {
356 KMessageBox::information( this, 356 KMessageBox::information( this,
357 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 357 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
358 qApp->processEvents(); 358 qApp->processEvents();
359 mView->dialogManager()->showSyncOptions(); 359 mView->dialogManager()->showSyncOptions();
360 } 360 }
361 361
362 //US listen for result adressed from Ka/Pi 362 //US listen for result adressed from Ka/Pi
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
387 389
388} 390}
389 391
390void MainWindow::disableBR(bool b) 392void MainWindow::disableBR(bool b)
391{ 393{
392#ifndef DESKTOP_VERSION 394#ifndef DESKTOP_VERSION
393 if ( b ) { 395 if ( b ) {
394 if ( infrared ) { 396 if ( infrared ) {
395 toggleBeamReceive(); 397 toggleBeamReceive();
396 mBRdisabled = true; 398 mBRdisabled = true;
397 } 399 }
398 mBRdisabled = true; 400 mBRdisabled = true;
399 } else { 401 } else {
400 if ( mBRdisabled ) { 402 if ( mBRdisabled ) {
401 mBRdisabled = false; 403 mBRdisabled = false;
402 //makes no sense,because other cal ap is probably running 404 //makes no sense,because other cal ap is probably running
403 // toggleBeamReceive(); 405 // toggleBeamReceive();
404 } 406 }
405 } 407 }
406#endif 408#endif
407 409
408} 410}
409bool MainWindow::beamReceiveEnabled() 411bool MainWindow::beamReceiveEnabled()
410{ 412{
411#ifndef DESKTOP_VERSION 413#ifndef DESKTOP_VERSION
412 return ( infrared != 0 ); 414 return ( infrared != 0 );
413#endif 415#endif
414 return false; 416 return false;
415} 417}
416 418
417void MainWindow::toggleBeamReceive() 419void MainWindow::toggleBeamReceive()
418{ 420{
419 if ( mBRdisabled ) 421 if ( mBRdisabled )
420 return; 422 return;
421#ifndef DESKTOP_VERSION 423#ifndef DESKTOP_VERSION
422 if ( infrared ) { 424 if ( infrared ) {
@@ -752,96 +754,98 @@ void MainWindow::initActions()
752 754
753 icon = loadPixmap( pathString + "today" ); 755 icon = loadPixmap( pathString + "today" );
754 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 756 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
755 today_action->addTo( viewMenu ); 757 today_action->addTo( viewMenu );
756 connect( today_action, SIGNAL( activated() ), 758 connect( today_action, SIGNAL( activated() ),
757 mView, SLOT( goToday() ) ); 759 mView, SLOT( goToday() ) );
758 viewMenu->insertSeparator(); 760 viewMenu->insertSeparator();
759 761
760 // *********************** 762 // ***********************
761 if ( KOPrefs::instance()->mVerticalScreen ) { 763 if ( KOPrefs::instance()->mVerticalScreen ) {
762 icon = SmallIcon( "1updownarrow" ); 764 icon = SmallIcon( "1updownarrow" );
763 } else { 765 } else {
764 icon = SmallIcon("1leftrightarrow" ); 766 icon = SmallIcon("1leftrightarrow" );
765 } 767 }
766 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 768 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
767 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 769 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
768 FSaction->addTo( viewMenu ); 770 FSaction->addTo( viewMenu );
769 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 771 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
770 772
771 icon = loadPixmap( pathString + "navi" ); 773 icon = loadPixmap( pathString + "navi" );
772 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 774 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
773 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 775 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
774 action->addTo( viewMenu ); 776 action->addTo( viewMenu );
775 connect( action, SIGNAL( activated() ), 777 connect( action, SIGNAL( activated() ),
776 mView, SLOT( toggleDateNavigatorWidget() ) ); 778 mView, SLOT( toggleDateNavigatorWidget() ) );
777 mToggleNav = action ; 779 mToggleNav = action ;
778 icon = loadPixmap( pathString + "filter" ); 780 icon = loadPixmap( pathString + "filter" );
779 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 781 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
780 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 782 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
781 action->addTo( viewMenu ); 783 action->addTo( viewMenu );
782 connect( action, SIGNAL( activated() ), 784 connect( action, SIGNAL( activated() ),
783 mView, SLOT( toggleFilter() ) ); 785 mView, SLOT( toggleFilter() ) );
784 mToggleFilter = action; 786 mToggleFilter = action;
785 icon = loadPixmap( pathString + "allday" ); 787 icon = loadPixmap( pathString + "allday" );
786 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 788 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
787 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 789 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
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 );
812 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 816 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
813 817
814 //******************** 818 //********************
815 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 819 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
816 820
817 821
818 icon = loadPixmap( pathString + "whatsnext" ); 822 icon = loadPixmap( pathString + "whatsnext" );
819 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 823 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
820 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 824 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
821 whatsnext_action->addTo( viewMenu ); 825 whatsnext_action->addTo( viewMenu );
822 connect( whatsnext_action, SIGNAL( activated() ), 826 connect( whatsnext_action, SIGNAL( activated() ),
823 mView->viewManager(), SLOT( showWhatsNextView() ) ); 827 mView->viewManager(), SLOT( showWhatsNextView() ) );
824 828
825 icon = loadPixmap( pathString + "xdays" ); 829 icon = loadPixmap( pathString + "xdays" );
826 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 830 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
827 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 831 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
828 xdays_action->addTo( viewMenu ); 832 xdays_action->addTo( viewMenu );
829 connect( xdays_action, SIGNAL( activated() ), 833 connect( xdays_action, SIGNAL( activated() ),
830 mView->viewManager(), SLOT( showNextXView() ) ); 834 mView->viewManager(), SLOT( showNextXView() ) );
831 835
832 836
833 icon = loadPixmap( pathString + "journal" ); 837 icon = loadPixmap( pathString + "journal" );
834 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 838 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
835 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 839 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
836 viewjournal_action->addTo( viewMenu ); 840 viewjournal_action->addTo( viewMenu );
837 connect( viewjournal_action, SIGNAL( activated() ), 841 connect( viewjournal_action, SIGNAL( activated() ),
838 mView->viewManager(), SLOT( showJournalView() ) ); 842 mView->viewManager(), SLOT( showJournalView() ) );
839 843
840 844
841 icon = loadPixmap( pathString + "day" ); 845 icon = loadPixmap( pathString + "day" );
842 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 846 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
843 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 847 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
844 day1_action->addTo( viewMenu ); 848 day1_action->addTo( viewMenu );
845 // action->addTo( toolBar ); 849 // action->addTo( toolBar );
846 connect( day1_action, SIGNAL( activated() ), 850 connect( day1_action, SIGNAL( activated() ),
847 mView->viewManager(), SLOT( showDayView() ) ); 851 mView->viewManager(), SLOT( showDayView() ) );