-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 073ab74..03034b4 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -1,230 +1,231 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KdePim/Pi. | 2 | This file is part of KdePim/Pi. |
3 | Copyright (c) 2004 Ulf Schenk | 3 | Copyright (c) 2004 Ulf Schenk |
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 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
38 | #include <qfile.h> | 38 | #include <qfile.h> |
39 | #include <qregexp.h> | ||
39 | 40 | ||
40 | #include <kdialog.h> | 41 | #include <kdialog.h> |
41 | #include <klocale.h> | 42 | #include <klocale.h> |
42 | #include <kdateedit.h> | 43 | #include <kdateedit.h> |
43 | #include <kglobal.h> | 44 | #include <kglobal.h> |
44 | #include <stdlib.h> | 45 | #include <stdlib.h> |
45 | 46 | ||
46 | /*US | 47 | /*US |
47 | #include <qcheckbox.h> | 48 | #include <qcheckbox.h> |
48 | #include <qframe.h> | 49 | #include <qframe.h> |
49 | #include <qpushbutton.h> | 50 | #include <qpushbutton.h> |
50 | #include <qcombobox.h> | 51 | #include <qcombobox.h> |
51 | #include <qlineedit.h> | 52 | #include <qlineedit.h> |
52 | #include <qlabel.h> | 53 | #include <qlabel.h> |
53 | #include <qfile.h> | 54 | #include <qfile.h> |
54 | 55 | ||
55 | #include <kconfig.h> | 56 | #include <kconfig.h> |
56 | #include <kdebug.h> | 57 | #include <kdebug.h> |
57 | #include <kdialog.h> | 58 | #include <kdialog.h> |
58 | #include <klistview.h> | 59 | #include <klistview.h> |
59 | #include <klocale.h> | 60 | #include <klocale.h> |
60 | #include <kglobal.h> | 61 | #include <kglobal.h> |
61 | #include <kmessagebox.h> | 62 | #include <kmessagebox.h> |
62 | #include <kstandarddirs.h> | 63 | #include <kstandarddirs.h> |
63 | 64 | ||
64 | #ifndef KAB_EMBEDDED | 65 | #ifndef KAB_EMBEDDED |
65 | #include <ktrader.h> | 66 | #include <ktrader.h> |
66 | #else // KAB_EMBEDDED | 67 | #else // KAB_EMBEDDED |
67 | #include <mergewidget.h> | 68 | #include <mergewidget.h> |
68 | #include <distributionlistwidget.h> | 69 | #include <distributionlistwidget.h> |
69 | #endif // KAB_EMBEDDED | 70 | #endif // KAB_EMBEDDED |
70 | 71 | ||
71 | #include "addresseewidget.h" | 72 | #include "addresseewidget.h" |
72 | #include "extensionconfigdialog.h" | 73 | #include "extensionconfigdialog.h" |
73 | #include "extensionwidget.h" | 74 | #include "extensionwidget.h" |
74 | */ | 75 | */ |
75 | 76 | ||
76 | #include "qapplication.h" | 77 | #include "qapplication.h" |
77 | 78 | ||
78 | #include "kpimglobalprefs.h" | 79 | #include "kpimglobalprefs.h" |
79 | 80 | ||
80 | #include "kdepimconfigwidget.h" | 81 | #include "kdepimconfigwidget.h" |
81 | 82 | ||
82 | 83 | ||
83 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 84 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
84 | : KPrefsWidget(prefs, parent, name ) | 85 | : KPrefsWidget(prefs, parent, name ) |
85 | { | 86 | { |
86 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 87 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
87 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 88 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
88 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 89 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
89 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 90 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
90 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 91 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
91 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 92 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
92 | 93 | ||
93 | 94 | ||
94 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 95 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
95 | KDialog::spacingHint() ); | 96 | KDialog::spacingHint() ); |
96 | 97 | ||
97 | tabWidget = new QTabWidget( this ); | 98 | tabWidget = new QTabWidget( this ); |
98 | topLayout->addWidget( tabWidget ); | 99 | topLayout->addWidget( tabWidget ); |
99 | 100 | ||
100 | 101 | ||
101 | setupLocaleTab(); | 102 | setupLocaleTab(); |
102 | setupLocaleDateTab(); | 103 | setupLocaleDateTab(); |
103 | setupTimeZoneTab(); | 104 | setupTimeZoneTab(); |
104 | setupExternalAppTab(); | 105 | setupExternalAppTab(); |
105 | 106 | ||
106 | } | 107 | } |
107 | void KDEPIMConfigWidget::showTimeZoneTab() | 108 | void KDEPIMConfigWidget::showTimeZoneTab() |
108 | { | 109 | { |
109 | tabWidget->setCurrentPage ( 2 ) ; | 110 | tabWidget->setCurrentPage ( 2 ) ; |
110 | } | 111 | } |
111 | void KDEPIMConfigWidget::setupExternalAppTab() | 112 | void KDEPIMConfigWidget::setupExternalAppTab() |
112 | { | 113 | { |
113 | QWidget *externalAppsPage = new QWidget( this ); | 114 | QWidget *externalAppsPage = new QWidget( this ); |
114 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 115 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
115 | KDialog::spacingHintSmall() ); | 116 | KDialog::spacingHintSmall() ); |
116 | 117 | ||
117 | mExternalApps = new QComboBox( externalAppsPage ); | 118 | mExternalApps = new QComboBox( externalAppsPage ); |
118 | 119 | ||
119 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 120 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
120 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 121 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
121 | mExternalApps->insertItem( it.data(), it.key() ); | 122 | mExternalApps->insertItem( it.data(), it.key() ); |
122 | 123 | ||
123 | layout->addWidget( mExternalApps ); | 124 | layout->addWidget( mExternalApps ); |
124 | 125 | ||
125 | connect( mExternalApps, SIGNAL( activated( int ) ), | 126 | connect( mExternalApps, SIGNAL( activated( int ) ), |
126 | this, SLOT (externalapp_changed( int ) ) ); | 127 | this, SLOT (externalapp_changed( int ) ) ); |
127 | 128 | ||
128 | 129 | ||
129 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 130 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
130 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 131 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
131 | 132 | ||
132 | 133 | ||
133 | mClient = new QComboBox( mExternalAppGroupBox ); | 134 | mClient = new QComboBox( mExternalAppGroupBox ); |
134 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 135 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
135 | 136 | ||
136 | connect( mClient, SIGNAL( activated( int ) ), | 137 | connect( mClient, SIGNAL( activated( int ) ), |
137 | this, SLOT (client_changed( int ) ) ); | 138 | this, SLOT (client_changed( int ) ) ); |
138 | 139 | ||
139 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); | 140 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); |
140 | boxLayout->addWidget( lab, 1, 0 ); | 141 | boxLayout->addWidget( lab, 1, 0 ); |
141 | mChannel = new QLineEdit(mExternalAppGroupBox); | 142 | mChannel = new QLineEdit(mExternalAppGroupBox); |
142 | mChannel->setReadOnly(true); | 143 | mChannel->setReadOnly(true); |
143 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); | 144 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); |
144 | 145 | ||
145 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); | 146 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); |
146 | boxLayout->addWidget( lab, 3, 0 ); | 147 | boxLayout->addWidget( lab, 3, 0 ); |
147 | mMessage = new QLineEdit(mExternalAppGroupBox); | 148 | mMessage = new QLineEdit(mExternalAppGroupBox); |
148 | mMessage->setReadOnly(true); | 149 | mMessage->setReadOnly(true); |
149 | boxLayout->addWidget( mMessage , 4, 0); | 150 | boxLayout->addWidget( mMessage , 4, 0); |
150 | 151 | ||
151 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); | 152 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); |
152 | boxLayout->addWidget( lab, 3, 1 ); | 153 | boxLayout->addWidget( lab, 3, 1 ); |
153 | mParameters = new QLineEdit(mExternalAppGroupBox); | 154 | mParameters = new QLineEdit(mExternalAppGroupBox); |
154 | mParameters->setReadOnly(true); | 155 | mParameters->setReadOnly(true); |
155 | boxLayout->addWidget( mParameters, 4, 1 ); | 156 | boxLayout->addWidget( mParameters, 4, 1 ); |
156 | 157 | ||
157 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); | 158 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); |
158 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); | 159 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); |
159 | 160 | ||
160 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); | 161 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); |
161 | boxLayout->addWidget( lab, 6, 0 ); | 162 | boxLayout->addWidget( lab, 6, 0 ); |
162 | mMessage2 = new QLineEdit(mExternalAppGroupBox); | 163 | mMessage2 = new QLineEdit(mExternalAppGroupBox); |
163 | mMessage2->setReadOnly(true); | 164 | mMessage2->setReadOnly(true); |
164 | boxLayout->addWidget( mMessage2 , 7, 0); | 165 | boxLayout->addWidget( mMessage2 , 7, 0); |
165 | 166 | ||
166 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); | 167 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); |
167 | boxLayout->addWidget( lab, 6, 1 ); | 168 | boxLayout->addWidget( lab, 6, 1 ); |
168 | mParameters2 = new QLineEdit(mExternalAppGroupBox); | 169 | mParameters2 = new QLineEdit(mExternalAppGroupBox); |
169 | mParameters2->setReadOnly(true); | 170 | mParameters2->setReadOnly(true); |
170 | boxLayout->addWidget( mParameters2, 7, 1 ); | 171 | boxLayout->addWidget( mParameters2, 7, 1 ); |
171 | 172 | ||
172 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); | 173 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); |
173 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); | 174 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); |
174 | 175 | ||
175 | 176 | ||
176 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 177 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
177 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 178 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
178 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 179 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
179 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 180 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
180 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 181 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
181 | 182 | ||
182 | 183 | ||
183 | layout->addWidget( mExternalAppGroupBox ); | 184 | layout->addWidget( mExternalAppGroupBox ); |
184 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); | 185 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); |
185 | 186 | ||
186 | } | 187 | } |
187 | 188 | ||
188 | 189 | ||
189 | void KDEPIMConfigWidget::setupLocaleDateTab() | 190 | void KDEPIMConfigWidget::setupLocaleDateTab() |
190 | { | 191 | { |
191 | QWidget *topFrame = new QWidget( this ); | 192 | QWidget *topFrame = new QWidget( this ); |
192 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); | 193 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); |
193 | 194 | ||
194 | topLayout->setSpacing(KDialog::spacingHint()); | 195 | topLayout->setSpacing(KDialog::spacingHint()); |
195 | topLayout->setMargin(KDialog::marginHint()); | 196 | topLayout->setMargin(KDialog::marginHint()); |
196 | int iii = 0; | 197 | int iii = 0; |
197 | 198 | ||
198 | 199 | ||
199 | KPrefsWidRadios *syncPrefsGroup = | 200 | KPrefsWidRadios *syncPrefsGroup = |
200 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); | 201 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); |
201 | QString format; | 202 | QString format; |
202 | if ( QApplication::desktop()->width() < 480 ) | 203 | if ( QApplication::desktop()->width() < 480 ) |
203 | format = "(%d.%m.%Y)"; | 204 | format = "(%d.%m.%Y)"; |
204 | else | 205 | else |
205 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 206 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
206 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 207 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
207 | if ( QApplication::desktop()->width() < 480 ) | 208 | if ( QApplication::desktop()->width() < 480 ) |
208 | format = "(%m.%d.%Y)"; | 209 | format = "(%m.%d.%Y)"; |
209 | else | 210 | else |
210 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 211 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
211 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 212 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
212 | if ( QApplication::desktop()->width() < 480 ) | 213 | if ( QApplication::desktop()->width() < 480 ) |
213 | format = "(%Y-%m-%d)"; | 214 | format = "(%Y-%m-%d)"; |
214 | else | 215 | else |
215 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 216 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
216 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 217 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
217 | syncPrefsGroup->addRadio(i18n("User defined")); | 218 | syncPrefsGroup->addRadio(i18n("User defined")); |
218 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 219 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
219 | ++iii; | 220 | ++iii; |
220 | ++iii; | 221 | ++iii; |
221 | QLabel * lab; | 222 | QLabel * lab; |
222 | mUserDateFormatLong = new QLineEdit(topFrame); | 223 | mUserDateFormatLong = new QLineEdit(topFrame); |
223 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 224 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
224 | topLayout->addWidget(lab ,iii,0); | 225 | topLayout->addWidget(lab ,iii,0); |
225 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 226 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
226 | ++iii; | 227 | ++iii; |
227 | mUserDateFormatShort = new QLineEdit(topFrame); | 228 | mUserDateFormatShort = new QLineEdit(topFrame); |
228 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 229 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
229 | topLayout->addWidget(lab ,iii,0); | 230 | topLayout->addWidget(lab ,iii,0); |
230 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 231 | topLayout->addWidget(mUserDateFormatShort,iii,1); |