Diffstat (limited to 'korganizer/koeventeditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeventeditor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp index 0ff99a4..337db9b 100644 --- a/korganizer/koeventeditor.cpp +++ b/korganizer/koeventeditor.cpp | |||
@@ -314,64 +314,64 @@ void KOEventEditor::writeEvent(Event *event) | |||
314 | 314 | ||
315 | bool KOEventEditor::validateInput() | 315 | bool KOEventEditor::validateInput() |
316 | { | 316 | { |
317 | if (!mGeneral->validateInput()) return false; | 317 | if (!mGeneral->validateInput()) return false; |
318 | if (!mDetails->validateInput()) return false; | 318 | if (!mDetails->validateInput()) return false; |
319 | if (!mRecurrence->validateInput()) return false; | 319 | if (!mRecurrence->validateInput()) return false; |
320 | return true; | 320 | return true; |
321 | } | 321 | } |
322 | 322 | ||
323 | int KOEventEditor::msgItemDelete() | 323 | int KOEventEditor::msgItemDelete() |
324 | { | 324 | { |
325 | return KMessageBox::warningContinueCancel(this, | 325 | return KMessageBox::warningContinueCancel(this, |
326 | i18n("This item will be permanently deleted."), | 326 | i18n("This item will be permanently deleted."), |
327 | i18n("KOrganizer Confirmation"),i18n("Delete")); | 327 | i18n("KOrganizer Confirmation"),i18n("Delete")); |
328 | } | 328 | } |
329 | 329 | ||
330 | void KOEventEditor::slotLoadTemplate() | 330 | void KOEventEditor::slotLoadTemplate() |
331 | { | 331 | { |
332 | 332 | ||
333 | QString fileName =locateLocal( "templates", "events" ); | 333 | QString fileName =locateLocal( "templates", "events" ); |
334 | QDir t_dir; | 334 | QDir t_dir; |
335 | if ( !t_dir.exists(fileName) ) | 335 | if ( !t_dir.exists(fileName) ) |
336 | t_dir.mkdir ( fileName ); | 336 | t_dir.mkdir ( fileName ); |
337 | fileName += "/event"; | 337 | fileName += "/event"; |
338 | fileName = KFileDialog::getSaveFileName( fileName , "Load Event template", this ); | 338 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this ); |
339 | if ( fileName.length() == 0 ) | 339 | if ( fileName.length() == 0 ) |
340 | return; | 340 | return; |
341 | CalendarLocal cal; | 341 | CalendarLocal cal; |
342 | ICalFormat format; | 342 | ICalFormat format; |
343 | if ( !format.load( &cal, fileName ) ) { | 343 | if ( !format.load( &cal, fileName ) ) { |
344 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 344 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
345 | .arg( fileName ) ); | 345 | .arg( fileName ) ); |
346 | return ; | 346 | return ; |
347 | } | 347 | } |
348 | QPtrList<Event> events = cal.events(); | 348 | QPtrList<Event> events = cal.events(); |
349 | Event* event = events.first(); | 349 | Event* event = events.first(); |
350 | if ( !event ) { | 350 | if ( !event ) { |
351 | KMessageBox::error( this, | 351 | KMessageBox::error( this, |
352 | i18n("Template does not contain\na valid Event.")); | 352 | i18n("Template does not contain\na valid Event.")); |
353 | } else { | 353 | } else { |
354 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; | 354 | kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; |
355 | readEvent( event, true ); | 355 | readEvent( event, true ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | 359 | ||
360 | void KOEventEditor::slotSaveTemplate() | 360 | void KOEventEditor::slotSaveTemplate() |
361 | { | 361 | { |
362 | QString fileName =locateLocal( "templates", "events" ); | 362 | QString fileName =locateLocal( "templates", "events" ); |
363 | QDir t_dir; | 363 | QDir t_dir; |
364 | if ( !t_dir.exists(fileName) ) | 364 | if ( !t_dir.exists(fileName) ) |
365 | t_dir.mkdir ( fileName ); | 365 | t_dir.mkdir ( fileName ); |
366 | fileName += "/event"; | 366 | fileName += "/event"; |
367 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Event template", this ); | 367 | fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Event template"), this ); |
368 | if ( fileName.length() > 0 ) | 368 | if ( fileName.length() > 0 ) |
369 | saveTemplate( fileName ); | 369 | saveTemplate( fileName ); |
370 | } | 370 | } |
371 | 371 | ||
372 | void KOEventEditor::saveTemplate( const QString &templateName ) | 372 | void KOEventEditor::saveTemplate( const QString &templateName ) |
373 | { | 373 | { |
374 | Event *event = new Event; | 374 | Event *event = new Event; |
375 | writeEvent( event ); | 375 | writeEvent( event ); |
376 | saveAsTemplate( event, templateName ); | 376 | saveAsTemplate( event, templateName ); |
377 | } | 377 | } |