author | zautrix <zautrix> | 2005-02-09 12:21:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-09 12:21:39 (UTC) |
commit | 940cdd0fd1349e7f8e53adff0595c1d946322ef1 (patch) (unidiff) | |
tree | 1a78f2c862afbc0d3c019c0905775782c906df64 /libkdepim/ksyncmanager.h | |
parent | 968099947455adc0e8681aedf8c161327e311f38 (diff) | |
download | kdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.zip kdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.tar.gz kdepimpi-940cdd0fd1349e7f8e53adff0595c1d946322ef1.tar.bz2 |
pisync fixes
-rw-r--r-- | libkdepim/ksyncmanager.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 6d89950..9a3066e 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -14,141 +14,145 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | $Id$ | 20 | $Id$ |
21 | */ | 21 | */ |
22 | #ifndef _KSYNCMANAGER_H | 22 | #ifndef _KSYNCMANAGER_H |
23 | #define _KSYNCMANAGER_H | 23 | #define _KSYNCMANAGER_H |
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 | 32 | ||
33 | class QPopupMenu; | 33 | class QPopupMenu; |
34 | class KSyncProfile; | 34 | class KSyncProfile; |
35 | class KPimPrefs; | 35 | class KPimPrefs; |
36 | class QWidget; | 36 | class QWidget; |
37 | class KSyncManager; | 37 | class KSyncManager; |
38 | class KSyncInterface; | 38 | class KSyncInterface; |
39 | class QProgressBar; | 39 | class QProgressBar; |
40 | 40 | ||
41 | 41 | ||
42 | class KServerSocket : public QServerSocket | 42 | class KServerSocket : public QServerSocket |
43 | { | 43 | { |
44 | Q_OBJECT | 44 | Q_OBJECT |
45 | 45 | ||
46 | public: | 46 | public: |
47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); | 47 | KServerSocket ( QString password, Q_UINT16 port, int backlog = 0, QObject * parent=0, const char * name=0 ); |
48 | 48 | ||
49 | void newConnection ( int socket ) ; | 49 | void newConnection ( int socket ) ; |
50 | void setFileName( QString fn ) {mFileName = fn;}; | 50 | void setFileName( QString fn ) {mFileName = fn;}; |
51 | signals: | 51 | signals: |
52 | void file_received( bool ); | 52 | void file_received( bool ); |
53 | void request_file(); | 53 | void request_file(); |
54 | void saveFile(); | 54 | void saveFile(); |
55 | void endConnect(); | 55 | void endConnect(); |
56 | private slots: | 56 | private slots: |
57 | void discardClient(); | 57 | void discardClient(); |
58 | void readClient(); | 58 | void readClient(); |
59 | void readBackFileFromSocket(); | 59 | void readBackFileFromSocket(); |
60 | private : | 60 | private : |
61 | bool blockRC; | 61 | bool blockRC; |
62 | void send_file(); | 62 | void send_file(); |
63 | void get_file(); | 63 | void get_file(); |
64 | void end_connect(); | 64 | void end_connect(); |
65 | QDialog* mSyncActionDialog; | 65 | QDialog* mSyncActionDialog; |
66 | QSocket* mSocket; | 66 | QSocket* mSocket; |
67 | QString mPassWord; | 67 | QString mPassWord; |
68 | QString mFileName; | 68 | QString mFileName; |
69 | QTime piTime; | 69 | QTime piTime; |
70 | QString piFileString; | 70 | QString piFileString; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | class KCommandSocket : public QObject | 73 | class KCommandSocket : public QObject |
74 | { | 74 | { |
75 | Q_OBJECT | 75 | Q_OBJECT |
76 | public: | 76 | public: |
77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; | 77 | enum state { successR, errorR, successW, errorW, errorTO, quiet }; |
78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); | 78 | KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 ); |
79 | void readFile( QString ); | 79 | void readFile( QString ); |
80 | void writeFile( QString ); | 80 | void writeFile( QString ); |
81 | void sendStop(); | 81 | void sendStop(); |
82 | |||
83 | private slots : | ||
84 | void sendFileRequest(); | ||
82 | 85 | ||
83 | signals: | 86 | signals: |
84 | void commandFinished( KCommandSocket*, int ); | 87 | void commandFinished( KCommandSocket*, int ); |
85 | private slots: | 88 | private slots: |
86 | void startReadFileFromSocket(); | 89 | void startReadFileFromSocket(); |
87 | void readFileFromSocket(); | 90 | void readFileFromSocket(); |
88 | void deleteSocket(); | 91 | void deleteSocket(); |
89 | void writeFileToSocket(); | 92 | void writeFileToSocket(); |
90 | private : | 93 | private : |
94 | QWidget* tlw; | ||
91 | QSocket* mSocket; | 95 | QSocket* mSocket; |
92 | QString mPassWord; | 96 | QString mPassWord; |
93 | Q_UINT16 mPort; | 97 | Q_UINT16 mPort; |
94 | QString mHost; | 98 | QString mHost; |
95 | QString mFileName; | 99 | QString mFileName; |
96 | QTimer* mTimerSocket; | 100 | QTimer* mTimerSocket; |
97 | int mRetVal; | 101 | int mRetVal; |
98 | QTime mTime; | 102 | QTime mTime; |
99 | QString mFileString; | 103 | QString mFileString; |
100 | bool mFirst; | 104 | bool mFirst; |
101 | }; | 105 | }; |
102 | 106 | ||
103 | 107 | ||
104 | class KSyncManager : public QObject | 108 | class KSyncManager : public QObject |
105 | { | 109 | { |
106 | Q_OBJECT | 110 | Q_OBJECT |
107 | 111 | ||
108 | public: | 112 | public: |
109 | enum TargetApp { | 113 | enum TargetApp { |
110 | KOPI = 0, | 114 | KOPI = 0, |
111 | KAPI = 1, | 115 | KAPI = 1, |
112 | PWMPI = 2 }; | 116 | PWMPI = 2 }; |
113 | 117 | ||
114 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); | 118 | KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu); |
115 | ~KSyncManager() ; | 119 | ~KSyncManager() ; |
116 | 120 | ||
117 | void multiSync( bool askforPrefs ); | 121 | void multiSync( bool askforPrefs ); |
118 | bool blockSave() { return mBlockSaveFlag; } | 122 | bool blockSave() { return mBlockSaveFlag; } |
119 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } | 123 | void setBlockSave(bool sa) { mBlockSaveFlag = sa; } |
120 | void setDefaultFileName( QString s) { mDefFileName = s ;} | 124 | void setDefaultFileName( QString s) { mDefFileName = s ;} |
121 | QString defaultFileName() { return mDefFileName ;} | 125 | QString defaultFileName() { return mDefFileName ;} |
122 | QString syncFileName(); | 126 | QString syncFileName(); |
123 | void enableQuick( bool ask = true); | 127 | void enableQuick( bool ask = true); |
124 | 128 | ||
125 | bool syncWithDesktop () { return mSyncWithDesktop;} | 129 | bool syncWithDesktop () { return mSyncWithDesktop;} |
126 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } | 130 | QString getCurrentSyncDevice() { return mCurrentSyncDevice; } |
127 | QString getCurrentSyncName() { return mCurrentSyncName; } | 131 | QString getCurrentSyncName() { return mCurrentSyncName; } |
128 | 132 | ||
129 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); | 133 | void showProgressBar(int percentage, QString caption = QString::null, int total=100); |
130 | void hideProgressBar(); | 134 | void hideProgressBar(); |
131 | bool isProgressBarCanceled(); | 135 | bool isProgressBarCanceled(); |
132 | 136 | ||
133 | // sync stuff | 137 | // sync stuff |
134 | QString mLocalMachineName; | 138 | QString mLocalMachineName; |
135 | QStringList mExternSyncProfiles; | 139 | QStringList mExternSyncProfiles; |
136 | QStringList mSyncProfileNames; | 140 | QStringList mSyncProfileNames; |
137 | bool mAskForPreferences; | 141 | bool mAskForPreferences; |
138 | bool mShowSyncSummary; | 142 | bool mShowSyncSummary; |
139 | bool mIsKapiFile; | 143 | bool mIsKapiFile; |
140 | bool mWriteBackExistingOnly; | 144 | bool mWriteBackExistingOnly; |
141 | int mSyncAlgoPrefs; | 145 | int mSyncAlgoPrefs; |
142 | bool mWriteBackFile; | 146 | bool mWriteBackFile; |
143 | int mWriteBackInFuture; | 147 | int mWriteBackInFuture; |
144 | int mWriteBackInPast; | 148 | int mWriteBackInPast; |
145 | QString mPhoneDevice; | 149 | QString mPhoneDevice; |
146 | QString mPhoneConnection; | 150 | QString mPhoneConnection; |
147 | QString mPhoneModel; | 151 | QString mPhoneModel; |
148 | QString mPassWordPiSync; | 152 | QString mPassWordPiSync; |
149 | QString mActiveSyncPort; | 153 | QString mActiveSyncPort; |
150 | QString mActiveSyncIP ; | 154 | QString mActiveSyncIP ; |
151 | QString mFilterInCal; | 155 | QString mFilterInCal; |
152 | QString mFilterOutCal; | 156 | QString mFilterOutCal; |
153 | QString mFilterInAB; | 157 | QString mFilterInAB; |
154 | QString mFilterOutAB; | 158 | QString mFilterOutAB; |