author | zautrix <zautrix> | 2005-01-15 00:20:28 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-15 00:20:28 (UTC) |
commit | 80da9080c1c33c4704806c442179522edce06bd2 (patch) (unidiff) | |
tree | f17bfb786b7c85d4d3bf93545494dafdf9ec5184 /korganizer/koeventviewerdialog.cpp | |
parent | d937154e5ae3691dda55fac9114142f92e29e37b (diff) | |
download | kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.zip kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.gz kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.bz2 |
completed todo
Diffstat (limited to 'korganizer/koeventviewerdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeventviewerdialog.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp index 68c0e1a..772fd95 100644 --- a/korganizer/koeventviewerdialog.cpp +++ b/korganizer/koeventviewerdialog.cpp | |||
@@ -137,45 +137,54 @@ void KOEventViewerDialog::addIncidence(Incidence *in) | |||
137 | addEvent( (Event*) in ); | 137 | addEvent( (Event*) in ); |
138 | else if ( in->type() =="Todo" ) | 138 | else if ( in->type() =="Todo" ) |
139 | mEventViewer->setTodo( (Todo*) in, false ); | 139 | mEventViewer->setTodo( (Todo*) in, false ); |
140 | else if ( in->type() =="Journal" ) | 140 | else if ( in->type() =="Journal" ) |
141 | mEventViewer->setJournal( (Journal*) in, false ); | 141 | mEventViewer->setJournal( (Journal*) in, false ); |
142 | if ( mSyncMode ) { | 142 | if ( mSyncMode ) { |
143 | findButton( User1 )->setFocus(); | 143 | findButton( User1 )->setFocus(); |
144 | setCaption(i18n("Conflict! Please choose entry")); | 144 | setCaption(i18n("Conflict! Please choose entry")); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | void KOEventViewerDialog::addEvent(Event *event) | 148 | void KOEventViewerDialog::addEvent(Event *event) |
149 | { | 149 | { |
150 | mEventViewer->addEvent(event); | 150 | mEventViewer->addEvent(event); |
151 | mIncidence = event; | 151 | mIncidence = event; |
152 | findButton( Close )->setFocus(); | 152 | findButton( Close )->setFocus(); |
153 | if ( !mSyncMode ) { | ||
154 | findButton( User1 )->setText( i18n("Agenda")); | ||
155 | } | ||
153 | } | 156 | } |
154 | 157 | ||
155 | void KOEventViewerDialog::setTodo(Todo *event) | 158 | void KOEventViewerDialog::setTodo(Todo *event) |
156 | { | 159 | { |
157 | mEventViewer->setTodo(event); | 160 | mEventViewer->setTodo(event); |
158 | mIncidence = (Incidence*)event; | 161 | mIncidence = (Incidence*)event; |
159 | findButton( Close )->setFocus(); | 162 | findButton( Close )->setFocus(); |
163 | if ( !mSyncMode ) { | ||
164 | findButton( User1 )->setText( i18n("Set complete")); | ||
165 | } | ||
160 | } | 166 | } |
161 | void KOEventViewerDialog::setJournal(Journal *j) | 167 | void KOEventViewerDialog::setJournal(Journal *j) |
162 | { | 168 | { |
163 | mEventViewer->setJournal(j); | 169 | mEventViewer->setJournal(j); |
164 | mIncidence = (Incidence*)j; | 170 | mIncidence = (Incidence*)j; |
165 | findButton( Close )->setFocus(); | 171 | findButton( Close )->setFocus(); |
172 | if ( !mSyncMode ) { | ||
173 | findButton( User1 )->setText( i18n("Agenda")); | ||
174 | } | ||
166 | } | 175 | } |
167 | 176 | ||
168 | void KOEventViewerDialog::addText(QString text) | 177 | void KOEventViewerDialog::addText(QString text) |
169 | { | 178 | { |
170 | mEventViewer->addText(text); | 179 | mEventViewer->addText(text); |
171 | findButton( Close )->setFocus(); | 180 | findButton( Close )->setFocus(); |
172 | } | 181 | } |
173 | void KOEventViewerDialog::editIncidence() | 182 | void KOEventViewerDialog::editIncidence() |
174 | { | 183 | { |
175 | if ( mSyncMode ) { | 184 | if ( mSyncMode ) { |
176 | mSyncResult = 2; | 185 | mSyncResult = 2; |
177 | accept(); | 186 | accept(); |
178 | return; | 187 | return; |
179 | } | 188 | } |
180 | if ( mIncidence ){ | 189 | if ( mIncidence ){ |
181 | #ifndef DESKTOP_VERSION | 190 | #ifndef DESKTOP_VERSION |
@@ -186,39 +195,46 @@ void KOEventViewerDialog::editIncidence() | |||
186 | } | 195 | } |
187 | void KOEventViewerDialog::showIncidence() | 196 | void KOEventViewerDialog::showIncidence() |
188 | { | 197 | { |
189 | 198 | ||
190 | if ( mSyncMode ) { | 199 | if ( mSyncMode ) { |
191 | mSyncResult = 1; | 200 | mSyncResult = 1; |
192 | accept(); | 201 | accept(); |
193 | return; | 202 | return; |
194 | } | 203 | } |
195 | 204 | ||
196 | if ( mIncidence ){ | 205 | if ( mIncidence ){ |
197 | #ifndef DESKTOP_VERSION | 206 | #ifndef DESKTOP_VERSION |
198 | hide(); | 207 | hide(); |
199 | #endif | 208 | #endif |
200 | QDate date; | 209 | QDate date; |
201 | if ( mIncidence->type() == "Todo" ) { | 210 | if ( mIncidence->type() == "Todo" ) { |
211 | /* | ||
202 | if ( ((Todo*)mIncidence)->hasDueDate() ) | 212 | if ( ((Todo*)mIncidence)->hasDueDate() ) |
203 | date = ((Todo*)mIncidence)->dtDue().date(); | 213 | date = ((Todo*)mIncidence)->dtDue().date(); |
204 | else { | 214 | else { |
205 | globalFlagBlockAgenda = 2; | 215 | globalFlagBlockAgenda = 2; |
206 | emit showAgendaView( false ); | 216 | emit showAgendaView( false ); |
207 | return; | 217 | return; |
208 | } | 218 | } |
219 | */ | ||
220 | ((Todo*)mIncidence)->setCompleted( true ); | ||
221 | hide(); | ||
222 | emit todoCompleted(((Todo*)mIncidence)); | ||
223 | return; | ||
224 | |||
209 | } else | 225 | } else |
210 | date = mIncidence->dtStart().date(); | 226 | date = mIncidence->dtStart().date(); |
211 | globalFlagBlockAgenda = 1; | 227 | globalFlagBlockAgenda = 1; |
212 | emit showAgendaView( false ); | 228 | emit showAgendaView( false ); |
213 | globalFlagBlockAgenda = 2; | 229 | globalFlagBlockAgenda = 2; |
214 | emit jumpToTime( date ); | 230 | emit jumpToTime( date ); |
215 | } | 231 | } |
216 | } | 232 | } |
217 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) | 233 | void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) |
218 | { | 234 | { |
219 | switch ( e->key() ) { | 235 | switch ( e->key() ) { |
220 | 236 | ||
221 | case Qt::Key_A : | 237 | case Qt::Key_A : |
222 | case Qt::Key_L : | 238 | case Qt::Key_L : |
223 | showIncidence(); | 239 | showIncidence(); |
224 | break; | 240 | break; |