summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-29 16:41:15 (UTC)
committer zautrix <zautrix>2005-01-29 16:41:15 (UTC)
commit41baa2e15a1ec5e14750297e0a21020c9e53d953 (patch) (unidiff)
tree2a1a1ae20928d4f2dc3ac73e9be82f04563b3604
parentc6548bb194a5e73b9b72505c2e952ef6346dec46 (diff)
downloadkdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.zip
kdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.tar.gz
kdepimpi-41baa2e15a1ec5e14750297e0a21020c9e53d953.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt8
-rw-r--r--korganizer/calendarview.cpp1
-rw-r--r--korganizer/koagenda.cpp59
-rw-r--r--korganizer/koagenda.h1
-rw-r--r--korganizer/koagendaview.cpp3
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/koviewmanager.cpp50
-rw-r--r--korganizer/koviewmanager.h1
8 files changed, 93 insertions, 31 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 6a20868..8572bf9 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1133,69 +1133,73 @@
1133{ "&Start date:","&Startdatum:" }, 1133{ "&Start date:","&Startdatum:" },
1134{ "Start &time:","Startzeit:" }, 1134{ "Start &time:","Startzeit:" },
1135{ "End ti&me:","Endzeit:" }, 1135{ "End ti&me:","Endzeit:" },
1136{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1136{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1137{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1137{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1138{ "Alt+D","Alt+D" }, 1138{ "Alt+D","Alt+D" },
1139{ "&Use colors","Nutze Farben" }, 1139{ "&Use colors","Nutze Farben" },
1140{ "Alt+U","Alt+U" }, 1140{ "Alt+U","Alt+U" },
1141{ "Print week","Drucke Woche" }, 1141{ "Print week","Drucke Woche" },
1142{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1142{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1143{ "Use &colors","Nutze Farben" }, 1143{ "Use &colors","Nutze Farben" },
1144{ "Type of View","Typ der Ansicht" }, 1144{ "Type of View","Typ der Ansicht" },
1145{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1145{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1146{ "Alt+F","Alt+F" }, 1146{ "Alt+F","Alt+F" },
1147{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1147{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1148{ "Alt+T","Alt+T" }, 1148{ "Alt+T","Alt+T" },
1149{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1149{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1150{ "Print month","Drucke Monat" }, 1150{ "Print month","Drucke Monat" },
1151{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1151{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1152{ "&Start month:","&Startmonat:" }, 1152{ "&Start month:","&Startmonat:" },
1153{ "&End month:","&Endmonat:" }, 1153{ "&End month:","&Endmonat:" },
1154{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1154{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1155{ "Print todos","Drucke Todos" }, 1155{ "Print todos","Drucke Todos" },
1156{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1156{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1157{ "Include &description of the item","Inclusive Itembeschreibung" }, 1157{ "Include &description of the item","Inclusive Itembeschreibung" },
1158{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1158{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1159{ "Include &priority of the item","Inclusive Priorität des Items" }, 1159{ "Include &priority of the item","Inclusive Priorität des Items" },
1160{ "Items to Print","Zu druckende Items" }, 1160{ "Items to Print","Zu druckende Items" },
1161{ "&From:","Von:" }, 1161{ "&From:","Von:" },
1162{ "&To:","Bis:" }, 1162{ "&To:","Bis:" },
1163{ "Print &all todo items","Drucke alle Todo Items" }, 1163{ "Print &all todo items","Drucke alle Todo Items" },
1164{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1164{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1165{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1165{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1166{ "Todo List","Todo Liste" }, 1166{ "Todo List","Todo Liste" },
1167{ "&Title:","&Titel:" }, 1167{ "&Title:","&Titel:" },
1168{ "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, 1168{ "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" },
1169{ "Todo list","Todo Liste" }, 1169{ "Todo list","Todo Liste" },
1170{ "&Print...","Drucke..." }, 1170{ "&Print...","Drucke..." },
1171{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1171{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1172{ "[Unconfigured]","[Unkonfiguriert]" }, 1172{ "[Unconfigured]","[Unkonfiguriert]" },
1173{ "OK","OK" }, 1173{ "OK","OK" },
1174{ "FilterEditor","FilterEditor" }, 1174{ "FilterEditor","FilterEditor" },
1175{ "Include","Inclusive" }, 1175{ "Include","Inclusive" },
1176{ "Exclude","Exclusive" }, 1176{ "Exclude","Exclusive" },
1177{ "Edit Selection...","Editiere Auswahl" }, 1177{ "Edit Selection...","Editiere Auswahl" },
1178{ "recurring events","wiederholende Termine" }, 1178{ "recurring events","wiederholende Termine" },
1179{ "recurr. events","wiederh.Termine" }, 1179{ "recurr. events","wiederh.Termine" },
1180{ "completed to-dos","erledigte Todos" }, 1180{ "completed to-dos","erledigte Todos" },
1181{ "events","Termine" }, 1181{ "events","Termine" },
1182{ "todos","Todos" }, 1182{ "todos","Todos" },
1183{ "journals","Journale" }, 1183{ "journals","Journale" },
1184{ "public","öffentl." }, 1184{ "public","öffentl." },
1185{ "private","privat" }, 1185{ "private","privat" },
1186{ "confidential","vertraul." }, 1186{ "confidential","vertraul." },
1187{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, 1187{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" },
1188{ "Yesterday","Gestern" }, 1188{ "Yesterday","Gestern" },
1189{ "Day after tomorrow","Übermorgen" }, 1189{ "Day after tomorrow","Übermorgen" },
1190{ "Tomorrow","Morgen" }, 1190{ "Tomorrow","Morgen" },
1191{ "Day before yesterday","Vorgestern" }, 1191{ "Day before yesterday","Vorgestern" },
1192{ "Size %1","Größe %1" }, 1192{ "Size %1","Größe %1" },
1193{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1193{ "New Agendasize: %1","Neue Agendagröße: %1" },
1194{ " (%1 y.)"," (%1 J.)" }, 1194{ " (%1 y.)"," (%1 J.)" },
1195{ "Allday:","Ganztägig:" }, 1195{ "Allday:","Ganztägig:" },
1196{ "compl.todos","erled.Todos" }, 1196{ "compl.todos","erled.Todos" },
1197{ "","" }, 1197{ "Day view","Tagesansicht" },
1198{ "","" }, 1198{ "Next days","Nächste Tage" },
1199{ "Next week","Nächste Woche" },
1200{ "Next two weeks","Nächste zwei Wochen" },
1201{ "Next month","Nächster Monat" },
1202{ "Journal view","Journal" },
1199{ "","" }, 1203{ "","" },
1200{ "","" }, 1204{ "","" },
1201{ "","" }, 1205{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 035d630..e7b6755 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2628,129 +2628,128 @@ void CalendarView::newEvent()
2628 if ( date <= current.date() ) { 2628 if ( date <= current.date() ) {
2629 int hour = current.time().hour() +1; 2629 int hour = current.time().hour() +1;
2630 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2630 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2631 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2631 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2632 } else 2632 } else
2633 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2633 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2634 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2634 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2635 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2635 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2636} 2636}
2637 2637
2638void CalendarView::newEvent(QDateTime fh) 2638void CalendarView::newEvent(QDateTime fh)
2639{ 2639{
2640 newEvent(fh, 2640 newEvent(fh,
2641 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2641 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2642} 2642}
2643 2643
2644void CalendarView::newEvent(QDate dt) 2644void CalendarView::newEvent(QDate dt)
2645{ 2645{
2646 newEvent(QDateTime(dt, QTime(0,0,0)), 2646 newEvent(QDateTime(dt, QTime(0,0,0)),
2647 QDateTime(dt, QTime(0,0,0)), true); 2647 QDateTime(dt, QTime(0,0,0)), true);
2648} 2648}
2649void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 2649void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
2650{ 2650{
2651 newEvent(fromHint, toHint, false); 2651 newEvent(fromHint, toHint, false);
2652} 2652}
2653void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2653void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2654{ 2654{
2655 2655
2656 showEventEditor(); 2656 showEventEditor();
2657 mEventEditor->newEvent(fromHint,toHint,allDay); 2657 mEventEditor->newEvent(fromHint,toHint,allDay);
2658 if ( mFilterView->filtersEnabled() ) { 2658 if ( mFilterView->filtersEnabled() ) {
2659 CalFilter *filter = mFilterView->selectedFilter(); 2659 CalFilter *filter = mFilterView->selectedFilter();
2660 if (filter && filter->showCategories()) { 2660 if (filter && filter->showCategories()) {
2661 mEventEditor->setCategories(filter->categoryList().join(",") ); 2661 mEventEditor->setCategories(filter->categoryList().join(",") );
2662 } 2662 }
2663 if ( filter ) 2663 if ( filter )
2664 mEventEditor->setSecrecy( filter->getSecrecy() ); 2664 mEventEditor->setSecrecy( filter->getSecrecy() );
2665 } 2665 }
2666} 2666}
2667void CalendarView::todoAdded(Todo * t) 2667void CalendarView::todoAdded(Todo * t)
2668{ 2668{
2669 2669
2670 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2670 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2671 updateTodoViews(); 2671 updateTodoViews();
2672} 2672}
2673void CalendarView::todoChanged(Todo * t) 2673void CalendarView::todoChanged(Todo * t)
2674{ 2674{
2675 emit todoModified( t, 4 ); 2675 emit todoModified( t, 4 );
2676 // updateTodoViews(); 2676 // updateTodoViews();
2677} 2677}
2678void CalendarView::todoToBeDeleted(Todo *) 2678void CalendarView::todoToBeDeleted(Todo *)
2679{ 2679{
2680 //qDebug("todoToBeDeleted(Todo *) "); 2680 //qDebug("todoToBeDeleted(Todo *) ");
2681 updateTodoViews(); 2681 updateTodoViews();
2682} 2682}
2683void CalendarView::todoDeleted() 2683void CalendarView::todoDeleted()
2684{ 2684{
2685 //qDebug(" todoDeleted()"); 2685 //qDebug(" todoDeleted()");
2686 updateTodoViews(); 2686 updateTodoViews();
2687} 2687}
2688 2688
2689 2689
2690void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 2690void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
2691{ 2691{
2692 qDebug("datetime ");
2693 showTodoEditor(); 2692 showTodoEditor();
2694 mTodoEditor->newTodo(dt,0,allday); 2693 mTodoEditor->newTodo(dt,0,allday);
2695 if ( mFilterView->filtersEnabled() ) { 2694 if ( mFilterView->filtersEnabled() ) {
2696 CalFilter *filter = mFilterView->selectedFilter(); 2695 CalFilter *filter = mFilterView->selectedFilter();
2697 if (filter && filter->showCategories()) { 2696 if (filter && filter->showCategories()) {
2698 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2697 mTodoEditor->setCategories(filter->categoryList().join(",") );
2699 } 2698 }
2700 if ( filter ) 2699 if ( filter )
2701 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2700 mTodoEditor->setSecrecy( filter->getSecrecy() );
2702 } 2701 }
2703} 2702}
2704 2703
2705void CalendarView::newTodo() 2704void CalendarView::newTodo()
2706{ 2705{
2707 newTodoDateTime( QDateTime(),true ); 2706 newTodoDateTime( QDateTime(),true );
2708} 2707}
2709 2708
2710void CalendarView::newSubTodo() 2709void CalendarView::newSubTodo()
2711{ 2710{
2712 Todo *todo = selectedTodo(); 2711 Todo *todo = selectedTodo();
2713 if ( todo ) newSubTodo( todo ); 2712 if ( todo ) newSubTodo( todo );
2714} 2713}
2715 2714
2716void CalendarView::newSubTodo(Todo *parentEvent) 2715void CalendarView::newSubTodo(Todo *parentEvent)
2717{ 2716{
2718 2717
2719 showTodoEditor(); 2718 showTodoEditor();
2720 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); 2719 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2721} 2720}
2722 2721
2723void CalendarView::newFloatingEvent() 2722void CalendarView::newFloatingEvent()
2724{ 2723{
2725 DateList tmpList = mNavigator->selectedDates(); 2724 DateList tmpList = mNavigator->selectedDates();
2726 QDate date = tmpList.first(); 2725 QDate date = tmpList.first();
2727 2726
2728 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2727 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2729 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2728 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2730} 2729}
2731 2730
2732 2731
2733void CalendarView::editEvent( Event *event ) 2732void CalendarView::editEvent( Event *event )
2734{ 2733{
2735 2734
2736 if ( !event ) return; 2735 if ( !event ) return;
2737 if ( event->isReadOnly() ) { 2736 if ( event->isReadOnly() ) {
2738 showEvent( event ); 2737 showEvent( event );
2739 return; 2738 return;
2740 } 2739 }
2741 showEventEditor(); 2740 showEventEditor();
2742 mEventEditor->editEvent( event , mFlagEditDescription); 2741 mEventEditor->editEvent( event , mFlagEditDescription);
2743} 2742}
2744void CalendarView::editJournal( Journal *jour ) 2743void CalendarView::editJournal( Journal *jour )
2745{ 2744{
2746 if ( !jour ) return; 2745 if ( !jour ) return;
2747 mDialogManager->hideSearchDialog(); 2746 mDialogManager->hideSearchDialog();
2748 mViewManager->showJournalView(); 2747 mViewManager->showJournalView();
2749 mNavigator->slotDaySelect( jour->dtStart().date() ); 2748 mNavigator->slotDaySelect( jour->dtStart().date() );
2750} 2749}
2751void CalendarView::editTodo( Todo *todo ) 2750void CalendarView::editTodo( Todo *todo )
2752{ 2751{
2753 if ( !todo ) return; 2752 if ( !todo ) return;
2754 2753
2755 if ( todo->isReadOnly() ) { 2754 if ( todo->isReadOnly() ) {
2756 showTodo( todo ); 2755 showTodo( todo );
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 73ee5cb..0eeacb3 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -107,202 +107,200 @@ int MarcusBains::todayColumn()
107void MarcusBains::updateLoc() 107void MarcusBains::updateLoc()
108{ 108{
109 updateLocation(); 109 updateLocation();
110} 110}
111void MarcusBains::updateLocation(bool recalculate) 111void MarcusBains::updateLocation(bool recalculate)
112{ 112{
113 113
114 QTime tim = QTime::currentTime(); 114 QTime tim = QTime::currentTime();
115 //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); 115 //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1());
116 if((tim.hour() == 0) && (oldTime.hour()==23)) 116 if((tim.hour() == 0) && (oldTime.hour()==23))
117 recalculate = true; 117 recalculate = true;
118 118
119 int mins = tim.hour()*60 + tim.minute(); 119 int mins = tim.hour()*60 + tim.minute();
120 int minutesPerCell = 24 * 60 / agenda->rows(); 120 int minutesPerCell = 24 * 60 / agenda->rows();
121 int y = mins*agenda->gridSpacingY()/minutesPerCell; 121 int y = mins*agenda->gridSpacingY()/minutesPerCell;
122 int today = recalculate ? todayColumn() : oldToday; 122 int today = recalculate ? todayColumn() : oldToday;
123 int x = agenda->gridSpacingX()*today; 123 int x = agenda->gridSpacingX()*today;
124 bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); 124 bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled);
125 125
126 oldTime = tim; 126 oldTime = tim;
127 oldToday = today; 127 oldToday = today;
128 128
129 if(disabled || (today<0)) { 129 if(disabled || (today<0)) {
130 hide(); mTimeBox->hide(); 130 hide(); mTimeBox->hide();
131 return; 131 return;
132 } else { 132 } else {
133 show(); mTimeBox->show(); 133 show(); mTimeBox->show();
134 } 134 }
135 135
136 if(recalculate) 136 if(recalculate)
137 setFixedSize(agenda->gridSpacingX(),1); 137 setFixedSize(agenda->gridSpacingX(),1);
138 agenda->moveChild(this, x, y); 138 agenda->moveChild(this, x, y);
139 raise(); 139 raise();
140 140
141 if(recalculate) 141 if(recalculate)
142 //mTimeBox->setFont(QFont("helvetica",10)); 142 //mTimeBox->setFont(QFont("helvetica",10));
143 mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); 143 mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont);
144 144
145 mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); 145 mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds));
146 mTimeBox->adjustSize(); 146 mTimeBox->adjustSize();
147 // the -2 below is there because there is a bug in this program 147 // the -2 below is there because there is a bug in this program
148 // somewhere, where the last column of this widget is a few pixels 148 // somewhere, where the last column of this widget is a few pixels
149 // narrower than the other columns. 149 // narrower than the other columns.
150 int offs = (today==agenda->columns()-1) ? -4 : 0; 150 int offs = (today==agenda->columns()-1) ? -4 : 0;
151 agenda->moveChild(mTimeBox, 151 agenda->moveChild(mTimeBox,
152 x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, 152 x+agenda->gridSpacingX()-mTimeBox->width()+offs-1,
153 y-mTimeBox->height()); 153 y-mTimeBox->height());
154 154
155 mTimeBox->raise(); 155 mTimeBox->raise();
156 //mTimeBox->setAutoMask(true); 156 //mTimeBox->setAutoMask(true);
157 minutes->start(5000,true); 157 minutes->start(5000,true);
158} 158}
159 159
160 160
161//////////////////////////////////////////////////////////////////////////// 161////////////////////////////////////////////////////////////////////////////
162 162
163 163
164/* 164/*
165 Create an agenda widget with rows rows and columns columns. 165 Create an agenda widget with rows rows and columns columns.
166*/ 166*/
167KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, 167KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
168 const char *name,WFlags f) : 168 const char *name,WFlags f) :
169 QScrollView(parent,name,f) 169 QScrollView(parent,name,f)
170{ 170{
171 mNewItemPopup = new QPopupMenu( this ); 171
172 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
173 QString pathString = "";
174 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
175 if ( QApplication::desktop()->width() < 480 )
176 pathString += "icons16/";
177 } else
178 pathString += "iconsmini/";
179
180 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
181 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
182 172
183 mColumns = columns; 173 mColumns = columns;
184 mRows = rows; 174 mRows = rows;
185 mGridSpacingY = rowSize; 175 mGridSpacingY = rowSize;
186 mAllDayMode = false; 176 mAllDayMode = false;
187#ifndef DESKTOP_VERSION 177#ifndef DESKTOP_VERSION
188 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 178 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
189#endif 179#endif
190 mHolidayMask = 0; 180 mHolidayMask = 0;
191 init(); 181 init();
192} 182}
193 183
194/* 184/*
195 Create an agenda widget with columns columns and one row. This is used for 185 Create an agenda widget with columns columns and one row. This is used for
196 all-day events. 186 all-day events.
197*/ 187*/
198KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : 188KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
199 QScrollView(parent,name,f) 189 QScrollView(parent,name,f)
200{ 190{
201 mNewItemPopup = new QPopupMenu( this );
202 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
203 QString pathString = "";
204 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
205 if ( QApplication::desktop()->width() < 480 )
206 pathString += "icons16/";
207 } else
208 pathString += "iconsmini/";
209 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."),1 );
210 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
211 blockResize = false; 191 blockResize = false;
212 mColumns = columns; 192 mColumns = columns;
213 mRows = 1; 193 mRows = 1;
214 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); 194 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
215 mGridSpacingY = KOPrefs::instance()->mAllDaySize; 195 mGridSpacingY = KOPrefs::instance()->mAllDaySize;
216 mAllDayMode = true; 196 mAllDayMode = true;
217#ifndef DESKTOP_VERSION 197#ifndef DESKTOP_VERSION
218 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 198 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
219#endif 199#endif
220 mHolidayMask = 0; 200 mHolidayMask = 0;
221 init(); 201 init();
222} 202}
223 203
224 204
225KOAgenda::~KOAgenda() 205KOAgenda::~KOAgenda()
226{ 206{
227 if(mMarcusBains) delete mMarcusBains; 207 if(mMarcusBains) delete mMarcusBains;
228 208
229} 209}
230 210
231Incidence *KOAgenda::selectedIncidence() const 211Incidence *KOAgenda::selectedIncidence() const
232{ 212{
233 return (mSelectedItem ? mSelectedItem->incidence() : 0); 213 return (mSelectedItem ? mSelectedItem->incidence() : 0);
234} 214}
235 215
236 216
237QDate KOAgenda::selectedIncidenceDate() const 217QDate KOAgenda::selectedIncidenceDate() const
238{ 218{
239 return (mSelectedItem ? mSelectedItem->itemDate() : QDate()); 219 return (mSelectedItem ? mSelectedItem->itemDate() : QDate());
240} 220}
241 221
242 222
243void KOAgenda::init() 223void KOAgenda::init()
244{ 224{
225 mNewItemPopup = new QPopupMenu( this );
226 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
227 QString pathString = "";
228 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
229 if ( QApplication::desktop()->width() < 480 )
230 pathString += "icons16/";
231 } else
232 pathString += "iconsmini/";
233
234 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
235 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
236 mNewItemPopup->insertSeparator ( );
237 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
238 mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
239 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
240 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
241 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next month"),6 );
242 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
245#ifndef _WIN32_ 243#ifndef _WIN32_
246 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase 244 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
247 viewport()->setWFlags ( wflags); 245 viewport()->setWFlags ( wflags);
248#endif 246#endif
249 mGridSpacingX = 80; 247 mGridSpacingX = 80;
250 mResizeBorderWidth = 8; 248 mResizeBorderWidth = 8;
251 mScrollBorderWidth = 8; 249 mScrollBorderWidth = 8;
252 mScrollDelay = 30; 250 mScrollDelay = 30;
253 mScrollOffset = 10; 251 mScrollOffset = 10;
254 mPaintPixmap.resize( 20,20); 252 mPaintPixmap.resize( 20,20);
255 //enableClipper(true); 253 //enableClipper(true);
256 254
257 // Grab key strokes for keyboard navigation of agenda. Seems to have no 255 // Grab key strokes for keyboard navigation of agenda. Seems to have no
258 // effect. Has to be fixed. 256 // effect. Has to be fixed.
259 setFocusPolicy(WheelFocus); 257 setFocusPolicy(WheelFocus);
260 258
261 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); 259 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp()));
262 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); 260 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown()));
263 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); 261 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize()));
264 262
265 mStartCellX = 0; 263 mStartCellX = 0;
266 mStartCellY = 0; 264 mStartCellY = 0;
267 mCurrentCellX = 0; 265 mCurrentCellX = 0;
268 mCurrentCellY = 0; 266 mCurrentCellY = 0;
269 267
270 mSelectionCellX = 0; 268 mSelectionCellX = 0;
271 mSelectionYTop = 0; 269 mSelectionYTop = 0;
272 mSelectionHeight = 0; 270 mSelectionHeight = 0;
273 271
274 mOldLowerScrollValue = -1; 272 mOldLowerScrollValue = -1;
275 mOldUpperScrollValue = -1; 273 mOldUpperScrollValue = -1;
276 274
277 mClickedItem = 0; 275 mClickedItem = 0;
278 276
279 mActionItem = 0; 277 mActionItem = 0;
280 mActionType = NOP; 278 mActionType = NOP;
281 mItemMoved = false; 279 mItemMoved = false;
282 280
283 mSelectedItem = 0; 281 mSelectedItem = 0;
284 282
285 // mItems.setAutoDelete(true); 283 // mItems.setAutoDelete(true);
286 284
287 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 ); 285 resizeContents( mGridSpacingX * mColumns + 1 , mGridSpacingY * mRows + 1 );
288 286
289 viewport()->update(); 287 viewport()->update();
290 288
291 setMinimumSize(30, 1); 289 setMinimumSize(30, 1);
292// setMaximumHeight(mGridSpacingY * mRows + 5); 290// setMaximumHeight(mGridSpacingY * mRows + 5);
293 291
294 // Disable horizontal scrollbar. This is a hack. The geometry should be 292 // Disable horizontal scrollbar. This is a hack. The geometry should be
295 // controlled in a way that the contents horizontally always fits. Then it is 293 // controlled in a way that the contents horizontally always fits. Then it is
296 // not necessary to turn off the scrollbar. 294 // not necessary to turn off the scrollbar.
297 setHScrollBarMode(AlwaysOff); 295 setHScrollBarMode(AlwaysOff);
298 if ( ! mAllDayMode ) 296 if ( ! mAllDayMode )
299 setVScrollBarMode(AlwaysOn); 297 setVScrollBarMode(AlwaysOn);
300 else 298 else
301 setVScrollBarMode(AlwaysOff); 299 setVScrollBarMode(AlwaysOff);
302 300
303 setStartHour(KOPrefs::instance()->mDayBegins); 301 setStartHour(KOPrefs::instance()->mDayBegins);
304 302
305 calculateWorkingHours(); 303 calculateWorkingHours();
306 304
307 connect(verticalScrollBar(),SIGNAL(valueChanged(int)), 305 connect(verticalScrollBar(),SIGNAL(valueChanged(int)),
308 SLOT(checkScrollBoundaries(int))); 306 SLOT(checkScrollBoundaries(int)));
@@ -501,135 +499,142 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
501 break; 499 break;
502 500
503 case QEvent::MouseMove: 501 case QEvent::MouseMove:
504 if (object != viewport()) { 502 if (object != viewport()) {
505 KOAgendaItem *moveItem = (KOAgendaItem *)object; 503 KOAgendaItem *moveItem = (KOAgendaItem *)object;
506 //qDebug("moveItem %d ",moveItem ); 504 //qDebug("moveItem %d ",moveItem );
507 if (!moveItem->incidence()->isReadOnly() /*&& 505 if (!moveItem->incidence()->isReadOnly() /*&&
508 !moveItem->incidence()->recurrence()->doesRecur()*/ ) 506 !moveItem->incidence()->recurrence()->doesRecur()*/ )
509 if (!mActionItem) 507 if (!mActionItem)
510 setNoActionCursor(moveItem,viewportPos); 508 setNoActionCursor(moveItem,viewportPos);
511 else { 509 else {
512 if ( block ) { 510 if ( block ) {
513 int dX, dY; 511 int dX, dY;
514 dX = startX - viewportPos.x(); 512 dX = startX - viewportPos.x();
515 if ( dX < 0 ) 513 if ( dX < 0 )
516 dX = -dX; 514 dX = -dX;
517 dY = viewportPos.y() - startY; 515 dY = viewportPos.y() - startY;
518 if ( dY < 0 ) 516 if ( dY < 0 )
519 dY = -dY; 517 dY = -dY;
520 int diff = 30; 518 int diff = 30;
521 if ( QApplication::desktop()->width() < 480 ) 519 if ( QApplication::desktop()->width() < 480 )
522 diff = 15; 520 diff = 15;
523 // qDebug(" %d %d ",dX, dY ); 521 // qDebug(" %d %d ",dX, dY );
524 if ( dX > diff || dY > diff ) { 522 if ( dX > diff || dY > diff ) {
525 block = false; 523 block = false;
526 } 524 }
527 } 525 }
528 if ( !block ) 526 if ( !block )
529 performItemAction(viewportPos); 527 performItemAction(viewportPos);
530 } 528 }
531 } else { 529 } else {
532 if ( mActionType == SELECT ) { 530 if ( mActionType == SELECT ) {
533 performSelectAction( viewportPos ); 531 performSelectAction( viewportPos );
534 } 532 }
535 } 533 }
536 break; 534 break;
537 535
538 case QEvent::MouseButtonDblClick: 536 case QEvent::MouseButtonDblClick:
539 if (object == viewport()) { 537 if (object == viewport()) {
540 selectItem(0); 538 selectItem(0);
541 int x,y; 539 int x,y;
542 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 540 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
543 int gx,gy; 541 int gx,gy;
544 contentsToGrid(x,y,gx,gy); 542 contentsToGrid(x,y,gx,gy);
545 emit newEventSignal(gx,gy); 543 emit newEventSignal(gx,gy);
546 } else { 544 } else {
547 KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; 545 KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object;
548 selectItem(doubleClickedItem); 546 selectItem(doubleClickedItem);
549 if ( KOPrefs::instance()->mEditOnDoubleClick ) 547 if ( KOPrefs::instance()->mEditOnDoubleClick )
550 emit editIncidenceSignal(doubleClickedItem->incidence()); 548 emit editIncidenceSignal(doubleClickedItem->incidence());
551 else 549 else
552 emit showIncidenceSignal(doubleClickedItem->incidence()); 550 emit showIncidenceSignal(doubleClickedItem->incidence());
553 } 551 }
554 break; 552 break;
555 553
556 default: 554 default:
557 break; 555 break;
558 } 556 }
559 557
560 return true; 558 return true;
561} 559}
562 560
563void KOAgenda::newItem( int item ) 561void KOAgenda::newItem( int item )
564{ 562{
565 qDebug("new %d ", item);
566 if ( item == 1 ) { //new event 563 if ( item == 1 ) { //new event
567 newEventSignal(mStartCellX ,mStartCellY ); 564 newEventSignal(mStartCellX ,mStartCellY );
568 } 565 } else
569 if ( item == 2 ) { //new event 566 if ( item == 2 ) { //new event
570 newTodoSignal(mStartCellX ,mStartCellY ); 567 newTodoSignal(mStartCellX ,mStartCellY );
571 } 568 } else
569 {
570 QDate day = mSelectedDates[mStartCellX];
571 emit showDateView( item, day );
572 // 3Day view
573 // 4Week view
574 // 5Month view
575 // 6Journal view
576 }
572} 577}
573void KOAgenda::startSelectAction(QPoint viewportPos) 578void KOAgenda::startSelectAction(QPoint viewportPos)
574{ 579{
575 //emit newStartSelectSignal(); 580 //emit newStartSelectSignal();
576 581
577 mActionType = SELECT; 582 mActionType = SELECT;
578 583
579 int x,y; 584 int x,y;
580 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 585 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
581 int gx,gy; 586 int gx,gy;
582 contentsToGrid(x,y,gx,gy); 587 contentsToGrid(x,y,gx,gy);
583 588
584 mStartCellX = gx; 589 mStartCellX = gx;
585 mStartCellY = gy; 590 mStartCellY = gy;
586 mCurrentCellX = gx; 591 mCurrentCellX = gx;
587 mCurrentCellY = gy; 592 mCurrentCellY = gy;
588 593
589 // Store coordinates of old selection 594 // Store coordinates of old selection
590 int selectionX = mSelectionCellX * mGridSpacingX; 595 int selectionX = mSelectionCellX * mGridSpacingX;
591 int selectionYTop = mSelectionYTop; 596 int selectionYTop = mSelectionYTop;
592 int selectionHeight = mSelectionHeight; 597 int selectionHeight = mSelectionHeight;
593 598
594 // Store new selection 599 // Store new selection
595 mSelectionCellX = gx; 600 mSelectionCellX = gx;
596 mSelectionYTop = gy * mGridSpacingY; 601 mSelectionYTop = gy * mGridSpacingY;
597 mSelectionHeight = mGridSpacingY; 602 mSelectionHeight = mGridSpacingY;
598 603
599 // Clear old selection 604 // Clear old selection
600 repaintContents( selectionX, selectionYTop, 605 repaintContents( selectionX, selectionYTop,
601 mGridSpacingX, selectionHeight,false ); 606 mGridSpacingX, selectionHeight,false );
602 607
603 // Paint new selection 608 // Paint new selection
604 // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop, 609 // repaintContents( mSelectionCellX * mGridSpacingX, mSelectionYTop,
605 // mGridSpacingX, mSelectionHeight ); 610 // mGridSpacingX, mSelectionHeight );
606} 611}
607 612
608void KOAgenda::performSelectAction(QPoint viewportPos) 613void KOAgenda::performSelectAction(QPoint viewportPos)
609{ 614{
610 int x,y; 615 int x,y;
611 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 616 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
612 int gx,gy; 617 int gx,gy;
613 contentsToGrid(x,y,gx,gy); 618 contentsToGrid(x,y,gx,gy);
614 619
615 QPoint clipperPos = clipper()-> 620 QPoint clipperPos = clipper()->
616 mapFromGlobal(viewport()->mapToGlobal(viewportPos)); 621 mapFromGlobal(viewport()->mapToGlobal(viewportPos));
617 622
618 // Scroll if cursor was moved to upper or lower end of agenda. 623 // Scroll if cursor was moved to upper or lower end of agenda.
619 if (clipperPos.y() < mScrollBorderWidth) { 624 if (clipperPos.y() < mScrollBorderWidth) {
620 mScrollUpTimer.start(mScrollDelay); 625 mScrollUpTimer.start(mScrollDelay);
621 } else if (visibleHeight() - clipperPos.y() < 626 } else if (visibleHeight() - clipperPos.y() <
622 mScrollBorderWidth) { 627 mScrollBorderWidth) {
623 mScrollDownTimer.start(mScrollDelay); 628 mScrollDownTimer.start(mScrollDelay);
624 } else { 629 } else {
625 mScrollUpTimer.stop(); 630 mScrollUpTimer.stop();
626 mScrollDownTimer.stop(); 631 mScrollDownTimer.stop();
627 } 632 }
628 633
629 if ( gy > mCurrentCellY ) { 634 if ( gy > mCurrentCellY ) {
630 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop; 635 mSelectionHeight = ( gy + 1 ) * mGridSpacingY - mSelectionYTop;
631 636
632#if 0 637#if 0
633 // FIXME: Repaint only the newly selected region 638 // FIXME: Repaint only the newly selected region
634 repaintContents( mSelectionCellX * mGridSpacingX, 639 repaintContents( mSelectionCellX * mGridSpacingX,
635 mCurrentCellY + mGridSpacingY, 640 mCurrentCellY + mGridSpacingY,
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 12943d7..2069b22 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -83,128 +83,129 @@ class KOAgenda : public QScrollView
83 void contentsToGrid (int x, int y, int& gx, int& gy); 83 void contentsToGrid (int x, int y, int& gx, int& gy);
84 void gridToContents (int gx, int gy, int& x, int& y); 84 void gridToContents (int gx, int gy, int& x, int& y);
85 85
86 int timeToY (const QTime &time); 86 int timeToY (const QTime &time);
87 QTime gyToTime (int y); 87 QTime gyToTime (int y);
88 88
89 void setStartHour(int startHour); 89 void setStartHour(int startHour);
90 90
91 KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); 91 KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom);
92 KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); 92 KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd);
93 void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, 93 void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd,
94 int YTop,int YBottom); 94 int YTop,int YBottom);
95 95
96 void changeColumns(int columns); 96 void changeColumns(int columns);
97 97
98 int columns() { return mColumns; } 98 int columns() { return mColumns; }
99 int rows() { return mRows; } 99 int rows() { return mRows; }
100 100
101 int gridSpacingX() const { return mGridSpacingX; } 101 int gridSpacingX() const { return mGridSpacingX; }
102 int gridSpacingY() const { return mGridSpacingY; } 102 int gridSpacingY() const { return mGridSpacingY; }
103 103
104// virtual QSizePolicy sizePolicy() const; 104// virtual QSizePolicy sizePolicy() const;
105 105
106 void clear(); 106 void clear();
107 107
108 void clearSelection(); 108 void clearSelection();
109 void hideUnused(); 109 void hideUnused();
110 110
111 /** Calculates the minimum width */ 111 /** Calculates the minimum width */
112 virtual int minimumWidth() const; 112 virtual int minimumWidth() const;
113 /** Update configuration from preference settings */ 113 /** Update configuration from preference settings */
114 void updateConfig(); 114 void updateConfig();
115 115
116 void checkScrollBoundaries(); 116 void checkScrollBoundaries();
117 117
118 void setHolidayMask(QMemArray<bool> *); 118 void setHolidayMask(QMemArray<bool> *);
119 void setDateList(const DateList &selectedDates); 119 void setDateList(const DateList &selectedDates);
120 DateList dateList() const; 120 DateList dateList() const;
121 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); 121 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
122 void finishUpdate(); 122 void finishUpdate();
123 void printSelection(); 123 void printSelection();
124 void storePosition(); 124 void storePosition();
125 void restorePosition(); 125 void restorePosition();
126 126
127 127
128 public slots: 128 public slots:
129 void newItem( int ); 129 void newItem( int );
130 void moveChild( QWidget *, int, int ); 130 void moveChild( QWidget *, int, int );
131 void scrollUp(); 131 void scrollUp();
132 void scrollDown(); 132 void scrollDown();
133 void updateTodo( Todo * t, int , bool ); 133 void updateTodo( Todo * t, int , bool );
134 void popupAlarm(); 134 void popupAlarm();
135 135
136 void checkScrollBoundaries(int); 136 void checkScrollBoundaries(int);
137 137
138 /** Deselect selected items. This function does not emit any signals. */ 138 /** Deselect selected items. This function does not emit any signals. */
139 void deselectItem(); 139 void deselectItem();
140 /** Select item. If the argument is 0, the currently selected item gets 140 /** Select item. If the argument is 0, the currently selected item gets
141 deselected. This function emits the itemSelected(bool) signal to inform 141 deselected. This function emits the itemSelected(bool) signal to inform
142 about selection/deseelction of events. */ 142 about selection/deseelction of events. */
143 void selectItem(KOAgendaItem *); 143 void selectItem(KOAgendaItem *);
144 void finishResize(); 144 void finishResize();
145 145
146 signals: 146 signals:
147 void showDateView( int, QDate );
147 void newEventSignal(); 148 void newEventSignal();
148 void newEventSignal(int gx,int gy); 149 void newEventSignal(int gx,int gy);
149 void newTodoSignal(int gx,int gy); 150 void newTodoSignal(int gx,int gy);
150 void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); 151 void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
151 void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); 152 void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd);
152 void newStartSelectSignal(); 153 void newStartSelectSignal();
153 void showIncidenceSignal(Incidence *); 154 void showIncidenceSignal(Incidence *);
154 void editIncidenceSignal(Incidence *); 155 void editIncidenceSignal(Incidence *);
155 void deleteIncidenceSignal(Incidence *); 156 void deleteIncidenceSignal(Incidence *);
156 void showIncidencePopupSignal(Incidence *); 157 void showIncidencePopupSignal(Incidence *);
157 158
158 void itemModified(KOAgendaItem *item, int ); 159 void itemModified(KOAgendaItem *item, int );
159 void incidenceSelected(Incidence *); 160 void incidenceSelected(Incidence *);
160 161
161 void lowerYChanged(int); 162 void lowerYChanged(int);
162 void upperYChanged(int); 163 void upperYChanged(int);
163 164
164 void startDragSignal(Incidence *); 165 void startDragSignal(Incidence *);
165 void addToCalSignal(Incidence *, Incidence *); 166 void addToCalSignal(Incidence *, Incidence *);
166 void resizedSignal(); 167 void resizedSignal();
167 168
168 protected: 169 protected:
169 QPainter mPixPainter; 170 QPainter mPixPainter;
170 QPixmap mPaintPixmap; 171 QPixmap mPaintPixmap;
171 QPixmap mHighlightPixmap; 172 QPixmap mHighlightPixmap;
172 void drawContents(QPainter *p,int cx, int cy, int cw, int ch); 173 void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
173 virtual void resizeEvent ( QResizeEvent * ); 174 virtual void resizeEvent ( QResizeEvent * );
174 175
175 /** Handles mouse events. Called from eventFilter */ 176 /** Handles mouse events. Called from eventFilter */
176 virtual bool eventFilter_mouse ( QObject *, QMouseEvent * ); 177 virtual bool eventFilter_mouse ( QObject *, QMouseEvent * );
177 178
178 /** Start selecting time span. */ 179 /** Start selecting time span. */
179 void startSelectAction(QPoint viewportPos); 180 void startSelectAction(QPoint viewportPos);
180 181
181 /** Select time span. */ 182 /** Select time span. */
182 void performSelectAction(QPoint viewportPos); 183 void performSelectAction(QPoint viewportPos);
183 184
184 /** Emd selecting time span. */ 185 /** Emd selecting time span. */
185 void endSelectAction( bool emitNewEvent = false ); 186 void endSelectAction( bool emitNewEvent = false );
186 187
187 /** Start moving/resizing agenda item */ 188 /** Start moving/resizing agenda item */
188 void startItemAction(QPoint viewportPos); 189 void startItemAction(QPoint viewportPos);
189 190
190 /** Move/resize agenda item */ 191 /** Move/resize agenda item */
191 void performItemAction(QPoint viewportPos); 192 void performItemAction(QPoint viewportPos);
192 193
193 /** End moving/resizing agenda item */ 194 /** End moving/resizing agenda item */
194 void endItemAction(); 195 void endItemAction();
195 196
196 /** Set cursor, when no item action is in progress */ 197 /** Set cursor, when no item action is in progress */
197 void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos); 198 void setNoActionCursor(KOAgendaItem *moveItem,QPoint viewportPos);
198 199
199 /** Place agenda item in agenda and adjust other cells if necessary */ 200 /** Place agenda item in agenda and adjust other cells if necessary */
200 void placeSubCells(KOAgendaItem *placeItem); 201 void placeSubCells(KOAgendaItem *placeItem);
201 202
202 /** Process the keyevent, including the ignored keyevents of eventwidgets. 203 /** Process the keyevent, including the ignored keyevents of eventwidgets.
203 * Implements pgup/pgdn and cursor key navigation in the view. 204 * Implements pgup/pgdn and cursor key navigation in the view.
204 */ 205 */
205 void keyPressEvent( QKeyEvent * ); 206 void keyPressEvent( QKeyEvent * );
206 207
207 void calculateWorkingHours(); 208 void calculateWorkingHours();
208 209
209 virtual void contentsMousePressEvent ( QMouseEvent * ); 210 virtual void contentsMousePressEvent ( QMouseEvent * );
210 211
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 60ae41f..e0a1a21 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -424,128 +424,131 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
424 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 424 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
425 mAllDayAgenda->setFocusPolicy(NoFocus); 425 mAllDayAgenda->setFocusPolicy(NoFocus);
426 QWidget *dummyAllDayRight = new QWidget(mAllDayFrame); 426 QWidget *dummyAllDayRight = new QWidget(mAllDayFrame);
427 427
428 // Create event context menu for all day agenda 428 // Create event context menu for all day agenda
429 mAllDayAgendaPopup = eventPopup(); 429 mAllDayAgendaPopup = eventPopup();
430 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 430 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
431 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 431 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
432 432
433 // Create agenda frame 433 // Create agenda frame
434 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); 434 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
435 // QHBox *agendaFrame = new QHBox(splitterAgenda); 435 // QHBox *agendaFrame = new QHBox(splitterAgenda);
436 436
437 // create event indicator bars 437 // create event indicator bars
438 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 438 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
439 agendaLayout->addWidget(mEventIndicatorTop,0,1); 439 agendaLayout->addWidget(mEventIndicatorTop,0,1);
440 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 440 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
441 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 441 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
442 agendaFrame); 442 agendaFrame);
443 agendaLayout->addWidget(mEventIndicatorBottom,2,1); 443 agendaLayout->addWidget(mEventIndicatorBottom,2,1);
444 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 444 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
445 agendaLayout->addWidget(dummyAgendaRight,0,2); 445 agendaLayout->addWidget(dummyAgendaRight,0,2);
446 446
447 // Create time labels 447 // Create time labels
448 mTimeLabels = new TimeLabels(24,agendaFrame); 448 mTimeLabels = new TimeLabels(24,agendaFrame);
449 agendaLayout->addWidget(mTimeLabels,1,0); 449 agendaLayout->addWidget(mTimeLabels,1,0);
450 connect(mTimeLabels,SIGNAL( scaleChanged()), 450 connect(mTimeLabels,SIGNAL( scaleChanged()),
451 this,SLOT(updateConfig())); 451 this,SLOT(updateConfig()));
452 452
453 // Create agenda 453 // Create agenda
454 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 454 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
455 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); 455 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2);
456 agendaLayout->setColStretch(1,1); 456 agendaLayout->setColStretch(1,1);
457 mAgenda->setFocusPolicy(NoFocus); 457 mAgenda->setFocusPolicy(NoFocus);
458 // Create event context menu for agenda 458 // Create event context menu for agenda
459 mAgendaPopup = eventPopup(); 459 mAgendaPopup = eventPopup();
460 460
461 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 461 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
462 i18n("Toggle Alarm"),mAgenda, 462 i18n("Toggle Alarm"),mAgenda,
463 SLOT(popupAlarm()),true); 463 SLOT(popupAlarm()),true);
464 464
465 465
466 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 466 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
467 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 467 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
468 468
469 // make connections between dependent widgets 469 // make connections between dependent widgets
470 mTimeLabels->setAgenda(mAgenda); 470 mTimeLabels->setAgenda(mAgenda);
471 471
472 // Update widgets to reflect user preferences 472 // Update widgets to reflect user preferences
473 // updateConfig(); 473 // updateConfig();
474 474
475 // createDayLabels(); 475 // createDayLabels();
476 476
477 // these blank widgets make the All Day Event box line up with the agenda 477 // these blank widgets make the All Day Event box line up with the agenda
478 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 478 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
479 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 479 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
480 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 480 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
481 481
482 // Scrolling 482 // Scrolling
483 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 483 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
484 mTimeLabels, SLOT(positionChanged())); 484 mTimeLabels, SLOT(positionChanged()));
485 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 485 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
486 SLOT(setContentsPos(int))); 486 SLOT(setContentsPos(int)));
487 487
488 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
489 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
490
488 // Create/Show/Edit/Delete Event 491 // Create/Show/Edit/Delete Event
489 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 492 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
490 SLOT(newEvent(int,int))); 493 SLOT(newEvent(int,int)));
491 connect(mAgenda,SIGNAL(newTodoSignal(int,int)), 494 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
492 SLOT(newTodo(int,int))); 495 SLOT(newTodo(int,int)));
493 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 496 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
494 SLOT(newEvent(int,int,int,int))); 497 SLOT(newEvent(int,int,int,int)));
495 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 498 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
496 SLOT(newEventAllDay(int,int))); 499 SLOT(newEventAllDay(int,int)));
497 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), 500 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
498 SLOT(newTodoAllDay(int,int))); 501 SLOT(newTodoAllDay(int,int)));
499 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), 502 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
500 SLOT(newEventAllDay(int,int))); 503 SLOT(newEventAllDay(int,int)));
501 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 504 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
502 SLOT(newTimeSpanSelected(int,int,int,int))); 505 SLOT(newTimeSpanSelected(int,int,int,int)));
503 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 506 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
504 SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); 507 SLOT(newTimeSpanSelectedAllDay(int,int,int,int)));
505 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 508 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
506 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 509 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
507 510
508 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 511 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
509 SIGNAL(editIncidenceSignal(Incidence *))); 512 SIGNAL(editIncidenceSignal(Incidence *)));
510 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 513 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
511 SIGNAL(editIncidenceSignal(Incidence *))); 514 SIGNAL(editIncidenceSignal(Incidence *)));
512 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 515 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
513 SIGNAL(showIncidenceSignal(Incidence *))); 516 SIGNAL(showIncidenceSignal(Incidence *)));
514 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 517 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
515 SIGNAL(showIncidenceSignal(Incidence *))); 518 SIGNAL(showIncidenceSignal(Incidence *)));
516 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 519 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
517 SIGNAL(deleteIncidenceSignal(Incidence *))); 520 SIGNAL(deleteIncidenceSignal(Incidence *)));
518 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 521 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
519 SIGNAL(deleteIncidenceSignal(Incidence *))); 522 SIGNAL(deleteIncidenceSignal(Incidence *)));
520 523
521 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 524 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
522 SLOT(updateEventDates(KOAgendaItem *, int ))); 525 SLOT(updateEventDates(KOAgendaItem *, int )));
523 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 526 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
524 SLOT(updateEventDates(KOAgendaItem *, int))); 527 SLOT(updateEventDates(KOAgendaItem *, int)));
525 528
526 // event indicator update 529 // event indicator update
527 connect(mAgenda,SIGNAL(lowerYChanged(int)), 530 connect(mAgenda,SIGNAL(lowerYChanged(int)),
528 SLOT(updateEventIndicatorTop(int))); 531 SLOT(updateEventIndicatorTop(int)));
529 connect(mAgenda,SIGNAL(upperYChanged(int)), 532 connect(mAgenda,SIGNAL(upperYChanged(int)),
530 SLOT(updateEventIndicatorBottom(int))); 533 SLOT(updateEventIndicatorBottom(int)));
531 // drag signals 534 // drag signals
532 /* 535 /*
533 connect(mAgenda,SIGNAL(startDragSignal(Event *)), 536 connect(mAgenda,SIGNAL(startDragSignal(Event *)),
534 SLOT(startDrag(Event *))); 537 SLOT(startDrag(Event *)));
535 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), 538 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)),
536 SLOT(startDrag(Event *))); 539 SLOT(startDrag(Event *)));
537 */ 540 */
538 // synchronize selections 541 // synchronize selections
539 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 542 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
540 mAllDayAgenda, SLOT( deselectItem() ) ); 543 mAllDayAgenda, SLOT( deselectItem() ) );
541 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 544 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
542 mAgenda, SLOT( deselectItem() ) ); 545 mAgenda, SLOT( deselectItem() ) );
543 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 546 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
544 SIGNAL( incidenceSelected( Incidence * ) ) ); 547 SIGNAL( incidenceSelected( Incidence * ) ) );
545 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 548 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
546 SIGNAL( incidenceSelected( Incidence * ) ) ); 549 SIGNAL( incidenceSelected( Incidence * ) ) );
547 connect( mAgenda, SIGNAL( resizedSignal() ), 550 connect( mAgenda, SIGNAL( resizedSignal() ),
548 SLOT( updateConfig( ) ) ); 551 SLOT( updateConfig( ) ) );
549 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), 552 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
550 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 553 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
551 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 554 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 01d74a1..7774fbe 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -121,128 +121,129 @@ class KOAgendaView : public KOEventView {
121 KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 ); 121 KOAgendaView(Calendar *cal,QWidget *parent = 0,const char *name = 0 );
122 virtual ~KOAgendaView(); 122 virtual ~KOAgendaView();
123 void setStartHour( int ); 123 void setStartHour( int );
124 void toggleAllDay(); 124 void toggleAllDay();
125 125
126 126
127 /** Returns maximum number of days supported by the koagendaview */ 127 /** Returns maximum number of days supported by the koagendaview */
128 virtual int maxDatesHint(); 128 virtual int maxDatesHint();
129 129
130 /** Returns number of currently shown dates. */ 130 /** Returns number of currently shown dates. */
131 virtual int currentDateCount(); 131 virtual int currentDateCount();
132 132
133 /** returns the currently selected events */ 133 /** returns the currently selected events */
134 virtual QPtrList<Incidence> selectedIncidences(); 134 virtual QPtrList<Incidence> selectedIncidences();
135 135
136 /** returns the currently selected events */ 136 /** returns the currently selected events */
137 virtual DateList selectedDates(); 137 virtual DateList selectedDates();
138 138
139 /** Remove all events from view */ 139 /** Remove all events from view */
140 void clearView(); 140 void clearView();
141 KOAgenda *agenda() { return mAgenda;} 141 KOAgenda *agenda() { return mAgenda;}
142 virtual void printPreview(CalPrinter *calPrinter, 142 virtual void printPreview(CalPrinter *calPrinter,
143 const QDate &, const QDate &); 143 const QDate &, const QDate &);
144 144
145 /** start-datetime of selection */ 145 /** start-datetime of selection */
146 QDateTime selectionStart() {return mTimeSpanBegin;} 146 QDateTime selectionStart() {return mTimeSpanBegin;}
147 /** end-datetime of selection */ 147 /** end-datetime of selection */
148 QDateTime selectionEnd() {return mTimeSpanEnd;} 148 QDateTime selectionEnd() {return mTimeSpanEnd;}
149 /** returns true if selection is for whole day */ 149 /** returns true if selection is for whole day */
150 bool selectedIsAllDay() {return mTimeSpanInAllDay;} 150 bool selectedIsAllDay() {return mTimeSpanInAllDay;}
151 /** make selected start/end invalid */ 151 /** make selected start/end invalid */
152 void deleteSelectedDateTime(); 152 void deleteSelectedDateTime();
153 void repaintAgenda(); 153 void repaintAgenda();
154 public slots: 154 public slots:
155 virtual void updateView(); 155 virtual void updateView();
156 virtual void updateConfig(); 156 virtual void updateConfig();
157 virtual void showDates(const QDate &start, const QDate &end); 157 virtual void showDates(const QDate &start, const QDate &end);
158 virtual void showEvents(QPtrList<Event> eventList); 158 virtual void showEvents(QPtrList<Event> eventList);
159 159
160 void updateTodo( Todo *, int ); 160 void updateTodo( Todo *, int );
161 void changeEventDisplay(Event *, int); 161 void changeEventDisplay(Event *, int);
162 162
163 void clearSelection(); 163 void clearSelection();
164 164
165 void newTodo(int gx,int gy); 165 void newTodo(int gx,int gy);
166 void newEvent(int gx,int gy); 166 void newEvent(int gx,int gy);
167 void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd); 167 void newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd);
168 void newEventAllDay(int gx, int gy); 168 void newEventAllDay(int gx, int gy);
169 void newTodoAllDay(int gx, int gy); 169 void newTodoAllDay(int gx, int gy);
170 170
171 void startDrag(Event *); 171 void startDrag(Event *);
172 172
173 void readSettings(); 173 void readSettings();
174 void readSettings(KConfig *); 174 void readSettings(KConfig *);
175 void writeSettings(KConfig *); 175 void writeSettings(KConfig *);
176 176
177 void setContentsPos(int y); 177 void setContentsPos(int y);
178 178
179 void setExpandedButton( bool expanded ); 179 void setExpandedButton( bool expanded );
180 void scrollOneHourUp(); 180 void scrollOneHourUp();
181 void scrollOneHourDown(); 181 void scrollOneHourDown();
182 void addToCalSlot(Incidence *, Incidence *); 182 void addToCalSlot(Incidence *, Incidence *);
183 183
184 signals: 184 signals:
185 void showDateView( int, QDate );
185 void newTodoSignal( QDateTime ,bool ); 186 void newTodoSignal( QDateTime ,bool );
186 void toggleExpand(); 187 void toggleExpand();
187 void todoMoved( Todo *, int ); 188 void todoMoved( Todo *, int );
188 void incidenceChanged(Incidence * , int ); 189 void incidenceChanged(Incidence * , int );
189 // void cloneIncidenceSignal(Incidence *); 190 // void cloneIncidenceSignal(Incidence *);
190 191
191 protected: 192 protected:
192 bool mBlockUpdating; 193 bool mBlockUpdating;
193 int mUpcomingWidth; 194 int mUpcomingWidth;
194 /** Fill agenda beginning with date startDate */ 195 /** Fill agenda beginning with date startDate */
195 void fillAgenda(const QDate &startDate); 196 void fillAgenda(const QDate &startDate);
196 void resizeEvent( QResizeEvent* e ); 197 void resizeEvent( QResizeEvent* e );
197 /** Fill agenda using the current set value for the start date */ 198 /** Fill agenda using the current set value for the start date */
198 void fillAgenda(); 199 void fillAgenda();
199 200
200 /** Create labels for the selected dates. */ 201 /** Create labels for the selected dates. */
201 void createDayLabels(); 202 void createDayLabels();
202 203
203 /** 204 /**
204 Set the masks on the agenda widgets indicating, which days are holidays. 205 Set the masks on the agenda widgets indicating, which days are holidays.
205 */ 206 */
206 void setHolidayMasks(); 207 void setHolidayMasks();
207 208
208 protected slots: 209 protected slots:
209 /** Update event belonging to agenda item */ 210 /** Update event belonging to agenda item */
210 void updateEventDates(KOAgendaItem *item, int mode = -1); 211 void updateEventDates(KOAgendaItem *item, int mode = -1);
211 //void updateMovedTodo(); 212 //void updateMovedTodo();
212 213
213 void updateEventIndicatorTop(int newY); 214 void updateEventIndicatorTop(int newY);
214 void updateEventIndicatorBottom(int newY); 215 void updateEventIndicatorBottom(int newY);
215 216
216 /** Updates data for selected timespan */ 217 /** Updates data for selected timespan */
217 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); 218 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
218 /** Updates data for selected timespan for all day event*/ 219 /** Updates data for selected timespan for all day event*/
219 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); 220 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
220 221
221 private: 222 private:
222 // view widgets 223 // view widgets
223 QFrame *mDayLabels; 224 QFrame *mDayLabels;
224 QHBox *mDayLabelsFrame; 225 QHBox *mDayLabelsFrame;
225 QBoxLayout *mLayoutDayLabels; 226 QBoxLayout *mLayoutDayLabels;
226 QFrame *mAllDayFrame; 227 QFrame *mAllDayFrame;
227 KOAgenda *mAllDayAgenda; 228 KOAgenda *mAllDayAgenda;
228 KOAgenda *mAgenda; 229 KOAgenda *mAgenda;
229 TimeLabels *mTimeLabels; 230 TimeLabels *mTimeLabels;
230 QWidget *mDummyAllDayLeft; 231 QWidget *mDummyAllDayLeft;
231 232
232 KDGanttMinimizeSplitter* mSplitterAgenda; 233 KDGanttMinimizeSplitter* mSplitterAgenda;
233 QPushButton *mExpandButton; 234 QPushButton *mExpandButton;
234 235
235 DateList mSelectedDates; // List of dates to be displayed 236 DateList mSelectedDates; // List of dates to be displayed
236 int mViewType; 237 int mViewType;
237 238
238 bool mWeekStartsMonday; 239 bool mWeekStartsMonday;
239 int mStartHour; 240 int mStartHour;
240 241
241 KOEventPopupMenu *mAgendaPopup; 242 KOEventPopupMenu *mAgendaPopup;
242 KOEventPopupMenu *mAllDayAgendaPopup; 243 KOEventPopupMenu *mAllDayAgendaPopup;
243 244
244 EventIndicator *mEventIndicatorTop; 245 EventIndicator *mEventIndicatorTop;
245 EventIndicator *mEventIndicatorBottom; 246 EventIndicator *mEventIndicatorBottom;
246 247
247 QMemArray<int> mMinY; 248 QMemArray<int> mMinY;
248 QMemArray<int> mMaxY; 249 QMemArray<int> mMaxY;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a88276e..6da4799 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -37,128 +37,176 @@
37#include "datenavigator.h" 37#include "datenavigator.h"
38#include "kotodoview.h" 38#include "kotodoview.h"
39#include "koagendaview.h" 39#include "koagendaview.h"
40#include "kodialogmanager.h" 40#include "kodialogmanager.h"
41#include "komonthview.h" 41#include "komonthview.h"
42#include "kolistview.h" 42#include "kolistview.h"
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44#include "kojournalview.h" 44#include "kojournalview.h"
45#include "kotimespanview.h" 45#include "kotimespanview.h"
46#include "koprefs.h" 46#include "koprefs.h"
47#include "navigatorbar.h" 47#include "navigatorbar.h"
48#include "kdatenavigator.h" 48#include "kdatenavigator.h"
49 49
50#include "koviewmanager.h" 50#include "koviewmanager.h"
51//extern bool externFlagMonthviewBlockPainting; 51//extern bool externFlagMonthviewBlockPainting;
52 52
53//bool globalFlagBlockPainting = false; 53//bool globalFlagBlockPainting = false;
54int globalFlagBlockAgenda = 0; 54int globalFlagBlockAgenda = 0;
55int globalFlagBlockLabel = 0; 55int globalFlagBlockLabel = 0;
56int globalFlagBlockAgendaItemPaint = 1; 56int globalFlagBlockAgendaItemPaint = 1;
57int globalFlagBlockAgendaItemUpdate = 1; 57int globalFlagBlockAgendaItemUpdate = 1;
58 58
59 59
60KOViewManager::KOViewManager( CalendarView *mainView ) : 60KOViewManager::KOViewManager( CalendarView *mainView ) :
61 QObject(), mMainView( mainView ) 61 QObject(), mMainView( mainView )
62{ 62{
63 mCurrentView = 0; 63 mCurrentView = 0;
64 64
65 mWhatsNextView = 0; 65 mWhatsNextView = 0;
66 mTodoView = 0; 66 mTodoView = 0;
67 mAgendaView = 0; 67 mAgendaView = 0;
68 mMonthView = 0; 68 mMonthView = 0;
69 mListView = 0; 69 mListView = 0;
70 mJournalView = 0; 70 mJournalView = 0;
71 mTimeSpanView = 0; 71 mTimeSpanView = 0;
72 mCurrentAgendaView = 0 ; 72 mCurrentAgendaView = 0 ;
73 mFlagShowNextxDays = false; 73 mFlagShowNextxDays = false;
74} 74}
75 75
76KOViewManager::~KOViewManager() 76KOViewManager::~KOViewManager()
77{ 77{
78} 78}
79 79
80 80
81KOrg::BaseView *KOViewManager::currentView() 81KOrg::BaseView *KOViewManager::currentView()
82{ 82{
83 return mCurrentView; 83 return mCurrentView;
84} 84}
85 85
86void KOViewManager::readSettings(KConfig *config) 86void KOViewManager::readSettings(KConfig *config)
87{ 87{
88 config->setGroup("General"); 88 config->setGroup("General");
89 QString view = config->readEntry("Current View"); 89 QString view = config->readEntry("Current View");
90 if (view == "WhatsNext") showWhatsNextView(); 90 if (view == "WhatsNext") showWhatsNextView();
91 else if (view == "Month") showMonthView(); 91 else if (view == "Month") showMonthView();
92 else if (view == "List") showListView(); 92 else if (view == "List") showListView();
93 else if (view == "Journal") showJournalView(); 93 else if (view == "Journal") showJournalView();
94 else if (view == "TimeSpan") showTimeSpanView(); 94 else if (view == "TimeSpan") showTimeSpanView();
95 else if (view == "Todo") showTodoView(); 95 else if (view == "Todo") showTodoView();
96 else { 96 else {
97 showAgendaView(); 97 showAgendaView();
98 } 98 }
99} 99}
100 100
101
102void KOViewManager::showDateView( int view, QDate date)
103{
104
105 qDebug("date %d %s", view, date.toString().latin1());
106#if 0
107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
112#endif
113 if ( view == 3 ) {
114 mMainView->showDay( date );
115 } else if (view == 4 ) {
116 mMainView->dateNavigator()->selectDates( date, 7 );
117 } else if (view == 5 ) {
118 mMainView->dateNavigator()->selectDates( date, 14);
119 } else if (view == 6 ) {
120 showMonthView();
121 mMainView->dateNavigator()->selectMonthByDate( date );
122 mMainView->dateNavigator()->selectDate( date );
123 } else if (view == 7 ) {
124 mMainView->dateNavigator()->selectDate( date );
125 showJournalView();
126 } else if (view == 8 ) {
127 globalFlagBlockAgenda = 1;
128 if ( mCurrentAgendaView != 3 )
129 mCurrentAgendaView = -1;
130 showAgendaView(KOPrefs::instance()->mFullViewMonth);
131 globalFlagBlockAgenda = 2;
132 mMainView->dateNavigator()->selectDates( date ,
133 KOPrefs::instance()->mNextXDays );
134 mFlagShowNextxDays = true;
135 mCurrentAgendaView = 3 ;
136 }
137
138#if 0
139 dateNavigator()->blockSignals( true );
140 dateNavigator()->selectDate( d );
141 dateNavigator()->blockSignals( false );
142 mViewManager->showDayView();
143#endif
144
145}
146
147
148
101void KOViewManager::writeSettings(KConfig *config) 149void KOViewManager::writeSettings(KConfig *config)
102{ 150{
103 config->setGroup("General"); 151 config->setGroup("General");
104 152
105 QString view; 153 QString view;
106 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 154 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
107 else if (mCurrentView == mMonthView) view = "Month"; 155 else if (mCurrentView == mMonthView) view = "Month";
108 else if (mCurrentView == mListView) view = "List"; 156 else if (mCurrentView == mListView) view = "List";
109 else if (mCurrentView == mJournalView) view = "Journal"; 157 else if (mCurrentView == mJournalView) view = "Journal";
110 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 158 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
111 else if (mCurrentView == mTodoView) view = "Todo"; 159 else if (mCurrentView == mTodoView) view = "Todo";
112 else view = "Agenda"; 160 else view = "Agenda";
113 161
114 config->writeEntry("Current View",view); 162 config->writeEntry("Current View",view);
115 163
116 if (mAgendaView) { 164 if (mAgendaView) {
117 mAgendaView->writeSettings(config); 165 mAgendaView->writeSettings(config);
118 } 166 }
119 if (mTimeSpanView) { 167 if (mTimeSpanView) {
120 mTimeSpanView->writeSettings(config); 168 mTimeSpanView->writeSettings(config);
121 } 169 }
122 if (mListView) { 170 if (mListView) {
123 mListView->writeSettings(config); 171 mListView->writeSettings(config);
124 } 172 }
125 if (mTodoView) { 173 if (mTodoView) {
126 mTodoView->saveLayout(config,"Todo View"); 174 mTodoView->saveLayout(config,"Todo View");
127 } 175 }
128} 176}
129 177
130void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 178void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
131{ 179{
132 180
133 //mFlagShowNextxDays = false; 181 //mFlagShowNextxDays = false;
134 //if(view == mCurrentView) return; 182 //if(view == mCurrentView) return;
135 if ( view == 0 ) { 183 if ( view == 0 ) {
136 view = mCurrentView; 184 view = mCurrentView;
137 if ( view == 0 ) 185 if ( view == 0 )
138 return; 186 return;
139 } 187 }
140 bool full = fullScreen; 188 bool full = fullScreen;
141 if(view == mCurrentView && view != mWhatsNextView ) { 189 if(view == mCurrentView && view != mWhatsNextView ) {
142 if ( mCurrentAgendaView < 0 ) 190 if ( mCurrentAgendaView < 0 )
143 return; 191 return;
144 full = mMainView->leftFrame()->isVisible(); 192 full = mMainView->leftFrame()->isVisible();
145 } else { 193 } else {
146 mCurrentView = view; 194 mCurrentView = view;
147 195
148 // bool full = fullScreen; 196 // bool full = fullScreen;
149 bool isFull = !mMainView->leftFrame()->isVisible(); 197 bool isFull = !mMainView->leftFrame()->isVisible();
150 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 198 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
151 full = true; 199 full = true;
152 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 200 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
153 full = false; 201 full = false;
154 } 202 }
155 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 203 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
156 //raiseCurrentView( full ); 204 //raiseCurrentView( full );
157 mMainView->processIncidenceSelection( 0 ); 205 mMainView->processIncidenceSelection( 0 );
158 mMainView->updateView(); 206 mMainView->updateView();
159 raiseCurrentView( full ); 207 raiseCurrentView( full );
160 mMainView->adaptNavigationUnits(); 208 mMainView->adaptNavigationUnits();
161} 209}
162 210
163void KOViewManager::raiseCurrentView( bool fullScreen ) 211void KOViewManager::raiseCurrentView( bool fullScreen )
164{ 212{
@@ -247,129 +295,129 @@ void KOViewManager::showWhatsNextView()
247 } 295 }
248 globalFlagBlockAgenda = 1; 296 globalFlagBlockAgenda = 1;
249 showView(mWhatsNextView, true ); 297 showView(mWhatsNextView, true );
250 //mWhatsNextView->updateView(); 298 //mWhatsNextView->updateView();
251 299
252} 300}
253 301
254void KOViewManager::showListView() 302void KOViewManager::showListView()
255{ 303{
256 if (!mListView) { 304 if (!mListView) {
257 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 305 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
258 addView(mListView); 306 addView(mListView);
259 307
260 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 308 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
261 mMainView, SLOT(showIncidence(Incidence *))); 309 mMainView, SLOT(showIncidence(Incidence *)));
262 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 310 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
263 mMainView, SLOT(editIncidence(Incidence *))); 311 mMainView, SLOT(editIncidence(Incidence *)));
264 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 312 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
265 mMainView, SLOT(deleteIncidence(Incidence *))); 313 mMainView, SLOT(deleteIncidence(Incidence *)));
266 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 314 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
267 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 315 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
268 connect( mListView, SIGNAL( signalNewEvent() ), 316 connect( mListView, SIGNAL( signalNewEvent() ),
269 mMainView, SLOT( newEvent() ) ); 317 mMainView, SLOT( newEvent() ) );
270 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 318 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
271 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 319 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
272 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 320 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
273 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 321 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
274 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 322 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
275 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 323 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
276 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 324 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
277 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 325 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
278 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 326 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
279 } 327 }
280 // bool temp = mFlagShowNextxDays; 328 // bool temp = mFlagShowNextxDays;
281 //globalFlagBlockPainting = true; 329 //globalFlagBlockPainting = true;
282 globalFlagBlockAgenda = 1; 330 globalFlagBlockAgenda = 1;
283 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 331 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
284 mMainView->setBlockShowDates( true ); 332 mMainView->setBlockShowDates( true );
285 mMainView->dateNavigator()->selectMonth(); 333 mMainView->dateNavigator()->selectMonth();
286 mMainView->setBlockShowDates( false ); 334 mMainView->setBlockShowDates( false );
287 } 335 }
288 showView(mListView, KOPrefs::instance()->mFullViewTodo); 336 showView(mListView, KOPrefs::instance()->mFullViewTodo);
289 //mFlagShowNextxDays = temp; 337 //mFlagShowNextxDays = temp;
290} 338}
291 339
292void KOViewManager::showAgendaView( bool fullScreen ) 340void KOViewManager::showAgendaView( bool fullScreen )
293{ 341{
294 342
295 mMainView->dialogManager()->hideSearchDialog(); 343 mMainView->dialogManager()->hideSearchDialog();
296 // qDebug("KOViewManager::showAgendaView "); 344 // qDebug("KOViewManager::showAgendaView ");
297 bool full; 345 bool full;
298 full = fullScreen; 346 full = fullScreen;
299 if (!mAgendaView) { 347 if (!mAgendaView) {
300 full = false; 348 full = false;
301 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 349 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
302 addView(mAgendaView); 350 addView(mAgendaView);
303#ifndef DESKTOP_VERSION 351#ifndef DESKTOP_VERSION
304 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 352 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
305#endif 353#endif
306 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 354 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
307 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 355 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
308 356
309 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 357 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
310 358
311 359 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
312 360
313 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 361 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
314 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 362 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
315 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 363 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
316 mMainView, SLOT(newEvent(QDateTime))); 364 mMainView, SLOT(newEvent(QDateTime)));
317 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 365 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
318 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 366 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
319 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 367 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
320 mMainView, SLOT(newEvent(QDate))); 368 mMainView, SLOT(newEvent(QDate)));
321 369
322 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 370 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
323 mMainView, SLOT(editIncidence(Incidence *))); 371 mMainView, SLOT(editIncidence(Incidence *)));
324 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 372 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
325 mMainView, SLOT(showIncidence(Incidence *))); 373 mMainView, SLOT(showIncidence(Incidence *)));
326 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 374 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
327 mMainView, SLOT(deleteIncidence(Incidence *))); 375 mMainView, SLOT(deleteIncidence(Incidence *)));
328 376
329 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 377 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
330 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 378 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
331 379
332 connect(mAgendaView, SIGNAL( toggleExpand() ), 380 connect(mAgendaView, SIGNAL( toggleExpand() ),
333 mMainView, SLOT( toggleExpand() ) ); 381 mMainView, SLOT( toggleExpand() ) );
334 382
335 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), 383 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
336 mAgendaView, SLOT( setExpandedButton( bool ) ) ); 384 mAgendaView, SLOT( setExpandedButton( bool ) ) );
337 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 385 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
338 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 386 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
339 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 387 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
340 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 388 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
341 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 389 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
342 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 390 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
343 SLOT( updateTodo( Todo *, int ) ) ); 391 SLOT( updateTodo( Todo *, int ) ) );
344 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 392 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
345 mMainView, SIGNAL( todoModified( Todo *, int ))); 393 mMainView, SIGNAL( todoModified( Todo *, int )));
346 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 394 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
347 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 395 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
348 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 396 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
349 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 397 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
350 mAgendaView->readSettings(); 398 mAgendaView->readSettings();
351 mAgendaView->updateConfig(); 399 mAgendaView->updateConfig();
352 } 400 }
353 401
354 showView( mAgendaView, full); 402 showView( mAgendaView, full);
355 403
356} 404}
357 405
358void KOViewManager::showDayView() 406void KOViewManager::showDayView()
359{ 407{
360 mFlagShowNextxDays = false; 408 mFlagShowNextxDays = false;
361 globalFlagBlockLabel = 1; 409 globalFlagBlockLabel = 1;
362 globalFlagBlockAgenda = 1; 410 globalFlagBlockAgenda = 1;
363 if ( mCurrentAgendaView != 1 ) 411 if ( mCurrentAgendaView != 1 )
364 mCurrentAgendaView = -1; 412 mCurrentAgendaView = -1;
365 showAgendaView(); 413 showAgendaView();
366 qApp->processEvents(); 414 qApp->processEvents();
367 globalFlagBlockAgenda = 2; 415 globalFlagBlockAgenda = 2;
368 globalFlagBlockLabel = 0; 416 globalFlagBlockLabel = 0;
369 mMainView->dateNavigator()->selectDates( 1 ); 417 mMainView->dateNavigator()->selectDates( 1 );
370 mCurrentAgendaView = 1 ; 418 mCurrentAgendaView = 1 ;
371 419
372} 420}
373 421
374void KOViewManager::showWorkWeekView() 422void KOViewManager::showWorkWeekView()
375{ 423{
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index c8c7a7a..137eb2d 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -21,97 +21,98 @@
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef KOVIEWMANAGER_H 24#ifndef KOVIEWMANAGER_H
25#define KOVIEWMANAGER_H 25#define KOVIEWMANAGER_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28 28
29#include <korganizer/baseview.h> 29#include <korganizer/baseview.h>
30 30
31class CalendarView; 31class CalendarView;
32 32
33class KOListView; 33class KOListView;
34class KOAgendaView; 34class KOAgendaView;
35class KOMonthView; 35class KOMonthView;
36class KOTimeSpanView; 36class 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 ); 71 void raiseCurrentView( bool fullScreen = 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 showDateView( int, QDate );
85 void updateView(); 86 void updateView();
86 void showWhatsNextView(); 87 void showWhatsNextView();
87 void showListView(); 88 void showListView();
88 void showAgendaView( bool fullScreen = false ); 89 void showAgendaView( bool fullScreen = false );
89 void showDayView(); 90 void showDayView();
90 void showWorkWeekView(); 91 void showWorkWeekView();
91 void showWeekView(); 92 void showWeekView();
92 void showNextXView(); 93 void showNextXView();
93 void showMonthView(); 94 void showMonthView();
94 void showTodoView(); 95 void showTodoView();
95 void showJournalView(); 96 void showJournalView();
96 void showTimeSpanView(); 97 void showTimeSpanView();
97 98
98 private: 99 private:
99 CalendarView *mMainView; 100 CalendarView *mMainView;
100 101
101 int mCurrentAgendaView; 102 int mCurrentAgendaView;
102 KOAgendaView *mAgendaView; 103 KOAgendaView *mAgendaView;
103 KOListView *mListView; 104 KOListView *mListView;
104 KOMonthView *mMonthView; 105 KOMonthView *mMonthView;
105 KOTodoView *mTodoView; 106 KOTodoView *mTodoView;
106 KOWhatsNextView *mWhatsNextView; 107 KOWhatsNextView *mWhatsNextView;
107 KOJournalView *mJournalView; 108 KOJournalView *mJournalView;
108 KOTimeSpanView *mTimeSpanView; 109 KOTimeSpanView *mTimeSpanView;
109 110
110 KOrg::BaseView *mCurrentView; // currently active event view 111 KOrg::BaseView *mCurrentView; // currently active event view
111 112
112 int mAgendaViewMode; 113 int mAgendaViewMode;
113 bool mFlagShowNextxDays; 114 bool mFlagShowNextxDays;
114 115
115}; 116};
116 117
117#endif 118#endif