summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-10-10 00:54:59 (UTC)
committer zautrix <zautrix>2005-10-10 00:54:59 (UTC)
commit999e15691b8cd67db766a60906b96b68da8cfb30 (patch) (unidiff)
tree4b4873b893d1a1099ea4cf3edd175f4cd03163be /korganizer
parentdad8e8745591620c951cefd835ea7ea727db8925 (diff)
downloadkdepimpi-999e15691b8cd67db766a60906b96b68da8cfb30.zip
kdepimpi-999e15691b8cd67db766a60906b96b68da8cfb30.tar.gz
kdepimpi-999e15691b8cd67db766a60906b96b68da8cfb30.tar.bz2
chaged set todo complete in viewer
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeventviewerdialog.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 0763825..2e936f3 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -183,126 +183,128 @@ void KOEventViewerDialog::addEvent(Event *event)
183 183
184void KOEventViewerDialog::setTodo(Todo *event) 184void KOEventViewerDialog::setTodo(Todo *event)
185{ 185{
186 mEventViewer->setTodo(event); 186 mEventViewer->setTodo(event);
187 mIncidence = (Incidence*)event; 187 mIncidence = (Incidence*)event;
188 mEventViewer->setFocus(); 188 mEventViewer->setFocus();
189 //findButton( Close )->setFocus(); 189 //findButton( Close )->setFocus();
190 if ( !mSyncMode ) { 190 if ( !mSyncMode ) {
191 findButton( User1 )->setText( i18n("Set complete")); 191 findButton( User1 )->setText( i18n("Set complete"));
192 } 192 }
193} 193}
194void KOEventViewerDialog::setJournal(Journal *j) 194void KOEventViewerDialog::setJournal(Journal *j)
195{ 195{
196 mEventViewer->setJournal(j); 196 mEventViewer->setJournal(j);
197 mIncidence = (Incidence*)j; 197 mIncidence = (Incidence*)j;
198 mEventViewer->setFocus(); 198 mEventViewer->setFocus();
199 //findButton( Close )->setFocus(); 199 //findButton( Close )->setFocus();
200 if ( !mSyncMode ) { 200 if ( !mSyncMode ) {
201 findButton( User1 )->setText( i18n("Agenda")); 201 findButton( User1 )->setText( i18n("Agenda"));
202 } 202 }
203} 203}
204 204
205void KOEventViewerDialog::addText(QString text) 205void KOEventViewerDialog::addText(QString text)
206{ 206{
207 mEventViewer->addText(text); 207 mEventViewer->addText(text);
208 mEventViewer->setFocus(); 208 mEventViewer->setFocus();
209 //findButton( Close )->setFocus(); 209 //findButton( Close )->setFocus();
210} 210}
211void KOEventViewerDialog::editIncidence() 211void KOEventViewerDialog::editIncidence()
212{ 212{
213 sendSignalViewerClosed = false; 213 sendSignalViewerClosed = false;
214 if ( mSyncMode ) { 214 if ( mSyncMode ) {
215 mSyncResult = 2; 215 mSyncResult = 2;
216 accept(); 216 accept();
217 return; 217 return;
218 } 218 }
219 if ( mIncidence ){ 219 if ( mIncidence ){
220 close(); 220 close();
221 emit editIncidence( mIncidence ); 221 emit editIncidence( mIncidence );
222 } 222 }
223} 223}
224void KOEventViewerDialog::showIncidence() 224void KOEventViewerDialog::showIncidence()
225{ 225{
226 sendSignalViewerClosed = false; 226 sendSignalViewerClosed = false;
227 if ( mSyncMode ) { 227 if ( mSyncMode ) {
228 mSyncResult = 1; 228 mSyncResult = 1;
229 accept(); 229 accept();
230 return; 230 return;
231 } 231 }
232 232
233 if ( mIncidence ){ 233 if ( mIncidence ){
234 QDate date; 234 QDate date;
235 if ( mIncidence->type() == "Todo" ) { 235 if ( mIncidence->type() == "Todo" ) {
236 /* 236 /*
237 if ( ((Todo*)mIncidence)->hasDueDate() ) 237 if ( ((Todo*)mIncidence)->hasDueDate() )
238 date = ((Todo*)mIncidence)->dtDue().date(); 238 date = ((Todo*)mIncidence)->dtDue().date();
239 else { 239 else {
240 globalFlagBlockAgenda = 2; 240 globalFlagBlockAgenda = 2;
241 emit showAgendaView( false ); 241 emit showAgendaView( false );
242 return; 242 return;
243 } 243 }
244 */ 244 */
245 ((Todo*)mIncidence)->setCompleted( true ); 245 ((Todo*)mIncidence)->setCompleted( true );
246 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() ); 246 ((Todo*)mIncidence)->setCompleted(QDateTime::currentDateTime() );
247 emit todoCompleted(((Todo*)mIncidence)); 247 emit todoCompleted(((Todo*)mIncidence));
248 mEventViewer->setTodo((Todo*)mIncidence);
249 return;
248 } else { 250 } else {
249 date = mIncidence->dtStart().date(); 251 date = mIncidence->dtStart().date();
250 globalFlagBlockAgenda = 1; 252 globalFlagBlockAgenda = 1;
251 emit showAgendaView( false ); 253 emit showAgendaView( false );
252 globalFlagBlockAgenda = 2; 254 globalFlagBlockAgenda = 2;
253 emit jumpToTime( date ); 255 emit jumpToTime( date );
254 } 256 }
255 close(); 257 close();
256 } 258 }
257} 259}
258void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 260void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
259{ 261{
260 switch ( e->key() ) { 262 switch ( e->key() ) {
261 263
262 case Qt::Key_A : 264 case Qt::Key_A :
263 case Qt::Key_L : 265 case Qt::Key_L :
264 showIncidence(); 266 showIncidence();
265 break; 267 break;
266 case Qt::Key_E : 268 case Qt::Key_E :
267 case Qt::Key_R : 269 case Qt::Key_R :
268 editIncidence(); 270 editIncidence();
269 break; 271 break;
270 case Qt::Key_C: 272 case Qt::Key_C:
271 case Qt::Key_Escape: 273 case Qt::Key_Escape:
272 sendSignalViewerClosed = true; 274 sendSignalViewerClosed = true;
273 close(); 275 close();
274 break; 276 break;
275 case Qt::Key_I: 277 case Qt::Key_I:
276#ifndef DESKTOP_VERSION 278#ifndef DESKTOP_VERSION
277 sendSignalViewerClosed = true; 279 sendSignalViewerClosed = true;
278 close(); 280 close();
279#else 281#else
280 sendSignalViewerClosed = true; 282 sendSignalViewerClosed = true;
281 slotViewerClosed(); 283 slotViewerClosed();
282 //accept(); 284 //accept();
283#endif 285#endif
284 break; 286 break;
285 default: 287 default:
286 KDialogBase::keyPressEvent ( e ); 288 KDialogBase::keyPressEvent ( e );
287 break; 289 break;
288 } 290 }
289 291
290} 292}
291void KOEventViewerDialog::hideEvent ( QHideEvent * e ) 293void KOEventViewerDialog::hideEvent ( QHideEvent * e )
292{ 294{
293 KDialogBase::hideEvent ( e ); 295 KDialogBase::hideEvent ( e );
294 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) ); 296 QTimer::singleShot( 1, this, SLOT (slotViewerClosed() ) );
295} 297}
296 298
297void KOEventViewerDialog::slotViewerClosed() 299void KOEventViewerDialog::slotViewerClosed()
298{ 300{
299 if ( mSyncMode ) 301 if ( mSyncMode )
300 return; 302 return;
301 303
302 if ( sendSignalViewerClosed ) { 304 if ( sendSignalViewerClosed ) {
303 //qDebug("KOEventViewerDialog::hideEvent "); 305 //qDebug("KOEventViewerDialog::hideEvent ");
304 emit signalViewerClosed(); 306 emit signalViewerClosed();
305 } 307 }
306 sendSignalViewerClosed = true; 308 sendSignalViewerClosed = true;
307} 309}
308 310