summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp10
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/koviewmanager.cpp7
3 files changed, 18 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 0d36946..13d8398 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1524,24 +1524,34 @@ void KOAgendaView::scrollOneHourUp()
1524 mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); 1524 mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 );
1525} 1525}
1526void KOAgendaView::scrollOneHourDown() 1526void KOAgendaView::scrollOneHourDown()
1527{ 1527{
1528 mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); 1528 mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 );
1529} 1529}
1530 1530
1531void KOAgendaView::setStartHour( int h ) 1531void KOAgendaView::setStartHour( int h )
1532{ 1532{
1533 mAgenda->setStartHour( h ); 1533 mAgenda->setStartHour( h );
1534 1534
1535} 1535}
1536void KOAgendaView::setInitStartHour()
1537{
1538
1539 if ( KOPrefs::instance()->mCenterOnCurrentTime )
1540 setStartHour( QTime::currentTime ().hour() );
1541 else
1542 setStartHour( KOPrefs::instance()->mDayBegins );
1543
1544}
1545
1536 1546
1537void KOAgendaView::updateTodo( Todo * t, int ) 1547void KOAgendaView::updateTodo( Todo * t, int )
1538{ 1548{
1539 if ( !isVisible() ) 1549 if ( !isVisible() )
1540 return; 1550 return;
1541 bool remove = false; 1551 bool remove = false;
1542 bool removeAD = false; 1552 bool removeAD = false;
1543 QDate da; 1553 QDate da;
1544 if ( t->hasCompletedDate() ) 1554 if ( t->hasCompletedDate() )
1545 da = t->completed().date(); 1555 da = t->completed().date();
1546 else 1556 else
1547 da = t->dtDue().date(); 1557 da = t->dtDue().date();
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index 4a058ce..8b8bac0 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -168,24 +168,25 @@ class KOAgendaView : public KOEventView {
168 const QDate &, const QDate &); 168 const QDate &, const QDate &);
169 169
170 /** start-datetime of selection */ 170 /** start-datetime of selection */
171 QDateTime selectionStart() {return mTimeSpanBegin;} 171 QDateTime selectionStart() {return mTimeSpanBegin;}
172 /** end-datetime of selection */ 172 /** end-datetime of selection */
173 QDateTime selectionEnd() {return mTimeSpanEnd;} 173 QDateTime selectionEnd() {return mTimeSpanEnd;}
174 /** returns true if selection is for whole day */ 174 /** returns true if selection is for whole day */
175 bool selectedIsAllDay() {return mTimeSpanInAllDay;} 175 bool selectedIsAllDay() {return mTimeSpanInAllDay;}
176 /** make selected start/end invalid */ 176 /** make selected start/end invalid */
177 void deleteSelectedDateTime(); 177 void deleteSelectedDateTime();
178 void repaintAgenda(); 178 void repaintAgenda();
179 public slots: 179 public slots:
180 void setInitStartHour();
180 virtual void updateView(); 181 virtual void updateView();
181 virtual void updateConfig(); 182 virtual void updateConfig();
182 virtual void showDates(const QDate &start, const QDate &end); 183 virtual void showDates(const QDate &start, const QDate &end);
183 virtual void showEvents(QPtrList<Event> eventList); 184 virtual void showEvents(QPtrList<Event> eventList);
184 185
185 void updateTodo( Todo *, int ); 186 void updateTodo( Todo *, int );
186 void changeEventDisplay(Event *, int); 187 void changeEventDisplay(Event *, int);
187 188
188 void clearSelection(); 189 void clearSelection();
189 190
190 void newTodo(int gx,int gy); 191 void newTodo(int gx,int gy);
191 void newEvent(int gx,int gy); 192 void newEvent(int gx,int gy);
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index b0f26d1..f8f6c1d 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -85,25 +85,32 @@ KOrg::BaseView *KOViewManager::currentView()
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 config->setGroup( "Views" );
98 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
99 mCurrentAgendaView = dateCount;
97 showAgendaView(); 100 showAgendaView();
101 mCurrentAgendaView = dateCount;
102#ifdef DESKTOP_VERSION
103 QTimer::singleShot( 1000, mAgendaView, SLOT ( setInitStartHour() ) );
104#endif
98 } 105 }
99} 106}
100 107
101void KOViewManager::showDateView( int view, QDate date) 108void KOViewManager::showDateView( int view, QDate date)
102{ 109{
103 static int lastMode = 0; 110 static int lastMode = 0;
104 static int lastCount = 0; 111 static int lastCount = 0;
105 static bool lastNDMode = false; 112 static bool lastNDMode = false;
106 static QDate lastDate; 113 static QDate lastDate;
107 //qDebug("date %d %s", view, date.toString().latin1()); 114 //qDebug("date %d %s", view, date.toString().latin1());
108 115
109 if (view != 9) 116 if (view != 9)