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