summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 13035e0..2cfb382 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -364,100 +364,102 @@ void KOPrefs::setTimeZoneIdDefault()
364} 364}
365 365
366void KOPrefs::setCategoryDefaults() 366void KOPrefs::setCategoryDefaults()
367{ 367{
368 mCustomCategories.clear(); 368 mCustomCategories.clear();
369 mCustomCategories = getDefaultList(); 369 mCustomCategories = getDefaultList();
370 370
371 QStringList::Iterator it; 371 QStringList::Iterator it;
372 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 372 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
373 setCategoryColor(*it,mDefaultCategoryColor); 373 setCategoryColor(*it,mDefaultCategoryColor);
374 } 374 }
375} 375}
376 376
377QStringList KOPrefs::getDefaultList() 377QStringList KOPrefs::getDefaultList()
378{ 378{
379 QStringList retval ; 379 QStringList retval ;
380 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 380 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
381 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 381 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
382 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 382 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
383 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 383 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
384 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 384 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
385 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 385 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
386 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 386 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
387 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 387 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
388 retval.sort(); 388 retval.sort();
389 return retval; 389 return retval;
390} 390}
391 391
392void KOPrefs::usrReadConfig() 392void KOPrefs::usrReadConfig()
393{ 393{
394 mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 394 mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
395 mLocaleDict = 0; 395 mLocaleDict = 0;
396 // pending LR fix translation 396 // pending LR fix translation
397 // qDebug("KOPrefs::usrReadConfig() fix translation "); 397 // qDebug("KOPrefs::usrReadConfig() fix translation ");
398 if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) { 398 if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) {
399 if ( mPreferredLanguage == 1 ) { 399 if ( mPreferredLanguage == 1 ) {
400 mLocaleDict = new QDict<QString>; 400 mLocaleDict = new QDict<QString>;
401 int i = 0; 401 int i = 0;
402 QString fw ( germanwords[i] [0]); 402 QString fw ( germanwords[i] [0]);
403 while ( !fw.isEmpty() ) { 403 while ( !fw.isEmpty() ) {
404 mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); 404 mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
405 ++i; 405 ++i;
406 fw = germanwords[i] [0]; 406 fw = germanwords[i] [0];
407 } 407 }
408 408
409 setLocaleDict( mLocaleDict ); 409 setLocaleDict( mLocaleDict );
410 } else { 410 } else {
411 QString fileName ; 411 QString fileName ;
412 if ( mPreferredLanguage == 3 ) 412 if ( mPreferredLanguage == 4 )
413 fileName = MainWindow::resourcePath()+"usertranslation.txt"; 413 fileName = MainWindow::resourcePath()+"usertranslation.txt";
414 else if ( mPreferredLanguage == 2 ) 414 else if ( mPreferredLanguage == 2 )
415 fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; 415 fileName = MainWindow::resourcePath()+"frenchtranslation.txt";
416 else if ( mPreferredLanguage == 3 )
417 fileName = MainWindow::resourcePath()+"italiantranslation.txt";
416 QFile file( fileName ); 418 QFile file( fileName );
417 if (file.open( IO_ReadOnly ) ) { 419 if (file.open( IO_ReadOnly ) ) {
418 QTextStream ts( &file ); 420 QTextStream ts( &file );
419 ts.setEncoding( QTextStream::Latin1 ); 421 ts.setEncoding( QTextStream::Latin1 );
420 //ts.setCodec( QTextCodec::latin1 ); 422 //ts.setCodec( QTextCodec::latin1 );
421 QString text = ts.read(); 423 QString text = ts.read();
422 file.close(); 424 file.close();
423 text.replace( QRegExp("\\\\n"), "\n" ); 425 text.replace( QRegExp("\\\\n"), "\n" );
424 QString line; 426 QString line;
425 QString we; 427 QString we;
426 QString wt; 428 QString wt;
427 int br = 0; 429 int br = 0;
428 int nbr; 430 int nbr;
429 nbr = text.find ( "},", br ); 431 nbr = text.find ( "},", br );
430 line = text.mid( br, nbr - br ); 432 line = text.mid( br, nbr - br );
431 br = nbr+1; 433 br = nbr+1;
432 int se, ee, st, et; 434 int se, ee, st, et;
433 mLocaleDict = new QDict<QString>; 435 mLocaleDict = new QDict<QString>;
434 QString end = "{ \"\",\"\" }"; 436 QString end = "{ \"\",\"\" }";
435 while ( (line != end) && (br > 1) ) { 437 while ( (line != end) && (br > 1) ) {
436 //qDebug("%d *%s* ", br, line.latin1()); 438 //qDebug("%d *%s* ", br, line.latin1());
437 se = line.find("\"")+1; 439 se = line.find("\"")+1;
438 et = line.findRev("\"",-1); 440 et = line.findRev("\"",-1);
439 ee = line.find("\",\""); 441 ee = line.find("\",\"");
440 st = ee+3; 442 st = ee+3;
441 we = line.mid( se, ee-se ); 443 we = line.mid( se, ee-se );
442 wt = line.mid( st, et-st ); 444 wt = line.mid( st, et-st );
443 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); 445 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1());
444 mLocaleDict->insert( we, new QString (wt) ); 446 mLocaleDict->insert( we, new QString (wt) );
445 nbr = text.find ( "}", br ); 447 nbr = text.find ( "}", br );
446 line = text.mid( br, nbr - br ); 448 line = text.mid( br, nbr - br );
447 br = nbr+1; 449 br = nbr+1;
448 } 450 }
449 //qDebug("end *%s* ", end.latin1()); 451 //qDebug("end *%s* ", end.latin1());
450 452
451 setLocaleDict( mLocaleDict ); 453 setLocaleDict( mLocaleDict );
452 } else { 454 } else {
453 qDebug("KO: Cannot find translation file %s",fileName.latin1() ); 455 qDebug("KO: Cannot find translation file %s",fileName.latin1() );
454 } 456 }
455 457
456 } 458 }
457 } 459 }
458 config()->setGroup("General"); 460 config()->setGroup("General");
459 461
460 mCustomCategories = config()->readListEntry("Custom Categories"); 462 mCustomCategories = config()->readListEntry("Custom Categories");
461 if ( KOPrefs::instance()->mLanguageChanged ) { 463 if ( KOPrefs::instance()->mLanguageChanged ) {
462 mLocationDefaults.clear(); 464 mLocationDefaults.clear();
463 mEventSummaryUser.clear(); 465 mEventSummaryUser.clear();