-rw-r--r-- | bin/kdepim/WhatsNew.txt | 9 | ||||
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 8 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.cpp | 73 | ||||
-rw-r--r-- | kaddressbook/xxport/csvimportdialog.h | 4 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 5 | ||||
-rw-r--r-- | microkde/kio/kfile/kurlrequester.cpp | 2 |
6 files changed, 79 insertions, 22 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index fdcfab1..41b2a81 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,8 +1,17 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.3 ************ | ||
4 | |||
5 | Changed the menu structure of the alarm applet: | ||
6 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | ||
7 | |||
8 | Fixed several problems in the KA/Pi CSV import dialog: | ||
9 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | ||
10 | |||
11 | |||
3 | ********** VERSION 2.1.2 ************ | 12 | ********** VERSION 2.1.2 ************ |
4 | 13 | ||
5 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 14 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
6 | 15 | ||
7 | Fixed a problem when importing data from Outlook with mutiple categories set. | 16 | Fixed a problem when importing data from Outlook with mutiple categories set. |
8 | 17 | ||
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index ef4ab3f..899203e 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -282,15 +282,15 @@ | |||
282 | { "Personal","Persönl." }, | 282 | { "Personal","Persönl." }, |
283 | { "Organization","Organisation" }, | 283 | { "Organization","Organisation" }, |
284 | { "Custom","Benutzerdefiniert" }, | 284 | { "Custom","Benutzerdefiniert" }, |
285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, | 285 | { "&Selected\nfields:","&Selektierte\nFelder:" }, |
286 | { "Formatted Name","Format. Name" }, | 286 | { "Formatted Name","Format. Name" }, |
287 | { "Additional Names","Mittelname" }, | 287 | { "Additional Names","Mittelname" }, |
288 | { "Honorific Prefixes","Namen Prefix" }, | 288 | { "Honorific Prefixes","Namensprefix" }, |
289 | { "Honorific Suffixes","Namen Suffix" }, | 289 | { "Honorific Suffixes","Namenssuffix" }, |
290 | { "Nick Name","Sptitzname" }, | 290 | { "Nick Name","Spitzname" }, |
291 | { "Birthday","Geburtstag" }, | 291 | { "Birthday","Geburtstag" }, |
292 | { "Home Address Street","Privat Adresse Strasse" }, | 292 | { "Home Address Street","Privat Adresse Strasse" }, |
293 | { "Home Address Locality","Privat Adresse Stadt" }, | 293 | { "Home Address Locality","Privat Adresse Stadt" }, |
294 | { "Home Address Region","Privat Adresse Bundesland" }, | 294 | { "Home Address Region","Privat Adresse Bundesland" }, |
295 | { "Home Address Postal Code","Privat Adresse PLZ" }, | 295 | { "Home Address Postal Code","Privat Adresse PLZ" }, |
296 | { "Home Address Country","Privat Adresse Land" }, | 296 | { "Home Address Country","Privat Adresse Land" }, |
@@ -306,13 +306,13 @@ | |||
306 | { "Mobile Phone","Handy" }, | 306 | { "Mobile Phone","Handy" }, |
307 | { "Home Fax","Privat Fax" }, | 307 | { "Home Fax","Privat Fax" }, |
308 | { "Business Fax","Büro Fax" }, | 308 | { "Business Fax","Büro Fax" }, |
309 | { "Car Phone","Autotelefon" }, | 309 | { "Car Phone","Autotelefon" }, |
310 | { "ISDN","ISDN" }, | 310 | { "ISDN","ISDN" }, |
311 | { "Pager","Pager" }, | 311 | { "Pager","Pager" }, |
312 | { "Mail Client","Mail Client" }, | 312 | { "Mail Client","Mail Klient" }, |
313 | { "Title","Titel" }, | 313 | { "Title","Titel" }, |
314 | { "Role","Rolle" }, | 314 | { "Role","Rolle" }, |
315 | { "Note","Notiz" }, | 315 | { "Note","Notiz" }, |
316 | { "URL","URL" }, | 316 | { "URL","URL" }, |
317 | { "Resource","Resource" }, | 317 | { "Resource","Resource" }, |
318 | { "SIP","SIP" }, | 318 | { "SIP","SIP" }, |
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index cc55a24..41e2612 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp | |||
@@ -119,12 +119,13 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | |||
119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); | 119 | mTypeMap.insert( KABC::Addressee::mailerLabel(), Mailer ); |
120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); | 120 | mTypeMap.insert( KABC::Addressee::titleLabel(), Title ); |
121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); | 121 | mTypeMap.insert( KABC::Addressee::roleLabel(), Role ); |
122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); | 122 | mTypeMap.insert( KABC::Addressee::organizationLabel(), Organization ); |
123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); | 123 | mTypeMap.insert( KABC::Addressee::noteLabel(), Note ); |
124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); | 124 | mTypeMap.insert( KABC::Addressee::urlLabel(), URL ); |
125 | mTypeMap.insert( KABC::Addressee::categoryLabel(), Categories ); | ||
125 | 126 | ||
126 | mCustomCounter = mTypeMap.count(); | 127 | mCustomCounter = mTypeMap.count(); |
127 | int count = mCustomCounter; | 128 | int count = mCustomCounter; |
128 | 129 | ||
129 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); | 130 | KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); |
130 | KABC::Field::List::Iterator it; | 131 | KABC::Field::List::Iterator it; |
@@ -136,12 +137,14 @@ CSVImportDialog::CSVImportDialog( KABC::AddressBook *ab, QWidget *parent, | |||
136 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), | 137 | connect( mDelimiterEdit, SIGNAL( returnPressed() ), |
137 | this, SLOT( returnPressed() ) ); | 138 | this, SLOT( returnPressed() ) ); |
138 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), | 139 | connect( mDelimiterEdit, SIGNAL( textChanged ( const QString& ) ), |
139 | this, SLOT( textChanged ( const QString& ) ) ); | 140 | this, SLOT( textChanged ( const QString& ) ) ); |
140 | connect( mComboLine, SIGNAL( activated( const QString& ) ), | 141 | connect( mComboLine, SIGNAL( activated( const QString& ) ), |
141 | this, SLOT( lineSelected( const QString& ) ) ); | 142 | this, SLOT( lineSelected( const QString& ) ) ); |
143 | connect( mComboCodec, SIGNAL( activated( const QString& ) ), | ||
144 | this, SLOT( codecChanged( const QString& ) ) ); | ||
142 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), | 145 | connect( mComboQuote, SIGNAL( activated( const QString& ) ), |
143 | this, SLOT( textquoteSelected( const QString& ) ) ); | 146 | this, SLOT( textquoteSelected( const QString& ) ) ); |
144 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), | 147 | connect( mIgnoreDuplicates, SIGNAL( stateChanged( int ) ), |
145 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); | 148 | this, SLOT( ignoreDuplicatesChanged( int ) ) ); |
146 | 149 | ||
147 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), | 150 | connect( mUrlRequester, SIGNAL( returnPressed( const QString& ) ), |
@@ -246,15 +249,21 @@ KABC::AddresseeList CSVImportDialog::contacts() const | |||
246 | a.setUrl( value ); | 249 | a.setUrl( value ); |
247 | break; | 250 | break; |
248 | case Organization: | 251 | case Organization: |
249 | a.setOrganization( value ); | 252 | a.setOrganization( value ); |
250 | break; | 253 | break; |
251 | case Note: | 254 | case Note: |
252 | a.setNote( value ); | 255 | if ( a.note().isEmpty() ) |
256 | a.setNote( value ); | ||
257 | else { | ||
258 | a.setNote( a.note()+"\n"+value ); | ||
259 | } | ||
260 | break; | ||
261 | case Categories: | ||
262 | a.insertCategory( value ); | ||
253 | break; | 263 | break; |
254 | |||
255 | case HomePhone: | 264 | case HomePhone: |
256 | if ( !value.isEmpty() ) { | 265 | if ( !value.isEmpty() ) { |
257 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); | 266 | KABC::PhoneNumber number( value, KABC::PhoneNumber::Home ); |
258 | a.insertPhoneNumber( number ); | 267 | a.insertPhoneNumber( number ); |
259 | } | 268 | } |
260 | break; | 269 | break; |
@@ -382,22 +391,22 @@ void CSVImportDialog::initGUI() | |||
382 | hbox->addWidget( label ); | 391 | hbox->addWidget( label ); |
383 | 392 | ||
384 | mUrlRequester = new KURLRequester( page ); | 393 | mUrlRequester = new KURLRequester( page ); |
385 | mUrlRequester->setFilter( "*.csv" ); | 394 | mUrlRequester->setFilter( "*.csv" ); |
386 | hbox->addWidget( mUrlRequester ); | 395 | hbox->addWidget( mUrlRequester ); |
387 | 396 | ||
388 | layout->addMultiCellLayout( hbox, 0, 0, 0, 1 ); | 397 | layout->addMultiCellLayout( hbox, 0, 0, 0, 2 ); |
389 | 398 | ||
390 | // Delimiter: comma, semicolon, tab, space, other | 399 | // Delimiter: comma, semicolon, tab, space, other |
391 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); | 400 | mDelimiterBox = new QButtonGroup( i18n( "Delimiter" ), page ); |
392 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); | 401 | mDelimiterBox->setColumnLayout( 0, Qt::Vertical ); |
393 | mDelimiterBox->layout()->setSpacing( spacingHint() ); | 402 | mDelimiterBox->layout()->setSpacing( spacingHint() ); |
394 | mDelimiterBox->layout()->setMargin( marginHint() ); | 403 | mDelimiterBox->layout()->setMargin( marginHint() ); |
395 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); | 404 | QGridLayout *delimiterLayout = new QGridLayout( mDelimiterBox->layout() ); |
396 | delimiterLayout->setAlignment( Qt::AlignTop ); | 405 | delimiterLayout->setAlignment( Qt::AlignTop ); |
397 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 1 ); | 406 | layout->addMultiCellWidget( mDelimiterBox, 1, 1, 0, 2 ); |
398 | 407 | ||
399 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); | 408 | mRadioComma = new QRadioButton( i18n( "Comma" ), mDelimiterBox ); |
400 | mRadioComma->setChecked( true ); | 409 | mRadioComma->setChecked( true ); |
401 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); | 410 | delimiterLayout->addWidget( mRadioComma, 0, 0 ); |
402 | 411 | ||
403 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); | 412 | mRadioSemicolon = new QRadioButton( i18n( "Semicolon" ), mDelimiterBox ); |
@@ -421,39 +430,45 @@ void CSVImportDialog::initGUI() | |||
421 | 430 | ||
422 | mComboQuote = new QComboBox( false, page ); | 431 | mComboQuote = new QComboBox( false, page ); |
423 | mComboQuote->insertItem( i18n( "\"" ), 0 ); | 432 | mComboQuote->insertItem( i18n( "\"" ), 0 ); |
424 | mComboQuote->insertItem( i18n( "'" ), 1 ); | 433 | mComboQuote->insertItem( i18n( "'" ), 1 ); |
425 | mComboQuote->insertItem( i18n( "None" ), 2 ); | 434 | mComboQuote->insertItem( i18n( "None" ), 2 ); |
426 | layout->addWidget( mComboQuote, 3, 0 ); | 435 | layout->addWidget( mComboQuote, 3, 0 ); |
427 | 436 | mComboCodec = new QComboBox( false, page ); | |
437 | mComboCodec->insertItem( i18n( "UTF8" ), 0 ); | ||
438 | mComboCodec->insertItem( i18n( "LATIN1" ), 1 ); | ||
439 | mComboCodec->insertItem( i18n( "LOCALE" ), 2 ); | ||
440 | layout->addWidget( mComboCodec, 3, 2 ); | ||
428 | label = new QLabel( i18n( "Start at line:" ), page ); | 441 | label = new QLabel( i18n( "Start at line:" ), page ); |
429 | layout->addWidget( label, 2, 1 ); | 442 | layout->addWidget( label, 2, 1 ); |
430 | 443 | ||
431 | label = new QLabel( i18n( "Textquote:" ), page ); | 444 | label = new QLabel( i18n( "Textquote:" ), page ); |
432 | layout->addWidget( label, 2, 0 ); | 445 | layout->addWidget( label, 2, 0 ); |
446 | label = new QLabel( i18n( "Codec:" ), page ); | ||
447 | layout->addWidget( label, 2, 2 ); | ||
433 | 448 | ||
434 | mIgnoreDuplicates = new QCheckBox( page ); | 449 | mIgnoreDuplicates = new QCheckBox( page ); |
435 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); | 450 | mIgnoreDuplicates->setText( i18n( "Ignore duplicate delimiters" ) ); |
436 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 1 ); | 451 | layout->addMultiCellWidget( mIgnoreDuplicates, 4, 4, 0, 2 ); |
437 | 452 | ||
438 | mTable = new QTable( 0, 0, page ); | 453 | mTable = new QTable( 0, 0, page ); |
439 | mTable->setSelectionMode( QTable::NoSelection ); | 454 | mTable->setSelectionMode( QTable::NoSelection ); |
440 | //mTable->horizontalHeader()->hide(); | 455 | //mTable->horizontalHeader()->hide(); |
441 | layout->addMultiCellWidget( mTable, 5, 5, 0, 1 ); | 456 | layout->addMultiCellWidget( mTable, 5, 5, 0, 2 ); |
442 | /*US | 457 | /*US |
443 | setButtonText( User1, i18n( "Apply Template" ) ); | 458 | setButtonText( User1, i18n( "Apply Template" ) ); |
444 | setButtonText( User2, i18n( "Save Template" ) ); | 459 | setButtonText( User2, i18n( "Save Template" ) ); |
445 | */ | 460 | */ |
446 | 461 | ||
447 | enableButtonOK( false ); | 462 | enableButtonOK( false ); |
448 | 463 | ||
449 | findButton( User1 )->setEnabled( false ); | 464 | findButton( User1 )->setEnabled( false ); |
450 | findButton( User2 )->setEnabled( false ); | 465 | findButton( User2 )->setEnabled( false ); |
451 | 466 | ||
452 | #ifdef DESKTOP_VERSION | 467 | #ifdef DESKTOP_VERSION |
453 | resize( 500, 300 ); | 468 | resize( 640, 480 ); |
454 | #else | 469 | #else |
455 | showMaximized(); | 470 | showMaximized(); |
456 | #endif | 471 | #endif |
457 | } | 472 | } |
458 | 473 | ||
459 | void CSVImportDialog::fillTable() | 474 | void CSVImportDialog::fillTable() |
@@ -480,16 +495,29 @@ void CSVImportDialog::fillTable() | |||
480 | mTypeStore.append( item->currentItem() ); | 495 | mTypeStore.append( item->currentItem() ); |
481 | } | 496 | } |
482 | 497 | ||
483 | clearTable(); | 498 | clearTable(); |
484 | 499 | ||
485 | row = column = 1; | 500 | row = column = 1; |
486 | mData = QString( mFileArray ); | 501 | if ( mComboCodec->currentItem () == 0 ) { |
502 | mData = QString::fromUtf8( mFileArray.data() ); | ||
503 | } else if ( mComboCodec->currentItem () == 1 ) { | ||
504 | mData = QString::fromLatin1( mFileArray.data() ); | ||
505 | } else { | ||
506 | mData = QString::fromLocal8Bit( mFileArray.data() ); | ||
507 | } | ||
487 | 508 | ||
488 | QTextStream inputStream( mData, IO_ReadOnly ); | 509 | QTextStream inputStream( mData, IO_ReadOnly ); |
489 | inputStream.setEncoding( QTextStream::Locale ); | 510 | |
511 | if ( mComboCodec->currentItem () == 0 ) { | ||
512 | inputStream.setEncoding( QTextStream::UnicodeUTF8 ); | ||
513 | } else if ( mComboCodec->currentItem () == 1 ) { | ||
514 | inputStream.setEncoding( QTextStream::Latin1 ); | ||
515 | } else { | ||
516 | inputStream.setEncoding( QTextStream::Locale ); | ||
517 | } | ||
490 | 518 | ||
491 | int maxColumn = 0; | 519 | int maxColumn = 0; |
492 | while ( !inputStream.atEnd() ) { | 520 | while ( !inputStream.atEnd() ) { |
493 | inputStream >> x; // read one char | 521 | inputStream >> x; // read one char |
494 | 522 | ||
495 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly | 523 | if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly |
@@ -605,15 +633,20 @@ void CSVImportDialog::fillTable() | |||
605 | 633 | ||
606 | adjustRows( row - mStartLine ); | 634 | adjustRows( row - mStartLine ); |
607 | mTable->setNumCols( maxColumn ); | 635 | mTable->setNumCols( maxColumn ); |
608 | 636 | ||
609 | //US begin | 637 | //US begin |
610 | QStringList keys; | 638 | QStringList keys; |
639 | uint iii = 0, count = mTypeMap.count(); | ||
640 | while ( iii < count ) { | ||
641 | keys << "dummy"; | ||
642 | ++iii; | ||
643 | } | ||
611 | QMap<QString, uint>::ConstIterator it; | 644 | QMap<QString, uint>::ConstIterator it; |
612 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) | 645 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it) |
613 | keys << it.key(); | 646 | keys[( it.data() )] = it.key(); |
614 | //US end | 647 | //US end |
615 | 648 | ||
616 | for ( column = 0; column < mTable->numCols(); ++column ) { | 649 | for ( column = 0; column < mTable->numCols(); ++column ) { |
617 | 650 | ||
618 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); | 651 | //US QComboTableItem *item = new QComboTableItem( mTable, mTypeMap.keys() ); |
619 | QComboTableItem *item = new QComboTableItem( mTable, keys ); | 652 | QComboTableItem *item = new QComboTableItem( mTable, keys ); |
@@ -679,12 +712,16 @@ void CSVImportDialog::returnPressed() | |||
679 | 712 | ||
680 | void CSVImportDialog::textChanged ( const QString& ) | 713 | void CSVImportDialog::textChanged ( const QString& ) |
681 | { | 714 | { |
682 | mRadioOther->setChecked ( true ); | 715 | mRadioOther->setChecked ( true ); |
683 | delimiterClicked( 4 ); // other | 716 | delimiterClicked( 4 ); // other |
684 | } | 717 | } |
718 | void CSVImportDialog::codecChanged ( const QString& ) | ||
719 | { | ||
720 | fillTable(); | ||
721 | } | ||
685 | 722 | ||
686 | void CSVImportDialog::delimiterClicked( int id ) | 723 | void CSVImportDialog::delimiterClicked( int id ) |
687 | { | 724 | { |
688 | switch ( id ) { | 725 | switch ( id ) { |
689 | case 0: // comma | 726 | case 0: // comma |
690 | mDelimiter = ","; | 727 | mDelimiter = ","; |
@@ -751,29 +788,29 @@ void CSVImportDialog::applyTemplate() | |||
751 | */ | 788 | */ |
752 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + | 789 | QStringList list = KGlobal::dirs()->findAllResources( "data" , KGlobal::getAppName() + |
753 | "/csv-templates/*.desktop", true, true ); | 790 | "/csv-templates/*.desktop", true, true ); |
754 | 791 | ||
755 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 792 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
756 | { | 793 | { |
757 | qDebug("for "); | 794 | |
758 | //US KSimpleConfig config( *it, true ); | 795 | //US KSimpleConfig config( *it, true ); |
759 | KConfig config( *it ); | 796 | KConfig config( *it ); |
760 | 797 | ||
761 | if ( !config.hasGroup( "csv column map" ) ) | 798 | if ( !config.hasGroup( "csv column map" ) ) |
762 | continue; | 799 | continue; |
763 | 800 | ||
764 | config.setGroup( "Misc" ); | 801 | config.setGroup( "Misc" ); |
765 | templates.append( config.readEntry( "Name" ) ); | 802 | templates.append( config.readEntry( "Name" ) ); |
766 | fileMap.insert( config.readEntry( "Name" ), *it ); | 803 | fileMap.insert( config.readEntry( "Name" ), *it ); |
767 | } | 804 | } |
768 | qDebug("weiter "); | 805 | |
769 | // let the user chose, what to take | 806 | // let the user chose, what to take |
770 | bool ok = false; | 807 | bool ok = false; |
771 | QString tmp; | 808 | QString tmp; |
772 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), | 809 | tmp = QInputDialog::getItem( i18n( "Template Selection" ), |
773 | i18n( "Please select a template, that matches the CSV file." ), | 810 | i18n( "Please select a template\nthat matches the CSV file." ), |
774 | templates, 0, false, &ok, this ); | 811 | templates, 0, false, &ok, this ); |
775 | 812 | ||
776 | if ( !ok ) | 813 | if ( !ok ) |
777 | return; | 814 | return; |
778 | 815 | ||
779 | //US KSimpleConfig config( fileMap[ tmp ], true ); | 816 | //US KSimpleConfig config( fileMap[ tmp ], true ); |
@@ -817,13 +854,13 @@ void CSVImportDialog::saveTemplate() | |||
817 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ | 854 | locateLocal( "data", KGlobal::getAppName() + "/csv-templates/" )+ |
818 | "*.desktop",i18n("Save file name") , this ); | 855 | "*.desktop",i18n("Save file name") , this ); |
819 | 856 | ||
820 | if ( fileName.isEmpty() ) | 857 | if ( fileName.isEmpty() ) |
821 | return; | 858 | return; |
822 | 859 | ||
823 | if ( !fileName.contains( ".desktop" ) ) | 860 | if ( !fileName.contains( ".desktop" ) ) |
824 | fileName += ".desktop"; | 861 | fileName += ".desktop"; |
825 | 862 | ||
826 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); | 863 | QString name = QInputDialog::getText( i18n( "Template name" ), i18n( "Please enter a name for the template" ) ); |
827 | 864 | ||
828 | if ( name.isEmpty() ) | 865 | if ( name.isEmpty() ) |
829 | return; | 866 | return; |
@@ -857,30 +894,36 @@ QString CSVImportDialog::getText( int row, int col ) | |||
857 | { | 894 | { |
858 | return mTable->text( row, col ); | 895 | return mTable->text( row, col ); |
859 | } | 896 | } |
860 | 897 | ||
861 | uint CSVImportDialog::posToType( int pos ) const | 898 | uint CSVImportDialog::posToType( int pos ) const |
862 | { | 899 | { |
900 | return pos; | ||
901 | #if 0 | ||
863 | uint counter = 0; | 902 | uint counter = 0; |
864 | QMap<QString, uint>::ConstIterator it; | 903 | QMap<QString, uint>::ConstIterator it; |
865 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 904 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
866 | if ( counter == (uint)pos ) | 905 | if ( counter == (uint)pos ) |
867 | return it.data(); | 906 | return it.data(); |
868 | 907 | ||
869 | return 0; | 908 | return 0; |
909 | #endif | ||
870 | } | 910 | } |
871 | 911 | ||
872 | int CSVImportDialog::typeToPos( uint type ) const | 912 | int CSVImportDialog::typeToPos( uint type ) const |
873 | { | 913 | { |
914 | return type; | ||
915 | #if 0 | ||
874 | uint counter = 0; | 916 | uint counter = 0; |
875 | QMap<QString, uint>::ConstIterator it; | 917 | QMap<QString, uint>::ConstIterator it; |
876 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) | 918 | for ( it = mTypeMap.begin(); it != mTypeMap.end(); ++it, ++counter ) |
877 | if ( it.data() == type ) | 919 | if ( it.data() == type ) |
878 | return counter; | 920 | return counter; |
879 | 921 | ||
880 | return -1; | 922 | return -1; |
923 | #endif | ||
881 | } | 924 | } |
882 | 925 | ||
883 | void CSVImportDialog::ignoreDuplicatesChanged( int ) | 926 | void CSVImportDialog::ignoreDuplicatesChanged( int ) |
884 | { | 927 | { |
885 | fillTable(); | 928 | fillTable(); |
886 | } | 929 | } |
diff --git a/kaddressbook/xxport/csvimportdialog.h b/kaddressbook/xxport/csvimportdialog.h index 545b5f9..5f55ab2 100644 --- a/kaddressbook/xxport/csvimportdialog.h +++ b/kaddressbook/xxport/csvimportdialog.h | |||
@@ -65,12 +65,13 @@ class CSVImportDialog : public KDialogBase | |||
65 | void lineSelected( const QString& line ); | 65 | void lineSelected( const QString& line ); |
66 | void textquoteSelected( const QString& mark ); | 66 | void textquoteSelected( const QString& mark ); |
67 | void textChanged ( const QString & ); | 67 | void textChanged ( const QString & ); |
68 | void ignoreDuplicatesChanged( int ); | 68 | void ignoreDuplicatesChanged( int ); |
69 | void setFile( const QString& ); | 69 | void setFile( const QString& ); |
70 | void urlChanged( const QString& ); | 70 | void urlChanged( const QString& ); |
71 | void codecChanged ( const QString& ); | ||
71 | 72 | ||
72 | void applyTemplate(); | 73 | void applyTemplate(); |
73 | void saveTemplate(); | 74 | void saveTemplate(); |
74 | 75 | ||
75 | private: | 76 | private: |
76 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, | 77 | enum { Undefined, FormattedName, FamilyName, GivenName, AdditionalName, |
@@ -78,25 +79,26 @@ class CSVImportDialog : public KDialogBase | |||
78 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, | 79 | HomeAddressStreet, HomeAddressLocality, HomeAddressRegion, |
79 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, | 80 | HomeAddressPostalCode, HomeAddressCountry, HomeAddressLabel, |
80 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, | 81 | BusinessAddressStreet, BusinessAddressLocality, BusinessAddressRegion, |
81 | BusinessAddressPostalCode, BusinessAddressCountry, | 82 | BusinessAddressPostalCode, BusinessAddressCountry, |
82 | BusinessAddressLabel, | 83 | BusinessAddressLabel, |
83 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, | 84 | HomePhone, BusinessPhone, MobilePhone, HomeFax, BusinessFax, CarPhone, |
84 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL | 85 | Isdn, Pager, Email, Mailer, Title, Role, Organization, Note, URL, Categories |
85 | }; | 86 | }; |
86 | 87 | ||
87 | QTable* mTable; | 88 | QTable* mTable; |
88 | QButtonGroup* mDelimiterBox; | 89 | QButtonGroup* mDelimiterBox; |
89 | QRadioButton* mRadioComma; | 90 | QRadioButton* mRadioComma; |
90 | QRadioButton* mRadioSemicolon; | 91 | QRadioButton* mRadioSemicolon; |
91 | QRadioButton* mRadioTab; | 92 | QRadioButton* mRadioTab; |
92 | QRadioButton* mRadioSpace; | 93 | QRadioButton* mRadioSpace; |
93 | QRadioButton* mRadioOther; | 94 | QRadioButton* mRadioOther; |
94 | QLineEdit* mDelimiterEdit; | 95 | QLineEdit* mDelimiterEdit; |
95 | QComboBox* mComboLine; | 96 | QComboBox* mComboLine; |
96 | QComboBox* mComboQuote; | 97 | QComboBox* mComboQuote; |
98 | QComboBox* mComboCodec; | ||
97 | QCheckBox* mIgnoreDuplicates; | 99 | QCheckBox* mIgnoreDuplicates; |
98 | KURLRequester* mUrlRequester; | 100 | KURLRequester* mUrlRequester; |
99 | 101 | ||
100 | void initGUI(); | 102 | void initGUI(); |
101 | void fillTable(); | 103 | void fillTable(); |
102 | void clearTable(); | 104 | void clearTable(); |
diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 3f47425..6be1580 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp | |||
@@ -23,13 +23,16 @@ QString KFileDialog::getSaveFileName( const QString & fn, | |||
23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); | 23 | OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); |
24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); | 24 | QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); |
25 | lay.addWidget( &o); | 25 | lay.addWidget( &o); |
26 | // o.setNewVisible( true ); | 26 | // o.setNewVisible( true ); |
27 | // o.setNameVisible( true ); | 27 | // o.setNameVisible( true ); |
28 | dia.showMaximized(); | 28 | dia.showMaximized(); |
29 | dia.setCaption( cap ); | 29 | if ( cap.isEmpty() ) |
30 | dia.setCaption( file ); | ||
31 | else | ||
32 | dia.setCaption( cap ); | ||
30 | int res = dia.exec(); | 33 | int res = dia.exec(); |
31 | if ( res ) | 34 | if ( res ) |
32 | retfile = o.selectedName(); | 35 | retfile = o.selectedName(); |
33 | return retfile; | 36 | return retfile; |
34 | } | 37 | } |
35 | 38 | ||
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp index 6d39308..991c8be 100644 --- a/microkde/kio/kfile/kurlrequester.cpp +++ b/microkde/kio/kfile/kurlrequester.cpp | |||
@@ -269,13 +269,13 @@ void KURLRequester::slotOpenDialog() | |||
269 | emit openFileDialog( this ); | 269 | emit openFileDialog( this ); |
270 | 270 | ||
271 | //US use our special KFIleDialog instead | 271 | //US use our special KFIleDialog instead |
272 | KURL u( url() ); | 272 | KURL u( url() ); |
273 | //QString fn = u.url(); | 273 | //QString fn = u.url(); |
274 | QString fn = d->edit->text(); | 274 | QString fn = d->edit->text(); |
275 | fn = KFileDialog::getSaveFileName( fn, "Save backup filename", this ); | 275 | fn = KFileDialog::getSaveFileName( fn, "", this ); |
276 | 276 | ||
277 | if ( fn == "" ) | 277 | if ( fn == "" ) |
278 | return; | 278 | return; |
279 | 279 | ||
280 | setURL( fn ); | 280 | setURL( fn ); |
281 | emit urlSelected( d->url() ); | 281 | emit urlSelected( d->url() ); |