summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp70
-rw-r--r--libkdepim/ksyncprefsdialog.h15
-rw-r--r--libkdepim/ksyncprofile.cpp49
-rw-r--r--libkdepim/ksyncprofile.h37
4 files changed, 169 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 28aac45..f05c846 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -1,664 +1,730 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> 3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qdir.h> 32#include <qdir.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qvbox.h> 35#include <qvbox.h>
36#include <qhbox.h> 36#include <qhbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44#include <qlayout.h> 44#include <qlayout.h>
45#include <qscrollview.h> 45#include <qscrollview.h>
46 46
47#include <kcolorbutton.h> 47#include <kcolorbutton.h>
48#include <kdebug.h> 48#include <kdebug.h>
49#include <klocale.h> 49#include <klocale.h>
50#include <kglobal.h> 50#include <kglobal.h>
51#include <kfontdialog.h> 51#include <kfontdialog.h>
52#include <kmessagebox.h> 52#include <kmessagebox.h>
53#include <kcolordialog.h> 53#include <kcolordialog.h>
54#include <kiconloader.h> 54#include <kiconloader.h>
55#include <kemailsettings.h> 55#include <kemailsettings.h>
56#include <kstandarddirs.h> 56#include <kstandarddirs.h>
57#include <kfiledialog.h> 57#include <kfiledialog.h>
58#include <kmessagebox.h> 58#include <kmessagebox.h>
59 59
60//#include <kurlrequester.h> 60//#include <kurlrequester.h>
61#include <klineedit.h> 61#include <klineedit.h>
62#include "ksyncprofile.h" 62#include "ksyncprofile.h"
63 63
64 64
65//#include "koprefs.h" 65//#include "koprefs.h"
66 66
67#include "ksyncprefsdialog.h" 67#include "ksyncprefsdialog.h"
68//#include "koglobals.h" 68//#include "koglobals.h"
69 69
70 70
71KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : 71KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) :
72 KDialog(parent,name,true) 72 KDialog(parent,name,true)
73{ 73{
74 74
75 setCaption( i18n("Synchronization Preferences")); 75 setCaption( i18n("Synchronization Preferences"));
76 76
77 mSyncProfiles.setAutoDelete( true ); 77 mSyncProfiles.setAutoDelete( true );
78 setupSyncAlgTab(); 78 setupSyncAlgTab();
79} 79}
80 80
81 81
82KSyncPrefsDialog::~KSyncPrefsDialog() 82KSyncPrefsDialog::~KSyncPrefsDialog()
83{ 83{
84} 84}
85 85
86void KSyncPrefsDialog::setupSyncAlgTab() 86void KSyncPrefsDialog::setupSyncAlgTab()
87{ 87{
88 QLabel * lab; 88 QLabel * lab;
89 //QFrame *page = addPage(i18n("Sync Prefs"),0,0); 89 //QFrame *page = addPage(i18n("Sync Prefs"),0,0);
90 QVBox * mainbox = new QVBox( this ); 90 QVBox * mainbox = new QVBox( this );
91 QScrollView* sv = new QScrollView( mainbox ); 91 QScrollView* sv = new QScrollView( mainbox );
92 QHBoxLayout * lay = new QHBoxLayout( this ); 92 QHBoxLayout * lay = new QHBoxLayout( this );
93 lay->addWidget( mainbox ); 93 lay->addWidget( mainbox );
94 QHBox * b_box = new QHBox( mainbox ); 94 QHBox * b_box = new QHBox( mainbox );
95 95
96 QPushButton* button = new QPushButton( i18n("Ok"), b_box ); 96 QPushButton* button = new QPushButton( i18n("Ok"), b_box );
97 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); 97 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) );
98 button = new QPushButton( i18n("Cancel"), b_box ); 98 button = new QPushButton( i18n("Cancel"), b_box );
99 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); 99 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) );
100 //QBoxLayout * sl = new QVBoxLayout(this ); 100 //QBoxLayout * sl = new QVBoxLayout(this );
101 //sl->addWidget ( sv ); 101 //sl->addWidget ( sv );
102 sv->setResizePolicy ( QScrollView::AutoOneFit ); 102 sv->setResizePolicy ( QScrollView::AutoOneFit );
103 QFrame *topFrame = new QFrame ( sv ); 103 QFrame *topFrame = new QFrame ( sv );
104 sv->addChild( topFrame ); 104 sv->addChild( topFrame );
105 mSetupSyncAlgTab = topFrame; 105 mSetupSyncAlgTab = topFrame;
106 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 106 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
107 topLayout->setSpacing(spacingHint()); 107 topLayout->setSpacing(spacingHint());
108 topLayout->setMargin(marginHint()); 108 topLayout->setMargin(marginHint());
109 109
110 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); 110 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame);
111 int iii = 0; 111 int iii = 0;
112 //topLayout->addMultiCellWidget(lab , iii,iii,0,1); 112 //topLayout->addMultiCellWidget(lab , iii,iii,0,1);
113 //++iii; 113 //++iii;
114 114
115 mMyMachineName = new QLineEdit(topFrame); 115 mMyMachineName = new QLineEdit(topFrame);
116 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); 116 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame);
117 topLayout->addWidget(lab ,iii,0); 117 topLayout->addWidget(lab ,iii,0);
118 topLayout->addWidget(mMyMachineName,iii,1); 118 topLayout->addWidget(mMyMachineName,iii,1);
119 ++iii; 119 ++iii;
120 120
121 QHBox* buttonbox = new QHBox( topFrame); 121 QHBox* buttonbox = new QHBox( topFrame);
122 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); 122 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1);
123 ++iii; 123 ++iii;
124 button = new QPushButton( i18n("New profile"), buttonbox ); 124 button = new QPushButton( i18n("New profile"), buttonbox );
125 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); 125 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) );
126 126
127 button = new QPushButton( i18n("Clone profile"), buttonbox ); 127 button = new QPushButton( i18n("Clone profile"), buttonbox );
128 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); 128 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) );
129 129
130 button = new QPushButton( i18n("Delete profile"), buttonbox ); 130 button = new QPushButton( i18n("Delete profile"), buttonbox );
131 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); 131 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) );
132 132
133 mProfileBox = new QComboBox(topFrame); 133 mProfileBox = new QComboBox(topFrame);
134 mProfileBox->setEditable ( true ); 134 mProfileBox->setEditable ( true );
135 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion); 135 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion);
136 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); 136 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) );
137 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); 137 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) );
138 138
139 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); 139 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame);
140 topLayout->addWidget(lab ,iii,0); 140 topLayout->addWidget(lab ,iii,0);
141 topLayout->addWidget(mProfileBox, iii,1); 141 topLayout->addWidget(mProfileBox, iii,1);
142 ++iii; 142 ++iii;
143 143
144 mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame ); 144 mIncludeInRing = new QCheckBox( i18n("Include in multiple calendar sync"), topFrame );
145 topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1); 145 topLayout->addMultiCellWidget(mIncludeInRing, iii,iii,0,1);
146 ++iii; 146 ++iii;
147 mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); 147 mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame );
148 topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); 148 topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1);
149 ++iii; 149 ++iii;
150 mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); 150 mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame );
151 topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); 151 topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1);
152 ++iii; 152 ++iii;
153 153
154 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); 154 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
155 topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); 155 topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
156 ++iii; 156 ++iii;
157 QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); 157 QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
158 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 158 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
159 ++iii; 159 ++iii;
160 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); 160 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
161 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 161 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
162 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); 162 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
163 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); 163 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
164 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); 164 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
165 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); 165 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
166 // both = new QRadioButton ( i18n("Take both on conflict"), gr ); 166 // both = new QRadioButton ( i18n("Take both on conflict"), gr );
167 167
168 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 168 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
169 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 169 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
170 ++iii; 170 ++iii;
171 171
172 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 172 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
173 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 173 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
174 ++iii; 174 ++iii;
175 175
176 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); 176 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
177 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 177 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
178 ++iii; 178 ++iii;
179 179
180 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); 180 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame );
181 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 181 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
182 ++iii; 182 ++iii;
183 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); 183 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0);
184 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); 184 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame);
185 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 185 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
186 ++iii; 186 ++iii;
187 187
188 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 188 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
189 gr = proGr; 189 gr = proGr;
190 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 190 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
191 ++iii; 191 ++iii;
192 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 192 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
193 mIsPi = new QRadioButton ( i18n("Quick Pi-Sync"), gr );
194 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
193 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 195 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
194 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 196 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
195 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 197 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
196 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 198 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
197 199
198 200
199 phoneWidget = new QVBox( topFrame); 201 phoneWidget = new QVBox( topFrame);
200 topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 202 topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
201 ++iii; 203 ++iii;
202 mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 204 mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
203 QHBox* temphb = new QHBox( phoneWidget ); 205 QHBox* temphb = new QHBox( phoneWidget );
204 new QLabel( i18n("I/O device: "), temphb ); 206 new QLabel( i18n("I/O device: "), temphb );
205 mPhoneDevice = new QLineEdit( temphb); 207 mPhoneDevice = new QLineEdit( temphb);
206 button = new QPushButton( i18n("Help..."), temphb ); 208 button = new QPushButton( i18n("Help..."), temphb );
207 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); 209 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) );
208 210
209 211
210 temphb = new QHBox( phoneWidget ); 212 temphb = new QHBox( phoneWidget );
211 new QLabel( i18n("Connection: "), temphb ); 213 new QLabel( i18n("Connection: "), temphb );
212 mPhoneConnection = new QLineEdit( temphb); 214 mPhoneConnection = new QLineEdit( temphb);
213 button = new QPushButton( i18n("Help..."), temphb ); 215 button = new QPushButton( i18n("Help..."), temphb );
214 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); 216 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
215 217
216 218
217 temphb = new QHBox( phoneWidget ); 219 temphb = new QHBox( phoneWidget );
218 new QLabel( i18n("Model(opt.): "), temphb ); 220 new QLabel( i18n("Model(opt.): "), temphb );
219 mPhoneModel = new QLineEdit( temphb); 221 mPhoneModel = new QLineEdit( temphb);
220 button = new QPushButton( i18n("Help..."), temphb ); 222 button = new QPushButton( i18n("Help..."), temphb );
221 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 223 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
222 224
223 // *** local 225 // *** local
224 localFileWidget = new QVBox( topFrame); 226 localFileWidget = new QVBox( topFrame);
225 topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 227 topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
226 ++iii; 228 ++iii;
227 temphb = new QHBox( localFileWidget ); 229 temphb = new QHBox( localFileWidget );
228 230
229 lab = new QLabel( i18n("Local file Cal:"), temphb ); 231 lab = new QLabel( i18n("Local file Cal:"), temphb );
230 lab = new QLabel( i18n("Local file ABook:"), temphb ); 232 lab = new QLabel( i18n("Local file ABook:"), temphb );
231 lab = new QLabel( i18n("Local file PWMgr:"), temphb ); 233 lab = new QLabel( i18n("Local file PWMgr:"), temphb );
232 temphb = new QHBox( localFileWidget ); 234 temphb = new QHBox( localFileWidget );
233 button = new QPushButton( i18n("Choose..."), temphb ); 235 button = new QPushButton( i18n("Choose..."), temphb );
234 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 236 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
235 button = new QPushButton( i18n("Choose..."), temphb ); 237 button = new QPushButton( i18n("Choose..."), temphb );
236 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 238 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
237 button = new QPushButton( i18n("Choose..."), temphb ); 239 button = new QPushButton( i18n("Choose..."), temphb );
238 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 240 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
239 temphb = new QHBox( localFileWidget ); 241 temphb = new QHBox( localFileWidget );
240 242
241 mRemoteFile = new QLineEdit( temphb); 243 mRemoteFile = new QLineEdit( temphb);
242 mRemoteFileAB = new QLineEdit( temphb); 244 mRemoteFileAB = new QLineEdit( temphb);
243 mRemoteFilePWM = new QLineEdit( temphb); 245 mRemoteFilePWM = new QLineEdit( temphb);
244 246
245 // *** remote 247 // *** remote
246 remoteFileWidget = new QVBox( topFrame); 248 remoteFileWidget = new QVBox( topFrame);
247 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 249 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
248 ++iii; 250 ++iii;
249 temphb = new QHBox( remoteFileWidget ); 251 temphb = new QHBox( remoteFileWidget );
250 new QLabel( i18n("Calendar:"), temphb); 252 new QLabel( i18n("Calendar:"), temphb);
251 new QLabel( i18n("AddressBook:"), temphb); 253 new QLabel( i18n("AddressBook:"), temphb);
252 new QLabel( i18n("PWManager:"), temphb); 254 new QLabel( i18n("PWManager:"), temphb);
253 255
254 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 256 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
255 temphb = new QHBox( remoteFileWidget ); 257 temphb = new QHBox( remoteFileWidget );
256 mRemotePrecommand = new QLineEdit(temphb); 258 mRemotePrecommand = new QLineEdit(temphb);
257 mRemotePrecommandAB = new QLineEdit(temphb); 259 mRemotePrecommandAB = new QLineEdit(temphb);
258 mRemotePrecommandPWM = new QLineEdit(temphb); 260 mRemotePrecommandPWM = new QLineEdit(temphb);
259 261
260 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 262 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
261 temphb = new QHBox( remoteFileWidget ); 263 temphb = new QHBox( remoteFileWidget );
262 mLocalTempFile = new QLineEdit(temphb); 264 mLocalTempFile = new QLineEdit(temphb);
263 mLocalTempFileAB = new QLineEdit(temphb); 265 mLocalTempFileAB = new QLineEdit(temphb);
264 mLocalTempFilePWM = new QLineEdit(temphb); 266 mLocalTempFilePWM = new QLineEdit(temphb);
265 267
266 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 268 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
267 temphb = new QHBox( remoteFileWidget ); 269 temphb = new QHBox( remoteFileWidget );
268 mRemotePostcommand = new QLineEdit(temphb ); 270 mRemotePostcommand = new QLineEdit(temphb );
269 mRemotePostcommandAB = new QLineEdit(temphb ); 271 mRemotePostcommandAB = new QLineEdit(temphb );
270 mRemotePostcommandPWM = new QLineEdit(temphb ); 272 mRemotePostcommandPWM = new QLineEdit(temphb );
271 273
272 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 274 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
273 temphb = new QHBox( remoteFileWidget ); 275 temphb = new QHBox( remoteFileWidget );
274 button = new QPushButton( i18n("ssh/scp"), temphb ); 276 button = new QPushButton( i18n("ssh/scp"), temphb );
275 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 277 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
276 button = new QPushButton( i18n("ftp"), temphb ); 278 button = new QPushButton( i18n("ftp"), temphb );
277 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 279 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
278 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 280 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
279 281
282 // *** pi-sync
283 piWidget = new QVBox( topFrame);
284 topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
285 ++iii;
286 temphb = new QHBox( piWidget );
287 new QLabel( i18n("Calendar:"), temphb);
288 new QLabel( i18n("AddressBook:"), temphb);
289 new QLabel( i18n("PWManager:"), temphb);
290
291 lab = new QLabel( i18n("Password for remote access:"), piWidget);
292 temphb = new QHBox( piWidget );
293 mRemotePw = new QLineEdit(temphb);
294 mRemotePwAB = new QLineEdit(temphb);
295 mRemotePwPWM = new QLineEdit(temphb);
296
297 lab = new QLabel( i18n("Remote IP address:"), piWidget);
298 temphb = new QHBox( piWidget );
299 mRemoteIP = new QLineEdit(temphb);
300 mRemoteIPAB = new QLineEdit(temphb);
301 mRemoteIPPWM = new QLineEdit(temphb);
302
303 lab = new QLabel( i18n("Remote port number:"), piWidget);
304 temphb = new QHBox( piWidget );
305 mRemotePort = new QLineEdit(temphb);
306 mRemotePortAB = new QLineEdit(temphb);
307 mRemotePortPWM = new QLineEdit(temphb);
280 308
281} 309}
310
311
312
313
314
282void KSyncPrefsDialog::slotOK() 315void KSyncPrefsDialog::slotOK()
283{ 316{
284 if ( mMyMachineName->text() == "undefined" ) { 317 if ( mMyMachineName->text() == "undefined" ) {
285 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); 318 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
286 return; 319 return;
287 } 320 }
288 int i; 321 int i;
289 for (i = 0; i < mSyncProfileNames.count(); ++ i) { 322 for (i = 0; i < mSyncProfileNames.count(); ++ i) {
290 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { 323 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) {
291 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); 324 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error"));
292 return; 325 return;
293 } 326 }
294 } 327 }
295 usrWriteConfig(); 328 usrWriteConfig();
296 QDialog::accept(); 329 QDialog::accept();
297} 330}
298void KSyncPrefsDialog::accept() 331void KSyncPrefsDialog::accept()
299{ 332{
300 slotOK(); 333 slotOK();
301} 334}
302void KSyncPrefsDialog::chooseFile() 335void KSyncPrefsDialog::chooseFile()
303{ 336{
304 QString fn = QDir::homeDirPath(); 337 QString fn = QDir::homeDirPath();
305 338
306 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); 339 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
307 if ( fn == "" ) 340 if ( fn == "" )
308 return; 341 return;
309 mRemoteFile->setText( fn ); 342 mRemoteFile->setText( fn );
310} 343}
311 344
312void KSyncPrefsDialog::chooseFileAB() 345void KSyncPrefsDialog::chooseFileAB()
313{ 346{
314 QString fn = QDir::homeDirPath(); 347 QString fn = QDir::homeDirPath();
315 348
316 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); 349 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this );
317 if ( fn == "" ) 350 if ( fn == "" )
318 return; 351 return;
319 mRemoteFileAB->setText( fn ); 352 mRemoteFileAB->setText( fn );
320} 353}
321 354
322void KSyncPrefsDialog::chooseFilePWM() 355void KSyncPrefsDialog::chooseFilePWM()
323{ 356{
324 QString fn = QDir::homeDirPath(); 357 QString fn = QDir::homeDirPath();
325 358
326 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); 359 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this );
327 if ( fn == "" ) 360 if ( fn == "" )
328 return; 361 return;
329 mRemoteFilePWM->setText( fn ); 362 mRemoteFilePWM->setText( fn );
330} 363}
331 364
332void KSyncPrefsDialog::textChanged( const QString & s ) 365void KSyncPrefsDialog::textChanged( const QString & s )
333{ 366{
334 if ( mProfileBox->count() == 0 ) 367 if ( mProfileBox->count() == 0 )
335 return; 368 return;
336 if ( currentSelection < 3 ) { 369 if ( currentSelection < 3 ) {
337 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); 370 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error"));
338 mProfileBox->blockSignals( true ); 371 mProfileBox->blockSignals( true );
339 mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); 372 mProfileBox->setCurrentItem(mProfileBox-> currentItem ());
340 mProfileBox->blockSignals( false ); 373 mProfileBox->blockSignals( false );
341 return; 374 return;
342 } 375 }
343 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 376 //qDebug("cur i %d ",mProfileBox-> currentItem () );
344 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 377 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
345 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 378 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
346 prof->setName( s ); 379 prof->setName( s );
347 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 380 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
348} 381}
349void KSyncPrefsDialog::profileChanged( int item ) 382void KSyncPrefsDialog::profileChanged( int item )
350{ 383{
351 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 384 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
352 KSyncProfile* prof; 385 KSyncProfile* prof;
353 saveProfile(); 386 saveProfile();
354 currentSelection = item; 387 currentSelection = item;
355 prof = mSyncProfiles.at(item) ; 388 prof = mSyncProfiles.at(item) ;
389
390 mRemotePw->setText(prof->getRemotePw());
391 mRemoteIP->setText(prof->getRemoteIP());
392 mRemotePort->setText(prof->getRemotePort());
393
394 mRemotePwAB->setText(prof->getRemotePwAB());
395 mRemoteIPAB->setText(prof->getRemoteIPAB());
396 mRemotePortAB->setText(prof->getRemotePortAB());
397
398 mRemotePwPWM->setText(prof->getRemotePwPWM());
399 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
400 mRemotePortPWM->setText(prof->getRemotePortPWM());
401
356 mRemotePrecommand->setText(prof->getPreSyncCommand()); 402 mRemotePrecommand->setText(prof->getPreSyncCommand());
357 mRemotePostcommand->setText(prof->getPostSyncCommand()); 403 mRemotePostcommand->setText(prof->getPostSyncCommand());
358 mLocalTempFile->setText(prof->getLocalTempFile()); 404 mLocalTempFile->setText(prof->getLocalTempFile());
359 mRemoteFile->setText(prof->getRemoteFileName()) ; 405 mRemoteFile->setText(prof->getRemoteFileName()) ;
360 406
361 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 407 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
362 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 408 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
363 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 409 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
364 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 410 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
365 411
366 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 412 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
367 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 413 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
368 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 414 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
369 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 415 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
370 416
371 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 417 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
372 mPhoneDevice->setText(prof->getPhoneDevice()); 418 mPhoneDevice->setText(prof->getPhoneDevice());
373 mPhoneConnection->setText(prof->getPhoneConnection()); 419 mPhoneConnection->setText(prof->getPhoneConnection());
374 mPhoneModel->setText(prof->getPhoneModel()); 420 mPhoneModel->setText(prof->getPhoneModel());
375 421
376 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 422 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
377 mAskForPreferences->setChecked( prof->getAskForPreferences()); 423 mAskForPreferences->setChecked( prof->getAskForPreferences());
378 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 424 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
379 mWriteBackFile->setChecked( prof->getWriteBackFile()); 425 mWriteBackFile->setChecked( prof->getWriteBackFile());
380 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 426 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
381 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 427 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
382 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 428 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
383 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 429 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
384 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 430 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
385 431
386 switch ( prof->getSyncPrefs() ) { 432 switch ( prof->getSyncPrefs() ) {
387 case 0: 433 case 0:
388 loc->setChecked( true); 434 loc->setChecked( true);
389 break; 435 break;
390 case 1: 436 case 1:
391 rem->setChecked( true ); 437 rem->setChecked( true );
392 break; 438 break;
393 case 2: 439 case 2:
394 newest->setChecked( true); 440 newest->setChecked( true);
395 break; 441 break;
396 case 3: 442 case 3:
397 ask->setChecked( true); 443 ask->setChecked( true);
398 break; 444 break;
399 case 4: 445 case 4:
400 f_loc->setChecked( true); 446 f_loc->setChecked( true);
401 break; 447 break;
402 case 5: 448 case 5:
403 f_rem->setChecked( true); 449 f_rem->setChecked( true);
404 break; 450 break;
405 case 6: 451 case 6:
406 //both->setChecked( true); 452 //both->setChecked( true);
407 break; 453 break;
408 default: 454 default:
409 break; 455 break;
410 } 456 }
411 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 457 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
412 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 458 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
413 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); 459 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() );
414 proGr->setEnabled( item > 2 ); 460 proGr->setEnabled( item > 2 );
415 if ( item < 3 ) { 461 if ( item < 3 ) {
416 localFileWidget->hide(); 462 localFileWidget->hide();
417 remoteFileWidget->hide(); 463 remoteFileWidget->hide();
418 phoneWidget->hide(); 464 phoneWidget->hide();
465 piWidget->hide();
419 466
420 } else 467 } else
421 kindChanged( prof->getIsLocalFileSync() ); 468 kindChanged( prof->getIsLocalFileSync() );
422} 469}
423 470
424void KSyncPrefsDialog::fillSSH() 471void KSyncPrefsDialog::fillSSH()
425{ 472{
426 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 473 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
427 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 474 mLocalTempFile->setText("/tmp/mycalendar.ics" );
428 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 475 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
429 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 476 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
430 mLocalTempFileAB->setText("/tmp/std.vcf" ); 477 mLocalTempFileAB->setText("/tmp/std.vcf" );
431 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); 478 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
432 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 479 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
433 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 480 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
434 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); 481 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
435} 482}
436void KSyncPrefsDialog::fillFTP() 483void KSyncPrefsDialog::fillFTP()
437{ 484{
438 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); 485 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
439 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 486 mLocalTempFile->setText("/tmp/mycalendar.ics" );
440 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 487 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
441 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 488 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
442 mLocalTempFileAB->setText("/tmp/std.vcf" ); 489 mLocalTempFileAB->setText("/tmp/std.vcf" );
443 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 490 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
444 491
445 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 492 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
446 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 493 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
447 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 494 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
448 495
449} 496}
450void KSyncPrefsDialog::kindChanged( bool b ) 497void KSyncPrefsDialog::kindChanged( bool b )
451{ 498{
452 499
453 if ( mIsLocal->isChecked () ) 500 if ( mIsLocal->isChecked () )
454 localFileWidget->show(); 501 localFileWidget->show();
455 else 502 else
456 localFileWidget->hide(); 503 localFileWidget->hide();
457 504
458 if ( mIsNotLocal->isChecked () ) 505 if ( mIsNotLocal->isChecked () )
459 remoteFileWidget->show(); 506 remoteFileWidget->show();
460 else 507 else
461 remoteFileWidget->hide(); 508 remoteFileWidget->hide();
462 509
463 if ( mIsPhone->isChecked () ) { 510 if ( mIsPhone->isChecked () ) {
464 phoneWidget->show(); 511 phoneWidget->show();
465 } 512 }
466 else { 513 else {
467 phoneWidget->hide(); 514 phoneWidget->hide();
468 } 515 }
516 if ( mIsPi->isChecked () ) {
517 piWidget->show();
518 }
519 else {
520 piWidget->hide();
521 }
469 522
470} 523}
471void KSyncPrefsDialog::deleteProfile() 524void KSyncPrefsDialog::deleteProfile()
472{ 525{
473 //qDebug("KSyncPrefsDialog::deleteProfile() "); 526 //qDebug("KSyncPrefsDialog::deleteProfile() ");
474 if ( currentSelection >= 0 ) { 527 if ( currentSelection >= 0 ) {
475 if ( currentSelection < 3 ) { 528 if ( currentSelection < 3 ) {
476 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); 529 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
477 return; 530 return;
478 } 531 }
479 KSyncProfile* temp = mSyncProfiles.at(currentSelection); 532 KSyncProfile* temp = mSyncProfiles.at(currentSelection);
480 mSyncProfiles.remove( temp ); 533 mSyncProfiles.remove( temp );
481 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); 534 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection ));
482 insertProfiles(); 535 insertProfiles();
483 } 536 }
484} 537}
485 538
486void KSyncPrefsDialog::saveProfile() 539void KSyncPrefsDialog::saveProfile()
487{ 540{
488 KSyncProfile* prof; 541 KSyncProfile* prof;
489 if ( currentSelection >= 0 ) { 542 if ( currentSelection >= 0 ) {
490 prof = mSyncProfiles.at(currentSelection) ; 543 prof = mSyncProfiles.at(currentSelection) ;
544
545 prof->setRemotePw( mRemotePw->text());
546 prof->setRemoteIP( mRemoteIP->text());
547 prof->setRemotePort( mRemotePort->text());
548
549 prof->setRemotePwAB( mRemotePwAB->text());
550 prof->setRemoteIPAB( mRemoteIPAB->text());
551 prof->setRemotePortAB( mRemotePortAB->text());
552
553 prof->setRemotePwPWM( mRemotePwPWM->text());
554 prof->setRemoteIPPWM( mRemoteIPPWM->text());
555 prof->setRemotePortPWM( mRemotePortPWM->text());
556
491 prof->setPreSyncCommand( mRemotePrecommand->text()); 557 prof->setPreSyncCommand( mRemotePrecommand->text());
492 prof->setPostSyncCommand( mRemotePostcommand->text() ); 558 prof->setPostSyncCommand( mRemotePostcommand->text() );
493 prof->setLocalTempFile( mLocalTempFile->text()); 559 prof->setLocalTempFile( mLocalTempFile->text());
494 prof->setRemoteFileName( mRemoteFile->text() ); 560 prof->setRemoteFileName( mRemoteFile->text() );
495 prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); 561 prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
496 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); 562 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
497 prof->setLocalTempFileAB( mLocalTempFileAB->text()); 563 prof->setLocalTempFileAB( mLocalTempFileAB->text());
498 prof->setRemoteFileNameAB( mRemoteFileAB->text() ); 564 prof->setRemoteFileNameAB( mRemoteFileAB->text() );
499 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); 565 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text());
500 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); 566 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() );
501 prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); 567 prof->setLocalTempFilePWM( mLocalTempFilePWM->text());
502 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); 568 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() );
503 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 569 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
504 prof->setAskForPreferences( mAskForPreferences->isChecked()); 570 prof->setAskForPreferences( mAskForPreferences->isChecked());
505 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 571 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
506 prof->setWriteBackFile( mWriteBackFile->isChecked()); 572 prof->setWriteBackFile( mWriteBackFile->isChecked());
507 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 573 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
508 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 574 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
509 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 575 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
510 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 576 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
511 prof->setSyncPrefs( syncprefs); 577 prof->setSyncPrefs( syncprefs);
512 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 578 prof->setIsLocalFileSync( mIsLocal->isChecked() );
513 prof->setIsPhoneSync( mIsPhone->isChecked() ); 579 prof->setIsPhoneSync( mIsPhone->isChecked() );
514 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 580 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
515 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 581 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
516 582
517 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 583 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
518 prof->setPhoneDevice( mPhoneDevice->text() ); 584 prof->setPhoneDevice( mPhoneDevice->text() );
519 prof->setPhoneConnection( mPhoneConnection->text() ); 585 prof->setPhoneConnection( mPhoneConnection->text() );
520 prof->setPhoneModel( mPhoneModel->text() ); 586 prof->setPhoneModel( mPhoneModel->text() );
521 587
522 } 588 }
523 589
524} 590}
525 591
526void KSyncPrefsDialog::insertProfiles() 592void KSyncPrefsDialog::insertProfiles()
527{ 593{
528 int curItem = mProfileBox->currentItem(); 594 int curItem = mProfileBox->currentItem();
529 mProfileBox->blockSignals( true ); 595 mProfileBox->blockSignals( true );
530 mProfileBox->clear(); 596 mProfileBox->clear();
531 mProfileBox->insertStringList (mSyncProfileNames ); 597 mProfileBox->insertStringList (mSyncProfileNames );
532 int item = mSyncProfileNames.count() -1; 598 int item = mSyncProfileNames.count() -1;
533 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) 599 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
534 mProfileBox->setCurrentItem( curItem ); 600 mProfileBox->setCurrentItem( curItem );
535 else if ( item >= 0 ) { 601 else if ( item >= 0 ) {
536 mProfileBox->setCurrentItem( item ); 602 mProfileBox->setCurrentItem( item );
537 } 603 }
538 currentSelection = -1; 604 currentSelection = -1;
539 if ( mSyncProfileNames.count() > 0 ) { 605 if ( mSyncProfileNames.count() > 0 ) {
540 //qDebug(" profileChanged( mProfileBox->currentItem() "); 606 //qDebug(" profileChanged( mProfileBox->currentItem() ");
541 profileChanged( mProfileBox->currentItem() ); 607 profileChanged( mProfileBox->currentItem() );
542 currentSelection = mProfileBox->currentItem(); 608 currentSelection = mProfileBox->currentItem();
543 } 609 }
544 mProfileBox->blockSignals( false ); 610 mProfileBox->blockSignals( false );
545} 611}
546 612
547void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) 613void KSyncPrefsDialog::addProfile ( KSyncProfile* temp )
548{ 614{
549 saveProfile(); 615 saveProfile();
550 mSyncProfiles.append( temp ); 616 mSyncProfiles.append( temp );
551 mSyncProfileNames << temp->getName(); 617 mSyncProfileNames << temp->getName();
552 insertProfiles(); 618 insertProfiles();
553 int last = mProfileBox->count() -1; 619 int last = mProfileBox->count() -1;
554 mProfileBox->blockSignals( true ); 620 mProfileBox->blockSignals( true );
555 mProfileBox->setCurrentItem( last ); 621 mProfileBox->setCurrentItem( last );
556 mProfileBox->blockSignals( false ); 622 mProfileBox->blockSignals( false );
557 profileChanged(last); 623 profileChanged(last);
558} 624}
559void KSyncPrefsDialog::newProfile() 625void KSyncPrefsDialog::newProfile()
560{ 626{
561 addProfile ( new KSyncProfile () ); 627 addProfile ( new KSyncProfile () );
562} 628}
563 629
564void KSyncPrefsDialog::cloneProfile() 630void KSyncPrefsDialog::cloneProfile()
565{ 631{
566 if ( currentSelection >= 0 ) 632 if ( currentSelection >= 0 )
567 addProfile (mSyncProfiles.at(currentSelection)->clone()) ; 633 addProfile (mSyncProfiles.at(currentSelection)->clone()) ;
568 else 634 else
569 newProfile(); 635 newProfile();
570} 636}
571 637
572void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) 638void KSyncPrefsDialog::setLocalMachineName ( const QString& name )
573{ 639{
574 mMyMachineName->setText( name ); 640 mMyMachineName->setText( name );
575 641
576} 642}
577QString KSyncPrefsDialog::getLocalMachineName ( ) 643QString KSyncPrefsDialog::getLocalMachineName ( )
578{ 644{
579 return mMyMachineName->text(); 645 return mMyMachineName->text();
580} 646}
581 647
582QStringList KSyncPrefsDialog::getSyncProfileNames() 648QStringList KSyncPrefsDialog::getSyncProfileNames()
583{ 649{
584 return mSyncProfileNames; 650 return mSyncProfileNames;
585} 651}
586void KSyncPrefsDialog::usrReadConfig() 652void KSyncPrefsDialog::usrReadConfig()
587{ 653{
588 //KConfig *config = KOGlobals::config(); 654 //KConfig *config = KOGlobals::config();
589 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 655 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
590 config.setGroup("General"); 656 config.setGroup("General");
591 mSyncProfileNames =config.readListEntry("SyncProfileNames"); 657 mSyncProfileNames =config.readListEntry("SyncProfileNames");
592 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); 658 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined"));
593 int i; 659 int i;
594 KSyncProfile* temp ; 660 KSyncProfile* temp ;
595 mSyncProfiles.clear(); 661 mSyncProfiles.clear();
596 for ( i = 0; i < mSyncProfileNames.count();++i ) { 662 for ( i = 0; i < mSyncProfileNames.count();++i ) {
597 temp = new KSyncProfile (); 663 temp = new KSyncProfile ();
598 temp->setName( mSyncProfileNames[i] ); 664 temp->setName( mSyncProfileNames[i] );
599 temp->readConfig( &config ); 665 temp->readConfig( &config );
600 mSyncProfiles.append( temp ); 666 mSyncProfiles.append( temp );
601 } 667 }
602 insertProfiles(); 668 insertProfiles();
603 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); 669 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName );
604} 670}
605 671
606 672
607void KSyncPrefsDialog::usrWriteConfig() 673void KSyncPrefsDialog::usrWriteConfig()
608{ 674{
609 saveProfile(); 675 saveProfile();
610 if ( currentSelection >= 0 ) 676 if ( currentSelection >= 0 )
611 profileChanged(currentSelection); 677 profileChanged(currentSelection);
612 //KConfig *config = KOGlobals::config(); 678 //KConfig *config = KOGlobals::config();
613 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 679 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
614 KSyncProfile* prof = mSyncProfiles.first(); 680 KSyncProfile* prof = mSyncProfiles.first();
615 QStringList externalSyncProfileNames; 681 QStringList externalSyncProfileNames;
616 externalSyncProfileNames.append("Sharp_DTM");; 682 externalSyncProfileNames.append("Sharp_DTM");;
617 while ( prof ) { 683 while ( prof ) {
618 prof->writeConfig(&config); 684 prof->writeConfig(&config);
619 if ( prof->getIsPhoneSync( ) ) 685 if ( prof->getIsPhoneSync( ) )
620 externalSyncProfileNames.append(prof->getName( ) ); 686 externalSyncProfileNames.append(prof->getName( ) );
621 prof = mSyncProfiles.next(); 687 prof = mSyncProfiles.next();
622 } 688 }
623 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; 689 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames;
624 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); 690 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text();
625 config.setGroup("General"); 691 config.setGroup("General");
626 config.writeEntry("SyncProfileNames",mSyncProfileNames); 692 config.writeEntry("SyncProfileNames",mSyncProfileNames);
627 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); 693 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames);
628 config.writeEntry("LocalMachineName",mMyMachineName->text()); 694 config.writeEntry("LocalMachineName",mMyMachineName->text());
629 config.sync(); 695 config.sync();
630} 696}
631 697
632void KSyncPrefsDialog::helpDevice() 698void KSyncPrefsDialog::helpDevice()
633{ 699{
634 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); 700 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n");
635#ifdef _WIN32_ 701#ifdef _WIN32_
636 hint += "Leave empty for Irda.\n" 702 hint += "Leave empty for Irda.\n"
637 "com1:\n(first serial port)\n" 703 "com1:\n(first serial port)\n"
638 "usb not supported\n" 704 "usb not supported\n"
639 "???\n(bluetooth device address)\n"; 705 "???\n(bluetooth device address)\n";
640 706
641#else 707#else
642 hint += "/dev/ircomm\n(Irda)\n" 708 hint += "/dev/ircomm\n(Irda)\n"
643 "/dev/ttyS0\n(first serial port)\n" 709 "/dev/ttyS0\n(first serial port)\n"
644 "/dev/ttyUSB0\n(first device usb port)\n" 710 "/dev/ttyUSB0\n(first device usb port)\n"
645 "???\n(bluetooth device address)\n"; 711 "???\n(bluetooth device address)\n";
646#endif 712#endif
647 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 713 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
648} 714}
649void KSyncPrefsDialog::helpModel() 715void KSyncPrefsDialog::helpModel()
650{ 716{
651 QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); 717 QString hint = i18n("Leave empty or\ninsert name of phone model:\n");
652 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; 718 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection";
653 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 719 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
654 720
655} 721}
656void KSyncPrefsDialog::helpConnection() 722void KSyncPrefsDialog::helpConnection()
657{ 723{
658 QString hint = i18n("Insert kind of connection,e.g.:\n"); 724 QString hint = i18n("Insert kind of connection,e.g.:\n");
659 hint += "irda | Nokia FBUS over infrared\n" 725 hint += "irda | Nokia FBUS over infrared\n"
660 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" 726 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n"
661 "irdaobex | set also model as obex\n" 727 "irdaobex | set also model as obex\n"
662 "fbus | Nokia FBUS2 serial\n"; 728 "fbus | Nokia FBUS2 serial\n";
663 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 729 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
664} 730}
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 8094bdd..d3f8f4c 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -1,136 +1,151 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KSYNCPREFSDIALOG_H 23#ifndef _KSYNCPREFSDIALOG_H
24#define _KSYNCPREFSDIALOG_H 24#define _KSYNCPREFSDIALOG_H
25 25
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28#include <qptrlist.h> 28#include <qptrlist.h>
29 29
30//#include <libkdepim/kprefsdialog.h> 30//#include <libkdepim/kprefsdialog.h>
31 31
32class KColorButton; 32class KColorButton;
33class QSpinBox;; 33class QSpinBox;;
34class QRadioButton; 34class QRadioButton;
35class QCheckBox; 35class QCheckBox;
36class QSlider; 36class QSlider;
37class KURLRequester; 37class KURLRequester;
38class QComboBox; 38class QComboBox;
39class QButtonGroup; 39class QButtonGroup;
40class QLineEdit; 40class QLineEdit;
41class QVBox; 41class QVBox;
42class QStringList; 42class QStringList;
43class KSyncProfile; 43class KSyncProfile;
44 44
45/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
46 */ 46 */
47class KSyncPrefsDialog : public KDialog 47class KSyncPrefsDialog : public KDialog
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
52 KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
53 ~KSyncPrefsDialog(); 53 ~KSyncPrefsDialog();
54 void usrReadConfig(); 54 void usrReadConfig();
55 void setLocalMachineName ( const QString& name ); 55 void setLocalMachineName ( const QString& name );
56 QString getLocalMachineName ( ); 56 QString getLocalMachineName ( );
57 57
58 QStringList getSyncProfileNames(); 58 QStringList getSyncProfileNames();
59 59
60 public slots: 60 public slots:
61 protected slots: 61 protected slots:
62 void accept(); 62 void accept();
63 void deleteProfile(); 63 void deleteProfile();
64 void newProfile(); 64 void newProfile();
65 void cloneProfile(); 65 void cloneProfile();
66 void kindChanged(bool); 66 void kindChanged(bool);
67 void fillSSH(); 67 void fillSSH();
68 void fillFTP(); 68 void fillFTP();
69 void textChanged( const QString & ); 69 void textChanged( const QString & );
70 void profileChanged( int ); 70 void profileChanged( int );
71 void chooseFile(); 71 void chooseFile();
72 void chooseFileAB(); 72 void chooseFileAB();
73 void chooseFilePWM(); 73 void chooseFilePWM();
74 void slotOK(); 74 void slotOK();
75 void helpDevice(); 75 void helpDevice();
76 void helpModel(); 76 void helpModel();
77 void helpConnection(); 77 void helpConnection();
78 78
79 protected: 79 protected:
80 void usrWriteConfig(); 80 void usrWriteConfig();
81 81
82 void setupSyncAlgTab(); 82 void setupSyncAlgTab();
83 83
84 private: 84 private:
85 int currentSelection; 85 int currentSelection;
86 QPtrList<KSyncProfile> mSyncProfiles; 86 QPtrList<KSyncProfile> mSyncProfiles;
87 QStringList mSyncProfileNames; 87 QStringList mSyncProfileNames;
88 QLineEdit * mMyMachineName; 88 QLineEdit * mMyMachineName;
89 QComboBox * mProfileBox; 89 QComboBox * mProfileBox;
90 QRadioButton* mIsLocal; 90 QRadioButton* mIsLocal;
91 QRadioButton* mIsNotLocal; 91 QRadioButton* mIsNotLocal;
92 QRadioButton* mIsPhone; 92 QRadioButton* mIsPhone;
93 QRadioButton* mIsPi;
93 QCheckBox* mIncludeInRing; 94 QCheckBox* mIncludeInRing;
94 QCheckBox* mIncludeInRingAB; 95 QCheckBox* mIncludeInRingAB;
95 QCheckBox* mIncludeInRingPWM; 96 QCheckBox* mIncludeInRingPWM;
96 void addProfile ( KSyncProfile* ); 97 void addProfile ( KSyncProfile* );
97 void insertProfiles(); 98 void insertProfiles();
98 void saveProfile(); 99 void saveProfile();
99 QButtonGroup* proGr; 100 QButtonGroup* proGr;
100 101
101 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; 102 QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both;
102 103
103 104
104 QLineEdit * mRemotePostcommand; 105 QLineEdit * mRemotePostcommand;
105 QLineEdit * mRemotePrecommand; 106 QLineEdit * mRemotePrecommand;
106 QLineEdit * mRemoteFile; 107 QLineEdit * mRemoteFile;
107 QLineEdit * mLocalTempFile; 108 QLineEdit * mLocalTempFile;
108 109
109 QLineEdit * mRemotePostcommandAB; 110 QLineEdit * mRemotePostcommandAB;
110 QLineEdit * mRemotePrecommandAB; 111 QLineEdit * mRemotePrecommandAB;
111 QLineEdit * mRemoteFileAB; 112 QLineEdit * mRemoteFileAB;
112 QLineEdit * mLocalTempFileAB; 113 QLineEdit * mLocalTempFileAB;
113 114
114 QLineEdit * mRemotePostcommandPWM; 115 QLineEdit * mRemotePostcommandPWM;
115 QLineEdit * mRemotePrecommandPWM; 116 QLineEdit * mRemotePrecommandPWM;
116 QLineEdit * mRemoteFilePWM; 117 QLineEdit * mRemoteFilePWM;
117 QLineEdit * mLocalTempFilePWM; 118 QLineEdit * mLocalTempFilePWM;
118 119
120
121 QLineEdit * mRemotePw;
122 QLineEdit * mRemoteIP;
123 QLineEdit * mRemotePort;
124
125 QLineEdit * mRemotePwAB;
126 QLineEdit * mRemoteIPAB;
127 QLineEdit * mRemotePortAB;
128
129 QLineEdit * mRemotePwPWM;
130 QLineEdit * mRemoteIPPWM;
131 QLineEdit * mRemotePortPWM;
132
119 QLineEdit * mPhoneDevice; 133 QLineEdit * mPhoneDevice;
120 QLineEdit * mPhoneConnection; 134 QLineEdit * mPhoneConnection;
121 QLineEdit * mPhoneModel; 135 QLineEdit * mPhoneModel;
122 136
123 QWidget* mSetupSyncAlgTab; 137 QWidget* mSetupSyncAlgTab;
124 QVBox* localFileWidget; 138 QVBox* localFileWidget;
125 QVBox* remoteFileWidget; 139 QVBox* remoteFileWidget;
126 QVBox* phoneWidget; 140 QVBox* phoneWidget;
141 QVBox* piWidget;
127 QCheckBox* mWriteBackFile; 142 QCheckBox* mWriteBackFile;
128 QCheckBox* mWriteBackFuture; 143 QCheckBox* mWriteBackFuture;
129 QSpinBox* mWriteBackFutureWeeks; 144 QSpinBox* mWriteBackFutureWeeks;
130 QCheckBox* mWriteBackExisting; 145 QCheckBox* mWriteBackExisting;
131 QCheckBox* mAskForPreferences; 146 QCheckBox* mAskForPreferences;
132 QCheckBox* mShowSummaryAfterSync; 147 QCheckBox* mShowSummaryAfterSync;
133 QCheckBox* mWriteContactToSIM; 148 QCheckBox* mWriteContactToSIM;
134}; 149};
135 150
136#endif 151#endif
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 2bf4e6c..76dfe00 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -1,199 +1,248 @@
1/* 1/*
2 This file is part of KDE-Pim/Pi. 2 This file is part of KDE-Pim/Pi.
3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> 3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
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 20
21// $Id$ 21// $Id$
22 22
23#include <qcolor.h> 23#include <qcolor.h>
24 24
25#include <kconfig.h> 25#include <kconfig.h>
26#include <kstandarddirs.h> 26#include <kstandarddirs.h>
27#include <kglobal.h> 27#include <kglobal.h>
28#include <kdebug.h> 28#include <kdebug.h>
29 29
30#include "ksyncprofile.h" 30#include "ksyncprofile.h"
31 31
32 32
33KSyncProfile::KSyncProfile(): QObject () 33KSyncProfile::KSyncProfile(): QObject ()
34{ 34{
35 setDefault(); 35 setDefault();
36} 36}
37KSyncProfile::~KSyncProfile() 37KSyncProfile::~KSyncProfile()
38{ 38{
39 39
40} 40}
41 41
42 42
43KSyncProfile* KSyncProfile::clone() 43KSyncProfile* KSyncProfile::clone()
44{ 44{
45 KSyncProfile* myClone = new KSyncProfile(); 45 KSyncProfile* myClone = new KSyncProfile();
46 myClone->setRemotePw(mRemotePw);
47 myClone->setRemoteIP(mRemoteIP);
48 myClone->setRemotePort(mRemotePort);
49 myClone->setRemotePwAB(mRemotePwAB);
50 myClone->setRemoteIPAB(mRemoteIPAB);
51 myClone->setRemotePortAB(mRemotePortAB);
52 myClone->setRemotePwPWM(mRemotePwPWM);
53 myClone->setRemoteIPPWM(mRemoteIPPWM);
54 myClone->setRemotePortPWM (mRemotePortPWM);
46 myClone->setPreSyncCommand( mPreSyncCommand ); 55 myClone->setPreSyncCommand( mPreSyncCommand );
47 myClone->setPostSyncCommand( mPostSyncCommand ); 56 myClone->setPostSyncCommand( mPostSyncCommand );
48 myClone->setLocalTempFile( mLocalTempFile); 57 myClone->setLocalTempFile( mLocalTempFile);
49 myClone->setRemoteFileName( mRemoteFileName ); 58 myClone->setRemoteFileName( mRemoteFileName );
50 myClone->setPreSyncCommandAB( mPreSyncCommandAB ); 59 myClone->setPreSyncCommandAB( mPreSyncCommandAB );
51 myClone->setPostSyncCommandAB( mPostSyncCommandAB ); 60 myClone->setPostSyncCommandAB( mPostSyncCommandAB );
52 myClone->setLocalTempFileAB( mLocalTempFileAB); 61 myClone->setLocalTempFileAB( mLocalTempFileAB);
53 myClone->setRemoteFileNameAB( mRemoteFileNameAB ); 62 myClone->setRemoteFileNameAB( mRemoteFileNameAB );
54 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM ); 63 myClone->setPreSyncCommandPWM( mPreSyncCommandPWM );
55 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM ); 64 myClone->setPostSyncCommandPWM( mPostSyncCommandPWM );
56 myClone->setLocalTempFilePWM( mLocalTempFilePWM); 65 myClone->setLocalTempFilePWM( mLocalTempFilePWM);
57 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM ); 66 myClone->setRemoteFileNamePWM( mRemoteFileNamePWM );
58 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 67 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
59 myClone->setAskForPreferences( mAskForPreferences); 68 myClone->setAskForPreferences( mAskForPreferences);
60 myClone->setWriteBackExisting(mWriteBackExisting ); 69 myClone->setWriteBackExisting(mWriteBackExisting );
61 myClone->setWriteBackFile( mWriteBackFile); 70 myClone->setWriteBackFile( mWriteBackFile);
62 myClone->setWriteBackFuture( mWriteBackFuture ); 71 myClone->setWriteBackFuture( mWriteBackFuture );
63 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); 72 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
64 myClone->setIncludeInRingSync( mIncludeInRingSync ); 73 myClone->setIncludeInRingSync( mIncludeInRingSync );
65 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); 74 myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
66 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); 75 myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM );
67 myClone->setSyncPrefs( mSyncPrefs); 76 myClone->setSyncPrefs( mSyncPrefs);
68 myClone->setIsLocalFileSync( mIsLocalFileSync ); 77 myClone->setIsLocalFileSync( mIsLocalFileSync );
69 myClone->setIsPhoneSync( mIsPhoneSync ); 78 myClone->setIsPhoneSync( mIsPhoneSync );
79 myClone->setIsPiSync( mIsPiSync );
70 myClone->setWriteContactToSIM( mWriteContactToSIM ); 80 myClone->setWriteContactToSIM( mWriteContactToSIM );
71 myClone->setName( "noName" ); 81 myClone->setName( "noName" );
72 //myClone->setIdentifier( "noID" ); 82 //myClone->setIdentifier( "noID" );
73 return myClone; 83 return myClone;
74} 84}
75 85
76 86
77void KSyncProfile::setDefault() 87void KSyncProfile::setDefault()
78{ 88{
79 mPreSyncCommand = i18n("command for downloading remote file to local device"); 89 mPreSyncCommand = i18n("command for downloading remote file to local device");
80 mPostSyncCommand = i18n("command for uploading local temp file to remote device"); 90 mPostSyncCommand = i18n("command for uploading local temp file to remote device");
81 mLocalTempFile = "/tmp/mycalendar.ics"; 91 mLocalTempFile = "/tmp/mycalendar.ics";
82 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; 92 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
83 mPreSyncCommandAB = i18n("command for downloading remote file to local device"); 93 mPreSyncCommandAB = i18n("command for downloading remote file to local device");
84 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); 94 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
85 mLocalTempFileAB = "/tmp/std.vcf"; 95 mLocalTempFileAB = "/tmp/std.vcf";
86 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; 96 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
87 mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); 97 mPreSyncCommandPWM = i18n("command for downloading remote file to local device");
88 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); 98 mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device");
89 mLocalTempFilePWM = "/tmp/passwords.pwm"; 99 mLocalTempFilePWM = "/tmp/passwords.pwm";
90 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; 100 mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm";
101
102 mRemotePw = "abc";
103 mRemoteIP = "192.168.0.99";
104 mRemotePort = "9197";
105
106 mRemotePwAB = "abc";
107 mRemoteIPAB = "192.168.0.99";
108 mRemotePortAB = "9198";
109
110 mRemotePwPWM = "abc";
111 mRemoteIPPWM = "192.168.0.99";
112 mRemotePortPWM = "9199";
113
91 mShowSummaryAfterSync = true; 114 mShowSummaryAfterSync = true;
92 mAskForPreferences = true; 115 mAskForPreferences = true;
93 mWriteBackExisting = false; 116 mWriteBackExisting = false;
94 mWriteBackFuture = false; 117 mWriteBackFuture = false;
95 mWriteBackFutureWeeks = 12; 118 mWriteBackFutureWeeks = 12;
96 mWriteBackFile = true; 119 mWriteBackFile = true;
97 mIncludeInRingSync = false; 120 mIncludeInRingSync = false;
98 mIncludeInRingSyncAB = false; 121 mIncludeInRingSyncAB = false;
99 mIncludeInRingSyncPWM = false; 122 mIncludeInRingSyncPWM = false;
100 mSyncPrefs = SYNC_PREF_ASK; 123 mSyncPrefs = SYNC_PREF_ASK;
101 mIsLocalFileSync = true; 124 mIsLocalFileSync = true;
102 mName = "noName"; 125 mName = "noName";
103 mIsPhoneSync = false; 126 mIsPhoneSync = false;
127 mIsPiSync = false;
104 mWriteContactToSIM = false; 128 mWriteContactToSIM = false;
105 mPhoneDevice = "/dev/ircomm"; 129 mPhoneDevice = "/dev/ircomm";
106 mPhoneConnection = "irda"; 130 mPhoneConnection = "irda";
107 mPhoneModel = "6310i"; 131 mPhoneModel = "6310i";
108} 132}
109void KSyncProfile::readConfig(KConfig *config ) 133void KSyncProfile::readConfig(KConfig *config )
110{ 134{
111 if (config) 135 if (config)
112 { 136 {
113 137
114 config->setGroup( mName ); 138 config->setGroup( mName );
115 139
116 mName = config->readEntry( "Name", mName ); 140 mName = config->readEntry( "Name", mName );
141
142 mRemotePw = config->readEntry( "RemotePw",mRemotePw );
143 mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP );
144 mRemotePort = config->readEntry( "RemotePort", mRemotePort );
145 mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB );
146 mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB );
147 mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB );
148 mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM );
149 mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM );
150 mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM );
151
117 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); 152 mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand );
118 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); 153 mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand );
119 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); 154 mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile );
120 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); 155 mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName );
121 156
122 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 157 mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB );
123 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 158 mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB );
124 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); 159 mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB );
125 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 160 mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB );
126 161
127 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 162 mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
128 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); 163 mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
129 mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM ); 164 mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM );
130 mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); 165 mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
131 166
132 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); 167 mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice );
133 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); 168 mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection );
134 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); 169 mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel );
135 170
136 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); 171 mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync );
137 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 172 mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
138 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 173 mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
139 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 174 mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
140 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); 175 mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences );
141 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); 176 mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting );
142 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); 177 mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture );
143 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); 178 mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile );
144 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); 179 mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM );
145 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); 180 mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs );
146 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); 181 mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks );
147 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); 182 mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync );
148 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); 183 mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
184 mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
149 } 185 }
150 else 186 else
151 { 187 {
152 setDefault(); 188 setDefault();
153 } 189 }
154} 190}
155 191
156void KSyncProfile::deleteConfig(KConfig *config ) 192void KSyncProfile::deleteConfig(KConfig *config )
157{ 193{
158 config->deleteGroup( mName ); 194 config->deleteGroup( mName );
159} 195}
160 196
161void KSyncProfile::writeConfig( KConfig * config ) 197void KSyncProfile::writeConfig( KConfig * config )
162{ 198{
163 config->setGroup(mName); 199 config->setGroup(mName);
164 200
201 config->writeEntry( "RemotePw", mRemotePw);
202 config->writeEntry( "RemoteIP", mRemoteIP);
203 config->writeEntry( "RemotePort", mRemotePort);
204
205 config->writeEntry( "RemotePwAB", mRemotePwAB);
206 config->writeEntry( "RemoteIPAB", mRemoteIPAB);
207 config->writeEntry( "RemotePortAB", mRemotePortAB);
208
209 config->writeEntry( "RemotePwPWM", mRemotePwPWM);
210 config->writeEntry( "RemoteIPPWM", mRemoteIPPWM);
211 config->writeEntry( "RemotePortPWM", mRemotePortPWM);
212
165 config->writeEntry( "Name", mName ); 213 config->writeEntry( "Name", mName );
166 config->writeEntry( "PreSyncCommand",mPreSyncCommand ); 214 config->writeEntry( "PreSyncCommand",mPreSyncCommand );
167 config->writeEntry( "PostSyncCommand", mPostSyncCommand ); 215 config->writeEntry( "PostSyncCommand", mPostSyncCommand );
168 config->writeEntry( "LocalTempFile", mLocalTempFile ); 216 config->writeEntry( "LocalTempFile", mLocalTempFile );
169 config->writeEntry( "RemoteFileName", mRemoteFileName ); 217 config->writeEntry( "RemoteFileName", mRemoteFileName );
170 218
171 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); 219 config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB );
172 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); 220 config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB );
173 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); 221 config->writeEntry( "LocalTempFileAB", mLocalTempFileAB );
174 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); 222 config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB );
175 223
176 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); 224 config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM );
177 config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); 225 config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM );
178 config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM ); 226 config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM );
179 config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); 227 config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM );
180 228
181 config->writeEntry( "PhoneDevice", mPhoneDevice ); 229 config->writeEntry( "PhoneDevice", mPhoneDevice );
182 config->writeEntry( "PhoneConnection", mPhoneConnection ); 230 config->writeEntry( "PhoneConnection", mPhoneConnection );
183 config->writeEntry( "PhoneModel", mPhoneModel ); 231 config->writeEntry( "PhoneModel", mPhoneModel );
184 232
185 config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); 233 config->writeEntry( "IncludeInRingSync",mIncludeInRingSync );
186 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); 234 config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB );
187 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); 235 config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM );
188 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); 236 config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync );
189 config->writeEntry( "AskForPreferences",mAskForPreferences ); 237 config->writeEntry( "AskForPreferences",mAskForPreferences );
190 config->writeEntry( "WriteBackExisting",mWriteBackExisting ); 238 config->writeEntry( "WriteBackExisting",mWriteBackExisting );
191 config->writeEntry( "WriteBackFuture",mWriteBackFuture ); 239 config->writeEntry( "WriteBackFuture",mWriteBackFuture );
192 config->writeEntry( "WriteBackFile",mWriteBackFile ); 240 config->writeEntry( "WriteBackFile",mWriteBackFile );
193 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); 241 config->writeEntry( "WriteContactToSIM",mWriteContactToSIM );
194 config->writeEntry( "SyncPrefs", mSyncPrefs ); 242 config->writeEntry( "SyncPrefs", mSyncPrefs );
195 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); 243 config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks);
196 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); 244 config->writeEntry( "IsLocalFileSync", mIsLocalFileSync );
197 config->writeEntry( "IsPhoneSync", mIsPhoneSync ); 245 config->writeEntry( "IsPhoneSync", mIsPhoneSync );
246 config->writeEntry( "IsPiSync", mIsPiSync );
198} 247}
199 248
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index a81a9ad..6a68bd7 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -1,148 +1,185 @@
1/* 1/*
2 This file is part of KDE-Pim/Pi. 2 This file is part of KDE-Pim/Pi.
3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> 3 Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
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#ifndef _KSYNCPROFILE_H 20#ifndef _KSYNCPROFILE_H
21#define _KSYNCPROFILE_H 21#define _KSYNCPROFILE_H
22 22
23#include <qptrlist.h> 23#include <qptrlist.h>
24#include <qcolor.h> 24#include <qcolor.h>
25#include <qfont.h> 25#include <qfont.h>
26#include <qstringlist.h> 26#include <qstringlist.h>
27#include <qobject.h> 27#include <qobject.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <libkcal/syncdefines.h> 30#include <libkcal/syncdefines.h>
31 31
32 32
33 33
34class KConfig; 34class KConfig;
35 35
36 36
37class KSyncProfile : public QObject { 37class KSyncProfile : public QObject {
38 public: 38 public:
39 KSyncProfile(); 39 KSyncProfile();
40 ~KSyncProfile() ; 40 ~KSyncProfile() ;
41 41
42 KSyncProfile* clone(); 42 KSyncProfile* clone();
43 void setDefault(); 43 void setDefault();
44 void readConfig(KConfig *); 44 void readConfig(KConfig *);
45 void writeConfig(KConfig *); 45 void writeConfig(KConfig *);
46 void deleteConfig(KConfig *); 46 void deleteConfig(KConfig *);
47 47
48 void setRemotePw( const QString& n ) {mRemotePw = n;}
49 QString getRemotePw( ) { return mRemotePw; }
50 void setRemotePwAB( const QString& n ) {mRemotePwAB = n;}
51 QString getRemotePwAB( ) { return mRemotePwAB; }
52 void setRemotePwPWM( const QString& n ) {mRemotePwPWM = n;}
53 QString getRemotePwPWM( ) { return mRemotePwPWM; }
54
55 void setRemoteIP( const QString& n ) {mRemoteIP = n;}
56 QString getRemoteIP( ) { return mRemoteIP; }
57 void setRemoteIPAB( const QString& n ) {mRemoteIPAB = n;}
58 QString getRemoteIPAB( ) { return mRemoteIPAB; }
59 void setRemoteIPPWM( const QString& n ) {mRemoteIPPWM = n;}
60 QString getRemoteIPPWM( ) { return mRemoteIPPWM; }
61
62 void setRemotePort( const QString& n ) {mRemotePort = n;}
63 QString getRemotePort( ) { return mRemotePort; }
64 void setRemotePortAB( const QString& n ) {mRemotePortAB = n;}
65 QString getRemotePortAB( ) { return mRemotePortAB; }
66 void setRemotePortPWM( const QString& n ) {mRemotePortPWM = n;}
67 QString getRemotePortPWM( ) { return mRemotePortPWM; }
68
48 void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} 69 void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;}
49 QString getPreSyncCommand( ) { return mPreSyncCommand; } 70 QString getPreSyncCommand( ) { return mPreSyncCommand; }
50 void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} 71 void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;}
51 QString getPostSyncCommand( ) { return mPostSyncCommand;} 72 QString getPostSyncCommand( ) { return mPostSyncCommand;}
52 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} 73 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;}
53 QString getLocalTempFile( ) { return mLocalTempFile;} 74 QString getLocalTempFile( ) { return mLocalTempFile;}
54 void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} 75 void setRemoteFileName( const QString& n ) { mRemoteFileName = n;}
55 QString getRemoteFileName( ) { return mRemoteFileName;} 76 QString getRemoteFileName( ) { return mRemoteFileName;}
56 77
57 void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} 78 void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;}
58 QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } 79 QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; }
59 void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} 80 void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;}
60 QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} 81 QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;}
61 void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} 82 void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;}
62 QString getLocalTempFileAB( ) { return mLocalTempFileAB;} 83 QString getLocalTempFileAB( ) { return mLocalTempFileAB;}
63 void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} 84 void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;}
64 QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} 85 QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;}
65 86
66 void setPreSyncCommandPWM( const QString& n ) {mPreSyncCommandPWM = n;} 87 void setPreSyncCommandPWM( const QString& n ) {mPreSyncCommandPWM = n;}
67 QString getPreSyncCommandPWM( ) { return mPreSyncCommandPWM; } 88 QString getPreSyncCommandPWM( ) { return mPreSyncCommandPWM; }
68 void setPostSyncCommandPWM( const QString& n ) {mPostSyncCommandPWM = n;} 89 void setPostSyncCommandPWM( const QString& n ) {mPostSyncCommandPWM = n;}
69 QString getPostSyncCommandPWM( ) { return mPostSyncCommandPWM;} 90 QString getPostSyncCommandPWM( ) { return mPostSyncCommandPWM;}
70 void setLocalTempFilePWM( const QString& n ) { mLocalTempFilePWM= n;} 91 void setLocalTempFilePWM( const QString& n ) { mLocalTempFilePWM= n;}
71 QString getLocalTempFilePWM( ) { return mLocalTempFilePWM;} 92 QString getLocalTempFilePWM( ) { return mLocalTempFilePWM;}
72 void setRemoteFileNamePWM( const QString& n ) { mRemoteFileNamePWM = n;} 93 void setRemoteFileNamePWM( const QString& n ) { mRemoteFileNamePWM = n;}
73 QString getRemoteFileNamePWM( ) { return mRemoteFileNamePWM;} 94 QString getRemoteFileNamePWM( ) { return mRemoteFileNamePWM;}
74 95
75 void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} 96 void setPhoneDevice( const QString& n ) { mPhoneDevice = n;}
76 QString getPhoneDevice( ) { return mPhoneDevice;} 97 QString getPhoneDevice( ) { return mPhoneDevice;}
77 void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} 98 void setPhoneConnection( const QString& n ) { mPhoneConnection = n;}
78 QString getPhoneConnection( ) { return mPhoneConnection;} 99 QString getPhoneConnection( ) { return mPhoneConnection;}
79 void setPhoneModel( const QString& n ) { mPhoneModel = n;} 100 void setPhoneModel( const QString& n ) { mPhoneModel = n;}
80 QString getPhoneModel( ) { return mPhoneModel;} 101 QString getPhoneModel( ) { return mPhoneModel;}
81 /* 102 /*
82 void set( const QString& n ) { = n;} 103 void set( const QString& n ) { = n;}
83 QString get( ) { return ;} 104 QString get( ) { return ;}
84 */ 105 */
85 106
86 void setName( const QString& n ) {mName = n;} 107 void setName( const QString& n ) {mName = n;}
87 QString getName( ) { return mName;} 108 QString getName( ) { return mName;}
88 void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} 109 void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;}
89 bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} 110 bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;}
90 void setAskForPreferences( bool b ) { mAskForPreferences= b;} 111 void setAskForPreferences( bool b ) { mAskForPreferences= b;}
91 bool getAskForPreferences( ) { return mAskForPreferences;} 112 bool getAskForPreferences( ) { return mAskForPreferences;}
92 void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} 113 void setWriteBackExisting( bool b ) { mWriteBackExisting = b;}
93 bool getWriteBackExisting( ) { return mWriteBackExisting;} 114 bool getWriteBackExisting( ) { return mWriteBackExisting;}
94 void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} 115 void setWriteBackFuture( bool b ) { mWriteBackFuture = b;}
95 bool getWriteBackFuture( ) { return mWriteBackFuture;} 116 bool getWriteBackFuture( ) { return mWriteBackFuture;}
96 void setWriteBackFile( bool b ) { mWriteBackFile= b;} 117 void setWriteBackFile( bool b ) { mWriteBackFile= b;}
97 bool getWriteBackFile( ) { return mWriteBackFile;} 118 bool getWriteBackFile( ) { return mWriteBackFile;}
98 void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;} 119 void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;}
99 bool getWriteContactToSIM( ) { return mWriteContactToSIM;} 120 bool getWriteContactToSIM( ) { return mWriteContactToSIM;}
100 void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} 121 void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;}
101 bool getIncludeInRingSync( ) { return mIncludeInRingSync;} 122 bool getIncludeInRingSync( ) { return mIncludeInRingSync;}
102 void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} 123 void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;}
103 bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} 124 bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;}
104 void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;} 125 void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;}
105 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;} 126 bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;}
106 void setSyncPrefs( int n ) { mSyncPrefs= n;} 127 void setSyncPrefs( int n ) { mSyncPrefs= n;}
107 int getSyncPrefs( ) { return mSyncPrefs;} 128 int getSyncPrefs( ) { return mSyncPrefs;}
108 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} 129 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
109 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} 130 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
110 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} 131 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
111 bool getIsLocalFileSync( ) { return mIsLocalFileSync;} 132 bool getIsLocalFileSync( ) { return mIsLocalFileSync;}
112 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} 133 void setIsPhoneSync( bool b ) { mIsPhoneSync= b;}
113 bool getIsPhoneSync( ) { return mIsPhoneSync;} 134 bool getIsPhoneSync( ) { return mIsPhoneSync;}
135 void setIsPiSync( bool b ) { mIsPiSync= b;}
136 bool getIsPiSync( ) { return mIsPiSync;}
114 private: 137 private:
115 QString mName; 138 QString mName;
116 QString mPreSyncCommand; 139 QString mPreSyncCommand;
117 QString mPostSyncCommand; 140 QString mPostSyncCommand;
118 QString mLocalTempFile; 141 QString mLocalTempFile;
119 QString mRemoteFileName; 142 QString mRemoteFileName;
120 QString mPreSyncCommandAB; 143 QString mPreSyncCommandAB;
121 QString mPostSyncCommandAB; 144 QString mPostSyncCommandAB;
122 QString mLocalTempFileAB; 145 QString mLocalTempFileAB;
123 QString mRemoteFileNameAB; 146 QString mRemoteFileNameAB;
124 QString mPreSyncCommandPWM; 147 QString mPreSyncCommandPWM;
125 QString mPostSyncCommandPWM; 148 QString mPostSyncCommandPWM;
126 QString mLocalTempFilePWM; 149 QString mLocalTempFilePWM;
127 QString mRemoteFileNamePWM; 150 QString mRemoteFileNamePWM;
128 151
152 QString mRemotePw;
153 QString mRemoteIP;
154 QString mRemotePort;
155
156 QString mRemotePwAB;
157 QString mRemoteIPAB;
158 QString mRemotePortAB;
159
160 QString mRemotePwPWM;
161 QString mRemoteIPPWM;
162 QString mRemotePortPWM;
163
129 QString mPhoneDevice; 164 QString mPhoneDevice;
130 QString mPhoneConnection; 165 QString mPhoneConnection;
131 QString mPhoneModel; 166 QString mPhoneModel;
132 167
133 bool mIncludeInRingSync; 168 bool mIncludeInRingSync;
134 bool mIncludeInRingSyncAB; 169 bool mIncludeInRingSyncAB;
135 bool mIncludeInRingSyncPWM; 170 bool mIncludeInRingSyncPWM;
136 int mSyncPrefs; 171 int mSyncPrefs;
137 bool mWriteBackFile; 172 bool mWriteBackFile;
138 bool mWriteBackExisting; 173 bool mWriteBackExisting;
139 bool mWriteBackFuture; 174 bool mWriteBackFuture;
140 int mWriteBackFutureWeeks; 175 int mWriteBackFutureWeeks;
141 bool mAskForPreferences; 176 bool mAskForPreferences;
142 bool mShowSummaryAfterSync; 177 bool mShowSummaryAfterSync;
143 bool mIsLocalFileSync; 178 bool mIsLocalFileSync;
144 bool mIsPhoneSync; 179 bool mIsPhoneSync;
145 bool mWriteContactToSIM; 180 bool mWriteContactToSIM;
181
182 bool mIsPiSync;
146}; 183};
147 184
148#endif 185#endif