summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2004-10-26 22:19:18 (UTC)
committer zautrix <zautrix>2004-10-26 22:19:18 (UTC)
commit6385f303bef3cbcd19d097a7b05c30e144d5dd6e (patch) (unidiff)
tree770795d94ea6ec1dc8bcaa67cc174a9c0add564a /libkdepim
parent13e996beddabc5e88f4f2fe49b2ce6cb8408eb30 (diff)
downloadkdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.zip
kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.gz
kdepimpi-6385f303bef3cbcd19d097a7b05c30e144d5dd6e.tar.bz2
implemented remove sync info for kopi and kapi
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp42
-rw-r--r--libkdepim/ksyncmanager.h1
2 files changed, 41 insertions, 2 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 4390a06..feb184b 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -42,161 +42,193 @@
42#include <qbuttongroup.h> 42#include <qbuttongroup.h>
43#include <qtimer.h> 43#include <qtimer.h>
44#include <qmessagebox.h> 44#include <qmessagebox.h>
45#include <qapplication.h> 45#include <qapplication.h>
46#include <qlineedit.h> 46#include <qlineedit.h>
47#include <qdialog.h> 47#include <qdialog.h>
48#include <qlayout.h> 48#include <qlayout.h>
49#include <qtextcodec.h> 49#include <qtextcodec.h>
50#include <qlabel.h> 50#include <qlabel.h>
51#include <qcheckbox.h> 51#include <qcheckbox.h>
52 52
53#include <klocale.h> 53#include <klocale.h>
54#include <kglobal.h> 54#include <kglobal.h>
55#include <kconfig.h> 55#include <kconfig.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57 57
58KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) 58KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu)
59 : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) 59 : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu)
60{ 60{
61 mServerSocket = 0; 61 mServerSocket = 0;
62 bar = new QProgressBar ( 1, 0 ); 62 bar = new QProgressBar ( 1, 0 );
63 bar->setCaption (""); 63 bar->setCaption ("");
64 64
65 int w = 300; 65 int w = 300;
66 if ( QApplication::desktop()->width() < 320 ) 66 if ( QApplication::desktop()->width() < 320 )
67 w = 220; 67 w = 220;
68 int h = bar->sizeHint().height() ; 68 int h = bar->sizeHint().height() ;
69 int dw = QApplication::desktop()->width(); 69 int dw = QApplication::desktop()->width();
70 int dh = QApplication::desktop()->height(); 70 int dh = QApplication::desktop()->height();
71 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 71 bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
72 if ( mPrefs->mPassiveSyncAutoStart ) 72 if ( mPrefs->mPassiveSyncAutoStart )
73 enableQuick( false ); 73 enableQuick( false );
74 74
75} 75}
76 76
77KSyncManager::~KSyncManager() 77KSyncManager::~KSyncManager()
78{ 78{
79 delete bar; 79 delete bar;
80} 80}
81 81
82 82
83void KSyncManager::fillSyncMenu() 83void KSyncManager::fillSyncMenu()
84{ 84{
85 if ( mSyncMenu->count() ) 85 if ( mSyncMenu->count() )
86 mSyncMenu->clear(); 86 mSyncMenu->clear();
87 87
88 mSyncMenu->insertItem( i18n("Configure..."), 0 ); 88 mSyncMenu->insertItem( i18n("Configure..."), 0 );
89 mSyncMenu->insertSeparator(); 89 mSyncMenu->insertSeparator();
90 QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu );
91 mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 );
92 clearMenu->insertItem( i18n("For all profiles"), 1 );
93 clearMenu->insertSeparator();
94 connect ( clearMenu, SIGNAL( activated ( int ) ), this, SLOT (slotClearMenu( int ) ) );
95 mSyncMenu->insertSeparator();
90 if ( mServerSocket == 0 ) { 96 if ( mServerSocket == 0 ) {
91 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 ); 97 mSyncMenu->insertItem( i18n("Enable Pi-Sync"), 2 );
92 } else { 98 } else {
93 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 ); 99 mSyncMenu->insertItem( i18n("Disable Pi-Sync"), 3 );
94 } 100 }
95 mSyncMenu->insertSeparator(); 101 mSyncMenu->insertSeparator();
96 mSyncMenu->insertItem( i18n("Multiple sync"), 1 ); 102 mSyncMenu->insertItem( i18n("Multiple sync"), 1 );
97 mSyncMenu->insertSeparator(); 103 mSyncMenu->insertSeparator();
98
99 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 104 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
100 config.setGroup("General"); 105 config.setGroup("General");
101 QStringList prof = config.readListEntry("SyncProfileNames"); 106 QStringList prof = config.readListEntry("SyncProfileNames");
102 mLocalMachineName = config.readEntry("LocalMachineName","undefined"); 107 mLocalMachineName = config.readEntry("LocalMachineName","undefined");
103 if ( prof.count() < 2 ) { 108 if ( prof.count() < 2 ) {
104 prof.clear(); 109 prof.clear();
105 QString externalName; 110 QString externalName;
106#ifdef DESKTOP_VERSION 111#ifdef DESKTOP_VERSION
107#ifdef _WIN32_ 112#ifdef _WIN32_
108 externalName = "OutLook(not_implemented)"; 113 externalName = "OutLook(not_implemented)";
109#else 114#else
110 externalName = "KDE_Desktop"; 115 externalName = "KDE_Desktop";
111#endif 116#endif
112#else 117#else
113 externalName = "Sharp_DTM"; 118 externalName = "Sharp_DTM";
114#endif 119#endif
115 prof << externalName; 120 prof << externalName;
116 prof << i18n("Local_file"); 121 prof << i18n("Local_file");
117 prof << i18n("Last_file"); 122 prof << i18n("Last_file");
118 KSyncProfile* temp = new KSyncProfile (); 123 KSyncProfile* temp = new KSyncProfile ();
119 temp->setName( prof[0] ); 124 temp->setName( prof[0] );
120 temp->writeConfig(&config); 125 temp->writeConfig(&config);
121 temp->setName( prof[1] ); 126 temp->setName( prof[1] );
122 temp->writeConfig(&config); 127 temp->writeConfig(&config);
123 temp->setName( prof[2] ); 128 temp->setName( prof[2] );
124 temp->writeConfig(&config); 129 temp->writeConfig(&config);
125 config.setGroup("General"); 130 config.setGroup("General");
126 config.writeEntry("SyncProfileNames",prof); 131 config.writeEntry("SyncProfileNames",prof);
127 config.writeEntry("ExternSyncProfiles",externalName); 132 config.writeEntry("ExternSyncProfiles",externalName);
128 config.sync(); 133 config.sync();
129 delete temp; 134 delete temp;
130 } 135 }
131 mExternSyncProfiles = config.readListEntry("ExternSyncProfiles"); 136 mExternSyncProfiles = config.readListEntry("ExternSyncProfiles");
132 mSyncProfileNames = prof; 137 mSyncProfileNames = prof;
133 unsigned int i; 138 unsigned int i;
134 for ( i = 0; i < prof.count(); ++i ) { 139 for ( i = 0; i < prof.count(); ++i ) {
135 mSyncMenu->insertItem( prof[i], 1000+i ); 140 mSyncMenu->insertItem( prof[i], 1000+i );
141 clearMenu->insertItem( prof[i], 1000+i );
136 if ( i == 2 ) 142 if ( i == 2 )
137 mSyncMenu->insertSeparator(); 143 mSyncMenu->insertSeparator();
138 } 144 }
139 QDir app_dir; 145 QDir app_dir;
140 //US do not display SharpDTM if app is pwmpi, or no sharpfiles available 146 //US do not display SharpDTM if app is pwmpi, or no sharpfiles available
141 if ( mTargetApp == PWMPI) { 147 if ( mTargetApp == PWMPI) {
142 mSyncMenu->removeItem( 1000 ); 148 mSyncMenu->removeItem( 1000 );
149 clearMenu->removeItem( 1000 );
143 } 150 }
144#ifndef DESKTOP_VERSION 151#ifndef DESKTOP_VERSION
145 else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { 152 else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) {
146 mSyncMenu->removeItem( 1000 ); 153 mSyncMenu->removeItem( 1000 );
154 clearMenu->removeItem( 1000 );
147 } 155 }
148#endif 156#endif
149 mSyncMenu->removeItem( 1002 ); 157 mSyncMenu->removeItem( 1002 );
158 clearMenu->removeItem( 1002 );
150} 159}
160void KSyncManager::slotClearMenu( int action )
161{
162 QString syncDevice;
163 if ( action > 999 ) {
164 syncDevice = mSyncProfileNames[action - 1000] ;
165 }
151 166
167
168
169 int result = 0;
170 QString sd;
171 if ( syncDevice.isEmpty() )
172 sd = i18n("Do you want to\nclear all sync info\nof all profiles?");
173 else
174 sd = i18n("Do you want to\nclear the sync\ninfo of profile\n%1?\n"). arg( syncDevice );
175
176 result = QMessageBox::warning( mParent, i18n("Warning!"),sd,i18n("OK"), i18n("Cancel"), 0,
177 0, 1 );
178 if ( result )
179 return;
180 mImplementation->removeSyncInfo( syncDevice );
181}
152void KSyncManager::slotSyncMenu( int action ) 182void KSyncManager::slotSyncMenu( int action )
153{ 183{
154 qDebug("syncaction %d ", action); 184 qDebug("syncaction %d ", action);
185 if ( action == 5000 )
186 return;
155 if ( action == 0 ) { 187 if ( action == 0 ) {
156 188
157 // seems to be a Qt2 event handling bug 189 // seems to be a Qt2 event handling bug
158 // syncmenu.clear causes a segfault at first time 190 // syncmenu.clear causes a segfault at first time
159 // when we call it after the main event loop, it is ok 191 // when we call it after the main event loop, it is ok
160 // same behaviour when calling OM/Pi via QCOP for the first time 192 // same behaviour when calling OM/Pi via QCOP for the first time
161 QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); 193 QTimer::singleShot ( 1, this, SLOT ( confSync() ) );
162 //confSync(); 194 //confSync();
163 195
164 return; 196 return;
165 } 197 }
166 if ( action == 1 ) { 198 if ( action == 1 ) {
167 multiSync( true ); 199 multiSync( true );
168 return; 200 return;
169 } 201 }
170 if ( action == 2 ) { 202 if ( action == 2 ) {
171 enableQuick(); 203 enableQuick();
172 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 204 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
173 return; 205 return;
174 } 206 }
175 if ( action == 3 ) { 207 if ( action == 3 ) {
176 delete mServerSocket; 208 delete mServerSocket;
177 mServerSocket = 0; 209 mServerSocket = 0;
178 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 210 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
179 return; 211 return;
180 } 212 }
181 213
182 if (blockSave()) 214 if (blockSave())
183 return; 215 return;
184 216
185 setBlockSave(true); 217 setBlockSave(true);
186 bool silent = false; 218 bool silent = false;
187 if ( action == 999 ) { 219 if ( action == 999 ) {
188 //special mode for silent syncing 220 //special mode for silent syncing
189 action = 1000; 221 action = 1000;
190 silent = true; 222 silent = true;
191 } 223 }
192 224
193 mCurrentSyncProfile = action - 1000 ; 225 mCurrentSyncProfile = action - 1000 ;
194 mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ; 226 mCurrentSyncDevice = mSyncProfileNames[mCurrentSyncProfile] ;
195 mCurrentSyncName = mLocalMachineName ; 227 mCurrentSyncName = mLocalMachineName ;
196 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 228 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
197 KSyncProfile* temp = new KSyncProfile (); 229 KSyncProfile* temp = new KSyncProfile ();
198 temp->setName(mSyncProfileNames[mCurrentSyncProfile]); 230 temp->setName(mSyncProfileNames[mCurrentSyncProfile]);
199 temp->readConfig(&config); 231 temp->readConfig(&config);
200 if (silent) { 232 if (silent) {
201 mAskForPreferences = false; 233 mAskForPreferences = false;
202 mShowSyncSummary = false; 234 mShowSyncSummary = false;
@@ -790,98 +822,104 @@ bool KSyncManager::edit_sync_options()
790 break; 822 break;
791 } 823 }
792 if ( dia.exec() ) { 824 if ( dia.exec() ) {
793 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ; 825 mSyncAlgoPrefs = rem.isChecked()*1+newest.isChecked()*2+ ask.isChecked()*3+ f_loc.isChecked()*4+ f_rem.isChecked()*5;//+ both.isChecked()*6 ;
794 return true; 826 return true;
795 } 827 }
796 return false; 828 return false;
797} 829}
798 830
799QString KSyncManager::getPassword( ) 831QString KSyncManager::getPassword( )
800{ 832{
801 QString retfile = ""; 833 QString retfile = "";
802 QDialog dia ( mParent, "input-dialog", true ); 834 QDialog dia ( mParent, "input-dialog", true );
803 QLineEdit lab ( &dia ); 835 QLineEdit lab ( &dia );
804 lab.setEchoMode( QLineEdit::Password ); 836 lab.setEchoMode( QLineEdit::Password );
805 QVBoxLayout lay( &dia ); 837 QVBoxLayout lay( &dia );
806 lay.setMargin(7); 838 lay.setMargin(7);
807 lay.setSpacing(7); 839 lay.setSpacing(7);
808 lay.addWidget( &lab); 840 lay.addWidget( &lab);
809 dia.setFixedSize( 230,50 ); 841 dia.setFixedSize( 230,50 );
810 dia.setCaption( i18n("Enter password") ); 842 dia.setCaption( i18n("Enter password") );
811 QPushButton pb ( "OK", &dia); 843 QPushButton pb ( "OK", &dia);
812 lay.addWidget( &pb ); 844 lay.addWidget( &pb );
813 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) ); 845 connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
814 dia.show(); 846 dia.show();
815 int res = dia.exec(); 847 int res = dia.exec();
816 if ( res ) 848 if ( res )
817 retfile = lab.text(); 849 retfile = lab.text();
818 dia.hide(); 850 dia.hide();
819 qApp->processEvents(); 851 qApp->processEvents();
820 return retfile; 852 return retfile;
821 853
822} 854}
823 855
824 856
825void KSyncManager::confSync() 857void KSyncManager::confSync()
826{ 858{
827 static KSyncPrefsDialog* sp = 0; 859 static KSyncPrefsDialog* sp = 0;
828 if ( ! sp ) { 860 if ( ! sp ) {
829 sp = new KSyncPrefsDialog( mParent, "syncprefs", true ); 861 sp = new KSyncPrefsDialog( mParent, "syncprefs", true );
830 } 862 }
831 sp->usrReadConfig(); 863 sp->usrReadConfig();
832#ifndef DESKTOP_VERSION 864#ifndef DESKTOP_VERSION
833 sp->showMaximized(); 865 sp->showMaximized();
834#else 866#else
835 sp->show(); 867 sp->show();
836#endif 868#endif
837 sp->exec(); 869 sp->exec();
870 QStringList oldSyncProfileNames = mSyncProfileNames;
838 mSyncProfileNames = sp->getSyncProfileNames(); 871 mSyncProfileNames = sp->getSyncProfileNames();
839 mLocalMachineName = sp->getLocalMachineName (); 872 mLocalMachineName = sp->getLocalMachineName ();
873 int ii;
874 for ( ii = 0; ii < oldSyncProfileNames.count(); ++ii ) {
875 if ( ! mSyncProfileNames.contains( oldSyncProfileNames[ii] ) )
876 mImplementation->removeSyncInfo( oldSyncProfileNames[ii] );
877 }
840 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); 878 QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) );
841} 879}
842void KSyncManager::syncKDE() 880void KSyncManager::syncKDE()
843{ 881{
844 emit save(); 882 emit save();
845 switch(mTargetApp) 883 switch(mTargetApp)
846 { 884 {
847 case (KAPI): 885 case (KAPI):
848 886
849 break; 887 break;
850 case (KOPI): 888 case (KOPI):
851 { 889 {
852#ifdef DESKTOP_VERSION 890#ifdef DESKTOP_VERSION
853 QString command = qApp->applicationDirPath () + "/kdecaldump"; 891 QString command = qApp->applicationDirPath () + "/kdecaldump";
854#else 892#else
855 QString command = "kdecaldump"; 893 QString command = "kdecaldump";
856#endif 894#endif
857 if ( ! QFile::exists ( command ) ) 895 if ( ! QFile::exists ( command ) )
858 command = "kdecaldump"; 896 command = "kdecaldump";
859 QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics"; 897 QString fileName = QDir::homeDirPath ()+"/.kdecalendardump.ics";
860 system ( command.latin1()); 898 system ( command.latin1());
861 if ( syncWithFile( fileName,true ) ) { 899 if ( syncWithFile( fileName,true ) ) {
862 if ( mWriteBackFile ) { 900 if ( mWriteBackFile ) {
863 command += " --read"; 901 command += " --read";
864 system ( command.latin1()); 902 system ( command.latin1());
865 } 903 }
866 } 904 }
867 905
868 } 906 }
869 break; 907 break;
870 case (PWMPI): 908 case (PWMPI):
871 909
872 break; 910 break;
873 default: 911 default:
874 qDebug("KSyncManager::slotSyncMenu: invalid apptype selected"); 912 qDebug("KSyncManager::slotSyncMenu: invalid apptype selected");
875 break; 913 break;
876 914
877 } 915 }
878} 916}
879 917
880void KSyncManager::syncSharp() 918void KSyncManager::syncSharp()
881{ 919{
882 920
883 if ( ! syncExternalApplication("sharp") ) 921 if ( ! syncExternalApplication("sharp") )
884 qDebug("ERROR sync sharp "); 922 qDebug("ERROR sync sharp ");
885} 923}
886 924
887bool KSyncManager::syncExternalApplication(QString resource) 925bool KSyncManager::syncExternalApplication(QString resource)
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index af4f1ab..aa32e28 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -109,96 +109,97 @@ class KSyncManager : public QObject
109 enum TargetApp { 109 enum TargetApp {
110 KOPI = 0, 110 KOPI = 0,
111 KAPI = 1, 111 KAPI = 1,
112 PWMPI = 2 }; 112 PWMPI = 2 };
113 113
114 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); 114 KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu);
115 ~KSyncManager() ; 115 ~KSyncManager() ;
116 116
117 void multiSync( bool askforPrefs ); 117 void multiSync( bool askforPrefs );
118 bool blockSave() { return mBlockSaveFlag; } 118 bool blockSave() { return mBlockSaveFlag; }
119 void setBlockSave(bool sa) { mBlockSaveFlag = sa; } 119 void setBlockSave(bool sa) { mBlockSaveFlag = sa; }
120 void setDefaultFileName( QString s) { mDefFileName = s ;} 120 void setDefaultFileName( QString s) { mDefFileName = s ;}
121 QString defaultFileName() { return mDefFileName ;} 121 QString defaultFileName() { return mDefFileName ;}
122 QString syncFileName(); 122 QString syncFileName();
123 void enableQuick( bool ask = true); 123 void enableQuick( bool ask = true);
124 124
125 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 125 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
126 QString getCurrentSyncName() { return mCurrentSyncName; } 126 QString getCurrentSyncName() { return mCurrentSyncName; }
127 127
128 void showProgressBar(int percentage, QString caption = QString::null, int total=100); 128 void showProgressBar(int percentage, QString caption = QString::null, int total=100);
129 void hideProgressBar(); 129 void hideProgressBar();
130 bool isProgressBarCanceled(); 130 bool isProgressBarCanceled();
131 131
132 // sync stuff 132 // sync stuff
133 QString mLocalMachineName; 133 QString mLocalMachineName;
134 QStringList mExternSyncProfiles; 134 QStringList mExternSyncProfiles;
135 QStringList mSyncProfileNames; 135 QStringList mSyncProfileNames;
136 bool mAskForPreferences; 136 bool mAskForPreferences;
137 bool mShowSyncSummary; 137 bool mShowSyncSummary;
138 bool mIsKapiFile; 138 bool mIsKapiFile;
139 bool mWriteBackExistingOnly; 139 bool mWriteBackExistingOnly;
140 int mSyncAlgoPrefs; 140 int mSyncAlgoPrefs;
141 bool mWriteBackFile; 141 bool mWriteBackFile;
142 int mWriteBackInFuture; 142 int mWriteBackInFuture;
143 QString mPhoneDevice; 143 QString mPhoneDevice;
144 QString mPhoneConnection; 144 QString mPhoneConnection;
145 QString mPhoneModel; 145 QString mPhoneModel;
146 QString mPassWordPiSync; 146 QString mPassWordPiSync;
147 QString mActiveSyncPort; 147 QString mActiveSyncPort;
148 QString mActiveSyncIP ; 148 QString mActiveSyncIP ;
149 149
150 signals: 150 signals:
151 void save(); 151 void save();
152 void request_file(); 152 void request_file();
153 void getFile( bool ); 153 void getFile( bool );
154 154
155 public slots: 155 public slots:
156 void slotSyncMenu( int ); 156 void slotSyncMenu( int );
157 void slotClearMenu( int action );
157 void deleteCommandSocket(KCommandSocket*s, int state); 158 void deleteCommandSocket(KCommandSocket*s, int state);
158 void readFileFromSocket(); 159 void readFileFromSocket();
159 void fillSyncMenu(); 160 void fillSyncMenu();
160 161
161 private: 162 private:
162 void syncPi(); 163 void syncPi();
163 KServerSocket * mServerSocket; 164 KServerSocket * mServerSocket;
164 KPimPrefs* mPrefs; 165 KPimPrefs* mPrefs;
165 QString mDefFileName; 166 QString mDefFileName;
166 QString mCurrentSyncDevice; 167 QString mCurrentSyncDevice;
167 QString mCurrentSyncName; 168 QString mCurrentSyncName;
168 void quickSyncLocalFile(); 169 void quickSyncLocalFile();
169 bool syncWithFile( QString fn , bool quick ); 170 bool syncWithFile( QString fn , bool quick );
170 void syncLocalFile(); 171 void syncLocalFile();
171 void syncPhone(); 172 void syncPhone();
172 void syncSharp(); 173 void syncSharp();
173 void syncKDE(); 174 void syncKDE();
174 bool syncExternalApplication(QString); 175 bool syncExternalApplication(QString);
175 int mCurrentSyncProfile ; 176 int mCurrentSyncProfile ;
176 void syncRemote( KSyncProfile* prof, bool ask = true); 177 void syncRemote( KSyncProfile* prof, bool ask = true);
177 bool edit_sync_options(); 178 bool edit_sync_options();
178 bool edit_pisync_options(); 179 bool edit_pisync_options();
179 int ringSync(); 180 int ringSync();
180 QString getPassword( ); 181 QString getPassword( );
181 bool mPisyncFinished; 182 bool mPisyncFinished;
182 bool mBlockSaveFlag; 183 bool mBlockSaveFlag;
183 QWidget* mParent; 184 QWidget* mParent;
184 KSyncInterface* mImplementation; 185 KSyncInterface* mImplementation;
185 TargetApp mTargetApp; 186 TargetApp mTargetApp;
186 QPopupMenu* mSyncMenu; 187 QPopupMenu* mSyncMenu;
187 QProgressBar* bar; 188 QProgressBar* bar;
188 189
189private slots: 190private slots:
190 void confSync(); 191 void confSync();
191 192
192 193
193}; 194};
194 195
195 196
196class KSyncInterface 197class KSyncInterface
197{ 198{
198 public : 199 public :
199 virtual void removeSyncInfo( QString syncProfile) = 0; 200 virtual void removeSyncInfo( QString syncProfile) = 0;
200 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0; 201 virtual bool sync(KSyncManager* manager, QString filename, int mode) = 0;
201 virtual bool syncExternal(KSyncManager* manager, QString resource) 202 virtual bool syncExternal(KSyncManager* manager, QString resource)
202 { 203 {
203 // empty implementation, because some syncable applications do not 204 // empty implementation, because some syncable applications do not
204 // have an external(sharpdtm) syncmode, like pwmanager. 205 // have an external(sharpdtm) syncmode, like pwmanager.