author | zautrix <zautrix> | 2005-11-25 09:55:37 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-11-25 09:55:37 (UTC) |
commit | 90b62d1158d00f162a258541e24aaed4c967480b (patch) (unidiff) | |
tree | 96f76bc60fae40113101aa1f321ff869bbd7979b /libkdepim | |
parent | d0de047797095f1862f4ff77b8dcd0d22643882d (diff) | |
download | kdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.zip kdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.tar.gz kdepimpi-90b62d1158d00f162a258541e24aaed4c967480b.tar.bz2 |
sync
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 72 | ||||
-rw-r--r-- | libkdepim/ksyncprefsdialog.h | 10 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.cpp | 7 | ||||
-rw-r--r-- | libkdepim/ksyncprofile.h | 11 |
4 files changed, 95 insertions, 5 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 8873ed1..292cde1 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -1,841 +1,903 @@ | |||
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 | ||
73 | KSyncPrefsDialog::KSyncPrefsDialog(QWidget *parent, char *name, bool modal) : | 73 | KSyncPrefsDialog::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 | ||
84 | KSyncPrefsDialog::~KSyncPrefsDialog() | 84 | KSyncPrefsDialog::~KSyncPrefsDialog() |
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | void KSyncPrefsDialog::setupSyncAlgTab() | 88 | void 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 | 183 | #if 0 |
184 | QHGroupBox* gb51 = new QHGroupBox( i18n("Local resources to sync with:"), topFrame); | 184 | QHGroupBox* gb51 = new QHGroupBox( i18n("Local resources to sync with:"), topFrame); |
185 | { | 185 | { |
186 | QVBox * fibo2 = new QVBox ( gb51 ); | 186 | QVBox * fibo2 = new QVBox ( gb51 ); |
187 | new QLabel ( i18n("Calendar resources:"), fibo2 ); | 187 | new QLabel ( i18n("Calendar resources:"), fibo2 ); |
188 | //mFilterInCal = new QComboBox( fibo2 ); | 188 | //mFilterInCal = new QComboBox( fibo2 ); |
189 | fibo2 = new QVBox ( gb51 ); | 189 | fibo2 = new QVBox ( gb51 ); |
190 | new QLabel ( i18n("Addressbook resources:"), fibo2 ); | 190 | new QLabel ( i18n("Addressbook resources:"), fibo2 ); |
191 | //mFilterInAB = new QComboBox( fibo2 ); | 191 | //mFilterInAB = new QComboBox( fibo2 ); |
192 | } | 192 | } |
193 | #endif | 193 | #endif |
194 | 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); |
195 | QVBox * fibo2 = new QVBox ( gb5 ); | 195 | QVBox * fibo2 = new QVBox ( gb5 ); |
196 | new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); | 196 | new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); |
197 | mFilterInCal = new QComboBox( fibo2 ); | 197 | mFilterInCal = new QComboBox( fibo2 ); |
198 | fibo2 = new QVBox ( gb5 ); | 198 | fibo2 = new QVBox ( gb5 ); |
199 | new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); | 199 | new QLabel ( i18n("Incoming addressbook filter:"), fibo2 ); |
200 | mFilterInAB = new QComboBox( fibo2 ); | 200 | mFilterInAB = new QComboBox( fibo2 ); |
201 | 201 | ||
202 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); | 202 | mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); |
203 | // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); | 203 | // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); |
204 | // ++iii; | 204 | // ++iii; |
205 | 205 | ||
206 | QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); | 206 | QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); |
207 | //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); | 207 | //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); |
208 | //++iii; | 208 | //++iii; |
209 | { | 209 | { |
210 | QVGroupBox*topFrame = gb2; | 210 | QVGroupBox*topFrame = gb2; |
211 | 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 ); |
212 | 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); |
213 | QVBox * fibo = new QVBox ( gb4 ); | 213 | QVBox * fibo = new QVBox ( gb4 ); |
214 | new QLabel ( i18n("Outgoing calendar filter:"), fibo ); | 214 | new QLabel ( i18n("Outgoing calendar filter:"), fibo ); |
215 | mFilterOutCal = new QComboBox( fibo ); | 215 | mFilterOutCal = new QComboBox( fibo ); |
216 | fibo = new QVBox ( gb4 ); | 216 | fibo = new QVBox ( gb4 ); |
217 | new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); | 217 | new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); |
218 | mFilterOutAB = new QComboBox( fibo ); | 218 | mFilterOutAB = new QComboBox( fibo ); |
219 | //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); | 219 | //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); |
220 | //++iii; | 220 | //++iii; |
221 | 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 ); |
222 | //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); | 222 | //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); |
223 | //++iii; | 223 | //++iii; |
224 | QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); | 224 | QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); |
225 | connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); | 225 | connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); |
226 | new QLabel( i18n("From ") , gb3 ); | 226 | new QLabel( i18n("From ") , gb3 ); |
227 | mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); | 227 | mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); |
228 | new QLabel( i18n(" weeks in the past to ") , gb3 ); | 228 | new QLabel( i18n(" weeks in the past to ") , gb3 ); |
229 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); | 229 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); |
230 | new QLabel( i18n(" weeks in the future ") , gb3 ); | 230 | new QLabel( i18n(" weeks in the future ") , gb3 ); |
231 | //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); | 231 | //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); |
232 | //++iii; | 232 | //++iii; |
233 | gb3->setEnabled( false ); | 233 | gb3->setEnabled( false ); |
234 | connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); | 234 | connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); |
235 | } | 235 | } |
236 | connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); | 236 | connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); |
237 | 237 | ||
238 | } | 238 | } |
239 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 239 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
240 | gr = proGr; | 240 | gr = proGr; |
241 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 241 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
242 | ++iii; | 242 | ++iii; |
243 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 243 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
244 | mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); | 244 | mIsPi = new QRadioButton ( i18n("Pi-Sync - all resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); |
245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
246 | mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); | ||
247 | connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | ||
246 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 248 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
247 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 249 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
248 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); | 250 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); |
249 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 251 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
250 | 252 | ||
251 | QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); | 253 | QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); |
252 | topLayout->addMultiCellWidget(gb1, iii,iii,0,1); | 254 | topLayout->addMultiCellWidget(gb1, iii,iii,0,1); |
253 | ++iii; | 255 | ++iii; |
254 | 256 | ||
255 | // ****************************************** | 257 | // ****************************************** |
256 | // Profile kind specific settings | 258 | // Profile kind specific settings |
257 | { | 259 | { |
258 | // *** phone ******************************* | 260 | // *** phone ******************************* |
259 | QVGroupBox* topFrame = gb1; | 261 | QVGroupBox* topFrame = gb1; |
260 | phoneWidget = new QVBox( topFrame); | 262 | phoneWidget = new QVBox( topFrame); |
261 | //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); | 263 | //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); |
262 | //++iii; | 264 | //++iii; |
263 | mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); | 265 | mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); |
264 | QHBox* temphb = new QHBox( phoneWidget ); | 266 | QHBox* temphb = new QHBox( phoneWidget ); |
265 | new QLabel( i18n("I/O device: "), temphb ); | 267 | new QLabel( i18n("I/O device: "), temphb ); |
266 | mPhoneDevice = new QLineEdit( temphb); | 268 | mPhoneDevice = new QLineEdit( temphb); |
267 | button = new QPushButton( i18n("Help..."), temphb ); | 269 | button = new QPushButton( i18n("Help..."), temphb ); |
268 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); | 270 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); |
269 | 271 | ||
270 | 272 | ||
271 | temphb = new QHBox( phoneWidget ); | 273 | temphb = new QHBox( phoneWidget ); |
272 | new QLabel( i18n("Connection: "), temphb ); | 274 | new QLabel( i18n("Connection: "), temphb ); |
273 | mPhoneConnection = new QLineEdit( temphb); | 275 | mPhoneConnection = new QLineEdit( temphb); |
274 | button = new QPushButton( i18n("Help..."), temphb ); | 276 | button = new QPushButton( i18n("Help..."), temphb ); |
275 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); | 277 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); |
276 | 278 | ||
277 | 279 | ||
278 | temphb = new QHBox( phoneWidget ); | 280 | temphb = new QHBox( phoneWidget ); |
279 | new QLabel( i18n("Model(opt.): "), temphb ); | 281 | new QLabel( i18n("Model(opt.): "), temphb ); |
280 | mPhoneModel = new QLineEdit( temphb); | 282 | mPhoneModel = new QLineEdit( temphb); |
281 | button = new QPushButton( i18n("Help..."), temphb ); | 283 | button = new QPushButton( i18n("Help..."), temphb ); |
282 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); | 284 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); |
283 | 285 | ||
284 | // *** local******************************* | 286 | // *** local******************************* |
285 | localFileWidget = new QVBox( topFrame); | 287 | localFileWidget = new QVBox( topFrame); |
286 | //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 288 | //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
287 | //++iii; | 289 | //++iii; |
288 | temphb = new QHBox( localFileWidget ); | 290 | temphb = new QHBox( localFileWidget ); |
289 | 291 | ||
290 | lab = new QLabel( i18n("Local file Cal:"), temphb ); | 292 | lab = new QLabel( i18n("Local file Cal:"), temphb ); |
291 | lab = new QLabel( i18n("Local file ABook:"), temphb ); | 293 | lab = new QLabel( i18n("Local file ABook:"), temphb ); |
292 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); | 294 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); |
293 | temphb = new QHBox( localFileWidget ); | 295 | temphb = new QHBox( localFileWidget ); |
294 | button = new QPushButton( i18n("Choose..."), temphb ); | 296 | button = new QPushButton( i18n("Choose..."), temphb ); |
295 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 297 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
296 | button = new QPushButton( i18n("Choose..."), temphb ); | 298 | button = new QPushButton( i18n("Choose..."), temphb ); |
297 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); | 299 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); |
298 | button = new QPushButton( i18n("Choose..."), temphb ); | 300 | button = new QPushButton( i18n("Choose..."), temphb ); |
299 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); | 301 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); |
300 | temphb = new QHBox( localFileWidget ); | 302 | temphb = new QHBox( localFileWidget ); |
301 | 303 | ||
302 | mRemoteFile = new QLineEdit( temphb); | 304 | mRemoteFile = new QLineEdit( temphb); |
303 | mRemoteFileAB = new QLineEdit( temphb); | 305 | mRemoteFileAB = new QLineEdit( temphb); |
304 | mRemoteFilePWM = new QLineEdit( temphb); | 306 | mRemoteFilePWM = new QLineEdit( temphb); |
305 | mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); | 307 | mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); |
306 | 308 | ||
307 | 309 | ||
308 | // *** remote******************************* | 310 | // *** remote******************************* |
309 | remoteFileWidget = new QVBox( topFrame); | 311 | remoteFileWidget = new QVBox( topFrame); |
310 | //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 312 | //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
311 | //++iii; | 313 | //++iii; |
312 | temphb = new QHBox( remoteFileWidget ); | 314 | temphb = new QHBox( remoteFileWidget ); |
313 | new QLabel( i18n("Calendar:"), temphb); | 315 | new QLabel( i18n("Calendar:"), temphb); |
314 | new QLabel( i18n("AddressBook:"), temphb); | 316 | new QLabel( i18n("AddressBook:"), temphb); |
315 | new QLabel( i18n("PWManager:"), temphb); | 317 | new QLabel( i18n("PWManager:"), temphb); |
316 | 318 | ||
317 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 319 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
318 | temphb = new QHBox( remoteFileWidget ); | 320 | temphb = new QHBox( remoteFileWidget ); |
319 | mRemotePrecommand = new QLineEdit(temphb); | 321 | mRemotePrecommand = new QLineEdit(temphb); |
320 | mRemotePrecommandAB = new QLineEdit(temphb); | 322 | mRemotePrecommandAB = new QLineEdit(temphb); |
321 | mRemotePrecommandPWM = new QLineEdit(temphb); | 323 | mRemotePrecommandPWM = new QLineEdit(temphb); |
322 | 324 | ||
323 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 325 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
324 | temphb = new QHBox( remoteFileWidget ); | 326 | temphb = new QHBox( remoteFileWidget ); |
325 | mLocalTempFile = new QLineEdit(temphb); | 327 | mLocalTempFile = new QLineEdit(temphb); |
326 | mLocalTempFileAB = new QLineEdit(temphb); | 328 | mLocalTempFileAB = new QLineEdit(temphb); |
327 | mLocalTempFilePWM = new QLineEdit(temphb); | 329 | mLocalTempFilePWM = new QLineEdit(temphb); |
328 | 330 | ||
329 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 331 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
330 | temphb = new QHBox( remoteFileWidget ); | 332 | temphb = new QHBox( remoteFileWidget ); |
331 | mRemotePostcommand = new QLineEdit(temphb ); | 333 | mRemotePostcommand = new QLineEdit(temphb ); |
332 | mRemotePostcommandAB = new QLineEdit(temphb ); | 334 | mRemotePostcommandAB = new QLineEdit(temphb ); |
333 | mRemotePostcommandPWM = new QLineEdit(temphb ); | 335 | mRemotePostcommandPWM = new QLineEdit(temphb ); |
334 | mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); | 336 | mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); |
335 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 337 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
336 | temphb = new QHBox( remoteFileWidget ); | 338 | temphb = new QHBox( remoteFileWidget ); |
337 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 339 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
338 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 340 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
339 | button = new QPushButton( i18n("ftp"), temphb ); | 341 | button = new QPushButton( i18n("ftp"), temphb ); |
340 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 342 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
341 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 343 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
342 | 344 | ||
343 | // *** pi-sync******************************* | 345 | // *** pi-sync******************************* |
344 | piWidget = new QVBox( topFrame); | 346 | piWidget = new QVBox( topFrame); |
345 | //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); | 347 | //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); |
346 | //++iii; | 348 | //++iii; |
347 | temphb = new QHBox( piWidget ); | 349 | temphb = new QHBox( piWidget ); |
348 | new QLabel( i18n("Calendar:"), temphb); | 350 | new QLabel( i18n("Calendar:"), temphb); |
349 | new QLabel( i18n("AddressBook:"), temphb); | 351 | new QLabel( i18n("AddressBook:"), temphb); |
350 | new QLabel( i18n("PWManager:"), temphb); | 352 | new QLabel( i18n("PWManager:"), temphb); |
351 | 353 | ||
352 | lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); | 354 | lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); |
353 | temphb = new QHBox( piWidget ); | 355 | temphb = new QHBox( piWidget ); |
354 | mRemotePw = new QLineEdit(temphb); | 356 | mRemotePw = new QLineEdit(temphb); |
355 | mRemotePwAB = new QLineEdit(temphb); | 357 | mRemotePwAB = new QLineEdit(temphb); |
356 | mRemotePwPWM = new QLineEdit(temphb); | 358 | mRemotePwPWM = new QLineEdit(temphb); |
357 | 359 | ||
358 | lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); | 360 | lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); |
359 | temphb = new QHBox( piWidget ); | 361 | temphb = new QHBox( piWidget ); |
360 | mRemoteIP = new QLineEdit(temphb); | 362 | mRemoteIP = new QLineEdit(temphb); |
361 | mRemoteIPAB = new QLineEdit(temphb); | 363 | mRemoteIPAB = new QLineEdit(temphb); |
362 | mRemoteIPPWM = new QLineEdit(temphb); | 364 | mRemoteIPPWM = new QLineEdit(temphb); |
363 | 365 | ||
364 | lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); | 366 | lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); |
365 | temphb = new QHBox( piWidget ); | 367 | temphb = new QHBox( piWidget ); |
366 | mRemotePort = new QLineEdit(temphb); | 368 | mRemotePort = new QLineEdit(temphb); |
367 | mRemotePortAB = new QLineEdit(temphb); | 369 | mRemotePortAB = new QLineEdit(temphb); |
368 | mRemotePortPWM = new QLineEdit(temphb); | 370 | mRemotePortPWM = new QLineEdit(temphb); |
371 | |||
372 | lab = new QLabel( i18n("Local/remote Resource sync partners"), piWidget); | ||
373 | mTableBox = new QHBox( piWidget ); | ||
374 | mResTableKopi = new QTable( 1, 1, mTableBox ); | ||
375 | mResTableKapi = new QTable( 1, 1, mTableBox ); | ||
376 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); | ||
377 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
378 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
379 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | ||
380 | mResTableKopi->setLeftMargin( 80 ); | ||
369 | } | 381 | } |
370 | // ****************************************** | 382 | // ****************************************** |
371 | // Profile kind specific settings END | 383 | // Profile kind specific settings END |
372 | 384 | ||
373 | } | 385 | } |
374 | 386 | ||
387 | void KSyncPrefsDialog::readResources() | ||
388 | { | ||
389 | mResourcesKopi.clear(); | ||
390 | mResourcesKapi.clear(); | ||
391 | KConfig fc(locateLocal("config","kopicalendarrc")); | ||
392 | fc.setGroup("CC"); | ||
393 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | ||
394 | int curCal = 1; | ||
395 | while ( curCal <= numCals ) { | ||
396 | QString prefix = "Cal_" +QString::number( curCal ); | ||
397 | QString name = fc.readEntry( prefix+"_Name", "Calendar"); | ||
398 | mResourcesKopi.append( name ); | ||
399 | ++curCal; | ||
400 | } | ||
401 | mResTableKopi->setNumRows( mResourcesKopi.count() ); | ||
402 | int i; | ||
403 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | ||
404 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); | ||
405 | } | ||
406 | } | ||
375 | void KSyncPrefsDialog::readFilter() | 407 | void KSyncPrefsDialog::readFilter() |
376 | { | 408 | { |
377 | mFilterKapi.clear(); | 409 | mFilterKapi.clear(); |
378 | mFilterKopi.clear(); | 410 | mFilterKopi.clear(); |
379 | KConfig cfgko(locateLocal("config","korganizerrc")); | 411 | KConfig cfgko(locateLocal("config","korganizerrc")); |
380 | KConfig cfgka(locateLocal("config","kaddressbookrc")); | 412 | KConfig cfgka(locateLocal("config","kaddressbookrc")); |
381 | cfgko.setGroup("General"); | 413 | cfgko.setGroup("General"); |
382 | mFilterKopi = cfgko.readListEntry("CalendarFilters"); | 414 | mFilterKopi = cfgko.readListEntry("CalendarFilters"); |
383 | cfgka.setGroup("Filter"); | 415 | cfgka.setGroup("Filter"); |
384 | int count = cfgka.readNumEntry( "Count", 0 ); | 416 | int count = cfgka.readNumEntry( "Count", 0 ); |
385 | for ( int i = 0; i < count; i++ ) { | 417 | for ( int i = 0; i < count; i++ ) { |
386 | cfgka.setGroup("Filter_"+QString::number( i ) ); | 418 | cfgka.setGroup("Filter_"+QString::number( i ) ); |
387 | mFilterKapi.append( cfgka.readEntry("Name", "internal error") ); | 419 | mFilterKapi.append( cfgka.readEntry("Name", "internal error") ); |
388 | } | 420 | } |
389 | mFilterOutCal->clear(); | 421 | mFilterOutCal->clear(); |
390 | mFilterInCal->clear(); | 422 | mFilterInCal->clear(); |
391 | mFilterOutAB->clear(); | 423 | mFilterOutAB->clear(); |
392 | mFilterInAB->clear(); | 424 | mFilterInAB->clear(); |
393 | QStringList temp = mFilterKopi; | 425 | QStringList temp = mFilterKopi; |
394 | temp.prepend(i18n("No Filter") ); | 426 | temp.prepend(i18n("No Filter") ); |
395 | mFilterOutCal->insertStringList( temp ); | 427 | mFilterOutCal->insertStringList( temp ); |
396 | mFilterInCal->insertStringList( temp ); | 428 | mFilterInCal->insertStringList( temp ); |
397 | temp = mFilterKapi; | 429 | temp = mFilterKapi; |
398 | temp.prepend(i18n("No Filter") ); | 430 | temp.prepend(i18n("No Filter") ); |
399 | mFilterOutAB->insertStringList( temp ); | 431 | mFilterOutAB->insertStringList( temp ); |
400 | mFilterInAB->insertStringList( temp ); | 432 | mFilterInAB->insertStringList( temp ); |
401 | } | 433 | } |
402 | 434 | ||
403 | void KSyncPrefsDialog::slotOK() | 435 | void KSyncPrefsDialog::slotOK() |
404 | { | 436 | { |
405 | if ( mMyMachineName->text() == "undefined" ) { | 437 | if ( mMyMachineName->text() == "undefined" ) { |
406 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 438 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
407 | return; | 439 | return; |
408 | } | 440 | } |
409 | int i; | 441 | int i; |
410 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { | 442 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { |
411 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { | 443 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { |
412 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); | 444 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); |
413 | return; | 445 | return; |
414 | } | 446 | } |
415 | } | 447 | } |
416 | usrWriteConfig(); | 448 | usrWriteConfig(); |
417 | QDialog::accept(); | 449 | QDialog::accept(); |
418 | } | 450 | } |
419 | void KSyncPrefsDialog::accept() | 451 | void KSyncPrefsDialog::accept() |
420 | { | 452 | { |
421 | slotOK(); | 453 | slotOK(); |
422 | } | 454 | } |
423 | void KSyncPrefsDialog::chooseFile() | 455 | void KSyncPrefsDialog::chooseFile() |
424 | { | 456 | { |
425 | QString fn = QDir::homeDirPath(); | 457 | QString fn = QDir::homeDirPath(); |
426 | 458 | ||
427 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 459 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
428 | if ( fn == "" ) | 460 | if ( fn == "" ) |
429 | return; | 461 | return; |
430 | mRemoteFile->setText( fn ); | 462 | mRemoteFile->setText( fn ); |
431 | } | 463 | } |
432 | 464 | ||
433 | void KSyncPrefsDialog::chooseFileAB() | 465 | void KSyncPrefsDialog::chooseFileAB() |
434 | { | 466 | { |
435 | QString fn = QDir::homeDirPath(); | 467 | QString fn = QDir::homeDirPath(); |
436 | 468 | ||
437 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); | 469 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); |
438 | if ( fn == "" ) | 470 | if ( fn == "" ) |
439 | return; | 471 | return; |
440 | mRemoteFileAB->setText( fn ); | 472 | mRemoteFileAB->setText( fn ); |
441 | } | 473 | } |
442 | 474 | ||
443 | void KSyncPrefsDialog::chooseFilePWM() | 475 | void KSyncPrefsDialog::chooseFilePWM() |
444 | { | 476 | { |
445 | QString fn = QDir::homeDirPath(); | 477 | QString fn = QDir::homeDirPath(); |
446 | 478 | ||
447 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); | 479 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); |
448 | if ( fn == "" ) | 480 | if ( fn == "" ) |
449 | return; | 481 | return; |
450 | mRemoteFilePWM->setText( fn ); | 482 | mRemoteFilePWM->setText( fn ); |
451 | } | 483 | } |
452 | 484 | ||
453 | void KSyncPrefsDialog::textChanged( const QString & s ) | 485 | void KSyncPrefsDialog::textChanged( const QString & s ) |
454 | { | 486 | { |
455 | if ( mProfileBox->count() == 0 ) | 487 | if ( mProfileBox->count() == 0 ) |
456 | return; | 488 | return; |
457 | if ( currentSelection < 3 ) { | 489 | if ( currentSelection < 3 ) { |
458 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 490 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
459 | mProfileBox->blockSignals( true ); | 491 | mProfileBox->blockSignals( true ); |
460 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 492 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
461 | mProfileBox->blockSignals( false ); | 493 | mProfileBox->blockSignals( false ); |
462 | return; | 494 | return; |
463 | } | 495 | } |
464 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 496 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
465 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 497 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
466 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 498 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
467 | prof->setName( s ); | 499 | prof->setName( s ); |
468 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 500 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |
469 | } | 501 | } |
470 | void KSyncPrefsDialog::profileChanged( int item ) | 502 | void KSyncPrefsDialog::profileChanged( int item ) |
471 | { | 503 | { |
472 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); | 504 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); |
473 | KSyncProfile* prof; | 505 | KSyncProfile* prof; |
474 | saveProfile(); | 506 | saveProfile(); |
475 | readFilter(); | 507 | readFilter(); |
508 | readResources(); | ||
476 | currentSelection = item; | 509 | currentSelection = item; |
477 | prof = mSyncProfiles.at(item) ; | 510 | prof = mSyncProfiles.at(item) ; |
478 | 511 | ||
479 | mRemotePw->setText(prof->getRemotePw()); | 512 | mRemotePw->setText(prof->getRemotePw()); |
480 | mRemoteIP->setText(prof->getRemoteIP()); | 513 | mRemoteIP->setText(prof->getRemoteIP()); |
481 | mRemotePort->setText(prof->getRemotePort()); | 514 | mRemotePort->setText(prof->getRemotePort()); |
482 | 515 | ||
483 | mRemotePwAB->setText(prof->getRemotePwAB()); | 516 | mRemotePwAB->setText(prof->getRemotePwAB()); |
484 | mRemoteIPAB->setText(prof->getRemoteIPAB()); | 517 | mRemoteIPAB->setText(prof->getRemoteIPAB()); |
485 | mRemotePortAB->setText(prof->getRemotePortAB()); | 518 | mRemotePortAB->setText(prof->getRemotePortAB()); |
486 | 519 | ||
487 | mRemotePwPWM->setText(prof->getRemotePwPWM()); | 520 | mRemotePwPWM->setText(prof->getRemotePwPWM()); |
488 | mRemoteIPPWM->setText(prof->getRemoteIPPWM()); | 521 | mRemoteIPPWM->setText(prof->getRemoteIPPWM()); |
489 | mRemotePortPWM->setText(prof->getRemotePortPWM()); | 522 | mRemotePortPWM->setText(prof->getRemotePortPWM()); |
490 | 523 | ||
491 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 524 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
492 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 525 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
493 | mLocalTempFile->setText(prof->getLocalTempFile()); | 526 | mLocalTempFile->setText(prof->getLocalTempFile()); |
494 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 527 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
495 | 528 | ||
496 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); | 529 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); |
497 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); | 530 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); |
498 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); | 531 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); |
499 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; | 532 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; |
500 | 533 | ||
501 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); | 534 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); |
502 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); | 535 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); |
503 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); | 536 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); |
504 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; | 537 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; |
505 | 538 | ||
506 | if ( mWriteContactToSIM ) | 539 | if ( mWriteContactToSIM ) |
507 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); | 540 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); |
508 | mPhoneDevice->setText(prof->getPhoneDevice()); | 541 | mPhoneDevice->setText(prof->getPhoneDevice()); |
509 | mPhoneConnection->setText(prof->getPhoneConnection()); | 542 | mPhoneConnection->setText(prof->getPhoneConnection()); |
510 | mPhoneModel->setText(prof->getPhoneModel()); | 543 | mPhoneModel->setText(prof->getPhoneModel()); |
511 | 544 | ||
512 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); | 545 | mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); |
513 | mAskForPreferences->setChecked( prof->getAskForPreferences()); | 546 | mAskForPreferences->setChecked( prof->getAskForPreferences()); |
514 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 547 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
515 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 548 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
516 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 549 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
517 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | 550 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); |
518 | mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); | 551 | mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); |
519 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); | 552 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); |
520 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); | 553 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); |
521 | mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); | 554 | mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); |
522 | 555 | ||
523 | mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); | 556 | mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); |
524 | mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); | 557 | mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); |
525 | mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); | 558 | mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); |
526 | mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); | 559 | mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); |
527 | 560 | ||
528 | switch ( prof->getSyncPrefs() ) { | 561 | switch ( prof->getSyncPrefs() ) { |
529 | case 0: | 562 | case 0: |
530 | loc->setChecked( true); | 563 | loc->setChecked( true); |
531 | break; | 564 | break; |
532 | case 1: | 565 | case 1: |
533 | rem->setChecked( true ); | 566 | rem->setChecked( true ); |
534 | break; | 567 | break; |
535 | case 2: | 568 | case 2: |
536 | newest->setChecked( true); | 569 | newest->setChecked( true); |
537 | break; | 570 | break; |
538 | case 3: | 571 | case 3: |
539 | ask->setChecked( true); | 572 | ask->setChecked( true); |
540 | break; | 573 | break; |
541 | case 4: | 574 | case 4: |
542 | f_loc->setChecked( true); | 575 | f_loc->setChecked( true); |
543 | break; | 576 | break; |
544 | case 5: | 577 | case 5: |
545 | f_rem->setChecked( true); | 578 | f_rem->setChecked( true); |
546 | break; | 579 | break; |
547 | case 6: | 580 | case 6: |
548 | //both->setChecked( true); | 581 | //both->setChecked( true); |
549 | break; | 582 | break; |
550 | default: | 583 | default: |
551 | break; | 584 | break; |
552 | } | 585 | } |
553 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; | 586 | mIsLocal->setChecked(prof->getIsLocalFileSync()) ; |
554 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; | 587 | mIsPhone->setChecked(prof->getIsPhoneSync()) ; |
555 | mIsPi->setChecked(prof->getIsPiSync()) ; | 588 | mIsPi->setChecked(prof->getIsPiSync()) ; |
589 | mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ; | ||
556 | mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; | 590 | mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; |
557 | mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; | 591 | mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; |
558 | 592 | ||
559 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); | 593 | |
594 | QStringList res = QStringList::split( ":",prof->getResSpecKopi()); | ||
595 | int i; | ||
596 | for ( i = 0;i < res.count(); ++i ) { | ||
597 | mResTableKopi->setText( i, 0, res[i] ); | ||
598 | } | ||
599 | res = QStringList::split( ":",prof->getResSpecKapi()); | ||
600 | for ( i = 0;i < res.count(); ++i ) { | ||
601 | mResTableKapi->setText( i, 0, res[i] ); | ||
602 | } | ||
603 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec()); | ||
560 | proGr->setEnabled( item > 2 ); | 604 | proGr->setEnabled( item > 2 ); |
561 | if ( item < 3 ) { | 605 | if ( item < 3 ) { |
562 | localFileWidget->hide(); | 606 | localFileWidget->hide(); |
563 | remoteFileWidget->hide(); | 607 | remoteFileWidget->hide(); |
564 | phoneWidget->hide(); | 608 | phoneWidget->hide(); |
565 | piWidget->hide(); | 609 | piWidget->hide(); |
566 | 610 | ||
567 | } else | 611 | } else |
568 | kindChanged( prof->getIsLocalFileSync() ); | 612 | kindChanged( prof->getIsLocalFileSync() ); |
569 | } | 613 | } |
570 | 614 | ||
571 | void KSyncPrefsDialog::fillSSH() | 615 | void KSyncPrefsDialog::fillSSH() |
572 | { | 616 | { |
573 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 617 | mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
574 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 618 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
575 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 619 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
576 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 620 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
577 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 621 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
578 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); | 622 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); |
579 | mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | 623 | mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); |
580 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | 624 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); |
581 | mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); | 625 | mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); |
582 | } | 626 | } |
583 | void KSyncPrefsDialog::fillFTP() | 627 | void KSyncPrefsDialog::fillFTP() |
584 | { | 628 | { |
585 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 629 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
586 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); | 630 | mLocalTempFile->setText("/tmp/mycalendar.ics" ); |
587 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 631 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
588 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); | 632 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); |
589 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 633 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
590 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 634 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
591 | 635 | ||
592 | mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); | 636 | mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); |
593 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | 637 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); |
594 | mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | 638 | mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); |
595 | 639 | ||
596 | } | 640 | } |
597 | void KSyncPrefsDialog::kindChanged( bool b ) | 641 | void KSyncPrefsDialog::kindChanged( bool b ) |
598 | { | 642 | { |
599 | 643 | ||
600 | if ( mIsLocal->isChecked () ) { | 644 | if ( mIsLocal->isChecked () ) { |
601 | mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); | 645 | mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); |
602 | } else { | 646 | } else { |
603 | mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); | 647 | mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); |
604 | } | 648 | } |
605 | 649 | ||
606 | if ( mIsLocal->isChecked () ) | 650 | if ( mIsLocal->isChecked () ) |
607 | localFileWidget->show(); | 651 | localFileWidget->show(); |
608 | else | 652 | else |
609 | localFileWidget->hide(); | 653 | localFileWidget->hide(); |
610 | 654 | ||
611 | if ( mIsNotLocal->isChecked () ) | 655 | if ( mIsNotLocal->isChecked () ) |
612 | remoteFileWidget->show(); | 656 | remoteFileWidget->show(); |
613 | else | 657 | else |
614 | remoteFileWidget->hide(); | 658 | remoteFileWidget->hide(); |
615 | 659 | ||
616 | if ( mIsPhone->isChecked () ) { | 660 | if ( mIsPhone->isChecked () ) { |
617 | phoneWidget->show(); | 661 | phoneWidget->show(); |
618 | } | 662 | } |
619 | else { | 663 | else { |
620 | phoneWidget->hide(); | 664 | phoneWidget->hide(); |
621 | } | 665 | } |
622 | if ( mIsPi->isChecked () ) { | 666 | |
667 | if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) { | ||
623 | piWidget->show(); | 668 | piWidget->show(); |
669 | if (mIsPiSpecific->isChecked () ) { | ||
670 | mTableBox->show(); | ||
671 | } | ||
672 | else { | ||
673 | mTableBox->hide(); | ||
674 | } | ||
624 | } | 675 | } |
625 | else { | 676 | else { |
626 | piWidget->hide(); | 677 | piWidget->hide(); |
627 | } | 678 | } |
679 | |||
628 | 680 | ||
629 | } | 681 | } |
630 | void KSyncPrefsDialog::deleteProfile() | 682 | void KSyncPrefsDialog::deleteProfile() |
631 | { | 683 | { |
632 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 684 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
633 | if ( currentSelection >= 0 ) { | 685 | if ( currentSelection >= 0 ) { |
634 | if ( currentSelection < 3 ) { | 686 | if ( currentSelection < 3 ) { |
635 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); | 687 | KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); |
636 | return; | 688 | return; |
637 | } | 689 | } |
638 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); | 690 | KSyncProfile* temp = mSyncProfiles.at(currentSelection); |
639 | mSyncProfiles.remove( temp ); | 691 | mSyncProfiles.remove( temp ); |
640 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); | 692 | mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); |
641 | insertProfiles(); | 693 | insertProfiles(); |
642 | } | 694 | } |
643 | } | 695 | } |
644 | 696 | ||
645 | void KSyncPrefsDialog::saveProfile() | 697 | void KSyncPrefsDialog::saveProfile() |
646 | { | 698 | { |
647 | KSyncProfile* prof; | 699 | KSyncProfile* prof; |
648 | if ( currentSelection >= 0 ) { | 700 | if ( currentSelection >= 0 ) { |
649 | prof = mSyncProfiles.at(currentSelection) ; | 701 | prof = mSyncProfiles.at(currentSelection) ; |
650 | 702 | ||
651 | prof->setRemotePw( mRemotePw->text()); | 703 | prof->setRemotePw( mRemotePw->text()); |
652 | prof->setRemoteIP( mRemoteIP->text()); | 704 | prof->setRemoteIP( mRemoteIP->text()); |
653 | prof->setRemotePort( mRemotePort->text()); | 705 | prof->setRemotePort( mRemotePort->text()); |
654 | 706 | ||
655 | prof->setRemotePwAB( mRemotePwAB->text()); | 707 | prof->setRemotePwAB( mRemotePwAB->text()); |
656 | prof->setRemoteIPAB( mRemoteIPAB->text()); | 708 | prof->setRemoteIPAB( mRemoteIPAB->text()); |
657 | prof->setRemotePortAB( mRemotePortAB->text()); | 709 | prof->setRemotePortAB( mRemotePortAB->text()); |
658 | 710 | ||
659 | prof->setRemotePwPWM( mRemotePwPWM->text()); | 711 | prof->setRemotePwPWM( mRemotePwPWM->text()); |
660 | prof->setRemoteIPPWM( mRemoteIPPWM->text()); | 712 | prof->setRemoteIPPWM( mRemoteIPPWM->text()); |
661 | prof->setRemotePortPWM( mRemotePortPWM->text()); | 713 | prof->setRemotePortPWM( mRemotePortPWM->text()); |
662 | 714 | ||
663 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 715 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
664 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 716 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
665 | prof->setLocalTempFile( mLocalTempFile->text()); | 717 | prof->setLocalTempFile( mLocalTempFile->text()); |
666 | prof->setRemoteFileName( mRemoteFile->text() ); | 718 | prof->setRemoteFileName( mRemoteFile->text() ); |
667 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); | 719 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); |
668 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); | 720 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); |
669 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); | 721 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); |
670 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); | 722 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); |
671 | prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); | 723 | prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); |
672 | prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); | 724 | prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); |
673 | prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); | 725 | prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); |
674 | prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); | 726 | prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); |
675 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 727 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
676 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 728 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
677 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 729 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
678 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 730 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
679 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 731 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
680 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | 732 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); |
681 | prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); | 733 | prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); |
682 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 734 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
683 | prof->setSyncPrefs( syncprefs); | 735 | prof->setSyncPrefs( syncprefs); |
684 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 736 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
685 | prof->setIsPhoneSync( mIsPhone->isChecked() ); | 737 | prof->setIsPhoneSync( mIsPhone->isChecked() ); |
686 | prof->setIsPiSync( mIsPi->isChecked() ); | 738 | prof->setIsPiSync( mIsPi->isChecked() ); |
739 | prof->setIsPiSyncSpec( mIsPiSpecific->isChecked() ); | ||
687 | prof->setIsKapiFile( mIsKapiFileL->isChecked() ); | 740 | prof->setIsKapiFile( mIsKapiFileL->isChecked() ); |
688 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); | 741 | prof->setWriteBackFuture(mWriteBackFuture->isChecked()); |
689 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); | 742 | prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); |
690 | prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); | 743 | prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); |
691 | if ( mWriteContactToSIM ) | 744 | if ( mWriteContactToSIM ) |
692 | prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); | 745 | prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); |
693 | prof->setPhoneDevice( mPhoneDevice->text() ); | 746 | prof->setPhoneDevice( mPhoneDevice->text() ); |
694 | prof->setPhoneConnection( mPhoneConnection->text() ); | 747 | prof->setPhoneConnection( mPhoneConnection->text() ); |
695 | prof->setPhoneModel( mPhoneModel->text() ); | 748 | prof->setPhoneModel( mPhoneModel->text() ); |
696 | prof->setFilterInCal ( mFilterInCal->currentText ()); | 749 | prof->setFilterInCal ( mFilterInCal->currentText ()); |
697 | prof->setFilterOutCal ( mFilterOutCal ->currentText ()); | 750 | prof->setFilterOutCal ( mFilterOutCal ->currentText ()); |
698 | prof->setFilterInAB ( mFilterInAB ->currentText ()); | 751 | prof->setFilterInAB ( mFilterInAB ->currentText ()); |
699 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); | 752 | prof->setFilterOutAB ( mFilterOutAB ->currentText ()); |
753 | if ( mIsPiSpecific->isChecked() ) { | ||
754 | |||
755 | QStringList res; | ||
756 | int i; | ||
757 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | ||
758 | res.append( mResTableKopi->text( i, 0 )); | ||
759 | } | ||
760 | prof->setResSpecKopi( res.join(":")); | ||
761 | } | ||
700 | } | 762 | } |
701 | } | 763 | } |
702 | 764 | ||
703 | void KSyncPrefsDialog::insertProfiles() | 765 | void KSyncPrefsDialog::insertProfiles() |
704 | { | 766 | { |
705 | int curItem = mProfileBox->currentItem(); | 767 | int curItem = mProfileBox->currentItem(); |
706 | mProfileBox->blockSignals( true ); | 768 | mProfileBox->blockSignals( true ); |
707 | mProfileBox->clear(); | 769 | mProfileBox->clear(); |
708 | mProfileBox->insertStringList (mSyncProfileNames ); | 770 | mProfileBox->insertStringList (mSyncProfileNames ); |
709 | int item = mSyncProfileNames.count() -1; | 771 | int item = mSyncProfileNames.count() -1; |
710 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) | 772 | if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) |
711 | mProfileBox->setCurrentItem( curItem ); | 773 | mProfileBox->setCurrentItem( curItem ); |
712 | else if ( item >= 0 ) { | 774 | else if ( item >= 0 ) { |
713 | mProfileBox->setCurrentItem( item ); | 775 | mProfileBox->setCurrentItem( item ); |
714 | } | 776 | } |
715 | currentSelection = -1; | 777 | currentSelection = -1; |
716 | if ( mSyncProfileNames.count() > 0 ) { | 778 | if ( mSyncProfileNames.count() > 0 ) { |
717 | //qDebug(" profileChanged( mProfileBox->currentItem() "); | 779 | //qDebug(" profileChanged( mProfileBox->currentItem() "); |
718 | profileChanged( mProfileBox->currentItem() ); | 780 | profileChanged( mProfileBox->currentItem() ); |
719 | currentSelection = mProfileBox->currentItem(); | 781 | currentSelection = mProfileBox->currentItem(); |
720 | } | 782 | } |
721 | mProfileBox->blockSignals( false ); | 783 | mProfileBox->blockSignals( false ); |
722 | } | 784 | } |
723 | 785 | ||
724 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) | 786 | void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) |
725 | { | 787 | { |
726 | saveProfile(); | 788 | saveProfile(); |
727 | mSyncProfiles.append( temp ); | 789 | mSyncProfiles.append( temp ); |
728 | mSyncProfileNames << temp->getName(); | 790 | mSyncProfileNames << temp->getName(); |
729 | insertProfiles(); | 791 | insertProfiles(); |
730 | int last = mProfileBox->count() -1; | 792 | int last = mProfileBox->count() -1; |
731 | mProfileBox->blockSignals( true ); | 793 | mProfileBox->blockSignals( true ); |
732 | mProfileBox->setCurrentItem( last ); | 794 | mProfileBox->setCurrentItem( last ); |
733 | mProfileBox->blockSignals( false ); | 795 | mProfileBox->blockSignals( false ); |
734 | profileChanged(last); | 796 | profileChanged(last); |
735 | } | 797 | } |
736 | void KSyncPrefsDialog::newProfile() | 798 | void KSyncPrefsDialog::newProfile() |
737 | { | 799 | { |
738 | addProfile ( new KSyncProfile () ); | 800 | addProfile ( new KSyncProfile () ); |
739 | } | 801 | } |
740 | 802 | ||
741 | void KSyncPrefsDialog::cloneProfile() | 803 | void KSyncPrefsDialog::cloneProfile() |
742 | { | 804 | { |
743 | if ( currentSelection >= 0 ) | 805 | if ( currentSelection >= 0 ) |
744 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; | 806 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; |
745 | else | 807 | else |
746 | newProfile(); | 808 | newProfile(); |
747 | } | 809 | } |
748 | 810 | ||
749 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) | 811 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) |
750 | { | 812 | { |
751 | mMyMachineName->setText( name ); | 813 | mMyMachineName->setText( name ); |
752 | 814 | ||
753 | } | 815 | } |
754 | QString KSyncPrefsDialog::getLocalMachineName ( ) | 816 | QString KSyncPrefsDialog::getLocalMachineName ( ) |
755 | { | 817 | { |
756 | return mMyMachineName->text(); | 818 | return mMyMachineName->text(); |
757 | } | 819 | } |
758 | 820 | ||
759 | QStringList KSyncPrefsDialog::getSyncProfileNames() | 821 | QStringList KSyncPrefsDialog::getSyncProfileNames() |
760 | { | 822 | { |
761 | return mSyncProfileNames; | 823 | return mSyncProfileNames; |
762 | } | 824 | } |
763 | void KSyncPrefsDialog::usrReadConfig() | 825 | void KSyncPrefsDialog::usrReadConfig() |
764 | { | 826 | { |
765 | //KConfig *config = KOGlobals::config(); | 827 | //KConfig *config = KOGlobals::config(); |
766 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 828 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
767 | config.setGroup("General"); | 829 | config.setGroup("General"); |
768 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | 830 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); |
769 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); | 831 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); |
770 | int i; | 832 | int i; |
771 | KSyncProfile* temp ; | 833 | KSyncProfile* temp ; |
772 | mSyncProfiles.clear(); | 834 | mSyncProfiles.clear(); |
773 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 835 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
774 | temp = new KSyncProfile (); | 836 | temp = new KSyncProfile (); |
775 | temp->setName( mSyncProfileNames[i] ); | 837 | temp->setName( mSyncProfileNames[i] ); |
776 | temp->readConfig( &config ); | 838 | temp->readConfig( &config ); |
777 | mSyncProfiles.append( temp ); | 839 | mSyncProfiles.append( temp ); |
778 | } | 840 | } |
779 | insertProfiles(); | 841 | insertProfiles(); |
780 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 842 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
781 | } | 843 | } |
782 | 844 | ||
783 | 845 | ||
784 | void KSyncPrefsDialog::usrWriteConfig() | 846 | void KSyncPrefsDialog::usrWriteConfig() |
785 | { | 847 | { |
786 | saveProfile(); | 848 | saveProfile(); |
787 | if ( currentSelection >= 0 ) | 849 | if ( currentSelection >= 0 ) |
788 | profileChanged(currentSelection); | 850 | profileChanged(currentSelection); |
789 | //KConfig *config = KOGlobals::config(); | 851 | //KConfig *config = KOGlobals::config(); |
790 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 852 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
791 | KSyncProfile* prof = mSyncProfiles.first(); | 853 | KSyncProfile* prof = mSyncProfiles.first(); |
792 | QStringList externalSyncProfileNames; | 854 | QStringList externalSyncProfileNames; |
793 | externalSyncProfileNames.append("Sharp_DTM");; | 855 | externalSyncProfileNames.append("Sharp_DTM");; |
794 | while ( prof ) { | 856 | while ( prof ) { |
795 | prof->writeConfig(&config); | 857 | prof->writeConfig(&config); |
796 | if ( prof->getIsPhoneSync( ) ) | 858 | if ( prof->getIsPhoneSync( ) ) |
797 | externalSyncProfileNames.append(prof->getName( ) ); | 859 | externalSyncProfileNames.append(prof->getName( ) ); |
798 | prof = mSyncProfiles.next(); | 860 | prof = mSyncProfiles.next(); |
799 | } | 861 | } |
800 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 862 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
801 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 863 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
802 | config.setGroup("General"); | 864 | config.setGroup("General"); |
803 | config.writeEntry("SyncProfileNames",mSyncProfileNames); | 865 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
804 | config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); | 866 | config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); |
805 | config.writeEntry("LocalMachineName",mMyMachineName->text()); | 867 | config.writeEntry("LocalMachineName",mMyMachineName->text()); |
806 | config.sync(); | 868 | config.sync(); |
807 | } | 869 | } |
808 | 870 | ||
809 | void KSyncPrefsDialog::helpDevice() | 871 | void KSyncPrefsDialog::helpDevice() |
810 | { | 872 | { |
811 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); | 873 | QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); |
812 | #ifdef _WIN32_ | 874 | #ifdef _WIN32_ |
813 | hint += "Leave empty for Irda.\n" | 875 | hint += "Leave empty for Irda.\n" |
814 | "com1:\n(first serial port)\n" | 876 | "com1:\n(first serial port)\n" |
815 | "usb not supported\n" | 877 | "usb not supported\n" |
816 | "???\n(bluetooth device address)\n"; | 878 | "???\n(bluetooth device address)\n"; |
817 | 879 | ||
818 | #else | 880 | #else |
819 | hint += "/dev/ircomm\n(Irda)\n" | 881 | hint += "/dev/ircomm\n(Irda)\n" |
820 | "/dev/ttyS0\n(first serial port)\n" | 882 | "/dev/ttyS0\n(first serial port)\n" |
821 | "/dev/ttyUSB0\n(first device usb port)\n" | 883 | "/dev/ttyUSB0\n(first device usb port)\n" |
822 | "???\n(bluetooth device address)\n"; | 884 | "???\n(bluetooth device address)\n"; |
823 | #endif | 885 | #endif |
824 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 886 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
825 | } | 887 | } |
826 | void KSyncPrefsDialog::helpModel() | 888 | void KSyncPrefsDialog::helpModel() |
827 | { | 889 | { |
828 | QString hint = i18n("Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n"); | 890 | QString hint = i18n("Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n"); |
829 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; | 891 | hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; |
830 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 892 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
831 | 893 | ||
832 | } | 894 | } |
833 | void KSyncPrefsDialog::helpConnection() | 895 | void KSyncPrefsDialog::helpConnection() |
834 | { | 896 | { |
835 | QString hint = i18n("Insert kind of connection,e.g.:\n"); | 897 | QString hint = i18n("Insert kind of connection,e.g.:\n"); |
836 | hint += "irda | Nokia FBUS over infrared\n" | 898 | hint += "irda | Nokia FBUS over infrared\n" |
837 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" | 899 | "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" |
838 | "irdaobex | set also model as obex\n" | 900 | "irdaobex | set also model as obex\n" |
839 | "fbus | Nokia FBUS2 serial\n"; | 901 | "fbus | Nokia FBUS2 serial\n"; |
840 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); | 902 | KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); |
841 | } | 903 | } |
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h index 24543e1..e8a9709 100644 --- a/libkdepim/ksyncprefsdialog.h +++ b/libkdepim/ksyncprefsdialog.h | |||
@@ -1,160 +1,170 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KSYNCPREFSDIALOG_H | 23 | #ifndef _KSYNCPREFSDIALOG_H |
24 | #define _KSYNCPREFSDIALOG_H | 24 | #define _KSYNCPREFSDIALOG_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <kdialogbase.h> | 27 | #include <kdialogbase.h> |
28 | #include <qptrlist.h> | 28 | #include <qptrlist.h> |
29 | #include <qtable.h> | ||
30 | #include <qhbox.h> | ||
29 | 31 | ||
30 | //#include <libkdepim/kprefsdialog.h> | 32 | //#include <libkdepim/kprefsdialog.h> |
31 | 33 | ||
32 | class KColorButton; | 34 | class KColorButton; |
33 | class QSpinBox;; | 35 | class QSpinBox;; |
34 | class QRadioButton; | 36 | class QRadioButton; |
35 | class QCheckBox; | 37 | class QCheckBox; |
36 | class QSlider; | 38 | class QSlider; |
37 | class KURLRequester; | 39 | class KURLRequester; |
38 | class QComboBox; | 40 | class QComboBox; |
39 | class QButtonGroup; | 41 | class QButtonGroup; |
40 | class QLineEdit; | 42 | class QLineEdit; |
41 | class QVBox; | 43 | class QVBox; |
42 | class QStringList; | 44 | class QStringList; |
43 | class KSyncProfile; | 45 | class KSyncProfile; |
44 | 46 | ||
45 | /** Dialog to change the korganizer configuration. | 47 | /** Dialog to change the korganizer configuration. |
46 | */ | 48 | */ |
47 | class KSyncPrefsDialog : public KDialog | 49 | class KSyncPrefsDialog : public KDialog |
48 | { | 50 | { |
49 | Q_OBJECT | 51 | Q_OBJECT |
50 | public: | 52 | public: |
51 | /** Initialize dialog and pages */ | 53 | /** Initialize dialog and pages */ |
52 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 54 | KSyncPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
53 | ~KSyncPrefsDialog(); | 55 | ~KSyncPrefsDialog(); |
54 | void usrReadConfig(); | 56 | void usrReadConfig(); |
55 | void setLocalMachineName ( const QString& name ); | 57 | void setLocalMachineName ( const QString& name ); |
56 | QString getLocalMachineName ( ); | 58 | QString getLocalMachineName ( ); |
57 | 59 | ||
58 | QStringList getSyncProfileNames(); | 60 | QStringList getSyncProfileNames(); |
59 | 61 | ||
60 | public slots: | 62 | public slots: |
61 | protected slots: | 63 | protected slots: |
62 | void accept(); | 64 | void accept(); |
63 | void deleteProfile(); | 65 | void deleteProfile(); |
64 | void newProfile(); | 66 | void newProfile(); |
65 | void cloneProfile(); | 67 | void cloneProfile(); |
66 | void kindChanged(bool); | 68 | void kindChanged(bool); |
67 | void fillSSH(); | 69 | void fillSSH(); |
68 | void fillFTP(); | 70 | void fillFTP(); |
69 | void textChanged( const QString & ); | 71 | void textChanged( const QString & ); |
70 | void profileChanged( int ); | 72 | void profileChanged( int ); |
71 | void chooseFile(); | 73 | void chooseFile(); |
72 | void chooseFileAB(); | 74 | void chooseFileAB(); |
73 | void chooseFilePWM(); | 75 | void chooseFilePWM(); |
74 | void slotOK(); | 76 | void slotOK(); |
75 | void helpDevice(); | 77 | void helpDevice(); |
76 | void helpModel(); | 78 | void helpModel(); |
77 | void helpConnection(); | 79 | void helpConnection(); |
78 | 80 | ||
79 | protected: | 81 | protected: |
80 | void usrWriteConfig(); | 82 | void usrWriteConfig(); |
81 | void setupSyncAlgTab(); | 83 | void setupSyncAlgTab(); |
82 | void readFilter(); | 84 | void readFilter(); |
85 | void readResources(); | ||
83 | private: | 86 | private: |
84 | int currentSelection; | 87 | int currentSelection; |
85 | QPtrList<KSyncProfile> mSyncProfiles; | 88 | QPtrList<KSyncProfile> mSyncProfiles; |
86 | QStringList mSyncProfileNames; | 89 | QStringList mSyncProfileNames; |
87 | QStringList mFilterKapi; | 90 | QStringList mFilterKapi; |
88 | QStringList mFilterKopi; | 91 | QStringList mFilterKopi; |
92 | QStringList mResourcesKopi; | ||
93 | QStringList mResourcesKapi; | ||
89 | QLineEdit * mMyMachineName; | 94 | QLineEdit * mMyMachineName; |
90 | QComboBox * mProfileBox; | 95 | QComboBox * mProfileBox; |
91 | QRadioButton* mIsLocal; | 96 | QRadioButton* mIsLocal; |
92 | QRadioButton* mIsNotLocal; | 97 | QRadioButton* mIsNotLocal; |
93 | QRadioButton* mIsPhone; | 98 | QRadioButton* mIsPhone; |
94 | QRadioButton* mIsPi; | 99 | QRadioButton* mIsPi; |
100 | QRadioButton* mIsPiSpecific; | ||
95 | QCheckBox* mIncludeInRing; | 101 | QCheckBox* mIncludeInRing; |
96 | QCheckBox* mIncludeInRingAB; | 102 | QCheckBox* mIncludeInRingAB; |
97 | QCheckBox* mIncludeInRingPWM; | 103 | QCheckBox* mIncludeInRingPWM; |
98 | void addProfile ( KSyncProfile* ); | 104 | void addProfile ( KSyncProfile* ); |
99 | void insertProfiles(); | 105 | void insertProfiles(); |
100 | void saveProfile(); | 106 | void saveProfile(); |
101 | QButtonGroup* proGr; | 107 | QButtonGroup* proGr; |
108 | QHBox * mTableBox; | ||
109 | QTable* mResTableKopi; | ||
110 | QTable* mResTableKapi; | ||
111 | QTable* mResTablePwmpi; | ||
102 | 112 | ||
103 | QComboBox * mFilterOutCal; | 113 | QComboBox * mFilterOutCal; |
104 | QComboBox * mFilterInCal; | 114 | QComboBox * mFilterInCal; |
105 | QComboBox * mFilterOutAB; | 115 | QComboBox * mFilterOutAB; |
106 | QComboBox * mFilterInAB; | 116 | QComboBox * mFilterInAB; |
107 | 117 | ||
108 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; | 118 | QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both; |
109 | 119 | ||
110 | 120 | ||
111 | QLineEdit * mRemotePostcommand; | 121 | QLineEdit * mRemotePostcommand; |
112 | QLineEdit * mRemotePrecommand; | 122 | QLineEdit * mRemotePrecommand; |
113 | QLineEdit * mRemoteFile; | 123 | QLineEdit * mRemoteFile; |
114 | QLineEdit * mLocalTempFile; | 124 | QLineEdit * mLocalTempFile; |
115 | 125 | ||
116 | QLineEdit * mRemotePostcommandAB; | 126 | QLineEdit * mRemotePostcommandAB; |
117 | QLineEdit * mRemotePrecommandAB; | 127 | QLineEdit * mRemotePrecommandAB; |
118 | QLineEdit * mRemoteFileAB; | 128 | QLineEdit * mRemoteFileAB; |
119 | QLineEdit * mLocalTempFileAB; | 129 | QLineEdit * mLocalTempFileAB; |
120 | 130 | ||
121 | QLineEdit * mRemotePostcommandPWM; | 131 | QLineEdit * mRemotePostcommandPWM; |
122 | QLineEdit * mRemotePrecommandPWM; | 132 | QLineEdit * mRemotePrecommandPWM; |
123 | QLineEdit * mRemoteFilePWM; | 133 | QLineEdit * mRemoteFilePWM; |
124 | QLineEdit * mLocalTempFilePWM; | 134 | QLineEdit * mLocalTempFilePWM; |
125 | 135 | ||
126 | 136 | ||
127 | QLineEdit * mRemotePw; | 137 | QLineEdit * mRemotePw; |
128 | QLineEdit * mRemoteIP; | 138 | QLineEdit * mRemoteIP; |
129 | QLineEdit * mRemotePort; | 139 | QLineEdit * mRemotePort; |
130 | 140 | ||
131 | QLineEdit * mRemotePwAB; | 141 | QLineEdit * mRemotePwAB; |
132 | QLineEdit * mRemoteIPAB; | 142 | QLineEdit * mRemoteIPAB; |
133 | QLineEdit * mRemotePortAB; | 143 | QLineEdit * mRemotePortAB; |
134 | 144 | ||
135 | QLineEdit * mRemotePwPWM; | 145 | QLineEdit * mRemotePwPWM; |
136 | QLineEdit * mRemoteIPPWM; | 146 | QLineEdit * mRemoteIPPWM; |
137 | QLineEdit * mRemotePortPWM; | 147 | QLineEdit * mRemotePortPWM; |
138 | 148 | ||
139 | QLineEdit * mPhoneDevice; | 149 | QLineEdit * mPhoneDevice; |
140 | QLineEdit * mPhoneConnection; | 150 | QLineEdit * mPhoneConnection; |
141 | QLineEdit * mPhoneModel; | 151 | QLineEdit * mPhoneModel; |
142 | 152 | ||
143 | QWidget* mSetupSyncAlgTab; | 153 | QWidget* mSetupSyncAlgTab; |
144 | QVBox* localFileWidget; | 154 | QVBox* localFileWidget; |
145 | QVBox* remoteFileWidget; | 155 | QVBox* remoteFileWidget; |
146 | QVBox* phoneWidget; | 156 | QVBox* phoneWidget; |
147 | QVBox* piWidget; | 157 | QVBox* piWidget; |
148 | QCheckBox* mWriteBackFile; | 158 | QCheckBox* mWriteBackFile; |
149 | QCheckBox* mWriteBackFuture; | 159 | QCheckBox* mWriteBackFuture; |
150 | QSpinBox* mWriteBackFutureWeeks; | 160 | QSpinBox* mWriteBackFutureWeeks; |
151 | QSpinBox* mWriteBackPastWeeks; | 161 | QSpinBox* mWriteBackPastWeeks; |
152 | QCheckBox* mWriteBackExisting; | 162 | QCheckBox* mWriteBackExisting; |
153 | QCheckBox* mAskForPreferences; | 163 | QCheckBox* mAskForPreferences; |
154 | QCheckBox* mShowSummaryAfterSync; | 164 | QCheckBox* mShowSummaryAfterSync; |
155 | QCheckBox* mWriteContactToSIM; | 165 | QCheckBox* mWriteContactToSIM; |
156 | QCheckBox* mIsKapiFileL; | 166 | QCheckBox* mIsKapiFileL; |
157 | QCheckBox* mIsKapiFileR; | 167 | QCheckBox* mIsKapiFileR; |
158 | }; | 168 | }; |
159 | 169 | ||
160 | #endif | 170 | #endif |
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp index 0d72fc9..d6620c8 100644 --- a/libkdepim/ksyncprofile.cpp +++ b/libkdepim/ksyncprofile.cpp | |||
@@ -1,275 +1,282 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KDE-Pim/Pi. | 2 | This file is part of KDE-Pim/Pi. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | // $Id$ | 21 | // $Id$ |
22 | 22 | ||
23 | #include <qcolor.h> | 23 | #include <qcolor.h> |
24 | 24 | ||
25 | #include <kconfig.h> | 25 | #include <kconfig.h> |
26 | #include <kstandarddirs.h> | 26 | #include <kstandarddirs.h> |
27 | #include <kglobal.h> | 27 | #include <kglobal.h> |
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | 29 | ||
30 | #include "ksyncprofile.h" | 30 | #include "ksyncprofile.h" |
31 | 31 | ||
32 | 32 | ||
33 | KSyncProfile::KSyncProfile(): QObject () | 33 | KSyncProfile::KSyncProfile(): QObject () |
34 | { | 34 | { |
35 | setDefault(); | 35 | setDefault(); |
36 | } | 36 | } |
37 | KSyncProfile::~KSyncProfile() | 37 | KSyncProfile::~KSyncProfile() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | 42 | ||
43 | KSyncProfile* KSyncProfile::clone() | 43 | KSyncProfile* KSyncProfile::clone() |
44 | { | 44 | { |
45 | KSyncProfile* myClone = new KSyncProfile(); | 45 | KSyncProfile* myClone = new KSyncProfile(); |
46 | myClone->setRemotePw(mRemotePw); | 46 | myClone->setRemotePw(mRemotePw); |
47 | myClone->setRemoteIP(mRemoteIP); | 47 | myClone->setRemoteIP(mRemoteIP); |
48 | myClone->setRemotePort(mRemotePort); | 48 | myClone->setRemotePort(mRemotePort); |
49 | myClone->setRemotePwAB(mRemotePwAB); | 49 | myClone->setRemotePwAB(mRemotePwAB); |
50 | myClone->setRemoteIPAB(mRemoteIPAB); | 50 | myClone->setRemoteIPAB(mRemoteIPAB); |
51 | myClone->setRemotePortAB(mRemotePortAB); | 51 | myClone->setRemotePortAB(mRemotePortAB); |
52 | myClone->setRemotePwPWM(mRemotePwPWM); | 52 | myClone->setRemotePwPWM(mRemotePwPWM); |
53 | myClone->setRemoteIPPWM(mRemoteIPPWM); | 53 | myClone->setRemoteIPPWM(mRemoteIPPWM); |
54 | myClone->setRemotePortPWM (mRemotePortPWM); | 54 | myClone->setRemotePortPWM (mRemotePortPWM); |
55 | myClone->setPreSyncCommand( mPreSyncCommand ); | 55 | myClone->setPreSyncCommand( mPreSyncCommand ); |
56 | myClone->setPostSyncCommand( mPostSyncCommand ); | 56 | myClone->setPostSyncCommand( mPostSyncCommand ); |
57 | myClone->setLocalTempFile( mLocalTempFile); | 57 | myClone->setLocalTempFile( mLocalTempFile); |
58 | myClone->setRemoteFileName( mRemoteFileName ); | 58 | myClone->setRemoteFileName( mRemoteFileName ); |
59 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); | 59 | myClone->setPreSyncCommandAB( mPreSyncCommandAB ); |
60 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); | 60 | myClone->setPostSyncCommandAB( mPostSyncCommandAB ); |
61 | myClone->setLocalTempFileAB( mLocalTempFileAB); | 61 | myClone->setLocalTempFileAB( mLocalTempFileAB); |
62 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); | 62 | myClone->setRemoteFileNameAB( mRemoteFileNameAB ); |
63 | myClone->setPreSyncCommandPWM( mPreSyncCommandPWM ); | 63 | myClone->setPreSyncCommandPWM( mPreSyncCommandPWM ); |
64 | myClone->setPostSyncCommandPWM( mPostSyncCommandPWM ); | 64 | myClone->setPostSyncCommandPWM( mPostSyncCommandPWM ); |
65 | myClone->setLocalTempFilePWM( mLocalTempFilePWM); | 65 | myClone->setLocalTempFilePWM( mLocalTempFilePWM); |
66 | myClone->setRemoteFileNamePWM( mRemoteFileNamePWM ); | 66 | myClone->setRemoteFileNamePWM( mRemoteFileNamePWM ); |
67 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); | 67 | myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); |
68 | myClone->setAskForPreferences( mAskForPreferences); | 68 | myClone->setAskForPreferences( mAskForPreferences); |
69 | myClone->setWriteBackExisting(mWriteBackExisting ); | 69 | myClone->setWriteBackExisting(mWriteBackExisting ); |
70 | myClone->setWriteBackFile( mWriteBackFile); | 70 | myClone->setWriteBackFile( mWriteBackFile); |
71 | myClone->setWriteBackFuture( mWriteBackFuture ); | 71 | myClone->setWriteBackFuture( mWriteBackFuture ); |
72 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); | 72 | myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks ); |
73 | myClone->setWriteBackPastWeeks( mWriteBackPastWeeks ); | 73 | myClone->setWriteBackPastWeeks( mWriteBackPastWeeks ); |
74 | myClone->setIncludeInRingSync( mIncludeInRingSync ); | 74 | myClone->setIncludeInRingSync( mIncludeInRingSync ); |
75 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); | 75 | myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB ); |
76 | myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); | 76 | myClone->setIncludeInRingSyncPWM( mIncludeInRingSyncPWM ); |
77 | myClone->setSyncPrefs( mSyncPrefs); | 77 | myClone->setSyncPrefs( mSyncPrefs); |
78 | myClone->setIsLocalFileSync( mIsLocalFileSync ); | 78 | myClone->setIsLocalFileSync( mIsLocalFileSync ); |
79 | myClone->setIsPhoneSync( mIsPhoneSync ); | 79 | myClone->setIsPhoneSync( mIsPhoneSync ); |
80 | myClone->setIsKapiFile( mIsKapiFile ); | 80 | myClone->setIsKapiFile( mIsKapiFile ); |
81 | myClone->setIsPiSync( mIsPiSync ); | 81 | myClone->setIsPiSync( mIsPiSync ); |
82 | myClone->setWriteContactToSIM( mWriteContactToSIM ); | 82 | myClone->setWriteContactToSIM( mWriteContactToSIM ); |
83 | myClone->setName( "noName" ); | 83 | myClone->setName( "noName" ); |
84 | myClone->setFilterInCal ( mFilterInCal ); | 84 | myClone->setFilterInCal ( mFilterInCal ); |
85 | myClone->setFilterOutCal ( mFilterOutCal ); | 85 | myClone->setFilterOutCal ( mFilterOutCal ); |
86 | myClone->setFilterInAB ( mFilterInAB ); | 86 | myClone->setFilterInAB ( mFilterInAB ); |
87 | myClone->setFilterOutAB ( mFilterOutAB ); | 87 | myClone->setFilterOutAB ( mFilterOutAB ); |
88 | //myClone->setIdentifier( "noID" ); | 88 | //myClone->setIdentifier( "noID" ); |
89 | return myClone; | 89 | return myClone; |
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | void KSyncProfile::setDefault() | 93 | void KSyncProfile::setDefault() |
94 | { | 94 | { |
95 | mPreSyncCommand = i18n("command for downloading remote file to local device"); | 95 | mPreSyncCommand = i18n("command for downloading remote file to local device"); |
96 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); | 96 | mPostSyncCommand = i18n("command for uploading local temp file to remote device"); |
97 | mLocalTempFile = "/tmp/mycalendar.ics"; | 97 | mLocalTempFile = "/tmp/mycalendar.ics"; |
98 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; | 98 | mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; |
99 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); | 99 | mPreSyncCommandAB = i18n("command for downloading remote file to local device"); |
100 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); | 100 | mPostSyncCommandAB = i18n("command for uploading local temp file to remote device"); |
101 | mLocalTempFileAB = "/tmp/std.vcf"; | 101 | mLocalTempFileAB = "/tmp/std.vcf"; |
102 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; | 102 | mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf"; |
103 | mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); | 103 | mPreSyncCommandPWM = i18n("command for downloading remote file to local device"); |
104 | mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); | 104 | mPostSyncCommandPWM = i18n("command for uploading local temp file to remote device"); |
105 | mLocalTempFilePWM = "/tmp/passwords.pwm"; | 105 | mLocalTempFilePWM = "/tmp/passwords.pwm"; |
106 | mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; | 106 | mRemoteFileNamePWM = "/home/polo/kdepim/apps/pwmanager/localfile.pwm"; |
107 | 107 | ||
108 | mRemotePw = "abc"; | 108 | mRemotePw = "abc"; |
109 | mRemoteIP = "192.168.0.99"; | 109 | mRemoteIP = "192.168.0.99"; |
110 | mRemotePort = "9197"; | 110 | mRemotePort = "9197"; |
111 | 111 | ||
112 | mRemotePwAB = "abc"; | 112 | mRemotePwAB = "abc"; |
113 | mRemoteIPAB = "192.168.0.99"; | 113 | mRemoteIPAB = "192.168.0.99"; |
114 | mRemotePortAB = "9198"; | 114 | mRemotePortAB = "9198"; |
115 | 115 | ||
116 | mRemotePwPWM = "abc"; | 116 | mRemotePwPWM = "abc"; |
117 | mRemoteIPPWM = "192.168.0.99"; | 117 | mRemoteIPPWM = "192.168.0.99"; |
118 | mRemotePortPWM = "9199"; | 118 | mRemotePortPWM = "9199"; |
119 | 119 | ||
120 | mShowSummaryAfterSync = true; | 120 | mShowSummaryAfterSync = true; |
121 | mAskForPreferences = true; | 121 | mAskForPreferences = true; |
122 | mWriteBackExisting = false; | 122 | mWriteBackExisting = false; |
123 | mWriteBackFuture = false; | 123 | mWriteBackFuture = false; |
124 | mWriteBackFutureWeeks = 12; | 124 | mWriteBackFutureWeeks = 12; |
125 | mWriteBackPastWeeks = 2; | 125 | mWriteBackPastWeeks = 2; |
126 | mWriteBackFile = true; | 126 | mWriteBackFile = true; |
127 | mIncludeInRingSync = false; | 127 | mIncludeInRingSync = false; |
128 | mIncludeInRingSyncAB = false; | 128 | mIncludeInRingSyncAB = false; |
129 | mIncludeInRingSyncPWM = false; | 129 | mIncludeInRingSyncPWM = false; |
130 | mSyncPrefs = SYNC_PREF_ASK; | 130 | mSyncPrefs = SYNC_PREF_ASK; |
131 | mIsLocalFileSync = true; | 131 | mIsLocalFileSync = true; |
132 | mName = "noName"; | 132 | mName = "noName"; |
133 | mIsPhoneSync = false; | 133 | mIsPhoneSync = false; |
134 | mIsPiSync = false; | 134 | mIsPiSync = false; |
135 | mIsPiSyncSpec = false; | ||
135 | mIsKapiFile = false; | 136 | mIsKapiFile = false; |
136 | mWriteContactToSIM = false; | 137 | mWriteContactToSIM = false; |
137 | mPhoneDevice = "/dev/ircomm"; | 138 | mPhoneDevice = "/dev/ircomm"; |
138 | mPhoneConnection = "irda"; | 139 | mPhoneConnection = "irda"; |
139 | mPhoneModel = "6310i"; | 140 | mPhoneModel = "6310i"; |
140 | mFilterInCal = "no filter"; | 141 | mFilterInCal = "no filter"; |
141 | mFilterOutCal = "no filter"; | 142 | mFilterOutCal = "no filter"; |
142 | mFilterInAB = "no filter"; | 143 | mFilterInAB = "no filter"; |
143 | mFilterOutAB = "no filter"; | 144 | mFilterOutAB = "no filter"; |
144 | } | 145 | } |
145 | void KSyncProfile::readConfig(KConfig *config ) | 146 | void KSyncProfile::readConfig(KConfig *config ) |
146 | { | 147 | { |
147 | if (config) | 148 | if (config) |
148 | { | 149 | { |
149 | 150 | ||
150 | config->setGroup( mName ); | 151 | config->setGroup( mName ); |
151 | 152 | ||
152 | mName = config->readEntry( "Name", mName ); | 153 | mName = config->readEntry( "Name", mName ); |
153 | 154 | ||
154 | mRemotePw = config->readEntry( "RemotePw",mRemotePw ); | 155 | mRemotePw = config->readEntry( "RemotePw",mRemotePw ); |
155 | mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP ); | 156 | mRemoteIP = config->readEntry( "RemoteIP",mRemoteIP ); |
156 | mRemotePort = config->readEntry( "RemotePort", mRemotePort ); | 157 | mRemotePort = config->readEntry( "RemotePort", mRemotePort ); |
157 | mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB ); | 158 | mRemotePwAB = config->readEntry( "RemotePwAB", mRemotePwAB ); |
158 | mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB ); | 159 | mRemoteIPAB = config->readEntry( "RemoteIPAB", mRemoteIPAB ); |
159 | mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB ); | 160 | mRemotePortAB = config->readEntry( "RemotePortAB", mRemotePortAB ); |
160 | mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM ); | 161 | mRemotePwPWM = config->readEntry( "RemotePwPWM", mRemotePwPWM ); |
161 | mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM ); | 162 | mRemoteIPPWM = config->readEntry( "RemoteIPPWM", mRemoteIPPWM ); |
162 | mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM ); | 163 | mRemotePortPWM = config->readEntry( "RemotePortPWM", mRemotePortPWM ); |
163 | 164 | ||
164 | mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); | 165 | mPreSyncCommand = config->readEntry( "PreSyncCommand",mPreSyncCommand ); |
165 | mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); | 166 | mPostSyncCommand = config->readEntry( "PostSyncCommand", mPostSyncCommand ); |
166 | mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); | 167 | mLocalTempFile = config->readEntry( "LocalTempFile", mLocalTempFile ); |
167 | mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); | 168 | mRemoteFileName = config->readEntry( "RemoteFileName", mRemoteFileName ); |
168 | 169 | ||
169 | mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); | 170 | mPreSyncCommandAB = config->readEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
170 | mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); | 171 | mPostSyncCommandAB = config->readEntry( "PostSyncCommandAB", mPostSyncCommandAB ); |
171 | mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); | 172 | mLocalTempFileAB = config->readEntry( "LocalTempFileAB", mLocalTempFileAB ); |
172 | mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); | 173 | mRemoteFileNameAB = config->readEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
173 | 174 | ||
174 | mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); | 175 | mPreSyncCommandPWM = config->readEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); |
175 | mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); | 176 | mPostSyncCommandPWM = config->readEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); |
176 | mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM ); | 177 | mLocalTempFilePWM = config->readEntry( "LocalTempFilePWM", mLocalTempFilePWM ); |
177 | mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); | 178 | mRemoteFileNamePWM = config->readEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); |
178 | 179 | ||
179 | mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); | 180 | mPhoneDevice = config->readEntry( "PhoneDevice", mPhoneDevice ); |
180 | mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); | 181 | mPhoneConnection = config->readEntry( "PhoneConnection", mPhoneConnection ); |
181 | mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); | 182 | mPhoneModel = config->readEntry( "PhoneModel", mPhoneModel ); |
182 | 183 | ||
183 | mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); | 184 | mIncludeInRingSync = config->readBoolEntry( "IncludeInRingSync",mIncludeInRingSync ); |
184 | mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 185 | mIncludeInRingSyncAB = config->readBoolEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
185 | mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); | 186 | mIncludeInRingSyncPWM = config->readBoolEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); |
186 | mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 187 | mShowSummaryAfterSync = config->readBoolEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
187 | mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); | 188 | mAskForPreferences = config->readBoolEntry( "AskForPreferences",mAskForPreferences ); |
188 | mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); | 189 | mWriteBackExisting = config->readBoolEntry( "WriteBackExisting",mWriteBackExisting ); |
189 | mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); | 190 | mWriteBackFuture = config->readBoolEntry( "WriteBackFuture",mWriteBackFuture ); |
190 | mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); | 191 | mWriteBackFile = config->readBoolEntry( "WriteBackFile",mWriteBackFile ); |
191 | mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); | 192 | mWriteContactToSIM = config->readBoolEntry( "WriteContactToSIM",mWriteContactToSIM ); |
192 | mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); | 193 | mSyncPrefs = config->readNumEntry( "SyncPrefs", mSyncPrefs ); |
193 | mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); | 194 | mWriteBackFutureWeeks = config->readNumEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks ); |
194 | mWriteBackPastWeeks = config->readNumEntry( "WriteBackPastWeeks", mWriteBackPastWeeks ); | 195 | mWriteBackPastWeeks = config->readNumEntry( "WriteBackPastWeeks", mWriteBackPastWeeks ); |
195 | mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); | 196 | mIsLocalFileSync= config->readBoolEntry( "IsLocalFileSync", mIsLocalFileSync ); |
196 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); | 197 | mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync ); |
197 | mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); | 198 | mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync ); |
199 | mIsPiSyncSpec= config->readBoolEntry( "IsPiSyncSpec", mIsPiSyncSpec ); | ||
198 | mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); | 200 | mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile ); |
199 | 201 | ||
200 | mFilterInCal = config->readEntry( "FilterInCal", mFilterInCal ); | 202 | mFilterInCal = config->readEntry( "FilterInCal", mFilterInCal ); |
201 | mFilterOutCal = config->readEntry( "FilterOutCal", mFilterOutCal ); | 203 | mFilterOutCal = config->readEntry( "FilterOutCal", mFilterOutCal ); |
202 | mFilterInAB = config->readEntry( "FilterInAB", mFilterInAB ); | 204 | mFilterInAB = config->readEntry( "FilterInAB", mFilterInAB ); |
203 | mFilterOutAB = config->readEntry( "FilterOutAB", mFilterOutAB ); | 205 | mFilterOutAB = config->readEntry( "FilterOutAB", mFilterOutAB ); |
206 | mResSpecKopi = config->readEntry( "ResSpecKopi", mResSpecKopi ); | ||
207 | mResSpecKapi = config->readEntry( "ResSpecKapi", mResSpecKapi ); | ||
204 | 208 | ||
205 | } | 209 | } |
206 | else | 210 | else |
207 | { | 211 | { |
208 | setDefault(); | 212 | setDefault(); |
209 | } | 213 | } |
210 | } | 214 | } |
211 | 215 | ||
212 | void KSyncProfile::deleteConfig(KConfig *config ) | 216 | void KSyncProfile::deleteConfig(KConfig *config ) |
213 | { | 217 | { |
214 | config->deleteGroup( mName ); | 218 | config->deleteGroup( mName ); |
215 | } | 219 | } |
216 | 220 | ||
217 | void KSyncProfile::writeConfig( KConfig * config ) | 221 | void KSyncProfile::writeConfig( KConfig * config ) |
218 | { | 222 | { |
219 | config->setGroup(mName); | 223 | config->setGroup(mName); |
220 | 224 | ||
221 | config->writeEntry( "RemotePw", mRemotePw); | 225 | config->writeEntry( "RemotePw", mRemotePw); |
222 | config->writeEntry( "RemoteIP", mRemoteIP); | 226 | config->writeEntry( "RemoteIP", mRemoteIP); |
223 | config->writeEntry( "RemotePort", mRemotePort); | 227 | config->writeEntry( "RemotePort", mRemotePort); |
224 | 228 | ||
225 | config->writeEntry( "RemotePwAB", mRemotePwAB); | 229 | config->writeEntry( "RemotePwAB", mRemotePwAB); |
226 | config->writeEntry( "RemoteIPAB", mRemoteIPAB); | 230 | config->writeEntry( "RemoteIPAB", mRemoteIPAB); |
227 | config->writeEntry( "RemotePortAB", mRemotePortAB); | 231 | config->writeEntry( "RemotePortAB", mRemotePortAB); |
228 | 232 | ||
229 | config->writeEntry( "RemotePwPWM", mRemotePwPWM); | 233 | config->writeEntry( "RemotePwPWM", mRemotePwPWM); |
230 | config->writeEntry( "RemoteIPPWM", mRemoteIPPWM); | 234 | config->writeEntry( "RemoteIPPWM", mRemoteIPPWM); |
231 | config->writeEntry( "RemotePortPWM", mRemotePortPWM); | 235 | config->writeEntry( "RemotePortPWM", mRemotePortPWM); |
232 | 236 | ||
233 | config->writeEntry( "Name", mName ); | 237 | config->writeEntry( "Name", mName ); |
234 | config->writeEntry( "PreSyncCommand",mPreSyncCommand ); | 238 | config->writeEntry( "PreSyncCommand",mPreSyncCommand ); |
235 | config->writeEntry( "PostSyncCommand", mPostSyncCommand ); | 239 | config->writeEntry( "PostSyncCommand", mPostSyncCommand ); |
236 | config->writeEntry( "LocalTempFile", mLocalTempFile ); | 240 | config->writeEntry( "LocalTempFile", mLocalTempFile ); |
237 | config->writeEntry( "RemoteFileName", mRemoteFileName ); | 241 | config->writeEntry( "RemoteFileName", mRemoteFileName ); |
238 | 242 | ||
239 | config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); | 243 | config->writeEntry( "PreSyncCommandAB",mPreSyncCommandAB ); |
240 | config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); | 244 | config->writeEntry( "PostSyncCommandAB", mPostSyncCommandAB ); |
241 | config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); | 245 | config->writeEntry( "LocalTempFileAB", mLocalTempFileAB ); |
242 | config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); | 246 | config->writeEntry( "RemoteFileNameAB", mRemoteFileNameAB ); |
243 | 247 | ||
244 | config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); | 248 | config->writeEntry( "PreSyncCommandPWM",mPreSyncCommandPWM ); |
245 | config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); | 249 | config->writeEntry( "PostSyncCommandPWM", mPostSyncCommandPWM ); |
246 | config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM ); | 250 | config->writeEntry( "LocalTempFilePWM", mLocalTempFilePWM ); |
247 | config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); | 251 | config->writeEntry( "RemoteFileNamePWM", mRemoteFileNamePWM ); |
248 | 252 | ||
249 | config->writeEntry( "PhoneDevice", mPhoneDevice ); | 253 | config->writeEntry( "PhoneDevice", mPhoneDevice ); |
250 | config->writeEntry( "PhoneConnection", mPhoneConnection ); | 254 | config->writeEntry( "PhoneConnection", mPhoneConnection ); |
251 | config->writeEntry( "PhoneModel", mPhoneModel ); | 255 | config->writeEntry( "PhoneModel", mPhoneModel ); |
252 | 256 | ||
253 | config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); | 257 | config->writeEntry( "IncludeInRingSync",mIncludeInRingSync ); |
254 | config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); | 258 | config->writeEntry( "IncludeInRingSyncAB",mIncludeInRingSyncAB ); |
255 | config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); | 259 | config->writeEntry( "IncludeInRingSyncPWM",mIncludeInRingSyncPWM ); |
256 | config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); | 260 | config->writeEntry( "ShowSummaryAfterSync", mShowSummaryAfterSync ); |
257 | config->writeEntry( "AskForPreferences",mAskForPreferences ); | 261 | config->writeEntry( "AskForPreferences",mAskForPreferences ); |
258 | config->writeEntry( "WriteBackExisting",mWriteBackExisting ); | 262 | config->writeEntry( "WriteBackExisting",mWriteBackExisting ); |
259 | config->writeEntry( "WriteBackFuture",mWriteBackFuture ); | 263 | config->writeEntry( "WriteBackFuture",mWriteBackFuture ); |
260 | config->writeEntry( "WriteBackFile",mWriteBackFile ); | 264 | config->writeEntry( "WriteBackFile",mWriteBackFile ); |
261 | config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); | 265 | config->writeEntry( "WriteContactToSIM",mWriteContactToSIM ); |
262 | config->writeEntry( "SyncPrefs", mSyncPrefs ); | 266 | config->writeEntry( "SyncPrefs", mSyncPrefs ); |
263 | config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); | 267 | config->writeEntry( "WriteBackFutureWeeks", mWriteBackFutureWeeks); |
264 | config->writeEntry( "WriteBackPastWeeks", mWriteBackPastWeeks); | 268 | config->writeEntry( "WriteBackPastWeeks", mWriteBackPastWeeks); |
265 | config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); | 269 | config->writeEntry( "IsLocalFileSync", mIsLocalFileSync ); |
266 | config->writeEntry( "IsPhoneSync", mIsPhoneSync ); | 270 | config->writeEntry( "IsPhoneSync", mIsPhoneSync ); |
267 | config->writeEntry( "IsPiSync", mIsPiSync ); | 271 | config->writeEntry( "IsPiSync", mIsPiSync ); |
272 | config->writeEntry( "IsPiSyncSpec", mIsPiSyncSpec ); | ||
268 | config->writeEntry( "IsKapiFile", mIsKapiFile ); | 273 | config->writeEntry( "IsKapiFile", mIsKapiFile ); |
269 | config->writeEntry( "FilterInCal", mFilterInCal ); | 274 | config->writeEntry( "FilterInCal", mFilterInCal ); |
270 | config->writeEntry( "FilterOutCal", mFilterOutCal ); | 275 | config->writeEntry( "FilterOutCal", mFilterOutCal ); |
271 | config->writeEntry( "FilterInAB", mFilterInAB ); | 276 | config->writeEntry( "FilterInAB", mFilterInAB ); |
272 | config->writeEntry( "FilterOutAB", mFilterOutAB ); | 277 | config->writeEntry( "FilterOutAB", mFilterOutAB ); |
273 | 278 | ||
279 | config->writeEntry( "ResSpecKopi", mResSpecKopi ); | ||
280 | config->writeEntry( "ResSpecKapi", mResSpecKapi ); | ||
274 | } | 281 | } |
275 | 282 | ||
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h index aad63d3..91fcfc5 100644 --- a/libkdepim/ksyncprofile.h +++ b/libkdepim/ksyncprofile.h | |||
@@ -1,205 +1,216 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KDE-Pim/Pi. | 2 | This file is part of KDE-Pim/Pi. |
3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> | 3 | Copyright (c) 2004 Lutz Rogowski <rogowski@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef _KSYNCPROFILE_H | 20 | #ifndef _KSYNCPROFILE_H |
21 | #define _KSYNCPROFILE_H | 21 | #define _KSYNCPROFILE_H |
22 | 22 | ||
23 | #include <qptrlist.h> | 23 | #include <qptrlist.h> |
24 | #include <qcolor.h> | 24 | #include <qcolor.h> |
25 | #include <qfont.h> | 25 | #include <qfont.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qobject.h> | 27 | #include <qobject.h> |
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | 29 | ||
30 | #include <libkcal/syncdefines.h> | 30 | #include <libkcal/syncdefines.h> |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | class KConfig; | 34 | class KConfig; |
35 | 35 | ||
36 | 36 | ||
37 | class KSyncProfile : public QObject { | 37 | class KSyncProfile : public QObject { |
38 | public: | 38 | public: |
39 | KSyncProfile(); | 39 | KSyncProfile(); |
40 | ~KSyncProfile() ; | 40 | ~KSyncProfile() ; |
41 | 41 | ||
42 | KSyncProfile* clone(); | 42 | KSyncProfile* clone(); |
43 | void setDefault(); | 43 | void setDefault(); |
44 | void readConfig(KConfig *); | 44 | void readConfig(KConfig *); |
45 | void writeConfig(KConfig *); | 45 | void writeConfig(KConfig *); |
46 | void deleteConfig(KConfig *); | 46 | void deleteConfig(KConfig *); |
47 | 47 | ||
48 | void setRemotePw( const QString& n ) {mRemotePw = n;} | 48 | void setRemotePw( const QString& n ) {mRemotePw = n;} |
49 | QString getRemotePw( ) { return mRemotePw; } | 49 | QString getRemotePw( ) { return mRemotePw; } |
50 | void setRemotePwAB( const QString& n ) {mRemotePwAB = n;} | 50 | void setRemotePwAB( const QString& n ) {mRemotePwAB = n;} |
51 | QString getRemotePwAB( ) { return mRemotePwAB; } | 51 | QString getRemotePwAB( ) { return mRemotePwAB; } |
52 | void setRemotePwPWM( const QString& n ) {mRemotePwPWM = n;} | 52 | void setRemotePwPWM( const QString& n ) {mRemotePwPWM = n;} |
53 | QString getRemotePwPWM( ) { return mRemotePwPWM; } | 53 | QString getRemotePwPWM( ) { return mRemotePwPWM; } |
54 | 54 | ||
55 | void setRemoteIP( const QString& n ) {mRemoteIP = n;} | 55 | void setRemoteIP( const QString& n ) {mRemoteIP = n;} |
56 | QString getRemoteIP( ) { return mRemoteIP; } | 56 | QString getRemoteIP( ) { return mRemoteIP; } |
57 | void setRemoteIPAB( const QString& n ) {mRemoteIPAB = n;} | 57 | void setRemoteIPAB( const QString& n ) {mRemoteIPAB = n;} |
58 | QString getRemoteIPAB( ) { return mRemoteIPAB; } | 58 | QString getRemoteIPAB( ) { return mRemoteIPAB; } |
59 | void setRemoteIPPWM( const QString& n ) {mRemoteIPPWM = n;} | 59 | void setRemoteIPPWM( const QString& n ) {mRemoteIPPWM = n;} |
60 | QString getRemoteIPPWM( ) { return mRemoteIPPWM; } | 60 | QString getRemoteIPPWM( ) { return mRemoteIPPWM; } |
61 | 61 | ||
62 | void setRemotePort( const QString& n ) {mRemotePort = n;} | 62 | void setRemotePort( const QString& n ) {mRemotePort = n;} |
63 | QString getRemotePort( ) { return mRemotePort; } | 63 | QString getRemotePort( ) { return mRemotePort; } |
64 | void setRemotePortAB( const QString& n ) {mRemotePortAB = n;} | 64 | void setRemotePortAB( const QString& n ) {mRemotePortAB = n;} |
65 | QString getRemotePortAB( ) { return mRemotePortAB; } | 65 | QString getRemotePortAB( ) { return mRemotePortAB; } |
66 | void setRemotePortPWM( const QString& n ) {mRemotePortPWM = n;} | 66 | void setRemotePortPWM( const QString& n ) {mRemotePortPWM = n;} |
67 | QString getRemotePortPWM( ) { return mRemotePortPWM; } | 67 | QString getRemotePortPWM( ) { return mRemotePortPWM; } |
68 | 68 | ||
69 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} | 69 | void setPreSyncCommand( const QString& n ) {mPreSyncCommand = n;} |
70 | QString getPreSyncCommand( ) { return mPreSyncCommand; } | 70 | QString getPreSyncCommand( ) { return mPreSyncCommand; } |
71 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} | 71 | void setPostSyncCommand( const QString& n ) {mPostSyncCommand = n;} |
72 | QString getPostSyncCommand( ) { return mPostSyncCommand;} | 72 | QString getPostSyncCommand( ) { return mPostSyncCommand;} |
73 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} | 73 | void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} |
74 | QString getLocalTempFile( ) { return mLocalTempFile;} | 74 | QString getLocalTempFile( ) { return mLocalTempFile;} |
75 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} | 75 | void setRemoteFileName( const QString& n ) { mRemoteFileName = n;} |
76 | QString getRemoteFileName( ) { return mRemoteFileName;} | 76 | QString getRemoteFileName( ) { return mRemoteFileName;} |
77 | 77 | ||
78 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} | 78 | void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;} |
79 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } | 79 | QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; } |
80 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} | 80 | void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;} |
81 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} | 81 | QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;} |
82 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} | 82 | void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;} |
83 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} | 83 | QString getLocalTempFileAB( ) { return mLocalTempFileAB;} |
84 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} | 84 | void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;} |
85 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} | 85 | QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;} |
86 | 86 | ||
87 | void setPreSyncCommandPWM( const QString& n ) {mPreSyncCommandPWM = n;} | 87 | void setPreSyncCommandPWM( const QString& n ) {mPreSyncCommandPWM = n;} |
88 | QString getPreSyncCommandPWM( ) { return mPreSyncCommandPWM; } | 88 | QString getPreSyncCommandPWM( ) { return mPreSyncCommandPWM; } |
89 | void setPostSyncCommandPWM( const QString& n ) {mPostSyncCommandPWM = n;} | 89 | void setPostSyncCommandPWM( const QString& n ) {mPostSyncCommandPWM = n;} |
90 | QString getPostSyncCommandPWM( ) { return mPostSyncCommandPWM;} | 90 | QString getPostSyncCommandPWM( ) { return mPostSyncCommandPWM;} |
91 | void setLocalTempFilePWM( const QString& n ) { mLocalTempFilePWM= n;} | 91 | void setLocalTempFilePWM( const QString& n ) { mLocalTempFilePWM= n;} |
92 | QString getLocalTempFilePWM( ) { return mLocalTempFilePWM;} | 92 | QString getLocalTempFilePWM( ) { return mLocalTempFilePWM;} |
93 | void setRemoteFileNamePWM( const QString& n ) { mRemoteFileNamePWM = n;} | 93 | void setRemoteFileNamePWM( const QString& n ) { mRemoteFileNamePWM = n;} |
94 | QString getRemoteFileNamePWM( ) { return mRemoteFileNamePWM;} | 94 | QString getRemoteFileNamePWM( ) { return mRemoteFileNamePWM;} |
95 | 95 | ||
96 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} | 96 | void setPhoneDevice( const QString& n ) { mPhoneDevice = n;} |
97 | QString getPhoneDevice( ) { return mPhoneDevice;} | 97 | QString getPhoneDevice( ) { return mPhoneDevice;} |
98 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} | 98 | void setPhoneConnection( const QString& n ) { mPhoneConnection = n;} |
99 | QString getPhoneConnection( ) { return mPhoneConnection;} | 99 | QString getPhoneConnection( ) { return mPhoneConnection;} |
100 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} | 100 | void setPhoneModel( const QString& n ) { mPhoneModel = n;} |
101 | QString getPhoneModel( ) { return mPhoneModel;} | 101 | QString getPhoneModel( ) { return mPhoneModel;} |
102 | /* | 102 | /* |
103 | void set( const QString& n ) { = n;} | 103 | void set( const QString& n ) { = n;} |
104 | QString get( ) { return ;} | 104 | QString get( ) { return ;} |
105 | */ | 105 | */ |
106 | 106 | ||
107 | void setFilterInCal (const QString& n ){ mFilterInCal = n;} | 107 | void setFilterInCal (const QString& n ){ mFilterInCal = n;} |
108 | void setFilterOutCal (const QString& n ){ mFilterOutCal = n;} | 108 | void setFilterOutCal (const QString& n ){ mFilterOutCal = n;} |
109 | void setFilterInAB (const QString& n ){ mFilterInAB = n;} | 109 | void setFilterInAB (const QString& n ){ mFilterInAB = n;} |
110 | void setFilterOutAB (const QString& n ){ mFilterOutAB = n;} | 110 | void setFilterOutAB (const QString& n ){ mFilterOutAB = n;} |
111 | QString getFilterInCal () { return mFilterInCal ;} | 111 | QString getFilterInCal () { return mFilterInCal ;} |
112 | QString getFilterOutCal () { return mFilterOutCal ;} | 112 | QString getFilterOutCal () { return mFilterOutCal ;} |
113 | QString getFilterInAB () { return mFilterInAB ;} | 113 | QString getFilterInAB () { return mFilterInAB ;} |
114 | QString getFilterOutAB () { return mFilterOutAB ;} | 114 | QString getFilterOutAB () { return mFilterOutAB ;} |
115 | 115 | ||
116 | void setName( const QString& n ) {mName = n;} | 116 | void setName( const QString& n ) {mName = n;} |
117 | QString getName( ) { return mName;} | 117 | QString getName( ) { return mName;} |
118 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} | 118 | void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;} |
119 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} | 119 | bool getShowSummaryAfterSync( ) { return mShowSummaryAfterSync ;} |
120 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} | 120 | void setAskForPreferences( bool b ) { mAskForPreferences= b;} |
121 | bool getAskForPreferences( ) { return mAskForPreferences;} | 121 | bool getAskForPreferences( ) { return mAskForPreferences;} |
122 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} | 122 | void setWriteBackExisting( bool b ) { mWriteBackExisting = b;} |
123 | bool getWriteBackExisting( ) { return mWriteBackExisting;} | 123 | bool getWriteBackExisting( ) { return mWriteBackExisting;} |
124 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} | 124 | void setWriteBackFuture( bool b ) { mWriteBackFuture = b;} |
125 | bool getWriteBackFuture( ) { return mWriteBackFuture;} | 125 | bool getWriteBackFuture( ) { return mWriteBackFuture;} |
126 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} | 126 | void setWriteBackFile( bool b ) { mWriteBackFile= b;} |
127 | bool getWriteBackFile( ) { return mWriteBackFile;} | 127 | bool getWriteBackFile( ) { return mWriteBackFile;} |
128 | void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;} | 128 | void setWriteContactToSIM( bool b ) { mWriteContactToSIM= b;} |
129 | bool getWriteContactToSIM( ) { return mWriteContactToSIM;} | 129 | bool getWriteContactToSIM( ) { return mWriteContactToSIM;} |
130 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} | 130 | void setIncludeInRingSync( bool b ) {mIncludeInRingSync = b;} |
131 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} | 131 | bool getIncludeInRingSync( ) { return mIncludeInRingSync;} |
132 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} | 132 | void setIncludeInRingSyncAB( bool b ) {mIncludeInRingSyncAB = b;} |
133 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} | 133 | bool getIncludeInRingSyncAB( ) { return mIncludeInRingSyncAB;} |
134 | void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;} | 134 | void setIncludeInRingSyncPWM( bool b ) {mIncludeInRingSyncPWM = b;} |
135 | bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;} | 135 | bool getIncludeInRingSyncPWM( ) { return mIncludeInRingSyncPWM;} |
136 | void setSyncPrefs( int n ) { mSyncPrefs= n;} | 136 | void setSyncPrefs( int n ) { mSyncPrefs= n;} |
137 | int getSyncPrefs( ) { return mSyncPrefs;} | 137 | int getSyncPrefs( ) { return mSyncPrefs;} |
138 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} | 138 | void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;} |
139 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} | 139 | int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;} |
140 | void setWriteBackPastWeeks( int n ) { mWriteBackPastWeeks= n;} | 140 | void setWriteBackPastWeeks( int n ) { mWriteBackPastWeeks= n;} |
141 | int getWriteBackPastWeeks( ) { return mWriteBackPastWeeks;} | 141 | int getWriteBackPastWeeks( ) { return mWriteBackPastWeeks;} |
142 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} | 142 | void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} |
143 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} | 143 | bool getIsLocalFileSync( ) { return mIsLocalFileSync;} |
144 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} | 144 | void setIsPhoneSync( bool b ) { mIsPhoneSync= b;} |
145 | bool getIsPhoneSync( ) { return mIsPhoneSync;} | 145 | bool getIsPhoneSync( ) { return mIsPhoneSync;} |
146 | void setIsPiSync( bool b ) { mIsPiSync= b;} | 146 | void setIsPiSync( bool b ) { mIsPiSync= b;} |
147 | void setIsPiSyncSpec( bool b ) { mIsPiSyncSpec= b;} | ||
147 | bool getIsPiSync( ) { return mIsPiSync;} | 148 | bool getIsPiSync( ) { return mIsPiSync;} |
149 | bool getIsPiSyncSpec( ) { return mIsPiSyncSpec;} | ||
148 | void setIsKapiFile( bool b ) { mIsKapiFile= b;} | 150 | void setIsKapiFile( bool b ) { mIsKapiFile= b;} |
149 | bool getIsKapiFile( ) { return mIsKapiFile;} | 151 | bool getIsKapiFile( ) { return mIsKapiFile;} |
152 | |||
153 | |||
154 | QString getResSpecKopi() { return mResSpecKopi;} | ||
155 | QString getResSpecKapi() { return mResSpecKapi;} | ||
156 | void setResSpecKopi( const QString& n ) {mResSpecKopi = n;} | ||
157 | void setResSpecKapi( const QString& n ) {mResSpecKapi = n;} | ||
150 | private: | 158 | private: |
151 | QString mName; | 159 | QString mName; |
152 | QString mPreSyncCommand; | 160 | QString mPreSyncCommand; |
153 | QString mPostSyncCommand; | 161 | QString mPostSyncCommand; |
154 | QString mLocalTempFile; | 162 | QString mLocalTempFile; |
155 | QString mRemoteFileName; | 163 | QString mRemoteFileName; |
156 | QString mPreSyncCommandAB; | 164 | QString mPreSyncCommandAB; |
157 | QString mPostSyncCommandAB; | 165 | QString mPostSyncCommandAB; |
158 | QString mLocalTempFileAB; | 166 | QString mLocalTempFileAB; |
159 | QString mRemoteFileNameAB; | 167 | QString mRemoteFileNameAB; |
160 | QString mPreSyncCommandPWM; | 168 | QString mPreSyncCommandPWM; |
161 | QString mPostSyncCommandPWM; | 169 | QString mPostSyncCommandPWM; |
162 | QString mLocalTempFilePWM; | 170 | QString mLocalTempFilePWM; |
163 | QString mRemoteFileNamePWM; | 171 | QString mRemoteFileNamePWM; |
164 | 172 | ||
165 | QString mRemotePw; | 173 | QString mRemotePw; |
166 | QString mRemoteIP; | 174 | QString mRemoteIP; |
167 | QString mRemotePort; | 175 | QString mRemotePort; |
168 | 176 | ||
169 | QString mRemotePwAB; | 177 | QString mRemotePwAB; |
170 | QString mRemoteIPAB; | 178 | QString mRemoteIPAB; |
171 | QString mRemotePortAB; | 179 | QString mRemotePortAB; |
172 | 180 | ||
173 | QString mRemotePwPWM; | 181 | QString mRemotePwPWM; |
174 | QString mRemoteIPPWM; | 182 | QString mRemoteIPPWM; |
175 | QString mRemotePortPWM; | 183 | QString mRemotePortPWM; |
176 | 184 | ||
177 | QString mPhoneDevice; | 185 | QString mPhoneDevice; |
178 | QString mPhoneConnection; | 186 | QString mPhoneConnection; |
179 | QString mPhoneModel; | 187 | QString mPhoneModel; |
180 | 188 | ||
181 | QString mFilterInCal; | 189 | QString mFilterInCal; |
182 | QString mFilterOutCal; | 190 | QString mFilterOutCal; |
183 | QString mFilterInAB; | 191 | QString mFilterInAB; |
184 | QString mFilterOutAB; | 192 | QString mFilterOutAB; |
185 | 193 | ||
186 | bool mIncludeInRingSync; | 194 | bool mIncludeInRingSync; |
187 | bool mIncludeInRingSyncAB; | 195 | bool mIncludeInRingSyncAB; |
188 | bool mIncludeInRingSyncPWM; | 196 | bool mIncludeInRingSyncPWM; |
189 | int mSyncPrefs; | 197 | int mSyncPrefs; |
190 | bool mWriteBackFile; | 198 | bool mWriteBackFile; |
191 | bool mWriteBackExisting; | 199 | bool mWriteBackExisting; |
192 | bool mWriteBackFuture; | 200 | bool mWriteBackFuture; |
193 | int mWriteBackFutureWeeks; | 201 | int mWriteBackFutureWeeks; |
194 | int mWriteBackPastWeeks; | 202 | int mWriteBackPastWeeks; |
195 | bool mAskForPreferences; | 203 | bool mAskForPreferences; |
196 | bool mShowSummaryAfterSync; | 204 | bool mShowSummaryAfterSync; |
197 | bool mIsLocalFileSync; | 205 | bool mIsLocalFileSync; |
198 | bool mIsPhoneSync; | 206 | bool mIsPhoneSync; |
199 | bool mWriteContactToSIM; | 207 | bool mWriteContactToSIM; |
200 | 208 | ||
201 | bool mIsPiSync; | 209 | bool mIsPiSync; |
210 | bool mIsPiSyncSpec; | ||
202 | bool mIsKapiFile; | 211 | bool mIsKapiFile; |
212 | QString mResSpecKopi; | ||
213 | QString mResSpecKapi; | ||
203 | }; | 214 | }; |
204 | 215 | ||
205 | #endif | 216 | #endif |