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