author | zautrix <zautrix> | 2005-03-30 00:57:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 00:57:42 (UTC) |
commit | 889d2102fcfe2fb0786b3f8f406dc32b42e38c7a (patch) (unidiff) | |
tree | 32b269c1140a5646a00b65c78ac71116adb91aa1 /libkdepim | |
parent | 99324133d35ba588b688bc5b22788fd8fb9e752d (diff) | |
download | kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.zip kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.gz kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.bz2 |
fixes
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index bbed38d..5cd845e 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -1,405 +1,412 @@ | |||
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 <qvbox.h> | 39 | #include <qvbox.h> |
40 | #include <qdir.h> | 40 | #include <qdir.h> |
41 | #include <qregexp.h> | 41 | #include <qregexp.h> |
42 | 42 | ||
43 | #include <kdialog.h> | 43 | #include <kdialog.h> |
44 | #include <kprefsdialog.h> | 44 | #include <kprefsdialog.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kdateedit.h> | 46 | #include <kdateedit.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | 49 | ||
50 | /*US | 50 | /*US |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | #include <qframe.h> | 52 | #include <qframe.h> |
53 | #include <qpushbutton.h> | 53 | #include <qpushbutton.h> |
54 | #include <qcombobox.h> | 54 | #include <qcombobox.h> |
55 | #include <qlineedit.h> | 55 | #include <qlineedit.h> |
56 | #include <qlabel.h> | 56 | #include <qlabel.h> |
57 | #include <qfile.h> | 57 | #include <qfile.h> |
58 | 58 | ||
59 | #include <kconfig.h> | 59 | #include <kconfig.h> |
60 | #include <kdebug.h> | 60 | #include <kdebug.h> |
61 | #include <kdialog.h> | 61 | #include <kdialog.h> |
62 | #include <klistview.h> | 62 | #include <klistview.h> |
63 | #include <klocale.h> | 63 | #include <klocale.h> |
64 | #include <kglobal.h> | 64 | #include <kglobal.h> |
65 | #include <kmessagebox.h> | 65 | #include <kmessagebox.h> |
66 | #include <kstandarddirs.h> | 66 | #include <kstandarddirs.h> |
67 | 67 | ||
68 | #ifndef KAB_EMBEDDED | 68 | #ifndef KAB_EMBEDDED |
69 | #include <ktrader.h> | 69 | #include <ktrader.h> |
70 | #else // KAB_EMBEDDED | 70 | #else // KAB_EMBEDDED |
71 | #include <mergewidget.h> | 71 | #include <mergewidget.h> |
72 | #include <distributionlistwidget.h> | 72 | #include <distributionlistwidget.h> |
73 | #endif // KAB_EMBEDDED | 73 | #endif // KAB_EMBEDDED |
74 | 74 | ||
75 | #include "addresseewidget.h" | 75 | #include "addresseewidget.h" |
76 | #include "extensionconfigdialog.h" | 76 | #include "extensionconfigdialog.h" |
77 | #include "extensionwidget.h" | 77 | #include "extensionwidget.h" |
78 | */ | 78 | */ |
79 | 79 | ||
80 | #include "qapplication.h" | 80 | #include "qapplication.h" |
81 | 81 | ||
82 | #include "kpimglobalprefs.h" | 82 | #include "kpimglobalprefs.h" |
83 | 83 | ||
84 | #include "kdepimconfigwidget.h" | 84 | #include "kdepimconfigwidget.h" |
85 | #include <kprefs.h> | 85 | #include <kprefs.h> |
86 | 86 | ||
87 | 87 | ||
88 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 88 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
89 | : KPrefsWidget(prefs, parent, name ) | 89 | : KPrefsWidget(prefs, parent, name ) |
90 | { | 90 | { |
91 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 91 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
92 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 92 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
93 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 93 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
94 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 94 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
95 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 95 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
96 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 96 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
97 | 97 | ||
98 | 98 | ||
99 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 99 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
100 | KDialog::spacingHint() ); | 100 | KDialog::spacingHint() ); |
101 | 101 | ||
102 | tabWidget = new QTabWidget( this ); | 102 | tabWidget = new QTabWidget( this ); |
103 | topLayout->addWidget( tabWidget ); | 103 | topLayout->addWidget( tabWidget ); |
104 | 104 | ||
105 | 105 | ||
106 | setupLocaleTab(); | 106 | setupLocaleTab(); |
107 | setupLocaleDateTab(); | 107 | setupLocaleDateTab(); |
108 | setupTimeZoneTab(); | 108 | setupTimeZoneTab(); |
109 | setupExternalAppTab(); | 109 | setupExternalAppTab(); |
110 | setupStoreTab(); | 110 | setupStoreTab(); |
111 | 111 | ||
112 | } | 112 | } |
113 | void KDEPIMConfigWidget::showTimeZoneTab() | 113 | void KDEPIMConfigWidget::showTimeZoneTab() |
114 | { | 114 | { |
115 | tabWidget->setCurrentPage ( 3 ) ; | 115 | tabWidget->setCurrentPage ( 3 ) ; |
116 | } | 116 | } |
117 | void KDEPIMConfigWidget::setupStoreTab() | 117 | void KDEPIMConfigWidget::setupStoreTab() |
118 | { | 118 | { |
119 | QVBox *storePage = new QVBox( this ); | 119 | QVBox *storePage = new QVBox( this ); |
120 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); | 120 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); |
121 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 121 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
122 | mStoreUrl = new KURLRequester( storePage ); | 122 | mStoreUrl = new KURLRequester( storePage ); |
123 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 123 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
124 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 124 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
125 | QHBox *bb = new QHBox( storePage ); | 125 | QHBox *bb = new QHBox( storePage ); |
126 | QPushButton * pb; | 126 | QPushButton * pb; |
127 | if ( QApplication::desktop()->width() < 640 ) | 127 | if ( QApplication::desktop()->width() < 640 ) |
128 | pb = new QPushButton ( i18n("Save"), bb ); | 128 | pb = new QPushButton ( i18n("Save"), bb ); |
129 | else | 129 | else |
130 | pb = new QPushButton ( i18n("Save settings"), bb ); | 130 | pb = new QPushButton ( i18n("Save settings"), bb ); |
131 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 131 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
132 | pb = new QPushButton ( i18n("Save standard"), bb ); | 132 | pb = new QPushButton ( i18n("Save standard"), bb ); |
133 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 133 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
134 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 134 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
135 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 135 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
136 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 136 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
137 | } | 137 | } |
138 | void KDEPIMConfigWidget::setStandardStore() | 138 | void KDEPIMConfigWidget::setStandardStore() |
139 | { | 139 | { |
140 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 140 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
141 | saveStoreSettings(); | 141 | saveStoreSettings(); |
142 | } | 142 | } |
143 | void KDEPIMConfigWidget::saveStoreSettings() | 143 | void KDEPIMConfigWidget::saveStoreSettings() |
144 | { | 144 | { |
145 | if ( !mStoreUrl->url().isEmpty() ) { | 145 | if ( !mStoreUrl->url().isEmpty() ) { |
146 | KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); | 146 | QString path = QDir::homeDirPath(); |
147 | QString url = mStoreUrl->url(); | ||
148 | #ifdef DESKTOP_VERSION | ||
149 | if ( url.startsWith( "LOCAL:" ) ) { | ||
150 | path = qApp->applicationDirPath () ; | ||
151 | } | ||
152 | #endif | ||
153 | KConfig cfg ( path + "/.microkdehome" ); | ||
147 | cfg.setGroup("Global"); | 154 | cfg.setGroup("Global"); |
148 | cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); | 155 | cfg.writeEntry( "MICROKDEHOME", url ); |
149 | qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); | 156 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
150 | cfg.sync(); | 157 | cfg.sync(); |
151 | } else { | 158 | } else { |
152 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 159 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
153 | saveStoreSettings(); | 160 | saveStoreSettings(); |
154 | } | 161 | } |
155 | } | 162 | } |
156 | void KDEPIMConfigWidget::setupExternalAppTab() | 163 | void KDEPIMConfigWidget::setupExternalAppTab() |
157 | { | 164 | { |
158 | QWidget *externalAppsPage = new QWidget( this ); | 165 | QWidget *externalAppsPage = new QWidget( this ); |
159 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 166 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
160 | KDialog::spacingHintSmall() ); | 167 | KDialog::spacingHintSmall() ); |
161 | 168 | ||
162 | mExternalApps = new QComboBox( externalAppsPage ); | 169 | mExternalApps = new QComboBox( externalAppsPage ); |
163 | 170 | ||
164 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 171 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
165 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 172 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
166 | mExternalApps->insertItem( it.data(), it.key() ); | 173 | mExternalApps->insertItem( it.data(), it.key() ); |
167 | 174 | ||
168 | layout->addWidget( mExternalApps ); | 175 | layout->addWidget( mExternalApps ); |
169 | 176 | ||
170 | connect( mExternalApps, SIGNAL( activated( int ) ), | 177 | connect( mExternalApps, SIGNAL( activated( int ) ), |
171 | this, SLOT (externalapp_changed( int ) ) ); | 178 | this, SLOT (externalapp_changed( int ) ) ); |
172 | 179 | ||
173 | 180 | ||
174 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 181 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
175 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 182 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
176 | mExternalAppGroupBox->layout()->setMargin(5); | 183 | mExternalAppGroupBox->layout()->setMargin(5); |
177 | 184 | ||
178 | mClient = new QComboBox( mExternalAppGroupBox ); | 185 | mClient = new QComboBox( mExternalAppGroupBox ); |
179 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 186 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
180 | 187 | ||
181 | connect( mClient, SIGNAL( activated( int ) ), | 188 | connect( mClient, SIGNAL( activated( int ) ), |
182 | this, SLOT (client_changed( int ) ) ); | 189 | this, SLOT (client_changed( int ) ) ); |
183 | 190 | ||
184 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); | 191 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); |
185 | boxLayout->addWidget( lab, 1, 0 ); | 192 | boxLayout->addWidget( lab, 1, 0 ); |
186 | mChannel = new QLineEdit(mExternalAppGroupBox); | 193 | mChannel = new QLineEdit(mExternalAppGroupBox); |
187 | mChannel->setReadOnly(true); | 194 | mChannel->setReadOnly(true); |
188 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); | 195 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); |
189 | 196 | ||
190 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); | 197 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); |
191 | boxLayout->addWidget( lab, 3, 0 ); | 198 | boxLayout->addWidget( lab, 3, 0 ); |
192 | mMessage = new QLineEdit(mExternalAppGroupBox); | 199 | mMessage = new QLineEdit(mExternalAppGroupBox); |
193 | mMessage->setReadOnly(true); | 200 | mMessage->setReadOnly(true); |
194 | boxLayout->addWidget( mMessage , 4, 0); | 201 | boxLayout->addWidget( mMessage , 4, 0); |
195 | 202 | ||
196 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); | 203 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); |
197 | boxLayout->addWidget( lab, 3, 1 ); | 204 | boxLayout->addWidget( lab, 3, 1 ); |
198 | mParameters = new QLineEdit(mExternalAppGroupBox); | 205 | mParameters = new QLineEdit(mExternalAppGroupBox); |
199 | mParameters->setReadOnly(true); | 206 | mParameters->setReadOnly(true); |
200 | boxLayout->addWidget( mParameters, 4, 1 ); | 207 | boxLayout->addWidget( mParameters, 4, 1 ); |
201 | 208 | ||
202 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); | 209 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); |
203 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); | 210 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); |
204 | 211 | ||
205 | 212 | ||
206 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); | 213 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); |
207 | boxLayout->addWidget( lab, 6, 0 ); | 214 | boxLayout->addWidget( lab, 6, 0 ); |
208 | mMessage2 = new QLineEdit(mExternalAppGroupBox); | 215 | mMessage2 = new QLineEdit(mExternalAppGroupBox); |
209 | mMessage2->setReadOnly(true); | 216 | mMessage2->setReadOnly(true); |
210 | boxLayout->addWidget( mMessage2 , 7, 0); | 217 | boxLayout->addWidget( mMessage2 , 7, 0); |
211 | 218 | ||
212 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); | 219 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); |
213 | boxLayout->addWidget( lab, 6, 1 ); | 220 | boxLayout->addWidget( lab, 6, 1 ); |
214 | mParameters2 = new QLineEdit(mExternalAppGroupBox); | 221 | mParameters2 = new QLineEdit(mExternalAppGroupBox); |
215 | mParameters2->setReadOnly(true); | 222 | mParameters2->setReadOnly(true); |
216 | boxLayout->addWidget( mParameters2, 7, 1 ); | 223 | boxLayout->addWidget( mParameters2, 7, 1 ); |
217 | 224 | ||
218 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); | 225 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); |
219 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); | 226 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); |
220 | 227 | ||
221 | 228 | ||
222 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 229 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
223 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 230 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
224 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 231 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
225 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 232 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
226 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 233 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
227 | 234 | ||
228 | 235 | ||
229 | layout->addWidget( mExternalAppGroupBox ); | 236 | layout->addWidget( mExternalAppGroupBox ); |
230 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); | 237 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); |
231 | 238 | ||
232 | } | 239 | } |
233 | 240 | ||
234 | 241 | ||
235 | void KDEPIMConfigWidget::setupLocaleDateTab() | 242 | void KDEPIMConfigWidget::setupLocaleDateTab() |
236 | { | 243 | { |
237 | QWidget *topFrame = new QWidget( this ); | 244 | QWidget *topFrame = new QWidget( this ); |
238 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); | 245 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); |
239 | 246 | ||
240 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 247 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
241 | topLayout->setMargin(KDialog::marginHintSmall()); | 248 | topLayout->setMargin(KDialog::marginHintSmall()); |
242 | int iii = 0; | 249 | int iii = 0; |
243 | 250 | ||
244 | 251 | ||
245 | KPrefsWidRadios *syncPrefsGroup = | 252 | KPrefsWidRadios *syncPrefsGroup = |
246 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); | 253 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); |
247 | QString format; | 254 | QString format; |
248 | if ( QApplication::desktop()->width() < 480 ) | 255 | if ( QApplication::desktop()->width() < 480 ) |
249 | format = "(%d.%m.%Y)"; | 256 | format = "(%d.%m.%Y)"; |
250 | else | 257 | else |
251 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 258 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
252 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 259 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
253 | if ( QApplication::desktop()->width() < 480 ) | 260 | if ( QApplication::desktop()->width() < 480 ) |
254 | format = "(%m.%d.%Y)"; | 261 | format = "(%m.%d.%Y)"; |
255 | else | 262 | else |
256 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 263 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
257 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 264 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
258 | if ( QApplication::desktop()->width() < 480 ) | 265 | if ( QApplication::desktop()->width() < 480 ) |
259 | format = "(%Y-%m-%d)"; | 266 | format = "(%Y-%m-%d)"; |
260 | else | 267 | else |
261 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 268 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
262 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 269 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
263 | syncPrefsGroup->addRadio(i18n("User defined")); | 270 | syncPrefsGroup->addRadio(i18n("User defined")); |
264 | if ( QApplication::desktop()->width() < 480 ) { | 271 | if ( QApplication::desktop()->width() < 480 ) { |
265 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 272 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
266 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 273 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
267 | } | 274 | } |
268 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 275 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
269 | ++iii; | 276 | ++iii; |
270 | ++iii; | 277 | ++iii; |
271 | QLabel * lab; | 278 | QLabel * lab; |
272 | mUserDateFormatLong = new QLineEdit(topFrame); | 279 | mUserDateFormatLong = new QLineEdit(topFrame); |
273 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 280 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
274 | topLayout->addWidget(lab ,iii,0); | 281 | topLayout->addWidget(lab ,iii,0); |
275 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 282 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
276 | ++iii; | 283 | ++iii; |
277 | mUserDateFormatShort = new QLineEdit(topFrame); | 284 | mUserDateFormatShort = new QLineEdit(topFrame); |
278 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 285 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
279 | topLayout->addWidget(lab ,iii,0); | 286 | topLayout->addWidget(lab ,iii,0); |
280 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 287 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
281 | ++iii; | 288 | ++iii; |
282 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 289 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
283 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 290 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
284 | ++iii; | 291 | ++iii; |
285 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 292 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
286 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 293 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
287 | ++iii; | 294 | ++iii; |
288 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 295 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
289 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 296 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
290 | ++iii; | 297 | ++iii; |
291 | 298 | ||
292 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 299 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
293 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 300 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
294 | 301 | ||
295 | 302 | ||
296 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); | 303 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); |
297 | } | 304 | } |
298 | 305 | ||
299 | void KDEPIMConfigWidget::setupLocaleTab() | 306 | void KDEPIMConfigWidget::setupLocaleTab() |
300 | { | 307 | { |
301 | 308 | ||
302 | QWidget *topFrame = new QWidget( this ); | 309 | QWidget *topFrame = new QWidget( this ); |
303 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 310 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
304 | 311 | ||
305 | topLayout->setSpacing(KDialog::spacingHint()); | 312 | topLayout->setSpacing(KDialog::spacingHint()); |
306 | topLayout->setMargin(KDialog::marginHint()); | 313 | topLayout->setMargin(KDialog::marginHint()); |
307 | int iii = 0; | 314 | int iii = 0; |
308 | KPrefsWidRadios *syncPrefsGroup = | 315 | KPrefsWidRadios *syncPrefsGroup = |
309 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); | 316 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); |
310 | syncPrefsGroup->addRadio(i18n("English")); | 317 | syncPrefsGroup->addRadio(i18n("English")); |
311 | syncPrefsGroup->addRadio(i18n("German")); | 318 | syncPrefsGroup->addRadio(i18n("German")); |
312 | syncPrefsGroup->addRadio(i18n("French")); | 319 | syncPrefsGroup->addRadio(i18n("French")); |
313 | syncPrefsGroup->addRadio(i18n("Italian")); | 320 | syncPrefsGroup->addRadio(i18n("Italian")); |
314 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 321 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
315 | if ( QApplication::desktop()->width() < 300 ) { | 322 | if ( QApplication::desktop()->width() < 300 ) { |
316 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 323 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
317 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 324 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
318 | } | 325 | } |
319 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 326 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
320 | ++iii; | 327 | ++iii; |
321 | 328 | ||
322 | 329 | ||
323 | tabWidget->addTab( topFrame, i18n( "Language" ) ); | 330 | tabWidget->addTab( topFrame, i18n( "Language" ) ); |
324 | topFrame = new QWidget( this ); | 331 | topFrame = new QWidget( this ); |
325 | topLayout = new QGridLayout(topFrame,4,2); | 332 | topLayout = new QGridLayout(topFrame,4,2); |
326 | 333 | ||
327 | topLayout->setSpacing(KDialog::spacingHint()); | 334 | topLayout->setSpacing(KDialog::spacingHint()); |
328 | topLayout->setMargin(KDialog::marginHint()); | 335 | topLayout->setMargin(KDialog::marginHint()); |
329 | iii = 0; | 336 | iii = 0; |
330 | syncPrefsGroup = | 337 | syncPrefsGroup = |
331 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); | 338 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); |
332 | if ( QApplication::desktop()->width() > 300 ) | 339 | if ( QApplication::desktop()->width() > 300 ) |
333 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 340 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
334 | syncPrefsGroup->addRadio(i18n("24:00")); | 341 | syncPrefsGroup->addRadio(i18n("24:00")); |
335 | syncPrefsGroup->addRadio(i18n("12:00am")); | 342 | syncPrefsGroup->addRadio(i18n("12:00am")); |
336 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 343 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
337 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 344 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
338 | ++iii; | 345 | ++iii; |
339 | 346 | ||
340 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), | 347 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), |
341 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); | 348 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); |
342 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 349 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
343 | ++iii; | 350 | ++iii; |
344 | 351 | ||
345 | 352 | ||
346 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); | 353 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); |
347 | 354 | ||
348 | } | 355 | } |
349 | 356 | ||
350 | 357 | ||
351 | void KDEPIMConfigWidget::setupTimeZoneTab() | 358 | void KDEPIMConfigWidget::setupTimeZoneTab() |
352 | { | 359 | { |
353 | QWidget *topFrame; | 360 | QWidget *topFrame; |
354 | QGridLayout *topLayout ; | 361 | QGridLayout *topLayout ; |
355 | 362 | ||
356 | 363 | ||
357 | 364 | ||
358 | 365 | ||
359 | 366 | ||
360 | 367 | ||
361 | topFrame = new QWidget( this ); | 368 | topFrame = new QWidget( this ); |
362 | topLayout = new QGridLayout( topFrame, 5, 2); | 369 | topLayout = new QGridLayout( topFrame, 5, 2); |
363 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 370 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
364 | topLayout->setMargin(KDialog::marginHintSmall()); | 371 | topLayout->setMargin(KDialog::marginHintSmall()); |
365 | 372 | ||
366 | QHBox *timeZoneBox = new QHBox( topFrame ); | 373 | QHBox *timeZoneBox = new QHBox( topFrame ); |
367 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | 374 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); |
368 | 375 | ||
369 | new QLabel( i18n("Timezone:"), timeZoneBox ); | 376 | new QLabel( i18n("Timezone:"), timeZoneBox ); |
370 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | 377 | mTimeZoneCombo = new QComboBox( timeZoneBox ); |
371 | if ( QApplication::desktop()->width() < 300 ) { | 378 | if ( QApplication::desktop()->width() < 300 ) { |
372 | mTimeZoneCombo->setMaximumWidth(150); | 379 | mTimeZoneCombo->setMaximumWidth(150); |
373 | } | 380 | } |
374 | 381 | ||
375 | QStringList list; | 382 | QStringList list; |
376 | list = KGlobal::locale()->timeZoneList(); | 383 | list = KGlobal::locale()->timeZoneList(); |
377 | mTimeZoneCombo->insertStringList(list); | 384 | mTimeZoneCombo->insertStringList(list); |
378 | 385 | ||
379 | // find the currently set time zone and select it | 386 | // find the currently set time zone and select it |
380 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; | 387 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; |
381 | int nCurrentlySet = 11; | 388 | int nCurrentlySet = 11; |
382 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | 389 | for (int i = 0; i < mTimeZoneCombo->count(); i++) |
383 | { | 390 | { |
384 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | 391 | if (mTimeZoneCombo->text(i) == sCurrentlySet) |
385 | { | 392 | { |
386 | nCurrentlySet = i; | 393 | nCurrentlySet = i; |
387 | break; | 394 | break; |
388 | } | 395 | } |
389 | } | 396 | } |
390 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | 397 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); |
391 | int iii = 1; | 398 | int iii = 1; |
392 | KPrefsWidBool *sb = | 399 | KPrefsWidBool *sb = |
393 | addWidBool(i18n("Add 30 min to selected Timezone"), | 400 | addWidBool(i18n("Add 30 min to selected Timezone"), |
394 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); | 401 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); |
395 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 402 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
396 | ++iii; | 403 | ++iii; |
397 | sb = | 404 | sb = |
398 | addWidBool(i18n("Timezone has daylight saving"), | 405 | addWidBool(i18n("Timezone has daylight saving"), |
399 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); | 406 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); |
400 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 407 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
401 | ++iii; | 408 | ++iii; |
402 | QLabel* lab; | 409 | QLabel* lab; |
403 | 410 | ||
404 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | 411 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); |
405 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 412 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |