author | zautrix <zautrix> | 2004-10-17 14:32:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 14:32:16 (UTC) |
commit | 780a12295cbbcf4eff4f9570322c1cac517414ad (patch) (unidiff) | |
tree | 4c68b7e6ee854f9d4f0e7e3032f7c70cc45668be /libkdepim/ksyncmanager.cpp | |
parent | f909868a098a22c17906f3d2ab05d5fac0332e85 (diff) | |
download | kdepimpi-780a12295cbbcf4eff4f9570322c1cac517414ad.zip kdepimpi-780a12295cbbcf4eff4f9570322c1cac517414ad.tar.gz kdepimpi-780a12295cbbcf4eff4f9570322c1cac517414ad.tar.bz2 |
many kde sync fixes
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index c6e06f8..8851097 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -720,131 +720,134 @@ void KSyncManager::edit_sync_options() | |||
720 | break; | 720 | break; |
721 | default: | 721 | default: |
722 | break; | 722 | break; |
723 | } | 723 | } |
724 | if ( dia.exec() ) { | 724 | if ( dia.exec() ) { |
725 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; | 725 | mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; |
726 | } | 726 | } |
727 | 727 | ||
728 | 728 | ||
729 | } | 729 | } |
730 | 730 | ||
731 | QString KSyncManager::getPassword( ) | 731 | QString KSyncManager::getPassword( ) |
732 | { | 732 | { |
733 | QString retfile = ""; | 733 | QString retfile = ""; |
734 | QDialog dia ( mParent, "input-dialog", true ); | 734 | QDialog dia ( mParent, "input-dialog", true ); |
735 | QLineEdit lab ( &dia ); | 735 | QLineEdit lab ( &dia ); |
736 | lab.setEchoMode( QLineEdit::Password ); | 736 | lab.setEchoMode( QLineEdit::Password ); |
737 | QVBoxLayout lay( &dia ); | 737 | QVBoxLayout lay( &dia ); |
738 | lay.setMargin(7); | 738 | lay.setMargin(7); |
739 | lay.setSpacing(7); | 739 | lay.setSpacing(7); |
740 | lay.addWidget( &lab); | 740 | lay.addWidget( &lab); |
741 | dia.setFixedSize( 230,50 ); | 741 | dia.setFixedSize( 230,50 ); |
742 | dia.setCaption( i18n("Enter password") ); | 742 | dia.setCaption( i18n("Enter password") ); |
743 | QPushButton pb ( "OK", &dia); | 743 | QPushButton pb ( "OK", &dia); |
744 | lay.addWidget( &pb ); | 744 | lay.addWidget( &pb ); |
745 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); | 745 | connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); |
746 | dia.show(); | 746 | dia.show(); |
747 | int res = dia.exec(); | 747 | int res = dia.exec(); |
748 | if ( res ) | 748 | if ( res ) |
749 | retfile = lab.text(); | 749 | retfile = lab.text(); |
750 | dia.hide(); | 750 | dia.hide(); |
751 | qApp->processEvents(); | 751 | qApp->processEvents(); |
752 | return retfile; | 752 | return retfile; |
753 | 753 | ||
754 | } | 754 | } |
755 | 755 | ||
756 | 756 | ||
757 | void KSyncManager::confSync() | 757 | void KSyncManager::confSync() |
758 | { | 758 | { |
759 | static KSyncPrefsDialog* sp = 0; | 759 | static KSyncPrefsDialog* sp = 0; |
760 | if ( ! sp ) { | 760 | if ( ! sp ) { |
761 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); | 761 | sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); |
762 | } | 762 | } |
763 | sp->usrReadConfig(); | 763 | sp->usrReadConfig(); |
764 | #ifndef DESKTOP_VERSION | 764 | #ifndef DESKTOP_VERSION |
765 | sp->showMaximized(); | 765 | sp->showMaximized(); |
766 | #else | 766 | #else |
767 | sp->show(); | 767 | sp->show(); |
768 | #endif | 768 | #endif |
769 | sp->exec(); | 769 | sp->exec(); |
770 | mSyncProfileNames = sp->getSyncProfileNames(); | 770 | mSyncProfileNames = sp->getSyncProfileNames(); |
771 | mLocalMachineName = sp->getLocalMachineName (); | 771 | mLocalMachineName = sp->getLocalMachineName (); |
772 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); | 772 | QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); |
773 | } | 773 | } |
774 | void KSyncManager::syncKDE() | 774 | void KSyncManager::syncKDE() |
775 | { | 775 | { |
776 | emit save(); | 776 | emit save(); |
777 | switch(mTargetApp) | 777 | switch(mTargetApp) |
778 | { | 778 | { |
779 | case (KAPI): | 779 | case (KAPI): |
780 | 780 | ||
781 | break; | 781 | break; |
782 | case (KOPI): | 782 | case (KOPI): |
783 | { | 783 | { |
784 | QString command ="./kdecaldump"; | 784 | QString command = qApp->applicationDirPath () + "/kdecaldump"; |
785 | if ( ! QFile::exists ( command ) ) | ||
786 | command = "kdecaldump"; | ||
787 | QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; | ||
785 | system ( command.latin1()); | 788 | system ( command.latin1()); |
786 | if ( syncWithFile( "/tmp/kdedumpall.ics",true ) ) { | 789 | if ( syncWithFile( fileName,true ) ) { |
787 | if ( mWriteBackFile ) { | 790 | if ( mWriteBackFile ) { |
788 | command += " --read"; | 791 | command += " --read"; |
789 | system ( command.latin1()); | 792 | system ( command.latin1()); |
790 | } | 793 | } |
791 | } | 794 | } |
792 | 795 | ||
793 | } | 796 | } |
794 | break; | 797 | break; |
795 | case (PWMPI): | 798 | case (PWMPI): |
796 | 799 | ||
797 | break; | 800 | break; |
798 | default: | 801 | default: |
799 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); | 802 | qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); |
800 | break; | 803 | break; |
801 | 804 | ||
802 | } | 805 | } |
803 | } | 806 | } |
804 | 807 | ||
805 | void KSyncManager::syncSharp() | 808 | void KSyncManager::syncSharp() |
806 | { | 809 | { |
807 | 810 | ||
808 | if ( ! syncExternalApplication("sharp") ) | 811 | if ( ! syncExternalApplication("sharp") ) |
809 | qDebug("ERROR sync sharp "); | 812 | qDebug("ERROR sync sharp "); |
810 | } | 813 | } |
811 | 814 | ||
812 | bool KSyncManager::syncExternalApplication(QString resource) | 815 | bool KSyncManager::syncExternalApplication(QString resource) |
813 | { | 816 | { |
814 | 817 | ||
815 | emit save(); | 818 | emit save(); |
816 | 819 | ||
817 | if ( mAskForPreferences ) | 820 | if ( mAskForPreferences ) |
818 | edit_sync_options(); | 821 | edit_sync_options(); |
819 | 822 | ||
820 | qDebug("Sync extern %s", resource.latin1()); | 823 | qDebug("Sync extern %s", resource.latin1()); |
821 | 824 | ||
822 | bool syncOK = mImplementation->syncExternal(this, resource); | 825 | bool syncOK = mImplementation->syncExternal(this, resource); |
823 | 826 | ||
824 | return syncOK; | 827 | return syncOK; |
825 | 828 | ||
826 | } | 829 | } |
827 | 830 | ||
828 | void KSyncManager::syncPhone() | 831 | void KSyncManager::syncPhone() |
829 | { | 832 | { |
830 | 833 | ||
831 | syncExternalApplication("phone"); | 834 | syncExternalApplication("phone"); |
832 | 835 | ||
833 | } | 836 | } |
834 | 837 | ||
835 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) | 838 | void KSyncManager::showProgressBar(int percentage, QString caption, int total) |
836 | { | 839 | { |
837 | if (!bar->isVisible()) | 840 | if (!bar->isVisible()) |
838 | { | 841 | { |
839 | bar->setCaption (caption); | 842 | bar->setCaption (caption); |
840 | bar->setTotalSteps ( total ) ; | 843 | bar->setTotalSteps ( total ) ; |
841 | 844 | ||
842 | bar->show(); | 845 | bar->show(); |
843 | } | 846 | } |
844 | 847 | ||
845 | bar->setProgress( percentage ); | 848 | bar->setProgress( percentage ); |
846 | } | 849 | } |
847 | 850 | ||
848 | void KSyncManager::hideProgressBar() | 851 | void KSyncManager::hideProgressBar() |
849 | { | 852 | { |
850 | bar->hide(); | 853 | bar->hide(); |