author | zautrix <zautrix> | 2005-11-25 17:41:25 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-25 17:41:25 (UTC) |
commit | 279e183c0325cd9565605f60af0215bb9bfdc825 (patch) (unidiff) | |
tree | 43ab776cd108874819e7c6e73070a7d989a9078f /libkdepim/ksyncmanager.h | |
parent | 794a5204686ad9bfc16172b01db35f1f3b7683e5 (diff) | |
download | kdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.zip kdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.tar.gz kdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.tar.bz2 |
sync
-rw-r--r-- | libkdepim/ksyncmanager.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index f4654ce..53c611d 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -24,73 +24,76 @@ | |||
24 | 24 | ||
25 | #include <qobject.h> | 25 | #include <qobject.h> |
26 | #include <qstring.h> | 26 | #include <qstring.h> |
27 | #include <qsocket.h> | 27 | #include <qsocket.h> |
28 | #include <qdatetime.h> | 28 | #include <qdatetime.h> |
29 | #include <qserversocket.h> | 29 | #include <qserversocket.h> |
30 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qprogressdialog.h> | 32 | #include <qprogressdialog.h> |
33 | #include <kdialog.h> | 33 | #include <kdialog.h> |
34 | 34 | ||
35 | class QPopupMenu; | 35 | class QPopupMenu; |
36 | class KSyncProfile; | 36 | class KSyncProfile; |
37 | class KPimPrefs; | 37 | class KPimPrefs; |
38 | class QWidget; | 38 | class QWidget; |
39 | class KSyncManager; | 39 | class KSyncManager; |
40 | class KSyncInterface; | 40 | class KSyncInterface; |
41 | class QProgressBar; | 41 | class QProgressBar; |
42 | 42 | ||
43 | 43 | ||
44 | class KServerSocket : public QServerSocket | 44 | class KServerSocket : public QServerSocket |
45 | { | 45 | { |
46 | Q_OBJECT | 46 | Q_OBJECT |
47 | 47 | ||
48 | public: | 48 | public: |
49 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); | 49 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); |
50 | 50 | ||
51 | void newConnection ( int socket ) ; | 51 | void newConnection ( int socket ) ; |
52 | void setFileName( QString fn ) {mFileName = fn;}; | 52 | void setFileName( QString fn ) {mFileName = fn;}; |
53 | signals: | 53 | signals: |
54 | void file_received( bool ); | 54 | void file_received( bool ); |
55 | void request_file(); | 55 | void request_file(); |
56 | void file_received( bool, const QString &); | ||
57 | void request_file(const QString &); | ||
56 | void saveFile(); | 58 | void saveFile(); |
57 | void endConnect(); | 59 | void endConnect(); |
58 | private slots: | 60 | private slots: |
59 | void discardClient(); | 61 | void discardClient(); |
60 | void deleteSocket(); | 62 | void deleteSocket(); |
61 | void readClient(); | 63 | void readClient(); |
62 | void displayErrorMessage(); | 64 | void displayErrorMessage(); |
63 | void readBackFileFromSocket(); | 65 | void readBackFileFromSocket(); |
64 | private : | 66 | private : |
67 | QString mResource; | ||
65 | int mErrorMessage; | 68 | int mErrorMessage; |
66 | bool blockRC; | 69 | bool blockRC; |
67 | void send_file(); | 70 | void send_file(); |
68 | void get_file(); | 71 | void get_file(); |
69 | void end_connect(); | 72 | void end_connect(); |
70 | void error_connect( QString ); | 73 | void error_connect( QString ); |
71 | QDialog* mSyncActionDialog; | 74 | QDialog* mSyncActionDialog; |
72 | QSocket* mSocket; | 75 | QSocket* mSocket; |
73 | QString mPassWord; | 76 | QString mPassWord; |
74 | QString mFileName; | 77 | QString mFileName; |
75 | QTime piTime; | 78 | QTime piTime; |
76 | QString piFileString; | 79 | QString piFileString; |
77 | }; | 80 | }; |
78 | 81 | ||
79 | class KCommandSocket : public QObject | 82 | class KCommandSocket : public QObject |
80 | { | 83 | { |
81 | Q_OBJECT | 84 | Q_OBJECT |
82 | public: | 85 | public: |
83 | enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet }; | 86 | enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet }; |
84 | KCommandSocket (QString remoteResource, QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); | 87 | KCommandSocket (QString remoteResource, QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); |
85 | void readFile( QString ); | 88 | void readFile( QString ); |
86 | void writeFile( QString ); | 89 | void writeFile( QString ); |
87 | void sendStop(); | 90 | void sendStop(); |
88 | 91 | ||
89 | private slots : | 92 | private slots : |
90 | void sendFileRequest(); | 93 | void sendFileRequest(); |
91 | void updateConnectDialog(); | 94 | void updateConnectDialog(); |
92 | 95 | ||
93 | signals: | 96 | signals: |
94 | void commandFinished( KCommandSocket*, int ); | 97 | void commandFinished( KCommandSocket*, int ); |
95 | private slots: | 98 | private slots: |
96 | void startReadFileFromSocket(); | 99 | void startReadFileFromSocket(); |
@@ -145,64 +148,67 @@ class KSyncManager : public QObject | |||
145 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 148 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
146 | void hideProgressBar(); | 149 | void hideProgressBar(); |
147 | bool isProgressBarCanceled(); | 150 | bool isProgressBarCanceled(); |
148 | 151 | ||
149 | // sync stuff | 152 | // sync stuff |
150 | QString mLocalMachineName; | 153 | QString mLocalMachineName; |
151 | QStringList mExternSyncProfiles; | 154 | QStringList mExternSyncProfiles; |
152 | QStringList mSyncProfileNames; | 155 | QStringList mSyncProfileNames; |
153 | bool mAskForPreferences; | 156 | bool mAskForPreferences; |
154 | bool mShowSyncSummary; | 157 | bool mShowSyncSummary; |
155 | bool mIsKapiFile; | 158 | bool mIsKapiFile; |
156 | bool mWriteBackExistingOnly; | 159 | bool mWriteBackExistingOnly; |
157 | int mSyncAlgoPrefs; | 160 | int mSyncAlgoPrefs; |
158 | bool mWriteBackFile; | 161 | bool mWriteBackFile; |
159 | int mWriteBackInFuture; | 162 | int mWriteBackInFuture; |
160 | int mWriteBackInPast; | 163 | int mWriteBackInPast; |
161 | QString mPhoneDevice; | 164 | QString mPhoneDevice; |
162 | QString mPhoneConnection; | 165 | QString mPhoneConnection; |
163 | QString mPhoneModel; | 166 | QString mPhoneModel; |
164 | QString mPassWordPiSync; | 167 | QString mPassWordPiSync; |
165 | QString mActiveSyncPort; | 168 | QString mActiveSyncPort; |
166 | QString mActiveSyncIP ; | 169 | QString mActiveSyncIP ; |
167 | QString mFilterInCal; | 170 | QString mFilterInCal; |
168 | QString mFilterOutCal; | 171 | QString mFilterOutCal; |
169 | QString mFilterInAB; | 172 | QString mFilterInAB; |
170 | QString mFilterOutAB; | 173 | QString mFilterOutAB; |
171 | static QDateTime mRequestedSyncEvent; | 174 | static QDateTime mRequestedSyncEvent; |
172 | 175 | ||
173 | signals: | 176 | signals: |
174 | void save(); | 177 | void save(); |
175 | void request_file(); | 178 | void request_file(); |
176 | void getFile( bool ); | 179 | void getFile( bool ); |
180 | void getFile( bool, const QString &); | ||
181 | void request_file(const QString &); | ||
182 | void multiResourceSyncStart( bool ); | ||
177 | 183 | ||
178 | public slots: | 184 | public slots: |
179 | void slotSyncMenu( int ); | 185 | void slotSyncMenu( int ); |
180 | void slotClearMenu( int action ); | 186 | void slotClearMenu( int action ); |
181 | void deleteCommandSocket(KCommandSocket*s, int state); | 187 | void deleteCommandSocket(KCommandSocket*s, int state); |
182 | void readFileFromSocket(); | 188 | void readFileFromSocket(); |
183 | void fillSyncMenu(); | 189 | void fillSyncMenu(); |
184 | 190 | ||
185 | private: | 191 | private: |
186 | void syncPi(); | 192 | void syncPi(); |
187 | KServerSocket * mServerSocket; | 193 | KServerSocket * mServerSocket; |
188 | KPimPrefs* mPrefs; | 194 | KPimPrefs* mPrefs; |
189 | QString mDefFileName; | 195 | QString mDefFileName; |
190 | QString mCurrentSyncDevice; | 196 | QString mCurrentSyncDevice; |
191 | QString mCurrentSyncName; | 197 | QString mCurrentSyncName; |
192 | void quickSyncLocalFile(); | 198 | void quickSyncLocalFile(); |
193 | bool syncWithFile( QString fn , bool quick ); | 199 | bool syncWithFile( QString fn , bool quick ); |
194 | void syncLocalFile(); | 200 | void syncLocalFile(); |
195 | void syncPhone(); | 201 | void syncPhone(); |
196 | void syncSharp(); | 202 | void syncSharp(); |
197 | void syncKDE(); | 203 | void syncKDE(); |
198 | bool syncExternalApplication(QString); | 204 | bool syncExternalApplication(QString); |
199 | int mCurrentSyncProfile ; | 205 | int mCurrentSyncProfile ; |
200 | void syncRemote( KSyncProfile* prof, bool ask = true); | 206 | void syncRemote( KSyncProfile* prof, bool ask = true); |
201 | bool edit_sync_options(); | 207 | bool edit_sync_options(); |
202 | bool edit_pisync_options(); | 208 | bool edit_pisync_options(); |
203 | int ringSync(); | 209 | int ringSync(); |
204 | QString getPassword( ); | 210 | QString getPassword( ); |
205 | bool mPisyncFinished; | 211 | bool mPisyncFinished; |
206 | QStringList mSpecificResources; | 212 | QStringList mSpecificResources; |
207 | QString mCurrentResourceLocal; | 213 | QString mCurrentResourceLocal; |
208 | QString mCurrentResourceRemote; | 214 | QString mCurrentResourceRemote; |