summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-08 10:12:21 (UTC)
committer zautrix <zautrix>2004-09-08 10:12:21 (UTC)
commitcdff4506a9148c47406af86968da73c0dbfca0ba (patch) (unidiff)
tree10cf9302bfd14d768005e7ac3192f936364bd77d
parent848c77f86b7105095b27a6034a0fefac8a7a0891 (diff)
downloadkdepimpi-cdff4506a9148c47406af86968da73c0dbfca0ba.zip
kdepimpi-cdff4506a9148c47406af86968da73c0dbfca0ba.tar.gz
kdepimpi-cdff4506a9148c47406af86968da73c0dbfca0ba.tar.bz2
Changing sync profiles filename
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp6
-rw-r--r--libkdepim/ksyncprefsdialog.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7978b46..9e326a1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -811,140 +811,140 @@ void MainWindow::initActions()
811 if (p-> mShowIconDay1) 811 if (p-> mShowIconDay1)
812 configureToolBarMenu->setItemChecked( 40, true ); 812 configureToolBarMenu->setItemChecked( 40, true );
813 if (p-> mShowIconDay5) 813 if (p-> mShowIconDay5)
814 configureToolBarMenu->setItemChecked( 50, true ); 814 configureToolBarMenu->setItemChecked( 50, true );
815 if (p-> mShowIconDay7) 815 if (p-> mShowIconDay7)
816 configureToolBarMenu->setItemChecked( 60, true ); 816 configureToolBarMenu->setItemChecked( 60, true );
817 if (p-> mShowIconMonth) 817 if (p-> mShowIconMonth)
818 configureToolBarMenu->setItemChecked( 70, true ); 818 configureToolBarMenu->setItemChecked( 70, true );
819 if (p-> mShowIconTodoview) 819 if (p-> mShowIconTodoview)
820 configureToolBarMenu->setItemChecked( 80, true ); 820 configureToolBarMenu->setItemChecked( 80, true );
821 if (p-> mShowIconBackFast) 821 if (p-> mShowIconBackFast)
822 configureToolBarMenu->setItemChecked( 200, true ); 822 configureToolBarMenu->setItemChecked( 200, true );
823 if (p-> mShowIconBack) 823 if (p-> mShowIconBack)
824 configureToolBarMenu->setItemChecked( 210, true ); 824 configureToolBarMenu->setItemChecked( 210, true );
825 if (p-> mShowIconToday) 825 if (p-> mShowIconToday)
826 configureToolBarMenu->setItemChecked( 130, true ); 826 configureToolBarMenu->setItemChecked( 130, true );
827 if (p-> mShowIconForward) 827 if (p-> mShowIconForward)
828 configureToolBarMenu->setItemChecked( 220, true ); 828 configureToolBarMenu->setItemChecked( 220, true );
829 if (p-> mShowIconForwardFast) 829 if (p-> mShowIconForwardFast)
830 configureToolBarMenu->setItemChecked( 230, true ); 830 configureToolBarMenu->setItemChecked( 230, true );
831 if (p-> mShowIconNextDays) 831 if (p-> mShowIconNextDays)
832 configureToolBarMenu->setItemChecked( 100, true ); 832 configureToolBarMenu->setItemChecked( 100, true );
833 if (p-> mShowIconNext) 833 if (p-> mShowIconNext)
834 configureToolBarMenu->setItemChecked( 110, true ); 834 configureToolBarMenu->setItemChecked( 110, true );
835 if (p-> mShowIconJournal) 835 if (p-> mShowIconJournal)
836 configureToolBarMenu->setItemChecked( 90, true ); 836 configureToolBarMenu->setItemChecked( 90, true );
837 if (p-> mShowIconWhatsThis) 837 if (p-> mShowIconWhatsThis)
838 configureToolBarMenu->setItemChecked( 300, true ); 838 configureToolBarMenu->setItemChecked( 300, true );
839 839
840 QLabel* dummy = new QLabel( iconToolBar ); 840 QLabel* dummy = new QLabel( iconToolBar );
841 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 841 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
842 if (!p-> mShowIconStretch) 842 if (!p-> mShowIconStretch)
843 iconToolBar->setStretchableWidget ( dummy ) ; 843 iconToolBar->setStretchableWidget ( dummy ) ;
844 else 844 else
845 configureToolBarMenu->setItemChecked( 5, true ); 845 configureToolBarMenu->setItemChecked( 5, true );
846 if (p-> mShowIconWhatsThis) 846 if (p-> mShowIconWhatsThis)
847 QWhatsThis::whatsThisButton ( iconToolBar ); 847 QWhatsThis::whatsThisButton ( iconToolBar );
848 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 848 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
849 configureAgenda( p->mHourSize ); 849 configureAgenda( p->mHourSize );
850 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 850 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
851} 851}
852void MainWindow::fillSyncMenu() 852void MainWindow::fillSyncMenu()
853{ 853{
854 syncMenu->clear(); 854 syncMenu->clear();
855 syncMenu->insertItem( i18n("Configure..."), 0 ); 855 syncMenu->insertItem( i18n("Configure..."), 0 );
856 syncMenu->insertSeparator(); 856 syncMenu->insertSeparator();
857 syncMenu->insertItem( i18n("Multiple sync"), 1 ); 857 syncMenu->insertItem( i18n("Multiple sync"), 1 );
858 syncMenu->insertSeparator(); 858 syncMenu->insertSeparator();
859 KConfig config ( locateLocal( "config","syncprofilesrc" ) ); 859 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
860 config.setGroup("General"); 860 config.setGroup("General");
861 QStringList prof = config.readListEntry("SyncProfileNames"); 861 QStringList prof = config.readListEntry("SyncProfileNames");
862 KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined"); 862 KOPrefs::instance()->mLocalMachineName = config.readEntry("LocalMachineName","undefined");
863 if ( prof.count() < 3 ) { 863 if ( prof.count() < 3 ) {
864 prof.clear(); 864 prof.clear();
865 prof << i18n("Sharp_DTM"); 865 prof << i18n("Sharp_DTM");
866 prof << i18n("Local_file"); 866 prof << i18n("Local_file");
867 prof << i18n("Last_file"); 867 prof << i18n("Last_file");
868 KSyncProfile* temp = new KSyncProfile (); 868 KSyncProfile* temp = new KSyncProfile ();
869 temp->setName( prof[0] ); 869 temp->setName( prof[0] );
870 temp->writeConfig(&config); 870 temp->writeConfig(&config);
871 temp->setName( prof[1] ); 871 temp->setName( prof[1] );
872 temp->writeConfig(&config); 872 temp->writeConfig(&config);
873 temp->setName( prof[2] ); 873 temp->setName( prof[2] );
874 temp->writeConfig(&config); 874 temp->writeConfig(&config);
875 config.setGroup("General"); 875 config.setGroup("General");
876 config.writeEntry("SyncProfileNames",prof); 876 config.writeEntry("SyncProfileNames",prof);
877 config.writeEntry("ExternSyncProfiles","Sharp_DTM"); 877 config.writeEntry("ExternSyncProfiles","Sharp_DTM");
878 config.sync(); 878 config.sync();
879 delete temp; 879 delete temp;
880 } 880 }
881 KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); 881 KOPrefs::instance()->mExternSyncProfiles = config.readListEntry("ExternSyncProfiles");
882 KOPrefs::instance()->mSyncProfileNames = prof; 882 KOPrefs::instance()->mSyncProfileNames = prof;
883 int i; 883 int i;
884 for ( i = 0; i < prof.count(); ++i ) { 884 for ( i = 0; i < prof.count(); ++i ) {
885 885
886 syncMenu->insertItem( prof[i], 1000+i ); 886 syncMenu->insertItem( prof[i], 1000+i );
887 if ( i == 2 ) 887 if ( i == 2 )
888 syncMenu->insertSeparator(); 888 syncMenu->insertSeparator();
889 } 889 }
890 QDir app_dir; 890 QDir app_dir;
891 if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { 891 if ( !app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
892 syncMenu->setItemEnabled( false , 1000 ); 892 syncMenu->setItemEnabled( false , 1000 );
893 } 893 }
894 mView->setupExternSyncProfiles(); 894 mView->setupExternSyncProfiles();
895} 895}
896 896
897int MainWindow::ringSync() 897int MainWindow::ringSync()
898{ 898{
899 int syncedProfiles = 0; 899 int syncedProfiles = 0;
900 int i; 900 int i;
901 QTime timer; 901 QTime timer;
902 KConfig config ( locateLocal( "config","syncprofilesrc" ) ); 902 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
903 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; 903 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames;
904 KSyncProfile* temp = new KSyncProfile (); 904 KSyncProfile* temp = new KSyncProfile ();
905 KOPrefs::instance()->mAskForPreferences = false; 905 KOPrefs::instance()->mAskForPreferences = false;
906 for ( i = 0; i < syncProfileNames.count(); ++i ) { 906 for ( i = 0; i < syncProfileNames.count(); ++i ) {
907 mCurrentSyncProfile = i; 907 mCurrentSyncProfile = i;
908 temp->setName(syncProfileNames[mCurrentSyncProfile]); 908 temp->setName(syncProfileNames[mCurrentSyncProfile]);
909 temp->readConfig(&config); 909 temp->readConfig(&config);
910 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { 910 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) {
911 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); 911 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
912 ++syncedProfiles; 912 ++syncedProfiles;
913 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 913 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
914 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 914 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
915 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 915 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
916 KOPrefs::instance()->mShowSyncSummary = false; 916 KOPrefs::instance()->mShowSyncSummary = false;
917 mView->setSyncDevice(syncProfileNames[i] ); 917 mView->setSyncDevice(syncProfileNames[i] );
918 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 918 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
919 if ( i == 0 ) { 919 if ( i == 0 ) {
920 syncSharp(); 920 syncSharp();
921 } else { 921 } else {
922 if ( temp->getIsLocalFileSync() ) { 922 if ( temp->getIsLocalFileSync() ) {
923 if ( syncWithFile( temp->getRemoteFileName( ), true ) ) 923 if ( syncWithFile( temp->getRemoteFileName( ), true ) )
924 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 924 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
925 } else { 925 } else {
926 if ( temp->getIsPhoneSync() ) { 926 if ( temp->getIsPhoneSync() ) {
927 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; 927 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
928 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); 928 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
929 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); 929 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
930 syncPhone(); 930 syncPhone();
931 } else 931 } else
932 syncRemote( temp, false ); 932 syncRemote( temp, false );
933 933
934 } 934 }
935 } 935 }
936 timer.start(); 936 timer.start();
937 setCaption(i18n("Multiple sync in progress ... please wait!") ); 937 setCaption(i18n("Multiple sync in progress ... please wait!") );
938 while ( timer.elapsed () < 2000 ) { 938 while ( timer.elapsed () < 2000 ) {
939 qApp->processEvents(); 939 qApp->processEvents();
940#ifndef _WIN32_ 940#ifndef _WIN32_
941 sleep (1); 941 sleep (1);
942#endif 942#endif
943 } 943 }
944 944
945 } 945 }
946 946
947 } 947 }
948 delete temp; 948 delete temp;
949 return syncedProfiles; 949 return syncedProfiles;
950} 950}
@@ -958,97 +958,97 @@ void MainWindow::multiSync( bool askforPrefs )
958 if ( QMessageBox::information( this, i18n("KO/Pi Sync"), 958 if ( QMessageBox::information( this, i18n("KO/Pi Sync"),
959 question, 959 question,
960 i18n("Yes"), i18n("No"), 960 i18n("Yes"), i18n("No"),
961 0, 0 ) != 0 ) { 961 0, 0 ) != 0 ) {
962 mBlockSaveFlag = false; 962 mBlockSaveFlag = false;
963 setCaption(i18n("Aborted! Nothing synced!")); 963 setCaption(i18n("Aborted! Nothing synced!"));
964 return; 964 return;
965 } 965 }
966 mView->setSyncDevice(i18n("Multiple profiles") ); 966 mView->setSyncDevice(i18n("Multiple profiles") );
967 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs; 967 KOPrefs::instance()->mSyncAlgoPrefs = KOPrefs::instance()->mRingSyncAlgoPrefs;
968 if ( askforPrefs ) { 968 if ( askforPrefs ) {
969 mView->edit_sync_options(); 969 mView->edit_sync_options();
970 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs; 970 KOPrefs::instance()->mRingSyncAlgoPrefs = KOPrefs::instance()->mSyncAlgoPrefs;
971 } 971 }
972 setCaption(i18n("Multiple sync started.") ); 972 setCaption(i18n("Multiple sync started.") );
973 qApp->processEvents(); 973 qApp->processEvents();
974 int num = ringSync() ; 974 int num = ringSync() ;
975 if ( num > 1 ) 975 if ( num > 1 )
976 ringSync(); 976 ringSync();
977 mBlockSaveFlag = false; 977 mBlockSaveFlag = false;
978 if ( num ) 978 if ( num )
979 save(); 979 save();
980 if ( num ) 980 if ( num )
981 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); 981 setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) );
982 else 982 else
983 setCaption(i18n("Nothing synced! No profiles defined for multisync!")); 983 setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
984 return; 984 return;
985} 985}
986void MainWindow::slotSyncMenu( int action ) 986void MainWindow::slotSyncMenu( int action )
987{ 987{
988 //qDebug("syncaction %d ", action); 988 //qDebug("syncaction %d ", action);
989 if ( action == 0 ) { 989 if ( action == 0 ) {
990 990
991 confSync(); 991 confSync();
992 992
993 return; 993 return;
994 } 994 }
995 if ( action == 1 ) { 995 if ( action == 1 ) {
996 multiSync( true ); 996 multiSync( true );
997 return; 997 return;
998 } 998 }
999 999
1000 if (mBlockSaveFlag) 1000 if (mBlockSaveFlag)
1001 return; 1001 return;
1002 mBlockSaveFlag = true; 1002 mBlockSaveFlag = true;
1003 mCurrentSyncProfile = action - 1000 ; 1003 mCurrentSyncProfile = action - 1000 ;
1004 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); 1004 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] );
1005 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 1005 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
1006 KConfig config ( locateLocal( "config","syncprofilesrc" ) ); 1006 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
1007 KSyncProfile* temp = new KSyncProfile (); 1007 KSyncProfile* temp = new KSyncProfile ();
1008 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 1008 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
1009 temp->readConfig(&config); 1009 temp->readConfig(&config);
1010 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 1010 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
1011 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); 1011 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs();
1012 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 1012 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
1013 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 1013 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
1014 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); 1014 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync();
1015 if ( action == 1000 ) { 1015 if ( action == 1000 ) {
1016 syncSharp(); 1016 syncSharp();
1017 1017
1018 } else if ( action == 1001 ) { 1018 } else if ( action == 1001 ) {
1019 syncLocalFile(); 1019 syncLocalFile();
1020 1020
1021 } else if ( action == 1002 ) { 1021 } else if ( action == 1002 ) {
1022 quickSyncLocalFile(); 1022 quickSyncLocalFile();
1023 1023
1024 } else if ( action >= 1003 ) { 1024 } else if ( action >= 1003 ) {
1025 if ( temp->getIsLocalFileSync() ) { 1025 if ( temp->getIsLocalFileSync() ) {
1026 if ( syncWithFile( temp->getRemoteFileName( ), false ) ) 1026 if ( syncWithFile( temp->getRemoteFileName( ), false ) )
1027 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 1027 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
1028 } else { 1028 } else {
1029 if ( temp->getIsPhoneSync() ) { 1029 if ( temp->getIsPhoneSync() ) {
1030 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; 1030 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
1031 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); 1031 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
1032 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); 1032 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
1033 syncPhone(); 1033 syncPhone();
1034 } else 1034 } else
1035 syncRemote( temp ); 1035 syncRemote( temp );
1036 1036
1037 } 1037 }
1038 } 1038 }
1039 delete temp; 1039 delete temp;
1040 mBlockSaveFlag = false; 1040 mBlockSaveFlag = false;
1041} 1041}
1042void MainWindow::setDefaultPreferences() 1042void MainWindow::setDefaultPreferences()
1043{ 1043{
1044 KOPrefs *p = KOPrefs::instance(); 1044 KOPrefs *p = KOPrefs::instance();
1045 1045
1046 p->mCompactDialogs = true; 1046 p->mCompactDialogs = true;
1047 p->mConfirm = true; 1047 p->mConfirm = true;
1048 // p->mEnableQuickTodo = false; 1048 // p->mEnableQuickTodo = false;
1049} 1049}
1050 1050
1051QString MainWindow::resourcePath() 1051QString MainWindow::resourcePath()
1052{ 1052{
1053 return KGlobal::iconLoader()->iconPath(); 1053 return KGlobal::iconLoader()->iconPath();
1054} 1054}
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 67a3f52..857ceac 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -497,121 +497,121 @@ void KSyncPrefsDialog::insertProfiles()
497 profileChanged( mProfileBox->currentItem() ); 497 profileChanged( mProfileBox->currentItem() );
498 currentSelection = mProfileBox->currentItem(); 498 currentSelection = mProfileBox->currentItem();
499 } 499 }
500 mProfileBox->blockSignals( false ); 500 mProfileBox->blockSignals( false );
501} 501}
502 502
503void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) 503void KSyncPrefsDialog::addProfile ( KSyncProfile* temp )
504{ 504{
505 saveProfile(); 505 saveProfile();
506 mSyncProfiles.append( temp ); 506 mSyncProfiles.append( temp );
507 mSyncProfileNames << temp->getName(); 507 mSyncProfileNames << temp->getName();
508 insertProfiles(); 508 insertProfiles();
509 int last = mProfileBox->count() -1; 509 int last = mProfileBox->count() -1;
510 mProfileBox->blockSignals( true ); 510 mProfileBox->blockSignals( true );
511 mProfileBox->setCurrentItem( last ); 511 mProfileBox->setCurrentItem( last );
512 mProfileBox->blockSignals( false ); 512 mProfileBox->blockSignals( false );
513 profileChanged(last); 513 profileChanged(last);
514} 514}
515void KSyncPrefsDialog::newProfile() 515void KSyncPrefsDialog::newProfile()
516{ 516{
517 addProfile ( new KSyncProfile () ); 517 addProfile ( new KSyncProfile () );
518} 518}
519 519
520void KSyncPrefsDialog::cloneProfile() 520void KSyncPrefsDialog::cloneProfile()
521{ 521{
522 if ( currentSelection >= 0 ) 522 if ( currentSelection >= 0 )
523 addProfile (mSyncProfiles.at(currentSelection)->clone()) ; 523 addProfile (mSyncProfiles.at(currentSelection)->clone()) ;
524 else 524 else
525 newProfile(); 525 newProfile();
526} 526}
527 527
528void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) 528void KSyncPrefsDialog::setLocalMachineName ( const QString& name )
529{ 529{
530 mMyMachineName->setText( name ); 530 mMyMachineName->setText( name );
531 531
532} 532}
533QString KSyncPrefsDialog::getLocalMachineName ( ) 533QString KSyncPrefsDialog::getLocalMachineName ( )
534{ 534{
535 return mMyMachineName->text(); 535 return mMyMachineName->text();
536} 536}
537 537
538QStringList KSyncPrefsDialog::getSyncProfileNames() 538QStringList KSyncPrefsDialog::getSyncProfileNames()
539{ 539{
540 return mSyncProfileNames; 540 return mSyncProfileNames;
541} 541}
542void KSyncPrefsDialog::usrReadConfig() 542void KSyncPrefsDialog::usrReadConfig()
543{ 543{
544 //KConfig *config = KOGlobals::config(); 544 //KConfig *config = KOGlobals::config();
545 KConfig config ( locateLocal( "config","syncprofilesrc" ) ); 545 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
546 config.setGroup("General"); 546 config.setGroup("General");
547 mSyncProfileNames =config.readListEntry("SyncProfileNames"); 547 mSyncProfileNames =config.readListEntry("SyncProfileNames");
548 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); 548 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined"));
549 int i; 549 int i;
550 KSyncProfile* temp ; 550 KSyncProfile* temp ;
551 mSyncProfiles.clear(); 551 mSyncProfiles.clear();
552 for ( i = 0; i < mSyncProfileNames.count();++i ) { 552 for ( i = 0; i < mSyncProfileNames.count();++i ) {
553 temp = new KSyncProfile (); 553 temp = new KSyncProfile ();
554 temp->setName( mSyncProfileNames[i] ); 554 temp->setName( mSyncProfileNames[i] );
555 temp->readConfig( &config ); 555 temp->readConfig( &config );
556 mSyncProfiles.append( temp ); 556 mSyncProfiles.append( temp );
557 } 557 }
558 insertProfiles(); 558 insertProfiles();
559 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); 559 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName );
560} 560}
561 561
562 562
563void KSyncPrefsDialog::usrWriteConfig() 563void KSyncPrefsDialog::usrWriteConfig()
564{ 564{
565 saveProfile(); 565 saveProfile();
566 if ( currentSelection >= 0 ) 566 if ( currentSelection >= 0 )
567 profileChanged(currentSelection); 567 profileChanged(currentSelection);
568 //KConfig *config = KOGlobals::config(); 568 //KConfig *config = KOGlobals::config();
569 KConfig config ( locateLocal( "config","syncprofilesrc" ) ); 569 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
570 KSyncProfile* prof = mSyncProfiles.first(); 570 KSyncProfile* prof = mSyncProfiles.first();
571 QStringList externalSyncProfileNames; 571 QStringList externalSyncProfileNames;
572 externalSyncProfileNames.append("Sharp_DTM");; 572 externalSyncProfileNames.append("Sharp_DTM");;
573 while ( prof ) { 573 while ( prof ) {
574 prof->writeConfig(&config); 574 prof->writeConfig(&config);
575 if ( prof->getIsPhoneSync( ) ) 575 if ( prof->getIsPhoneSync( ) )
576 externalSyncProfileNames.append(prof->getName( ) ); 576 externalSyncProfileNames.append(prof->getName( ) );
577 prof = mSyncProfiles.next(); 577 prof = mSyncProfiles.next();
578 } 578 }
579 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; 579 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames;
580 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); 580 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text();
581 config.setGroup("General"); 581 config.setGroup("General");
582 config.writeEntry("SyncProfileNames",mSyncProfileNames); 582 config.writeEntry("SyncProfileNames",mSyncProfileNames);
583 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); 583 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames);
584 config.writeEntry("LocalMachineName",mMyMachineName->text()); 584 config.writeEntry("LocalMachineName",mMyMachineName->text());
585 config.sync(); 585 config.sync();
586} 586}
587 587
588void KSyncPrefsDialog::helpDevice() 588void KSyncPrefsDialog::helpDevice()
589{ 589{
590 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); 590 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n");
591#ifdef _WIN32_ 591#ifdef _WIN32_
592 hint += "Leave empty for Irda.\n" 592 hint += "Leave empty for Irda.\n"
593 "com1:\n(first serial port)\n" 593 "com1:\n(first serial port)\n"
594 "usb not supported\n" 594 "usb not supported\n"
595 "???\n(bluetooth device address)\n"; 595 "???\n(bluetooth device address)\n";
596 596
597#else 597#else
598 hint += "/dev/ircomm\n(Irda)\n" 598 hint += "/dev/ircomm\n(Irda)\n"
599 "/dev/ttyS0\n(first serial port)\n" 599 "/dev/ttyS0\n(first serial port)\n"
600 "/dev/ttyUSB0\n(first device usb port)\n" 600 "/dev/ttyUSB0\n(first device usb port)\n"
601 "???\n(bluetooth device address)\n"; 601 "???\n(bluetooth device address)\n";
602#endif 602#endif
603 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 603 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
604} 604}
605void KSyncPrefsDialog::helpModel() 605void KSyncPrefsDialog::helpModel()
606{ 606{
607 QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); 607 QString hint = i18n("Leave empty or\ninsert name of phone model:\n");
608 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; 608 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection";
609 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 609 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
610 610
611} 611}
612void KSyncPrefsDialog::helpConnection() 612void KSyncPrefsDialog::helpConnection()
613{ 613{
614 QString hint = i18n("Insert kind of connection,e.g.:\n"); 614 QString hint = i18n("Insert kind of connection,e.g.:\n");
615 hint += "irda | Nokia FBUS over infrared\n" 615 hint += "irda | Nokia FBUS over infrared\n"
616 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" 616 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n"
617 "irdaobex | set also model as obex\n" 617 "irdaobex | set also model as obex\n"