summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 8a3f4cf..6e42fd4 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -1,791 +1,830 @@
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#include <qvgroupbox.h> 46#include <qvgroupbox.h>
47#include <qhgroupbox.h> 47#include <qhgroupbox.h>
48 48
49#include <kcolorbutton.h> 49#include <kcolorbutton.h>
50#include <kdebug.h> 50#include <kdebug.h>
51#include <klocale.h> 51#include <klocale.h>
52#include <kglobal.h> 52#include <kglobal.h>
53#include <kfontdialog.h> 53#include <kfontdialog.h>
54#include <kmessagebox.h> 54#include <kmessagebox.h>
55#include <kcolordialog.h> 55#include <kcolordialog.h>
56#include <kiconloader.h> 56#include <kiconloader.h>
57#include <kemailsettings.h> 57#include <kemailsettings.h>
58#include <kstandarddirs.h> 58#include <kstandarddirs.h>
59#include <kfiledialog.h> 59#include <kfiledialog.h>
60#include <kmessagebox.h> 60#include <kmessagebox.h>
61 61
62//#include <kurlrequester.h> 62//#include <kurlrequester.h>
63#include <klineedit.h> 63#include <klineedit.h>
64#include "ksyncprofile.h" 64#include "ksyncprofile.h"
65 65
66 66
67//#include "koprefs.h" 67//#include "koprefs.h"
68 68
69#include "ksyncprefsdialog.h" 69#include "ksyncprefsdialog.h"
70//#include "koglobals.h" 70//#include "koglobals.h"
71 71
72 72
73KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : 73KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) :
74 KDialog(parent,name,true) 74 KDialog(parent,name,true)
75{ 75{
76 76
77 setCaption( i18n("Synchronization Preferences")); 77 setCaption( i18n("Synchronization Preferences"));
78 78
79 mSyncProfiles.setAutoDelete( true ); 79 mSyncProfiles.setAutoDelete( true );
80 setupSyncAlgTab(); 80 setupSyncAlgTab();
81} 81}
82 82
83 83
84KSyncPrefsDialog::~KSyncPrefsDialog() 84KSyncPrefsDialog::~KSyncPrefsDialog()
85{ 85{
86} 86}
87 87
88void KSyncPrefsDialog::setupSyncAlgTab() 88void KSyncPrefsDialog::setupSyncAlgTab()
89{ 89{
90 QLabel * lab; 90 QLabel * lab;
91 //QFrame *page = addPage(i18n("Sync Prefs"),0,0); 91 //QFrame *page = addPage(i18n("Sync Prefs"),0,0);
92 QVBox * mainbox = new QVBox( this ); 92 QVBox * mainbox = new QVBox( this );
93 QScrollView* sv = new QScrollView( mainbox ); 93 QScrollView* sv = new QScrollView( mainbox );
94 QHBoxLayout * lay = new QHBoxLayout( this ); 94 QHBoxLayout * lay = new QHBoxLayout( this );
95 lay->addWidget( mainbox ); 95 lay->addWidget( mainbox );
96 QHBox * b_box = new QHBox( mainbox ); 96 QHBox * b_box = new QHBox( mainbox );
97 97
98 QPushButton* button = new QPushButton( i18n("Ok"), b_box ); 98 QPushButton* button = new QPushButton( i18n("Ok"), b_box );
99 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) ); 99 connect ( button, SIGNAL( clicked()), this, SLOT (slotOK() ) );
100 button = new QPushButton( i18n("Cancel"), b_box ); 100 button = new QPushButton( i18n("Cancel"), b_box );
101 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) ); 101 connect ( button, SIGNAL( clicked()), this, SLOT (reject() ) );
102 //QBoxLayout * sl = new QVBoxLayout(this ); 102 //QBoxLayout * sl = new QVBoxLayout(this );
103 //sl->addWidget ( sv ); 103 //sl->addWidget ( sv );
104 sv->setResizePolicy ( QScrollView::AutoOneFit ); 104 sv->setResizePolicy ( QScrollView::AutoOneFit );
105 QFrame *topFrame = new QFrame ( sv ); 105 QFrame *topFrame = new QFrame ( sv );
106 sv->addChild( topFrame ); 106 sv->addChild( topFrame );
107 mSetupSyncAlgTab = topFrame; 107 mSetupSyncAlgTab = topFrame;
108 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 108 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
109 topLayout->setSpacing(spacingHint()); 109 topLayout->setSpacing(spacingHint());
110 topLayout->setMargin(marginHint()); 110 topLayout->setMargin(marginHint());
111 111
112 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame); 112 //lab = new QLabel(i18n("Sync settings not yet implemented. DO NOT USE!"), topFrame);
113 int iii = 0; 113 int iii = 0;
114 //topLayout->addMultiCellWidget(lab , iii,iii,0,1); 114 //topLayout->addMultiCellWidget(lab , iii,iii,0,1);
115 //++iii; 115 //++iii;
116 116
117 mMyMachineName = new QLineEdit(topFrame); 117 mMyMachineName = new QLineEdit(topFrame);
118 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame); 118 lab = new QLabel(mMyMachineName, i18n("Local device name:"), topFrame);
119 topLayout->addWidget(lab ,iii,0); 119 topLayout->addWidget(lab ,iii,0);
120 topLayout->addWidget(mMyMachineName,iii,1); 120 topLayout->addWidget(mMyMachineName,iii,1);
121 ++iii; 121 ++iii;
122 122
123 QHBox* buttonbox = new QHBox( topFrame); 123 QHBox* buttonbox = new QHBox( topFrame);
124 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1); 124 topLayout->addMultiCellWidget(buttonbox, iii,iii,0,1);
125 ++iii; 125 ++iii;
126 button = new QPushButton( i18n("New profile"), buttonbox ); 126 button = new QPushButton( i18n("New profile"), buttonbox );
127 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) ); 127 connect ( button, SIGNAL( clicked()), this, SLOT (newProfile() ) );
128 128
129 button = new QPushButton( i18n("Clone profile"), buttonbox ); 129 button = new QPushButton( i18n("Clone profile"), buttonbox );
130 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) ); 130 connect ( button, SIGNAL( clicked()), this, SLOT ( cloneProfile() ) );
131 131
132 button = new QPushButton( i18n("Delete profile"), buttonbox ); 132 button = new QPushButton( i18n("Delete profile"), buttonbox );
133 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) ); 133 connect ( button, SIGNAL( clicked()), this, SLOT (deleteProfile() ) );
134 134
135 mProfileBox = new QComboBox(topFrame); 135 mProfileBox = new QComboBox(topFrame);
136 mProfileBox->setEditable ( true ); 136 mProfileBox->setEditable ( true );
137 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion); 137 mProfileBox->setInsertionPolicy(QComboBox::NoInsertion);
138 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) ); 138 connect ( mProfileBox, SIGNAL(activated ( int ) ), this, SLOT (profileChanged( int ) ) );
139 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) ); 139 connect ( mProfileBox, SIGNAL( textChanged ( const QString & ) ), this, SLOT (textChanged( const QString & ) ) );
140 140
141 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame); 141 lab = new QLabel(mProfileBox, i18n("Profile:"), topFrame);
142 topLayout->addWidget(lab ,iii,0); 142 topLayout->addWidget(lab ,iii,0);
143 topLayout->addWidget(mProfileBox, iii,1); 143 topLayout->addWidget(mProfileBox, iii,1);
144 ++iii; 144 ++iii;
145 145
146 146
147 147
148 QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame); 148 QHGroupBox *iims = new QHGroupBox( i18n("Multiple Sync options"), topFrame);
149 new QLabel( i18n("Include in multiple "), iims ); 149 new QLabel( i18n("Include in multiple "), iims );
150 mIncludeInRing = new QCheckBox( i18n("calendar "), iims ); 150 mIncludeInRing = new QCheckBox( i18n("calendar "), iims );
151 mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims ); 151 mIncludeInRingAB = new QCheckBox( i18n("addressbook "), iims );
152 mIncludeInRingPWM = new QCheckBox( i18n("pwmanager"), iims ); 152 mIncludeInRingPWM = new QCheckBox( i18n("pwmanager"), iims );
153 new QLabel( i18n(" sync"), iims ); 153 new QLabel( i18n(" sync"), iims );
154 topLayout->addMultiCellWidget(iims, iii,iii,0,1); 154 topLayout->addMultiCellWidget(iims, iii,iii,0,1);
155 ++iii; 155 ++iii;
156 QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame); 156 QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame);
157 topLayout->addMultiCellWidget(gb0, iii,iii,0,1); 157 topLayout->addMultiCellWidget(gb0, iii,iii,0,1);
158 ++iii; 158 ++iii;
159 QButtonGroup* gr; 159 QButtonGroup* gr;
160 { 160 {
161 QVGroupBox* topFrame = gb0; 161 QVGroupBox* topFrame = gb0;
162
163
164
162 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); 165 mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
163 //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); 166 //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
164 //++iii; 167 //++iii;
165 gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); 168 gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
166 //topLayout->addMultiCellWidget(gr, iii,iii,0,1); 169 //topLayout->addMultiCellWidget(gr, iii,iii,0,1);
167 //++iii; 170 //++iii;
168 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); 171 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
169 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 172 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
170 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); 173 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
171 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); 174 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
172 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); 175 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
173 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); 176 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
174 // both = new QRadioButton ( i18n("Take both on conflict"), gr ); 177 // both = new QRadioButton ( i18n("Take both on conflict"), gr );
175 178
176 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 179 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
177 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 180 //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
178 //++iii; 181 //++iii;
179 182
183 QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame);
184 QVBox * fibo2 = new QVBox ( gb5 );
185 new QLabel ( i18n("Incoming calendar filter:"), fibo2 );
186 mFilterInCal = new QComboBox( fibo2 );
187 fibo2 = new QVBox ( gb5 );
188 new QLabel ( i18n("Incoming adressbook filter:"), fibo2 );
189 mFilterInAB = new QComboBox( fibo2 );
190
180 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 191 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
181 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 192 // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
182 // ++iii; 193 // ++iii;
183 194
184 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); 195 QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame);
185 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); 196 //topLayout->addMultiCellWidget(gb2, iii,iii,0,1);
186 //++iii; 197 //++iii;
187 { 198 {
188 QVGroupBox*topFrame = gb2; 199 QVGroupBox*topFrame = gb2;
189 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); 200 mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame );
201 QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame);
202 QVBox * fibo = new QVBox ( gb4 );
203 new QLabel ( i18n("Outgoing calendar filter:"), fibo );
204 mFilterOutCal = new QComboBox( fibo );
205 fibo = new QVBox ( gb4 );
206 new QLabel ( i18n("Outgoing addressbook filter:"), fibo );
207 mFilterOutAB = new QComboBox( fibo );
190 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 208 //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
191 //++iii; 209 //++iii;
192 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); 210 mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
193 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 211 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
194 //++iii; 212 //++iii;
195 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); 213 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame);
196 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); 214 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
197 new QLabel( i18n("From ") , gb3 ); 215 new QLabel( i18n("From ") , gb3 );
198 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); 216 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3);
199 new QLabel( i18n(" weeks in the past to ") , gb3 ); 217 new QLabel( i18n(" weeks in the past to ") , gb3 );
200 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); 218 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3);
201 new QLabel( i18n(" weeks in the future ") , gb3 ); 219 new QLabel( i18n(" weeks in the future ") , gb3 );
202 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 220 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
203 //++iii; 221 //++iii;
204 gb3->setEnabled( false ); 222 gb3->setEnabled( false );
223 connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) );
205 } 224 }
206 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); 225 connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
207 226
208 } 227 }
209 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 228 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
210 gr = proGr; 229 gr = proGr;
211 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 230 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
212 ++iii; 231 ++iii;
213 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 232 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
214 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); 233 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr );
215 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 234 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
216 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 235 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
217 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 236 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
218 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 237 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
219 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 238 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
220 239
221 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); 240 QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame);
222 topLayout->addMultiCellWidget(gb1, iii,iii,0,1); 241 topLayout->addMultiCellWidget(gb1, iii,iii,0,1);
223 ++iii; 242 ++iii;
224 243
225 // ****************************************** 244 // ******************************************
226 // Profile kind specific settings 245 // Profile kind specific settings
227 { 246 {
228 // *** phone ******************************* 247 // *** phone *******************************
229 QVGroupBox* topFrame = gb1; 248 QVGroupBox* topFrame = gb1;
230 phoneWidget = new QVBox( topFrame); 249 phoneWidget = new QVBox( topFrame);
231 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 250 //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
232 //++iii; 251 //++iii;
233 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 252 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
234 QHBox* temphb = new QHBox( phoneWidget ); 253 QHBox* temphb = new QHBox( phoneWidget );
235 new QLabel( i18n("I/O device: "), temphb ); 254 new QLabel( i18n("I/O device: "), temphb );
236 mPhoneDevice = new QLineEdit( temphb); 255 mPhoneDevice = new QLineEdit( temphb);
237 button = new QPushButton( i18n("Help..."), temphb ); 256 button = new QPushButton( i18n("Help..."), temphb );
238 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); 257 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) );
239 258
240 259
241 temphb = new QHBox( phoneWidget ); 260 temphb = new QHBox( phoneWidget );
242 new QLabel( i18n("Connection: "), temphb ); 261 new QLabel( i18n("Connection: "), temphb );
243 mPhoneConnection = new QLineEdit( temphb); 262 mPhoneConnection = new QLineEdit( temphb);
244 button = new QPushButton( i18n("Help..."), temphb ); 263 button = new QPushButton( i18n("Help..."), temphb );
245 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); 264 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
246 265
247 266
248 temphb = new QHBox( phoneWidget ); 267 temphb = new QHBox( phoneWidget );
249 new QLabel( i18n("Model(opt.): "), temphb ); 268 new QLabel( i18n("Model(opt.): "), temphb );
250 mPhoneModel = new QLineEdit( temphb); 269 mPhoneModel = new QLineEdit( temphb);
251 button = new QPushButton( i18n("Help..."), temphb ); 270 button = new QPushButton( i18n("Help..."), temphb );
252 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 271 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
253 272
254 // *** local******************************* 273 // *** local*******************************
255 localFileWidget = new QVBox( topFrame); 274 localFileWidget = new QVBox( topFrame);
256 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 275 //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
257 //++iii; 276 //++iii;
258 temphb = new QHBox( localFileWidget ); 277 temphb = new QHBox( localFileWidget );
259 278
260 lab = new QLabel( i18n("Local file Cal:"), temphb ); 279 lab = new QLabel( i18n("Local file Cal:"), temphb );
261 lab = new QLabel( i18n("Local file ABook:"), temphb ); 280 lab = new QLabel( i18n("Local file ABook:"), temphb );
262 lab = new QLabel( i18n("Local file PWMgr:"), temphb ); 281 lab = new QLabel( i18n("Local file PWMgr:"), temphb );
263 temphb = new QHBox( localFileWidget ); 282 temphb = new QHBox( localFileWidget );
264 button = new QPushButton( i18n("Choose..."), temphb ); 283 button = new QPushButton( i18n("Choose..."), temphb );
265 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 284 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
266 button = new QPushButton( i18n("Choose..."), temphb ); 285 button = new QPushButton( i18n("Choose..."), temphb );
267 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 286 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
268 button = new QPushButton( i18n("Choose..."), temphb ); 287 button = new QPushButton( i18n("Choose..."), temphb );
269 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 288 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
270 temphb = new QHBox( localFileWidget ); 289 temphb = new QHBox( localFileWidget );
271 290
272 mRemoteFile = new QLineEdit( temphb); 291 mRemoteFile = new QLineEdit( temphb);
273 mRemoteFileAB = new QLineEdit( temphb); 292 mRemoteFileAB = new QLineEdit( temphb);
274 mRemoteFilePWM = new QLineEdit( temphb); 293 mRemoteFilePWM = new QLineEdit( temphb);
275 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); 294 mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget );
276 295
277 296
278 // *** remote******************************* 297 // *** remote*******************************
279 remoteFileWidget = new QVBox( topFrame); 298 remoteFileWidget = new QVBox( topFrame);
280 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 299 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
281 //++iii; 300 //++iii;
282 temphb = new QHBox( remoteFileWidget ); 301 temphb = new QHBox( remoteFileWidget );
283 new QLabel( i18n("Calendar:"), temphb); 302 new QLabel( i18n("Calendar:"), temphb);
284 new QLabel( i18n("AddressBook:"), temphb); 303 new QLabel( i18n("AddressBook:"), temphb);
285 new QLabel( i18n("PWManager:"), temphb); 304 new QLabel( i18n("PWManager:"), temphb);
286 305
287 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 306 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
288 temphb = new QHBox( remoteFileWidget ); 307 temphb = new QHBox( remoteFileWidget );
289 mRemotePrecommand = new QLineEdit(temphb); 308 mRemotePrecommand = new QLineEdit(temphb);
290 mRemotePrecommandAB = new QLineEdit(temphb); 309 mRemotePrecommandAB = new QLineEdit(temphb);
291 mRemotePrecommandPWM = new QLineEdit(temphb); 310 mRemotePrecommandPWM = new QLineEdit(temphb);
292 311
293 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 312 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
294 temphb = new QHBox( remoteFileWidget ); 313 temphb = new QHBox( remoteFileWidget );
295 mLocalTempFile = new QLineEdit(temphb); 314 mLocalTempFile = new QLineEdit(temphb);
296 mLocalTempFileAB = new QLineEdit(temphb); 315 mLocalTempFileAB = new QLineEdit(temphb);
297 mLocalTempFilePWM = new QLineEdit(temphb); 316 mLocalTempFilePWM = new QLineEdit(temphb);
298 317
299 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 318 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
300 temphb = new QHBox( remoteFileWidget ); 319 temphb = new QHBox( remoteFileWidget );
301 mRemotePostcommand = new QLineEdit(temphb ); 320 mRemotePostcommand = new QLineEdit(temphb );
302 mRemotePostcommandAB = new QLineEdit(temphb ); 321 mRemotePostcommandAB = new QLineEdit(temphb );
303 mRemotePostcommandPWM = new QLineEdit(temphb ); 322 mRemotePostcommandPWM = new QLineEdit(temphb );
304 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); 323 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
305 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 324 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
306 temphb = new QHBox( remoteFileWidget ); 325 temphb = new QHBox( remoteFileWidget );
307 button = new QPushButton( i18n("ssh/scp"), temphb ); 326 button = new QPushButton( i18n("ssh/scp"), temphb );
308 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 327 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
309 button = new QPushButton( i18n("ftp"), temphb ); 328 button = new QPushButton( i18n("ftp"), temphb );
310 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 329 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
311 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 330 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
312 331
313 // *** pi-sync******************************* 332 // *** pi-sync*******************************
314 piWidget = new QVBox( topFrame); 333 piWidget = new QVBox( topFrame);
315 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 334 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
316 //++iii; 335 //++iii;
317 temphb = new QHBox( piWidget ); 336 temphb = new QHBox( piWidget );
318 new QLabel( i18n("Calendar:"), temphb); 337 new QLabel( i18n("Calendar:"), temphb);
319 new QLabel( i18n("AddressBook:"), temphb); 338 new QLabel( i18n("AddressBook:"), temphb);
320 new QLabel( i18n("PWManager:"), temphb); 339 new QLabel( i18n("PWManager:"), temphb);
321 340
322 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); 341 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget);
323 temphb = new QHBox( piWidget ); 342 temphb = new QHBox( piWidget );
324 mRemotePw = new QLineEdit(temphb); 343 mRemotePw = new QLineEdit(temphb);
325 mRemotePwAB = new QLineEdit(temphb); 344 mRemotePwAB = new QLineEdit(temphb);
326 mRemotePwPWM = new QLineEdit(temphb); 345 mRemotePwPWM = new QLineEdit(temphb);
327 346
328 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); 347 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
329 temphb = new QHBox( piWidget ); 348 temphb = new QHBox( piWidget );
330 mRemoteIP = new QLineEdit(temphb); 349 mRemoteIP = new QLineEdit(temphb);
331 mRemoteIPAB = new QLineEdit(temphb); 350 mRemoteIPAB = new QLineEdit(temphb);
332 mRemoteIPPWM = new QLineEdit(temphb); 351 mRemoteIPPWM = new QLineEdit(temphb);
333 352
334 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); 353 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
335 temphb = new QHBox( piWidget ); 354 temphb = new QHBox( piWidget );
336 mRemotePort = new QLineEdit(temphb); 355 mRemotePort = new QLineEdit(temphb);
337 mRemotePortAB = new QLineEdit(temphb); 356 mRemotePortAB = new QLineEdit(temphb);
338 mRemotePortPWM = new QLineEdit(temphb); 357 mRemotePortPWM = new QLineEdit(temphb);
339 } 358 }
340 // ****************************************** 359 // ******************************************
341 // Profile kind specific settings END 360 // Profile kind specific settings END
342 361
343} 362}
344 363
345 364
346 365
347void KSyncPrefsDialog::readFilter() 366void KSyncPrefsDialog::readFilter()
348{ 367{
349 mFilterKapi.clear(); 368 mFilterKapi.clear();
350 mFilterKopi.clear(); 369 mFilterKopi.clear();
351 mFilterKopi.append(i18n("No Filter") ); 370 mFilterKopi.append(i18n("No Filter") );
352 mFilterKapi.append(i18n("No Filter") ); 371 mFilterKapi.append(i18n("No Filter") );
353 KConfig cfgko(locateLocal("config","korganizerrc")); 372 KConfig cfgko(locateLocal("config","korganizerrc"));
354 KConfig cfgka(locateLocal("config","kaddressbookrc")); 373 KConfig cfgka(locateLocal("config","kaddressbookrc"));
355 cfgko.setGroup("General"); 374 cfgko.setGroup("General");
356 mFilterKopi = cfgko.readListEntry("CalendarFilters"); 375 mFilterKopi = cfgko.readListEntry("CalendarFilters");
357 mFilterKopi.prepend(i18n("No Filter") ); 376 mFilterKapi = mFilterKopi;
377 mFilterOutCal->clear();
378 mFilterInCal->clear();
379 mFilterOutAB->clear();
380 mFilterInAB->clear();
381 QStringList temp = mFilterKopi;
382 temp.prepend(i18n("No Filter") );
383 mFilterOutCal->insertStringList( temp );
384 mFilterInCal->insertStringList( temp );
385 temp = mFilterKapi;
386 temp.prepend(i18n("No Filter") );
387 mFilterOutAB->insertStringList( temp );
388 mFilterInAB->insertStringList( temp );
358} 389}
359 390
360 391
361void KSyncPrefsDialog::slotOK() 392void KSyncPrefsDialog::slotOK()
362{ 393{
363 if ( mMyMachineName->text() == "undefined" ) { 394 if ( mMyMachineName->text() == "undefined" ) {
364 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); 395 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
365 return; 396 return;
366 } 397 }
367 int i; 398 int i;
368 for (i = 0; i < mSyncProfileNames.count(); ++ i) { 399 for (i = 0; i < mSyncProfileNames.count(); ++ i) {
369 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { 400 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) {
370 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); 401 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error"));
371 return; 402 return;
372 } 403 }
373 } 404 }
374 usrWriteConfig(); 405 usrWriteConfig();
375 QDialog::accept(); 406 QDialog::accept();
376} 407}
377void KSyncPrefsDialog::accept() 408void KSyncPrefsDialog::accept()
378{ 409{
379 slotOK(); 410 slotOK();
380} 411}
381void KSyncPrefsDialog::chooseFile() 412void KSyncPrefsDialog::chooseFile()
382{ 413{
383 QString fn = QDir::homeDirPath(); 414 QString fn = QDir::homeDirPath();
384 415
385 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); 416 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
386 if ( fn == "" ) 417 if ( fn == "" )
387 return; 418 return;
388 mRemoteFile->setText( fn ); 419 mRemoteFile->setText( fn );
389} 420}
390 421
391void KSyncPrefsDialog::chooseFileAB() 422void KSyncPrefsDialog::chooseFileAB()
392{ 423{
393 QString fn = QDir::homeDirPath(); 424 QString fn = QDir::homeDirPath();
394 425
395 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); 426 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this );
396 if ( fn == "" ) 427 if ( fn == "" )
397 return; 428 return;
398 mRemoteFileAB->setText( fn ); 429 mRemoteFileAB->setText( fn );
399} 430}
400 431
401void KSyncPrefsDialog::chooseFilePWM() 432void KSyncPrefsDialog::chooseFilePWM()
402{ 433{
403 QString fn = QDir::homeDirPath(); 434 QString fn = QDir::homeDirPath();
404 435
405 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); 436 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this );
406 if ( fn == "" ) 437 if ( fn == "" )
407 return; 438 return;
408 mRemoteFilePWM->setText( fn ); 439 mRemoteFilePWM->setText( fn );
409} 440}
410 441
411void KSyncPrefsDialog::textChanged( const QString & s ) 442void KSyncPrefsDialog::textChanged( const QString & s )
412{ 443{
413 if ( mProfileBox->count() == 0 ) 444 if ( mProfileBox->count() == 0 )
414 return; 445 return;
415 if ( currentSelection < 3 ) { 446 if ( currentSelection < 3 ) {
416 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); 447 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error"));
417 mProfileBox->blockSignals( true ); 448 mProfileBox->blockSignals( true );
418 mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); 449 mProfileBox->setCurrentItem(mProfileBox-> currentItem ());
419 mProfileBox->blockSignals( false ); 450 mProfileBox->blockSignals( false );
420 return; 451 return;
421 } 452 }
422 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 453 //qDebug("cur i %d ",mProfileBox-> currentItem () );
423 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 454 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
424 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 455 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
425 prof->setName( s ); 456 prof->setName( s );
426 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 457 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
427} 458}
428void KSyncPrefsDialog::profileChanged( int item ) 459void KSyncPrefsDialog::profileChanged( int item )
429{ 460{
430 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 461 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
431 KSyncProfile* prof; 462 KSyncProfile* prof;
432 saveProfile(); 463 saveProfile();
464 readFilter();
433 currentSelection = item; 465 currentSelection = item;
434 prof = mSyncProfiles.at(item) ; 466 prof = mSyncProfiles.at(item) ;
435 467
436 mRemotePw->setText(prof->getRemotePw()); 468 mRemotePw->setText(prof->getRemotePw());
437 mRemoteIP->setText(prof->getRemoteIP()); 469 mRemoteIP->setText(prof->getRemoteIP());
438 mRemotePort->setText(prof->getRemotePort()); 470 mRemotePort->setText(prof->getRemotePort());
439 471
440 mRemotePwAB->setText(prof->getRemotePwAB()); 472 mRemotePwAB->setText(prof->getRemotePwAB());
441 mRemoteIPAB->setText(prof->getRemoteIPAB()); 473 mRemoteIPAB->setText(prof->getRemoteIPAB());
442 mRemotePortAB->setText(prof->getRemotePortAB()); 474 mRemotePortAB->setText(prof->getRemotePortAB());
443 475
444 mRemotePwPWM->setText(prof->getRemotePwPWM()); 476 mRemotePwPWM->setText(prof->getRemotePwPWM());
445 mRemoteIPPWM->setText(prof->getRemoteIPPWM()); 477 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
446 mRemotePortPWM->setText(prof->getRemotePortPWM()); 478 mRemotePortPWM->setText(prof->getRemotePortPWM());
447 479
448 mRemotePrecommand->setText(prof->getPreSyncCommand()); 480 mRemotePrecommand->setText(prof->getPreSyncCommand());
449 mRemotePostcommand->setText(prof->getPostSyncCommand()); 481 mRemotePostcommand->setText(prof->getPostSyncCommand());
450 mLocalTempFile->setText(prof->getLocalTempFile()); 482 mLocalTempFile->setText(prof->getLocalTempFile());
451 mRemoteFile->setText(prof->getRemoteFileName()) ; 483 mRemoteFile->setText(prof->getRemoteFileName()) ;
452 484
453 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 485 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
454 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 486 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
455 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 487 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
456 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 488 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
457 489
458 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 490 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
459 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 491 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
460 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 492 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
461 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 493 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
462 494
463 if ( mWriteContactToSIM ) 495 if ( mWriteContactToSIM )
464 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 496 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
465 mPhoneDevice->setText(prof->getPhoneDevice()); 497 mPhoneDevice->setText(prof->getPhoneDevice());
466 mPhoneConnection->setText(prof->getPhoneConnection()); 498 mPhoneConnection->setText(prof->getPhoneConnection());
467 mPhoneModel->setText(prof->getPhoneModel()); 499 mPhoneModel->setText(prof->getPhoneModel());
468 500
469 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 501 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
470 mAskForPreferences->setChecked( prof->getAskForPreferences()); 502 mAskForPreferences->setChecked( prof->getAskForPreferences());
471 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 503 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
472 mWriteBackFile->setChecked( prof->getWriteBackFile()); 504 mWriteBackFile->setChecked( prof->getWriteBackFile());
473 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 505 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
474 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 506 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
475 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 507 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
476 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 508 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
477 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 509 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
478 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); 510 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
511
512 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 );
513 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 );
514 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 );
515 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 );
479 516
480 switch ( prof->getSyncPrefs() ) { 517 switch ( prof->getSyncPrefs() ) {
481 case 0: 518 case 0:
482 loc->setChecked( true); 519 loc->setChecked( true);
483 break; 520 break;
484 case 1: 521 case 1:
485 rem->setChecked( true ); 522 rem->setChecked( true );
486 break; 523 break;
487 case 2: 524 case 2:
488 newest->setChecked( true); 525 newest->setChecked( true);
489 break; 526 break;
490 case 3: 527 case 3:
491 ask->setChecked( true); 528 ask->setChecked( true);
492 break; 529 break;
493 case 4: 530 case 4:
494 f_loc->setChecked( true); 531 f_loc->setChecked( true);
495 break; 532 break;
496 case 5: 533 case 5:
497 f_rem->setChecked( true); 534 f_rem->setChecked( true);
498 break; 535 break;
499 case 6: 536 case 6:
500 //both->setChecked( true); 537 //both->setChecked( true);
501 break; 538 break;
502 default: 539 default:
503 break; 540 break;
504 } 541 }
505 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 542 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
506 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 543 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
507 mIsPi->setChecked(prof->getIsPiSync()) ; 544 mIsPi->setChecked(prof->getIsPiSync()) ;
508 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; 545 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
509 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; 546 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
510 547
511 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); 548 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() );
512 proGr->setEnabled( item > 2 ); 549 proGr->setEnabled( item > 2 );
513 if ( item < 3 ) { 550 if ( item < 3 ) {
514 localFileWidget->hide(); 551 localFileWidget->hide();
515 remoteFileWidget->hide(); 552 remoteFileWidget->hide();
516 phoneWidget->hide(); 553 phoneWidget->hide();
517 piWidget->hide(); 554 piWidget->hide();
518 555
519 } else 556 } else
520 kindChanged( prof->getIsLocalFileSync() ); 557 kindChanged( prof->getIsLocalFileSync() );
521} 558}
522 559
523void KSyncPrefsDialog::fillSSH() 560void KSyncPrefsDialog::fillSSH()
524{ 561{
525 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 562 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
526 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 563 mLocalTempFile->setText("/tmp/mycalendar.ics" );
527 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 564 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
528 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 565 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
529 mLocalTempFileAB->setText("/tmp/std.vcf" ); 566 mLocalTempFileAB->setText("/tmp/std.vcf" );
530 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); 567 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
531 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 568 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
532 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 569 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
533 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); 570 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
534} 571}
535void KSyncPrefsDialog::fillFTP() 572void KSyncPrefsDialog::fillFTP()
536{ 573{
537 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); 574 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
538 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 575 mLocalTempFile->setText("/tmp/mycalendar.ics" );
539 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 576 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
540 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 577 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
541 mLocalTempFileAB->setText("/tmp/std.vcf" ); 578 mLocalTempFileAB->setText("/tmp/std.vcf" );
542 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 579 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
543 580
544 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 581 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
545 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 582 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
546 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 583 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
547 584
548} 585}
549void KSyncPrefsDialog::kindChanged( bool b ) 586void KSyncPrefsDialog::kindChanged( bool b )
550{ 587{
551 588
552 if ( mIsLocal->isChecked () ) { 589 if ( mIsLocal->isChecked () ) {
553 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); 590 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() );
554 } else { 591 } else {
555 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); 592 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() );
556 } 593 }
557 594
558 if ( mIsLocal->isChecked () ) 595 if ( mIsLocal->isChecked () )
559 localFileWidget->show(); 596 localFileWidget->show();
560 else 597 else
561 localFileWidget->hide(); 598 localFileWidget->hide();
562 599
563 if ( mIsNotLocal->isChecked () ) 600 if ( mIsNotLocal->isChecked () )
564 remoteFileWidget->show(); 601 remoteFileWidget->show();
565 else 602 else
566 remoteFileWidget->hide(); 603 remoteFileWidget->hide();
567 604
568 if ( mIsPhone->isChecked () ) { 605 if ( mIsPhone->isChecked () ) {
569 phoneWidget->show(); 606 phoneWidget->show();
570 } 607 }
571 else { 608 else {
572 phoneWidget->hide(); 609 phoneWidget->hide();
573 } 610 }
574 if ( mIsPi->isChecked () ) { 611 if ( mIsPi->isChecked () ) {
575 piWidget->show(); 612 piWidget->show();
576 } 613 }
577 else { 614 else {
578 piWidget->hide(); 615 piWidget->hide();
579 } 616 }
580 617
581} 618}
582void KSyncPrefsDialog::deleteProfile() 619void KSyncPrefsDialog::deleteProfile()
583{ 620{
584 //qDebug("KSyncPrefsDialog::deleteProfile() "); 621 //qDebug("KSyncPrefsDialog::deleteProfile() ");
585 if ( currentSelection >= 0 ) { 622 if ( currentSelection >= 0 ) {
586 if ( currentSelection < 3 ) { 623 if ( currentSelection < 3 ) {
587 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); 624 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
588 return; 625 return;
589 } 626 }
590 KSyncProfile* temp = mSyncProfiles.at(currentSelection); 627 KSyncProfile* temp = mSyncProfiles.at(currentSelection);
591 mSyncProfiles.remove( temp ); 628 mSyncProfiles.remove( temp );
592 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); 629 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection ));
593 insertProfiles(); 630 insertProfiles();
594 } 631 }
595} 632}
596 633
597void KSyncPrefsDialog::saveProfile() 634void KSyncPrefsDialog::saveProfile()
598{ 635{
599 KSyncProfile* prof; 636 KSyncProfile* prof;
600 if ( currentSelection >= 0 ) { 637 if ( currentSelection >= 0 ) {
601 prof = mSyncProfiles.at(currentSelection) ; 638 prof = mSyncProfiles.at(currentSelection) ;
602 639
603 prof->setRemotePw( mRemotePw->text()); 640 prof->setRemotePw( mRemotePw->text());
604 prof->setRemoteIP( mRemoteIP->text()); 641 prof->setRemoteIP( mRemoteIP->text());
605 prof->setRemotePort( mRemotePort->text()); 642 prof->setRemotePort( mRemotePort->text());
606 643
607 prof->setRemotePwAB( mRemotePwAB->text()); 644 prof->setRemotePwAB( mRemotePwAB->text());
608 prof->setRemoteIPAB( mRemoteIPAB->text()); 645 prof->setRemoteIPAB( mRemoteIPAB->text());
609 prof->setRemotePortAB( mRemotePortAB->text()); 646 prof->setRemotePortAB( mRemotePortAB->text());
610 647
611 prof->setRemotePwPWM( mRemotePwPWM->text()); 648 prof->setRemotePwPWM( mRemotePwPWM->text());
612 prof->setRemoteIPPWM( mRemoteIPPWM->text()); 649 prof->setRemoteIPPWM( mRemoteIPPWM->text());
613 prof->setRemotePortPWM( mRemotePortPWM->text()); 650 prof->setRemotePortPWM( mRemotePortPWM->text());
614 651
615 prof->setPreSyncCommand( mRemotePrecommand->text()); 652 prof->setPreSyncCommand( mRemotePrecommand->text());
616 prof->setPostSyncCommand( mRemotePostcommand->text() ); 653 prof->setPostSyncCommand( mRemotePostcommand->text() );
617 prof->setLocalTempFile( mLocalTempFile->text()); 654 prof->setLocalTempFile( mLocalTempFile->text());
618 prof->setRemoteFileName( mRemoteFile->text() ); 655 prof->setRemoteFileName( mRemoteFile->text() );
619 prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); 656 prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
620 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); 657 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
621 prof->setLocalTempFileAB( mLocalTempFileAB->text()); 658 prof->setLocalTempFileAB( mLocalTempFileAB->text());
622 prof->setRemoteFileNameAB( mRemoteFileAB->text() ); 659 prof->setRemoteFileNameAB( mRemoteFileAB->text() );
623 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); 660 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text());
624 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); 661 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() );
625 prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); 662 prof->setLocalTempFilePWM( mLocalTempFilePWM->text());
626 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); 663 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() );
627 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 664 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
628 prof->setAskForPreferences( mAskForPreferences->isChecked()); 665 prof->setAskForPreferences( mAskForPreferences->isChecked());
629 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 666 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
630 prof->setWriteBackFile( mWriteBackFile->isChecked()); 667 prof->setWriteBackFile( mWriteBackFile->isChecked());
631 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 668 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
632 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 669 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
633 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 670 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
634 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 671 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
635 prof->setSyncPrefs( syncprefs); 672 prof->setSyncPrefs( syncprefs);
636 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 673 prof->setIsLocalFileSync( mIsLocal->isChecked() );
637 prof->setIsPhoneSync( mIsPhone->isChecked() ); 674 prof->setIsPhoneSync( mIsPhone->isChecked() );
638 prof->setIsPiSync( mIsPi->isChecked() ); 675 prof->setIsPiSync( mIsPi->isChecked() );
639 prof->setIsKapiFile( mIsKapiFileL->isChecked() ); 676 prof->setIsKapiFile( mIsKapiFileL->isChecked() );
640 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 677 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
641 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 678 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
642 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); 679 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value());
643 if ( mWriteContactToSIM ) 680 if ( mWriteContactToSIM )
644 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 681 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
645 prof->setPhoneDevice( mPhoneDevice->text() ); 682 prof->setPhoneDevice( mPhoneDevice->text() );
646 prof->setPhoneConnection( mPhoneConnection->text() ); 683 prof->setPhoneConnection( mPhoneConnection->text() );
647 prof->setPhoneModel( mPhoneModel->text() ); 684 prof->setPhoneModel( mPhoneModel->text() );
648 685 prof->setFilterInCal ( mFilterInCal->currentText ());
686 prof->setFilterOutCal ( mFilterOutCal ->currentText ());
687 prof->setFilterInAB ( mFilterInAB ->currentText ());
688 prof->setFilterOutAB ( mFilterOutAB ->currentText ());
649 } 689 }
650
651} 690}
652 691
653void KSyncPrefsDialog::insertProfiles() 692void KSyncPrefsDialog::insertProfiles()
654{ 693{
655 int curItem = mProfileBox->currentItem(); 694 int curItem = mProfileBox->currentItem();
656 mProfileBox->blockSignals( true ); 695 mProfileBox->blockSignals( true );
657 mProfileBox->clear(); 696 mProfileBox->clear();
658 mProfileBox->insertStringList (mSyncProfileNames ); 697 mProfileBox->insertStringList (mSyncProfileNames );
659 int item = mSyncProfileNames.count() -1; 698 int item = mSyncProfileNames.count() -1;
660 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) 699 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
661 mProfileBox->setCurrentItem( curItem ); 700 mProfileBox->setCurrentItem( curItem );
662 else if ( item >= 0 ) { 701 else if ( item >= 0 ) {
663 mProfileBox->setCurrentItem( item ); 702 mProfileBox->setCurrentItem( item );
664 } 703 }
665 currentSelection = -1; 704 currentSelection = -1;
666 if ( mSyncProfileNames.count() > 0 ) { 705 if ( mSyncProfileNames.count() > 0 ) {
667 //qDebug(" profileChanged( mProfileBox->currentItem() "); 706 //qDebug(" profileChanged( mProfileBox->currentItem() ");
668 profileChanged( mProfileBox->currentItem() ); 707 profileChanged( mProfileBox->currentItem() );
669 currentSelection = mProfileBox->currentItem(); 708 currentSelection = mProfileBox->currentItem();
670 } 709 }
671 mProfileBox->blockSignals( false ); 710 mProfileBox->blockSignals( false );
672} 711}
673 712
674void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) 713void KSyncPrefsDialog::addProfile ( KSyncProfile* temp )
675{ 714{
676 saveProfile(); 715 saveProfile();
677 mSyncProfiles.append( temp ); 716 mSyncProfiles.append( temp );
678 mSyncProfileNames << temp->getName(); 717 mSyncProfileNames << temp->getName();
679 insertProfiles(); 718 insertProfiles();
680 int last = mProfileBox->count() -1; 719 int last = mProfileBox->count() -1;
681 mProfileBox->blockSignals( true ); 720 mProfileBox->blockSignals( true );
682 mProfileBox->setCurrentItem( last ); 721 mProfileBox->setCurrentItem( last );
683 mProfileBox->blockSignals( false ); 722 mProfileBox->blockSignals( false );
684 profileChanged(last); 723 profileChanged(last);
685} 724}
686void KSyncPrefsDialog::newProfile() 725void KSyncPrefsDialog::newProfile()
687{ 726{
688 addProfile ( new KSyncProfile () ); 727 addProfile ( new KSyncProfile () );
689} 728}
690 729
691void KSyncPrefsDialog::cloneProfile() 730void KSyncPrefsDialog::cloneProfile()
692{ 731{
693 if ( currentSelection >= 0 ) 732 if ( currentSelection >= 0 )
694 addProfile (mSyncProfiles.at(currentSelection)->clone()) ; 733 addProfile (mSyncProfiles.at(currentSelection)->clone()) ;
695 else 734 else
696 newProfile(); 735 newProfile();
697} 736}
698 737
699void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) 738void KSyncPrefsDialog::setLocalMachineName ( const QString& name )
700{ 739{
701 mMyMachineName->setText( name ); 740 mMyMachineName->setText( name );
702 741
703} 742}
704QString KSyncPrefsDialog::getLocalMachineName ( ) 743QString KSyncPrefsDialog::getLocalMachineName ( )
705{ 744{
706 return mMyMachineName->text(); 745 return mMyMachineName->text();
707} 746}
708 747
709QStringList KSyncPrefsDialog::getSyncProfileNames() 748QStringList KSyncPrefsDialog::getSyncProfileNames()
710{ 749{
711 return mSyncProfileNames; 750 return mSyncProfileNames;
712} 751}
713void KSyncPrefsDialog::usrReadConfig() 752void KSyncPrefsDialog::usrReadConfig()
714{ 753{
715 //KConfig *config = KOGlobals::config(); 754 //KConfig *config = KOGlobals::config();
716 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 755 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
717 config.setGroup("General"); 756 config.setGroup("General");
718 mSyncProfileNames =config.readListEntry("SyncProfileNames"); 757 mSyncProfileNames =config.readListEntry("SyncProfileNames");
719 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); 758 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined"));
720 int i; 759 int i;
721 KSyncProfile* temp ; 760 KSyncProfile* temp ;
722 mSyncProfiles.clear(); 761 mSyncProfiles.clear();
723 for ( i = 0; i < mSyncProfileNames.count();++i ) { 762 for ( i = 0; i < mSyncProfileNames.count();++i ) {
724 temp = new KSyncProfile (); 763 temp = new KSyncProfile ();
725 temp->setName( mSyncProfileNames[i] ); 764 temp->setName( mSyncProfileNames[i] );
726 temp->readConfig( &config ); 765 temp->readConfig( &config );
727 mSyncProfiles.append( temp ); 766 mSyncProfiles.append( temp );
728 } 767 }
729 insertProfiles(); 768 insertProfiles();
730 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); 769 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName );
731} 770}
732 771
733 772
734void KSyncPrefsDialog::usrWriteConfig() 773void KSyncPrefsDialog::usrWriteConfig()
735{ 774{
736 saveProfile(); 775 saveProfile();
737 if ( currentSelection >= 0 ) 776 if ( currentSelection >= 0 )
738 profileChanged(currentSelection); 777 profileChanged(currentSelection);
739 //KConfig *config = KOGlobals::config(); 778 //KConfig *config = KOGlobals::config();
740 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 779 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
741 KSyncProfile* prof = mSyncProfiles.first(); 780 KSyncProfile* prof = mSyncProfiles.first();
742 QStringList externalSyncProfileNames; 781 QStringList externalSyncProfileNames;
743 externalSyncProfileNames.append("Sharp_DTM");; 782 externalSyncProfileNames.append("Sharp_DTM");;
744 while ( prof ) { 783 while ( prof ) {
745 prof->writeConfig(&config); 784 prof->writeConfig(&config);
746 if ( prof->getIsPhoneSync( ) ) 785 if ( prof->getIsPhoneSync( ) )
747 externalSyncProfileNames.append(prof->getName( ) ); 786 externalSyncProfileNames.append(prof->getName( ) );
748 prof = mSyncProfiles.next(); 787 prof = mSyncProfiles.next();
749 } 788 }
750 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; 789 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames;
751 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); 790 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text();
752 config.setGroup("General"); 791 config.setGroup("General");
753 config.writeEntry("SyncProfileNames",mSyncProfileNames); 792 config.writeEntry("SyncProfileNames",mSyncProfileNames);
754 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); 793 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames);
755 config.writeEntry("LocalMachineName",mMyMachineName->text()); 794 config.writeEntry("LocalMachineName",mMyMachineName->text());
756 config.sync(); 795 config.sync();
757} 796}
758 797
759void KSyncPrefsDialog::helpDevice() 798void KSyncPrefsDialog::helpDevice()
760{ 799{
761 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); 800 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n");
762#ifdef _WIN32_ 801#ifdef _WIN32_
763 hint += "Leave empty for Irda.\n" 802 hint += "Leave empty for Irda.\n"
764 "com1:\n(first serial port)\n" 803 "com1:\n(first serial port)\n"
765 "usb not supported\n" 804 "usb not supported\n"
766 "???\n(bluetooth device address)\n"; 805 "???\n(bluetooth device address)\n";
767 806
768#else 807#else
769 hint += "/dev/ircomm\n(Irda)\n" 808 hint += "/dev/ircomm\n(Irda)\n"
770 "/dev/ttyS0\n(first serial port)\n" 809 "/dev/ttyS0\n(first serial port)\n"
771 "/dev/ttyUSB0\n(first device usb port)\n" 810 "/dev/ttyUSB0\n(first device usb port)\n"
772 "???\n(bluetooth device address)\n"; 811 "???\n(bluetooth device address)\n";
773#endif 812#endif
774 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 813 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
775} 814}
776void KSyncPrefsDialog::helpModel() 815void KSyncPrefsDialog::helpModel()
777{ 816{
778 QString hint = i18n("Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n"); 817 QString hint = i18n("Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n");
779 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; 818 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection";
780 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 819 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
781 820
782} 821}
783void KSyncPrefsDialog::helpConnection() 822void KSyncPrefsDialog::helpConnection()
784{ 823{
785 QString hint = i18n("Insert kind of connection,e.g.:\n"); 824 QString hint = i18n("Insert kind of connection,e.g.:\n");
786 hint += "irda | Nokia FBUS over infrared\n" 825 hint += "irda | Nokia FBUS over infrared\n"
787 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" 826 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n"
788 "irdaobex | set also model as obex\n" 827 "irdaobex | set also model as obex\n"
789 "fbus | Nokia FBUS2 serial\n"; 828 "fbus | Nokia FBUS2 serial\n";
790 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 829 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
791} 830}