-rw-r--r-- | korganizer/koviewmanager.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 6afd203..8aa0697 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -77,101 +77,98 @@ KOViewManager::~KOViewManager() | |||
77 | { | 77 | { |
78 | } | 78 | } |
79 | 79 | ||
80 | 80 | ||
81 | KOrg::BaseView *KOViewManager::currentView() | 81 | KOrg::BaseView *KOViewManager::currentView() |
82 | { | 82 | { |
83 | return mCurrentView; | 83 | return mCurrentView; |
84 | } | 84 | } |
85 | 85 | ||
86 | void KOViewManager::readSettings(KConfig *config) | 86 | void 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 | void KOViewManager::showDateView( int view, QDate date) | 101 | void KOViewManager::showDateView( int view, QDate date) |
102 | { | 102 | { |
103 | static int lastMode = 0; | 103 | static int lastMode = 0; |
104 | static int lastCount = 0; | 104 | static int lastCount = 0; |
105 | static bool lastNDMode = false; | 105 | static bool lastNDMode = false; |
106 | static QDate lastDate; | 106 | static QDate lastDate; |
107 | //qDebug("date %d %s", view, date.toString().latin1()); | 107 | //qDebug("date %d %s", view, date.toString().latin1()); |
108 | 108 | ||
109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); | 109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); |
110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; | 110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; |
111 | mFlagShowNextxDays = false; | 111 | mFlagShowNextxDays = false; |
112 | if ( view == 3 ) { | 112 | if ( view == 3 ) { |
113 | //mCurrentAgendaView = 1 ; | 113 | //mCurrentAgendaView = 1 ; |
114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); | 114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); |
115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); | 115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); |
116 | lastNDMode = savemFlagShowNextxDays; | 116 | lastNDMode = savemFlagShowNextxDays; |
117 | mMainView->showDay( date ); | 117 | mMainView->showDay( date ); |
118 | } else if (view == 4 ) { | 118 | } else if (view == 4 ) { |
119 | mCurrentAgendaView = 7 ; | 119 | mCurrentAgendaView = 7 ; |
120 | mMainView->dateNavigator()->selectDates( date, 7 ); | 120 | mMainView->dateNavigator()->selectDates( date, 7 ); |
121 | } else if (view == 5 ) { | 121 | } else if (view == 5 ) { |
122 | mCurrentAgendaView = 14 ; | 122 | mCurrentAgendaView = 14 ; |
123 | mMainView->dateNavigator()->selectDates( date, 14); | 123 | mMainView->dateNavigator()->selectDates( date, 14); |
124 | } else if (view == 6 ) { | 124 | } else if (view == 6 ) { |
125 | mMainView->dateNavigator()->blockSignals( true ); | 125 | mMainView->dateNavigator()->selectDates( date, 7 ); |
126 | showMonthView(); | 126 | showMonthView(); |
127 | mMainView->dateNavigator()->selectMonthByDate( date ); | ||
128 | mMainView->dateNavigator()->blockSignals( false ); | ||
129 | mMainView->dateNavigator()->selectDate( date ); | ||
130 | } else if (view == 7 ) { | 127 | } else if (view == 7 ) { |
131 | mMainView->dateNavigator()->selectDate( date ); | 128 | mMainView->dateNavigator()->selectDate( date ); |
132 | showJournalView(); | 129 | showJournalView(); |
133 | } else if (view == 8 ) { | 130 | } else if (view == 8 ) { |
134 | globalFlagBlockAgenda = 1; | 131 | globalFlagBlockAgenda = 1; |
135 | if ( mCurrentAgendaView != 3 ) | 132 | if ( mCurrentAgendaView != 3 ) |
136 | mCurrentAgendaView = -1; | 133 | mCurrentAgendaView = -1; |
137 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 134 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
138 | globalFlagBlockAgenda = 2; | 135 | globalFlagBlockAgenda = 2; |
139 | mMainView->dateNavigator()->selectDates( date , | 136 | mMainView->dateNavigator()->selectDates( date , |
140 | KOPrefs::instance()->mNextXDays ); | 137 | KOPrefs::instance()->mNextXDays ); |
141 | mFlagShowNextxDays = true; | 138 | mFlagShowNextxDays = true; |
142 | mCurrentAgendaView = 3 ; | 139 | mCurrentAgendaView = 3 ; |
143 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) | 140 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) |
144 | if ( lastMode ) { | 141 | if ( lastMode ) { |
145 | mCurrentAgendaView = lastCount ; | 142 | mCurrentAgendaView = lastCount ; |
146 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); | 143 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); |
147 | mFlagShowNextxDays = lastNDMode; | 144 | mFlagShowNextxDays = lastNDMode; |
148 | if ( mFlagShowNextxDays ) { | 145 | if ( mFlagShowNextxDays ) { |
149 | mCurrentAgendaView = 3 ; | 146 | mCurrentAgendaView = 3 ; |
150 | } | 147 | } |
151 | } else | 148 | } else |
152 | showWeekView(); | 149 | showWeekView(); |
153 | } else if (view == 10) { | 150 | } else if (view == 10) { |
154 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | 151 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); |
155 | } | 152 | } |
156 | lastMode = view; | 153 | lastMode = view; |
157 | } | 154 | } |
158 | 155 | ||
159 | 156 | ||
160 | 157 | ||
161 | void KOViewManager::writeSettings(KConfig *config) | 158 | void KOViewManager::writeSettings(KConfig *config) |
162 | { | 159 | { |
163 | config->setGroup("General"); | 160 | config->setGroup("General"); |
164 | 161 | ||
165 | QString view; | 162 | QString view; |
166 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; | 163 | if (mCurrentView == mWhatsNextView) view = "WhatsNext"; |
167 | else if (mCurrentView == mMonthView) view = "Month"; | 164 | else if (mCurrentView == mMonthView) view = "Month"; |
168 | else if (mCurrentView == mListView) view = "List"; | 165 | else if (mCurrentView == mListView) view = "List"; |
169 | else if (mCurrentView == mJournalView) view = "Journal"; | 166 | else if (mCurrentView == mJournalView) view = "Journal"; |
170 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; | 167 | else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; |
171 | else if (mCurrentView == mTodoView) view = "Todo"; | 168 | else if (mCurrentView == mTodoView) view = "Todo"; |
172 | else view = "Agenda"; | 169 | else view = "Agenda"; |
173 | 170 | ||
174 | config->writeEntry("Current View",view); | 171 | config->writeEntry("Current View",view); |
175 | 172 | ||
176 | if (mAgendaView) { | 173 | if (mAgendaView) { |
177 | mAgendaView->writeSettings(config); | 174 | mAgendaView->writeSettings(config); |