summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp4
-rw-r--r--korganizer/koagendaview.cpp2
-rw-r--r--korganizer/koviewmanager.cpp65
-rw-r--r--korganizer/koviewmanager.h1
-rw-r--r--korganizer/mainwindow.cpp5
5 files changed, 75 insertions, 2 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index ec7f730..e8ec033 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -613,69 +613,71 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
613 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.latin1()); 613 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.latin1());
614 mTimerTime = 1; 614 mTimerTime = 1;
615} 615}
616 616
617void SimpleAlarmDaemonImpl::writeFile() 617void SimpleAlarmDaemonImpl::writeFile()
618{ 618{
619 QCopEnvelope e("QPE/Application/kopi", "-writeFile"); 619 QCopEnvelope e("QPE/Application/kopi", "-writeFile");
620} 620}
621void SimpleAlarmDaemonImpl::showWN() 621void SimpleAlarmDaemonImpl::showWN()
622{ 622{
623 QCopEnvelope e("QPE/Application/kopi", "-showWN"); 623 QCopEnvelope e("QPE/Application/kopi", "-showWN");
624} 624}
625void SimpleAlarmDaemonImpl::newTodo() 625void SimpleAlarmDaemonImpl::newTodo()
626{ 626{
627 QCopEnvelope e("QPE/Application/kopi", "-newTodo"); 627 QCopEnvelope e("QPE/Application/kopi", "-newTodo");
628} 628}
629 629
630void SimpleAlarmDaemonImpl::newEvent() 630void SimpleAlarmDaemonImpl::newEvent()
631{ 631{
632 QCopEnvelope e("QPE/Application/kopi", "-newEvent"); 632 QCopEnvelope e("QPE/Application/kopi", "-newEvent");
633 633
634} 634}
635void SimpleAlarmDaemonImpl::newMail() 635void SimpleAlarmDaemonImpl::newMail()
636{ 636{
637 QCopEnvelope e("QPE/Application/ompi", "newMail()"); 637 QCopEnvelope e("QPE/Application/ompi", "newMail()");
638} 638}
639void SimpleAlarmDaemonImpl::showAdd() 639void SimpleAlarmDaemonImpl::showAdd()
640{ 640{
641 QCopEnvelope e("QPE/Application/kapi", "raise()"); 641 QCopEnvelope e("QPE/Application/kapi", "raise()");
642} 642}
643void SimpleAlarmDaemonImpl::ringSync() 643void SimpleAlarmDaemonImpl::ringSync()
644{ 644{
645 QCopEnvelope e("QPE/Application/kopi", "-ringSync"); 645 QCopEnvelope e("QPE/Application/kopi", "-ringSync");
646 646
647} 647}
648void SimpleAlarmDaemonImpl::newCountdown() 648void SimpleAlarmDaemonImpl::newCountdown()
649{ 649{
650 //recieve("cal_alarm", 10 ); 650 //recieve("cal_alarm", 10 );
651} 651}
652void SimpleAlarmDaemonImpl::simulate() 652void SimpleAlarmDaemonImpl::simulate()
653{ 653{
654 writeFile(); 654 writeFile();
655 QString filename = getenv("QPEDIR") ; 655 QString filename = getenv("QPEDIR") ;
656 filename += "/pics/kdepim/korganizer/koalarm.wav"; 656 filename += "/pics/kdepim/korganizer/koalarm.wav";
657 startAlarm("Alarm simulation", filename ); 657 startAlarm("Alarm simulation", filename );
658} 658}
659void SimpleAlarmDaemonImpl::showKO() 659void SimpleAlarmDaemonImpl::showKO()
660{ 660{
661 QCopEnvelope e("QPE/Application/kopi", "-showKO"); 661 QCopEnvelope e("QPE/Application/kopi", "-showKO");
662 // testing only
663 //QCopEnvelope e("QPE/Application/kopi", "nextView()");
662 664
663} 665}
664void SimpleAlarmDaemonImpl::showTodo() 666void SimpleAlarmDaemonImpl::showTodo()
665{ 667{
666 QCopEnvelope e("QPE/Application/kopi", "-showTodo"); 668 QCopEnvelope e("QPE/Application/kopi", "-showTodo");
667 669
668} 670}
669void SimpleAlarmDaemonImpl::writeJournal() 671void SimpleAlarmDaemonImpl::writeJournal()
670{ 672{
671 QCopEnvelope e("QPE/Application/kopi", "-showJournal"); 673 QCopEnvelope e("QPE/Application/kopi", "-showJournal");
672 674
673} 675}
674 676
675void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * ) 677void SimpleAlarmDaemonImpl::mousePressEvent( QMouseEvent * )
676{ 678{
677 679
678 mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() ))); 680 mPopUp->popup(mapToGlobal(QPoint (0, -mPopUp->height() )));
679 681
680} 682}
681 683
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index a32333c..fa6b951 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -717,96 +717,98 @@ void KOAgendaView::createDayLabels()
717 dayLabel = getNewDaylabel(); 717 dayLabel = getNewDaylabel();
718 } 718 }
719 dayLabel->setMinimumWidth( 1 ); 719 dayLabel->setMinimumWidth( 1 );
720 dayLabel->setMaximumWidth( 10240 ); 720 dayLabel->setMaximumWidth( 10240 );
721 dayLabel->setFont( dlf ); 721 dayLabel->setFont( dlf );
722 dayLabel->show(); 722 dayLabel->show();
723 dayLabel->setNum( counter ); 723 dayLabel->setNum( counter );
724 QString str; 724 QString str;
725 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); 725 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date);
726 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); 726 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true );
727 switch ( maxLen ) { 727 switch ( maxLen ) {
728 case 2: 728 case 2:
729 str = QString::number( date.day() ); 729 str = QString::number( date.day() );
730 break; 730 break;
731 731
732 case 3: 732 case 3:
733 str = dayName.left( 1 ) +QString::number( date.day()); 733 str = dayName.left( 1 ) +QString::number( date.day());
734 734
735 break; 735 break;
736 case 4: 736 case 4:
737 str = dayName.left( 1 ) + " " +QString::number( date.day()); 737 str = dayName.left( 1 ) + " " +QString::number( date.day());
738 738
739 break; 739 break;
740 case 5: 740 case 5:
741 str = dayName.left( 2 ) + " " +QString::number( date.day()); 741 str = dayName.left( 2 ) + " " +QString::number( date.day());
742 742
743 break; 743 break;
744 case 6: 744 case 6:
745 str = dayName.left( 3 ) + " " +QString::number( date.day()); 745 str = dayName.left( 3 ) + " " +QString::number( date.day());
746 break; 746 break;
747 747
748 default: 748 default:
749 break; 749 break;
750 } 750 }
751 if ( oneday ) { 751 if ( oneday ) {
752 QString addString; 752 QString addString;
753 if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) 753 if ( mSelectedDates.first() == QDateTime::currentDateTime().date() )
754 addString = i18n("Today"); 754 addString = i18n("Today");
755 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) 755 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) )
756 addString = i18n("Tomorrow"); 756 addString = i18n("Tomorrow");
757 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) 757 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) )
758 addString = i18n("Yesterday"); 758 addString = i18n("Yesterday");
759 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) 759 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) )
760 addString = i18n("Day before yesterday"); 760 addString = i18n("Day before yesterday");
761 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) 761 else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) )
762 addString = i18n("Day after tomorrow"); 762 addString = i18n("Day after tomorrow");
763 if ( !addString.isEmpty() ) { 763 if ( !addString.isEmpty() ) {
764 str = addString+", " + str; 764 str = addString+", " + str;
765 } else {
766 str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer);
765 } 767 }
766 } 768 }
767 dayLabel->setText(str); 769 dayLabel->setText(str);
768 //dayLabel->setAlignment(QLabel::AlignHCenter); 770 //dayLabel->setAlignment(QLabel::AlignHCenter);
769 if (date == QDate::currentDate()) { 771 if (date == QDate::currentDate()) {
770 QFont bFont = dlf; 772 QFont bFont = dlf;
771 bFont.setBold( true ); 773 bFont.setBold( true );
772 dayLabel->setFont(bFont); 774 dayLabel->setFont(bFont);
773 } 775 }
774 //dayLayout->addWidget(dayLabel); 776 //dayLayout->addWidget(dayLabel);
775 777
776#ifndef KORG_NOPLUGINS 778#ifndef KORG_NOPLUGINS
777 CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); 779 CalendarDecoration::List cds = KOCore::self()->calendarDecorations();
778 CalendarDecoration *it; 780 CalendarDecoration *it;
779 for(it = cds.first(); it; it = cds.next()) { 781 for(it = cds.first(); it; it = cds.next()) {
780 QString text = it->shortText( date ); 782 QString text = it->shortText( date );
781 if ( !text.isEmpty() ) { 783 if ( !text.isEmpty() ) {
782 QLabel *label = new QLabel(text,mDayLabels); 784 QLabel *label = new QLabel(text,mDayLabels);
783 label->setAlignment(AlignCenter); 785 label->setAlignment(AlignCenter);
784 dayLayout->addWidget(label); 786 dayLayout->addWidget(label);
785 } 787 }
786 } 788 }
787 789
788 for(it = cds.first(); it; it = cds.next()) { 790 for(it = cds.first(); it; it = cds.next()) {
789 QWidget *wid = it->smallWidget(mDayLabels,date); 791 QWidget *wid = it->smallWidget(mDayLabels,date);
790 if ( wid ) { 792 if ( wid ) {
791 // wid->setHeight(20); 793 // wid->setHeight(20);
792 dayLayout->addWidget(wid); 794 dayLayout->addWidget(wid);
793 } 795 }
794 } 796 }
795#endif 797#endif
796 } 798 }
797 if ( ! appendLabels ) { 799 if ( ! appendLabels ) {
798 dayLabel = mDayLabelsList.next(); 800 dayLabel = mDayLabelsList.next();
799 if ( !dayLabel ) 801 if ( !dayLabel )
800 appendLabels = true; 802 appendLabels = true;
801 } 803 }
802 if ( appendLabels ) { 804 if ( appendLabels ) {
803 dayLabel = getNewDaylabel(); 805 dayLabel = getNewDaylabel();
804 } 806 }
805 //dayLabel->hide();//test only 807 //dayLabel->hide();//test only
806 808
807 int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; 809 int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ;
808 if ( offset < 0 ) offset = 0; 810 if ( offset < 0 ) offset = 0;
809 //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); 811 //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 );
810 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); 812 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) );
811 dayLabel->setFont( dlf ); 813 dayLabel->setFont( dlf );
812 dayLabel->show(); 814 dayLabel->show();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 31ee5e2..b5de4a1 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -153,97 +153,162 @@ void KOViewManager::showDateView( int view, QDate date)
153 KOPrefs::instance()->mNextXDays ); 153 KOPrefs::instance()->mNextXDays );
154 mFlagShowNextxDays = true; 154 mFlagShowNextxDays = true;
155 mCurrentAgendaView = 3 ; 155 mCurrentAgendaView = 3 ;
156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) 156 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
157 if ( lastMode ) { 157 if ( lastMode ) {
158 mCurrentAgendaView = lastCount ; 158 mCurrentAgendaView = lastCount ;
159 mMainView->dateNavigator()->selectDates( lastDate, lastCount); 159 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
160 mFlagShowNextxDays = lastNDMode; 160 mFlagShowNextxDays = lastNDMode;
161 if ( mFlagShowNextxDays ) { 161 if ( mFlagShowNextxDays ) {
162 mCurrentAgendaView = 3 ; 162 mCurrentAgendaView = 3 ;
163 } 163 }
164 } else 164 } else
165 showWeekView(); 165 showWeekView();
166 } else if (view == 10) { 166 } else if (view == 10) {
167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); 167 mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() );
168 } 168 }
169} 169}
170 170
171 171
172 172
173void KOViewManager::writeSettings(KConfig *config) 173void KOViewManager::writeSettings(KConfig *config)
174{ 174{
175 config->setGroup("General"); 175 config->setGroup("General");
176 176
177 QString view; 177 QString view;
178 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 178 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
179 else if (mCurrentView == mMonthView) view = "Month"; 179 else if (mCurrentView == mMonthView) view = "Month";
180 else if (mCurrentView == mListView) view = "List"; 180 else if (mCurrentView == mListView) view = "List";
181 else if (mCurrentView == mJournalView) view = "Journal"; 181 else if (mCurrentView == mJournalView) view = "Journal";
182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 182 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
183 else if (mCurrentView == mTodoView) view = "Todo"; 183 else if (mCurrentView == mTodoView) view = "Todo";
184 else view = "Agenda"; 184 else view = "Agenda";
185 185
186 config->writeEntry("Current View",view); 186 config->writeEntry("Current View",view);
187 187
188 if (mAgendaView) { 188 if (mAgendaView) {
189 mAgendaView->writeSettings(config); 189 mAgendaView->writeSettings(config);
190 } 190 }
191 if (mTimeSpanView) { 191 if (mTimeSpanView) {
192 mTimeSpanView->writeSettings(config); 192 mTimeSpanView->writeSettings(config);
193 } 193 }
194 if (mListView) { 194 if (mListView) {
195 mListView->writeSettings(config); 195 mListView->writeSettings(config);
196 } 196 }
197 if (mTodoView) { 197 if (mTodoView) {
198 mTodoView->saveLayout(config,"Todo View"); 198 mTodoView->saveLayout(config,"Todo View");
199 } 199 }
200} 200}
201void KOViewManager::showNextView()
202{
203 if (mCurrentView == mWhatsNextView) goto NEXT_X;
204
205 if (mCurrentView == mAgendaView && mFlagShowNextxDays) goto LIST;
206
207 if (mCurrentView == mListView ) goto DAY_1;
208
209 if (mCurrentView == mAgendaView && mCurrentAgendaView == 1 ) goto DAY_5;
210
211 if (mCurrentView == mAgendaView && mCurrentAgendaView == 5 ) goto DAY_7;
212
213 if (mCurrentView == mAgendaView ) goto DAY_6;
214
215 if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
216
217 if (mCurrentView == mMonthView ) goto TODO;
218
219 if (mCurrentView == mTodoView ) goto JOURNAL;
220
221 NEXT:
222 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
223 NEXT_X:
224 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
225 LIST:
226 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
227 DAY_1:
228 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
229 DAY_5:
230 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
231 DAY_7:
232 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
233 DAY_6:
234 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
235 MONTH:
236 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
237 TODO:
238 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
239 JOURNAL:
240 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
241
242
243
244 if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();return ;}
245
246 if ( KOPrefs::instance()->mShowIconNextDays ) { showNextXView() ;return ;}
247
248 if ( KOPrefs::instance()->mShowIconList ) { showListView() ;return ;}
249
250 if ( KOPrefs::instance()->mShowIconDay1 ) { showDayView() ;return ;}
201 251
252 if ( KOPrefs::instance()->mShowIconDay5 ) { showWorkWeekView() ;return ;}
253
254 if ( KOPrefs::instance()->mShowIconDay7 ) { showWeekView();return ;}
255
256 if ( KOPrefs::instance()->mShowIconDay6 ) { showMonthViewWeek();return ;}
257
258 if ( KOPrefs::instance()->mShowIconMonth ) { showMonthView();return ;}
259
260 if ( KOPrefs::instance()->mShowIconTodoview ) { showTodoView() ;return ;}
261
262 if ( KOPrefs::instance()->mShowIconJournal ) { showJournalView() ;return ;}
263
264
265
266}
202void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 267void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
203{ 268{
204 269
205 //mFlagShowNextxDays = false; 270 //mFlagShowNextxDays = false;
206 //if(view == mCurrentView) return; 271 //if(view == mCurrentView) return;
207 if ( view == 0 ) { 272 if ( view == 0 ) {
208 view = mCurrentView; 273 view = mCurrentView;
209 if ( view == 0 ) 274 if ( view == 0 )
210 return; 275 return;
211 } 276 }
212 bool callupdate = !(view == mCurrentView); 277 bool callupdate = !(view == mCurrentView);
213 bool full = fullScreen; 278 bool full = fullScreen;
214 if(view == mCurrentView && view != mWhatsNextView ) { 279 if(view == mCurrentView && view != mWhatsNextView ) {
215 if ( mCurrentAgendaView < 0 ) 280 if ( mCurrentAgendaView < 0 )
216 return; 281 return;
217 if ( view != mMonthView ) 282 if ( view != mMonthView )
218 full = mMainView->leftFrame()->isVisible(); 283 full = mMainView->leftFrame()->isVisible();
219 } else { 284 } else {
220 if ( view == mMonthView && mMonthView) 285 if ( view == mMonthView && mMonthView)
221 ;//mMonthView->skipResize = true ; 286 ;//mMonthView->skipResize = true ;
222 mCurrentView = view; 287 mCurrentView = view;
223 // bool full = fullScreen; 288 // bool full = fullScreen;
224 bool isFull = !mMainView->leftFrame()->isVisible(); 289 bool isFull = !mMainView->leftFrame()->isVisible();
225 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 290 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
226 full = true; 291 full = true;
227 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 292 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
228 full = false; 293 full = false;
229 } 294 }
230 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 295 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
231 //raiseCurrentView( full ); 296 //raiseCurrentView( full );
232 mMainView->processIncidenceSelection( 0 ); 297 mMainView->processIncidenceSelection( 0 );
233 //mMainView->updateView(); 298 //mMainView->updateView();
234 raiseCurrentView( full, callupdate ); 299 raiseCurrentView( full, callupdate );
235 mMainView->adaptNavigationUnits(); 300 mMainView->adaptNavigationUnits();
236} 301}
237 302
238void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 303void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
239{ 304{
240 mCurrentAgendaView = 0; 305 mCurrentAgendaView = 0;
241 if ( fullScreen ) { 306 if ( fullScreen ) {
242 mMainView->leftFrame()->hide(); 307 mMainView->leftFrame()->hide();
243 } else { 308 } else {
244 mMainView->leftFrame()->show(); 309 mMainView->leftFrame()->show();
245 } 310 }
246 //if ( mCurrentView == mMonthView ) qApp->processEvents(); 311 //if ( mCurrentView == mMonthView ) qApp->processEvents();
247 emit signalFullScreen( !fullScreen ); 312 emit signalFullScreen( !fullScreen );
248 if ( callUpdateView ) 313 if ( callUpdateView )
249 mMainView->updateView(); 314 mMainView->updateView();
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 6290227..d829f14 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -37,85 +37,86 @@ class KOTimeSpanView;
37class KOTodoView; 37class KOTodoView;
38class KOWhatsNextView; 38class KOWhatsNextView;
39class KOJournalView; 39class KOJournalView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43/** 43/**
44 This class manages the views of the calendar. It owns the objects and handles 44 This class manages the views of the calendar. It owns the objects and handles
45 creation and selection. 45 creation and selection.
46*/ 46*/
47class KOViewManager : public QObject 47class KOViewManager : public QObject
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 void updateWNview(); 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
70 70
71 void raiseCurrentView( bool fullScreen = false , bool updateView = false); 71 void raiseCurrentView( bool fullScreen = false , bool updateView = false);
72 72
73 void addView(KOrg::BaseView *); 73 void addView(KOrg::BaseView *);
74 74
75 Incidence *currentSelection(); 75 Incidence *currentSelection();
76 QDate currentSelectionDate(); 76 QDate currentSelectionDate();
77 77
78 KOAgendaView *agendaView() const { return mAgendaView; } 78 KOAgendaView *agendaView() const { return mAgendaView; }
79 79
80 signals: 80 signals:
81 void printWNV(); 81 void printWNV();
82 void signalFullScreen( bool ); 82 void signalFullScreen( bool );
83 void signalAgendaView( bool ); 83 void signalAgendaView( bool );
84 public slots: 84 public slots:
85 void showNextView();
85 void showMonth( const QDate & ); 86 void showMonth( const QDate & );
86 void showDateView( int, QDate ); 87 void showDateView( int, QDate );
87 void updateView(); 88 void updateView();
88 void showWhatsNextView(); 89 void showWhatsNextView();
89 void showListView(); 90 void showListView();
90 void showAgendaView( bool fullScreen = false ); 91 void showAgendaView( bool fullScreen = false );
91 void showDayView(); 92 void showDayView();
92 void showWorkWeekView(); 93 void showWorkWeekView();
93 void showWeekView(); 94 void showWeekView();
94 void showNextXView(); 95 void showNextXView();
95 void showMonthView(); 96 void showMonthView();
96 void showMonthViewWeek(); 97 void showMonthViewWeek();
97 void showTodoView(); 98 void showTodoView();
98 void showJournalView(); 99 void showJournalView();
99 void showTimeSpanView(); 100 void showTimeSpanView();
100 101
101 private: 102 private:
102 void createMonthView(); 103 void createMonthView();
103 CalendarView *mMainView; 104 CalendarView *mMainView;
104 105
105 int mCurrentAgendaView; 106 int mCurrentAgendaView;
106 KOAgendaView *mAgendaView; 107 KOAgendaView *mAgendaView;
107 KOListView *mListView; 108 KOListView *mListView;
108 KOMonthView *mMonthView; 109 KOMonthView *mMonthView;
109 KOTodoView *mTodoView; 110 KOTodoView *mTodoView;
110 KOWhatsNextView *mWhatsNextView; 111 KOWhatsNextView *mWhatsNextView;
111 KOJournalView *mJournalView; 112 KOJournalView *mJournalView;
112 KOTimeSpanView *mTimeSpanView; 113 KOTimeSpanView *mTimeSpanView;
113 114
114 KOrg::BaseView *mCurrentView; // currently active event view 115 KOrg::BaseView *mCurrentView; // currently active event view
115 116
116 int mAgendaViewMode; 117 int mAgendaViewMode;
117 bool mFlagShowNextxDays; 118 bool mFlagShowNextxDays;
118 119
119}; 120};
120 121
121#endif 122#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7d5cf72..b947cac 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -439,99 +439,102 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
439 int nextC = allmsg.find( "-", 1 ); 439 int nextC = allmsg.find( "-", 1 );
440 if ( nextC == -1 ) { 440 if ( nextC == -1 ) {
441 msg = allmsg; 441 msg = allmsg;
442 allmsg = ""; 442 allmsg = "";
443 } else{ 443 } else{
444 msg = allmsg.left( nextC ); 444 msg = allmsg.left( nextC );
445 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 445 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
446 } 446 }
447 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 447 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
448 if ( msg == "-newEvent" ) { 448 if ( msg == "-newEvent" ) {
449 mView->newEvent(); 449 mView->newEvent();
450 } 450 }
451 if ( msg == "-newTodo" ) { 451 if ( msg == "-newTodo" ) {
452 mView->newTodo(); 452 mView->newTodo();
453 453
454 } 454 }
455 if ( msg == "-showWN" ) { 455 if ( msg == "-showWN" ) {
456 mView->viewManager()->showWhatsNextView(); 456 mView->viewManager()->showWhatsNextView();
457 } 457 }
458 if ( msg == "-showTodo" ) { 458 if ( msg == "-showTodo" ) {
459 mView->viewManager()->showTodoView(); 459 mView->viewManager()->showTodoView();
460 } 460 }
461 if ( msg == "-showList" ) { 461 if ( msg == "-showList" ) {
462 mView->viewManager()->showListView(); 462 mView->viewManager()->showListView();
463 } 463 }
464 else if ( msg == "-showDay" ) { 464 else if ( msg == "-showDay" ) {
465 mView->viewManager()->showDayView(); 465 mView->viewManager()->showDayView();
466 } 466 }
467 else if ( msg == "-showWWeek" ) { 467 else if ( msg == "-showWWeek" ) {
468 mView->viewManager()->showWorkWeekView(); 468 mView->viewManager()->showWorkWeekView();
469 } 469 }
470 else if ( msg == "-ringSync" ) { 470 else if ( msg == "-ringSync" ) {
471 mSyncManager->multiSync( false ); 471 mSyncManager->multiSync( false );
472 } 472 }
473 else if ( msg == "-showWeek" ) { 473 else if ( msg == "-showWeek" ) {
474 mView->viewManager()->showWeekView(); 474 mView->viewManager()->showWeekView();
475 } 475 }
476 else if ( msg == "-showTodo" ) { 476 else if ( msg == "-showTodo" ) {
477 mView->viewManager()->showTodoView(); 477 mView->viewManager()->showTodoView();
478 } 478 }
479 else if ( msg == "-showJournal" ) { 479 else if ( msg == "-showJournal" ) {
480 mView->dateNavigator()->selectDates( 1 ); 480 mView->dateNavigator()->selectDates( 1 );
481 mView->dateNavigator()->selectToday(); 481 mView->dateNavigator()->selectToday();
482 mView->viewManager()->showJournalView(); 482 mView->viewManager()->showJournalView();
483 } 483 }
484 else if ( msg == "-showKO" ) { 484 else if ( msg == "-showKO" ) {
485 mView->viewManager()->showNextXView(); 485 mView->viewManager()->showNextXView();
486 } 486 }
487 else if ( msg == "-showWNext" || msg == "nextView()" ) { 487 else if ( msg == "-showWNext" ) {
488 mView->viewManager()->showWhatsNextView(); 488 mView->viewManager()->showWhatsNextView();
489 } 489 }
490 else if ( msg == "nextView()" ) {
491 mView->viewManager()->showNextView();
492 }
490 else if ( msg == "-showNextXView" ) { 493 else if ( msg == "-showNextXView" ) {
491 mView->viewManager()->showNextXView(); 494 mView->viewManager()->showNextXView();
492 } 495 }
493 496
494 497
495 } 498 }
496 499
497 showMaximized(); 500 showMaximized();
498 raise(); 501 raise();
499} 502}
500 503
501QPixmap MainWindow::loadPixmap( QString name ) 504QPixmap MainWindow::loadPixmap( QString name )
502{ 505{
503 return SmallIcon( name ); 506 return SmallIcon( name );
504 507
505} 508}
506void MainWindow::initActions() 509void MainWindow::initActions()
507{ 510{
508 //KOPrefs::instance()->mShowFullMenu 511 //KOPrefs::instance()->mShowFullMenu
509 iconToolBar->clear(); 512 iconToolBar->clear();
510 KOPrefs *p = KOPrefs::instance(); 513 KOPrefs *p = KOPrefs::instance();
511 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 514 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
512 515
513 QPopupMenu *viewMenu = new QPopupMenu( this ); 516 QPopupMenu *viewMenu = new QPopupMenu( this );
514 QPopupMenu *actionMenu = new QPopupMenu( this ); 517 QPopupMenu *actionMenu = new QPopupMenu( this );
515 QPopupMenu *importMenu = new QPopupMenu( this ); 518 QPopupMenu *importMenu = new QPopupMenu( this );
516 QPopupMenu *importMenu_X = new QPopupMenu( this ); 519 QPopupMenu *importMenu_X = new QPopupMenu( this );
517 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 520 QPopupMenu *exportMenu_X = new QPopupMenu( this );
518 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 521 QPopupMenu *beamMenu_X = new QPopupMenu( this );
519 selectFilterMenu = new QPopupMenu( this ); 522 selectFilterMenu = new QPopupMenu( this );
520 selectFilterMenu->setCheckable( true ); 523 selectFilterMenu->setCheckable( true );
521 syncMenu = new QPopupMenu( this ); 524 syncMenu = new QPopupMenu( this );
522 configureAgendaMenu = new QPopupMenu( this ); 525 configureAgendaMenu = new QPopupMenu( this );
523 configureToolBarMenu = new QPopupMenu( this ); 526 configureToolBarMenu = new QPopupMenu( this );
524 QPopupMenu *helpMenu = new QPopupMenu( this ); 527 QPopupMenu *helpMenu = new QPopupMenu( this );
525 QIconSet icon; 528 QIconSet icon;
526 int pixWid = 22, pixHei = 22; 529 int pixWid = 22, pixHei = 22;
527 QString pathString = ""; 530 QString pathString = "";
528 if ( !p->mToolBarMiniIcons ) { 531 if ( !p->mToolBarMiniIcons ) {
529 if ( QApplication::desktop()->width() < 480 ) { 532 if ( QApplication::desktop()->width() < 480 ) {
530 pathString += "icons16/"; 533 pathString += "icons16/";
531 pixWid = 18; pixHei = 16; 534 pixWid = 18; pixHei = 16;
532 } 535 }
533 } else { 536 } else {
534 pathString += "iconsmini/"; 537 pathString += "iconsmini/";
535 pixWid = 18; pixHei = 16; 538 pixWid = 18; pixHei = 16;
536 } 539 }
537 if ( KOPrefs::instance()->mShowFullMenu ) { 540 if ( KOPrefs::instance()->mShowFullMenu ) {