summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp4
-rw-r--r--kmicromail/koprefsdialog.cpp4
-rw-r--r--microkde/kutils/kcmultidialog.cpp4
3 files changed, 9 insertions, 3 deletions
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 986c9b8..8a4dd3d 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -1,416 +1,418 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@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 <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qtabwidget.h> 29#include <qtabwidget.h>
30#include <qcombobox.h> 30#include <qcombobox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qvbox.h> 34#include <qvbox.h>
35 35
36#include <kconfig.h> 36#include <kconfig.h>
37#include <kdebug.h> 37#include <kdebug.h>
38#include <kdialog.h> 38#include <kdialog.h>
39#include <klistview.h> 39#include <klistview.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kglobal.h> 41#include <kglobal.h>
42#include <kmessagebox.h> 42#include <kmessagebox.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44 44
45#ifndef KAB_EMBEDDED 45#ifndef KAB_EMBEDDED
46#include <ktrader.h> 46#include <ktrader.h>
47#else // KAB_EMBEDDED 47#else // KAB_EMBEDDED
48#include <mergewidget.h> 48#include <mergewidget.h>
49#include <distributionlistwidget.h> 49#include <distributionlistwidget.h>
50#endif // KAB_EMBEDDED 50#endif // KAB_EMBEDDED
51 51
52#include "addresseewidget.h" 52#include "addresseewidget.h"
53#include "extensionconfigdialog.h" 53#include "extensionconfigdialog.h"
54#include "extensionwidget.h" 54#include "extensionwidget.h"
55#include "kabprefs.h" 55#include "kabprefs.h"
56 56
57#include "kabconfigwidget.h" 57#include "kabconfigwidget.h"
58#include <kglobalsettings.h>
58 59
59class ExtensionItem : public QCheckListItem 60class ExtensionItem : public QCheckListItem
60{ 61{
61 public: 62 public:
62 63
63#ifndef KAB_EMBEDDED 64#ifndef KAB_EMBEDDED
64 ExtensionItem( QListView *parent, const QString &text ); 65 ExtensionItem( QListView *parent, const QString &text );
65 void setService( const KService::Ptr &ptr ); 66 void setService( const KService::Ptr &ptr );
66#else //KAB_EMBEDDED 67#else //KAB_EMBEDDED
67 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); 68 ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment );
68 void setFactory( ExtensionFactory* fac ); 69 void setFactory( ExtensionFactory* fac );
69#endif //KAB_EMBEDDED 70#endif //KAB_EMBEDDED
70 71
71 bool configWidgetAvailable() const; 72 bool configWidgetAvailable() const;
72 ExtensionFactory *factory() const; 73 ExtensionFactory *factory() const;
73 74
74 virtual QString text( int column ) const; 75 virtual QString text( int column ) const;
75 76
76 private: 77 private:
77#ifndef KAB_EMBEDDED 78#ifndef KAB_EMBEDDED
78 KService::Ptr mPtr; 79 KService::Ptr mPtr;
79#else //KAB_EMBEDDED 80#else //KAB_EMBEDDED
80 ExtensionFactory* mFactory; 81 ExtensionFactory* mFactory;
81 QString mName; 82 QString mName;
82 QString mComment; 83 QString mComment;
83 84
84#endif //KAB_EMBEDDED 85#endif //KAB_EMBEDDED
85 86
86}; 87};
87 88
88KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) 89KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name )
89 : KPrefsWidget( prefs, parent, name ) 90 : KPrefsWidget( prefs, parent, name )
90{ 91{
92
91 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 93 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
92 KDialog::spacingHint() ); 94 KDialog::spacingHintSmall() );
93 95
94 QTabWidget *tabWidget = new QTabWidget( this ); 96 QTabWidget *tabWidget = new QTabWidget( this );
95 topLayout->addWidget( tabWidget ); 97 topLayout->addWidget( tabWidget );
96 98
97 // General page 99 // General page
98 QWidget *generalPage = new QWidget( this ); 100 QWidget *generalPage = new QWidget( this );
99 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 101 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(),
100 KDialog::spacingHintSmall() ); 102 KDialog::spacingHintSmall() );
101 103
102 104
103 QWidget *hBox = new QWidget( generalPage, "qhbox" ); 105 QWidget *hBox = new QWidget( generalPage, "qhbox" );
104 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); 106 QHBoxLayout *hboxLayout = new QHBoxLayout( hBox);
105 KPrefsWidFont *detailsFont = 107 KPrefsWidFont *detailsFont =
106 addWidFont(i18n("phone:123"),i18n("Details view font"), 108 addWidFont(i18n("phone:123"),i18n("Details view font"),
107 &(KABPrefs::instance()->mDetailsFont),hBox); 109 &(KABPrefs::instance()->mDetailsFont),hBox);
108 hboxLayout->addWidget(detailsFont->label()); 110 hboxLayout->addWidget(detailsFont->label());
109 hboxLayout->addWidget(detailsFont->preview()); 111 hboxLayout->addWidget(detailsFont->preview());
110 hboxLayout->addWidget(detailsFont->button()); 112 hboxLayout->addWidget(detailsFont->button());
111 hboxLayout->setMargin(KDialog::marginHintSmall() ); 113 hboxLayout->setMargin(KDialog::marginHintSmall() );
112 hboxLayout->setSpacing(KDialog::spacingHintSmall()); 114 hboxLayout->setSpacing(KDialog::spacingHintSmall());
113 //hBox->setBackgroundColor( black); 115 //hBox->setBackgroundColor( black);
114 layout->addWidget( hBox ); 116 layout->addWidget( hBox );
115 117
116 //general groupbox 118 //general groupbox
117 QWidget *vBox = new QWidget( generalPage, "qvbox" ); 119 QWidget *vBox = new QWidget( generalPage, "qvbox" );
118 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 120 QVBoxLayout *boxLayout = new QVBoxLayout( vBox );
119 boxLayout->setAlignment( Qt::AlignTop ); 121 boxLayout->setAlignment( Qt::AlignTop );
120 boxLayout->setMargin(KDialog::marginHintSmall() ); 122 boxLayout->setMargin(KDialog::marginHintSmall() );
121 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 123 boxLayout->setSpacing( KDialog::spacingHintSmall() );
122 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 124 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
123 boxLayout->addWidget( mMenuBarBox ); 125 boxLayout->addWidget( mMenuBarBox );
124 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 126 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
125 boxLayout->addWidget( mSearchReturnBox ); 127 boxLayout->addWidget( mSearchReturnBox );
126 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); 128 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
127 boxLayout->addWidget( mAutoSearchWithWildcardBox); 129 boxLayout->addWidget( mAutoSearchWithWildcardBox);
128 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); 130 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
129 boxLayout->addWidget( mHideSearchOnSwitchBox ); 131 boxLayout->addWidget( mHideSearchOnSwitchBox );
130 132
131#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
132 mHideSearchOnSwitchBox->hide(); 134 mHideSearchOnSwitchBox->hide();
133#endif 135#endif
134 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); 136 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" );
135 boxLayout->addWidget( mViewsSingleClickBox ); 137 boxLayout->addWidget( mViewsSingleClickBox );
136 138
137 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" ); 139 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" );
138 boxLayout->addWidget( mNameParsing ); 140 boxLayout->addWidget( mNameParsing );
139 141
140 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 142 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
141 boxLayout->addWidget( mMultipleViewsAtOnce ); 143 boxLayout->addWidget( mMultipleViewsAtOnce );
142 144
143 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); 145 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" );
144 boxLayout->addWidget( mAskForQuit ); 146 boxLayout->addWidget( mAskForQuit );
145 147
146 layout->addWidget( vBox ); 148 layout->addWidget( vBox );
147 149
148 tabWidget->addTab( generalPage, i18n( "General" ) ); 150 tabWidget->addTab( generalPage, i18n( "General" ) );
149 151
150 // Extension page 152 // Extension page
151 QWidget *extensionPage = new QWidget( this ); 153 QWidget *extensionPage = new QWidget( this );
152 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), 154 QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(),
153 KDialog::spacingHintSmall() ); 155 KDialog::spacingHintSmall() );
154 156
155 //extensions groupbox 157 //extensions groupbox
156 158
157 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); 159 QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage );
158 boxLayout = new QVBoxLayout( groupBox->layout() ); 160 boxLayout = new QVBoxLayout( groupBox->layout() );
159 boxLayout->setAlignment( Qt::AlignTop ); 161 boxLayout->setAlignment( Qt::AlignTop );
160 boxLayout->setMargin(KDialog::marginHintSmall()); 162 boxLayout->setMargin(KDialog::marginHintSmall());
161 boxLayout->setSpacing(KDialog::spacingHintSmall()); 163 boxLayout->setSpacing(KDialog::spacingHintSmall());
162 groupBox->layout()->setMargin(1) ; 164 groupBox->layout()->setMargin(1) ;
163 groupBox->layout()->setSpacing(0); 165 groupBox->layout()->setSpacing(0);
164 mExtensionView = new KListView( groupBox ); 166 mExtensionView = new KListView( groupBox );
165 mExtensionView->setAllColumnsShowFocus( true ); 167 mExtensionView->setAllColumnsShowFocus( true );
166 mExtensionView->addColumn( i18n( "Name" ) ); 168 mExtensionView->addColumn( i18n( "Name" ) );
167 mExtensionView->addColumn( i18n( "Description" ) ); 169 mExtensionView->addColumn( i18n( "Description" ) );
168 //mExtensionView->setMaximumHeight(80); 170 //mExtensionView->setMaximumHeight(80);
169 171
170 boxLayout->addWidget( mExtensionView ); 172 boxLayout->addWidget( mExtensionView );
171 173
172 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 174 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
173 mConfigureButton->setEnabled( false ); 175 mConfigureButton->setEnabled( false );
174 boxLayout->addWidget( mConfigureButton ); 176 boxLayout->addWidget( mConfigureButton );
175 177
176 extensionLayout->addWidget( groupBox ); 178 extensionLayout->addWidget( groupBox );
177 179
178 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 180 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
179 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 181 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
180 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 182 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
181 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 183 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
182 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 184 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
183 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 185 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
184 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 186 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
185 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 187 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
186 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 188 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
187 SLOT( selectionChanged( QListViewItem* ) ) ); 189 SLOT( selectionChanged( QListViewItem* ) ) );
188 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 190 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
189 SLOT( itemClicked( QListViewItem* ) ) ); 191 SLOT( itemClicked( QListViewItem* ) ) );
190 connect( mConfigureButton, SIGNAL( clicked() ), 192 connect( mConfigureButton, SIGNAL( clicked() ),
191 SLOT( configureExtension() ) ); 193 SLOT( configureExtension() ) );
192 194
193 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 195 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
194 196
195 // Addressee page 197 // Addressee page
196 mAddresseeWidget = new AddresseeWidget( this ); 198 mAddresseeWidget = new AddresseeWidget( this );
197 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 199 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
198 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 200 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
199 201
200} 202}
201 203
202void KABConfigWidget::usrReadConfig() 204void KABConfigWidget::usrReadConfig()
203{ 205{
204 KABPrefs* prefs = KABPrefs::instance(); 206 KABPrefs* prefs = KABPrefs::instance();
205 207
206 bool blocked = signalsBlocked(); 208 bool blocked = signalsBlocked();
207 blockSignals( true ); 209 blockSignals( true );
208 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); 210 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
209 mNameParsing->setChecked( prefs->mAutomaticNameParsing ); 211 mNameParsing->setChecked( prefs->mAutomaticNameParsing );
210 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); 212 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
211 mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); 213 mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
212 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); 214 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
213 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); 215 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
214 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); 216 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
215 mAskForQuit->setChecked( prefs->mAskForQuit ); 217 mAskForQuit->setChecked( prefs->mAskForQuit );
216 218
217 mAddresseeWidget->restoreSettings(); 219 mAddresseeWidget->restoreSettings();
218 220
219 restoreExtensionSettings(); 221 restoreExtensionSettings();
220 222
221 blockSignals( blocked ); 223 blockSignals( blocked );
222 224
223} 225}
224 226
225void KABConfigWidget::usrWriteConfig() 227void KABConfigWidget::usrWriteConfig()
226{ 228{
227 KABPrefs* prefs = KABPrefs::instance(); 229 KABPrefs* prefs = KABPrefs::instance();
228 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); 230 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
229 prefs->mAutomaticNameParsing = mNameParsing->isChecked(); 231 prefs->mAutomaticNameParsing = mNameParsing->isChecked();
230 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 232 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
231 prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); 233 prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
232 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); 234 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
233 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); 235 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
234 236
235 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); 237 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
236 prefs->mAskForQuit = mAskForQuit->isChecked(); 238 prefs->mAskForQuit = mAskForQuit->isChecked();
237 239
238 mAddresseeWidget->saveSettings(); 240 mAddresseeWidget->saveSettings();
239 241
240 saveExtensionSettings(); 242 saveExtensionSettings();
241 243
242} 244}
243 245
244void KABConfigWidget::restoreExtensionSettings() 246void KABConfigWidget::restoreExtensionSettings()
245{ 247{
246 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 248 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
247 249
248 mExtensionView->clear(); 250 mExtensionView->clear();
249 251
250#ifndef KAB_EMBEDDED 252#ifndef KAB_EMBEDDED
251 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); 253 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" );
252 KTrader::OfferList::ConstIterator it; 254 KTrader::OfferList::ConstIterator it;
253 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 255 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
254 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) 256 if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) )
255 continue; 257 continue;
256 258
257 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); 259 ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() );
258 item->setService( *it ); 260 item->setService( *it );
259 if ( activeExtensions.contains( item->factory()->identifier() ) ) 261 if ( activeExtensions.contains( item->factory()->identifier() ) )
260 item->setOn( true ); 262 item->setOn( true );
261 } 263 }
262#else //KAB_EMBEDDED 264#else //KAB_EMBEDDED
263 ExtensionFactory *extensionFactory = new MergeFactory(); 265 ExtensionFactory *extensionFactory = new MergeFactory();
264 266
265 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); 267 ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts");
266 268
267 item->setFactory( extensionFactory ); 269 item->setFactory( extensionFactory );
268 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 270 if ( activeExtensions.contains( extensionFactory->identifier() ) )
269 item->setOn( true ); 271 item->setOn( true );
270 272
271 273
272 274
273 extensionFactory = new DistributionListFactory(); 275 extensionFactory = new DistributionListFactory();
274 276
275 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists"); 277 item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists");
276 278
277 item->setFactory( extensionFactory ); 279 item->setFactory( extensionFactory );
278 if ( activeExtensions.contains( extensionFactory->identifier() ) ) 280 if ( activeExtensions.contains( extensionFactory->identifier() ) )
279 item->setOn( true ); 281 item->setOn( true );
280 282
281 283
282#endif //KAB_EMBEDDED 284#endif //KAB_EMBEDDED
283 285
284} 286}
285 287
286void KABConfigWidget::saveExtensionSettings() 288void KABConfigWidget::saveExtensionSettings()
287{ 289{
288 QStringList activeExtensions; 290 QStringList activeExtensions;
289 291
290 QPtrList<QListViewItem> list; 292 QPtrList<QListViewItem> list;
291 QListViewItemIterator it( mExtensionView ); 293 QListViewItemIterator it( mExtensionView );
292 while ( it.current() ) { 294 while ( it.current() ) {
293 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); 295 ExtensionItem *item = static_cast<ExtensionItem*>( it.current() );
294 if ( item ) { 296 if ( item ) {
295 if ( item->isOn() ) 297 if ( item->isOn() )
296 activeExtensions.append( item->factory()->identifier() ); 298 activeExtensions.append( item->factory()->identifier() );
297 } 299 }
298 ++it; 300 ++it;
299 } 301 }
300 302
301 KABPrefs::instance()->mActiveExtensions = activeExtensions; 303 KABPrefs::instance()->mActiveExtensions = activeExtensions;
302} 304}
303 305
304void KABConfigWidget::configureExtension() 306void KABConfigWidget::configureExtension()
305{ 307{
306 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() ); 308 ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() );
307 if ( !item ) 309 if ( !item )
308 return; 310 return;
309 311
310#ifndef KAB_EMBEDDED 312#ifndef KAB_EMBEDDED
311 KConfig config( "kaddressbookrc" ); 313 KConfig config( "kaddressbookrc" );
312#else //KAB_EMBEDDED 314#else //KAB_EMBEDDED
313 KConfig config( locateLocal("config", "kaddressbookrc") ); 315 KConfig config( locateLocal("config", "kaddressbookrc") );
314#endif //KAB_EMBEDDED 316#endif //KAB_EMBEDDED
315 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); 317 config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) );
316 318
317 ExtensionConfigDialog dlg( item->factory(), &config, this ); 319 ExtensionConfigDialog dlg( item->factory(), &config, this );
318 dlg.exec(); 320 dlg.exec();
319 321
320 config.sync(); 322 config.sync();
321} 323}
322 324
323void KABConfigWidget::selectionChanged( QListViewItem *i ) 325void KABConfigWidget::selectionChanged( QListViewItem *i )
324{ 326{
325 ExtensionItem *item = static_cast<ExtensionItem*>( i ); 327 ExtensionItem *item = static_cast<ExtensionItem*>( i );
326 if ( !item ) 328 if ( !item )
327 return; 329 return;
328 330
329 mConfigureButton->setEnabled( item->configWidgetAvailable() ); 331 mConfigureButton->setEnabled( item->configWidgetAvailable() );
330} 332}
331 333
332void KABConfigWidget::itemClicked( QListViewItem *item ) 334void KABConfigWidget::itemClicked( QListViewItem *item )
333{ 335{
334 if ( item != 0 ) 336 if ( item != 0 )
335 modified(); 337 modified();
336} 338}
337 339
338#ifndef KAB_EMBEDDED 340#ifndef KAB_EMBEDDED
339ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) 341ExtensionItem::ExtensionItem( QListView *parent, const QString &text )
340 : QCheckListItem( parent, text, CheckBox ) 342 : QCheckListItem( parent, text, CheckBox )
341{ 343{
342} 344}
343 345
344void ExtensionItem::setService( const KService::Ptr &ptr ) 346void ExtensionItem::setService( const KService::Ptr &ptr )
345{ 347{
346 mPtr = ptr; 348 mPtr = ptr;
347} 349}
348#else //KAB_EMBEDDED 350#else //KAB_EMBEDDED
349ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) 351ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment )
350 : QCheckListItem( parent, text, CheckBox ) 352 : QCheckListItem( parent, text, CheckBox )
351{ 353{
352 mName = name; 354 mName = name;
353 mComment = comment; 355 mComment = comment;
354} 356}
355 357
356 358
357void ExtensionItem::setFactory( ExtensionFactory* fac ) 359void ExtensionItem::setFactory( ExtensionFactory* fac )
358{ 360{
359 mFactory = fac; 361 mFactory = fac;
360} 362}
361#endif //KAB_EMBEDDED 363#endif //KAB_EMBEDDED
362 364
363bool ExtensionItem::configWidgetAvailable() const 365bool ExtensionItem::configWidgetAvailable() const
364{ 366{
365#ifndef KAB_EMBEDDED 367#ifndef KAB_EMBEDDED
366 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); 368 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() );
367 if ( !factory ) 369 if ( !factory )
368 return false; 370 return false;
369 371
370 ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); 372 ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory );
371 if ( !extensionFactory ) 373 if ( !extensionFactory )
372 return false; 374 return false;
373 375
374 return extensionFactory->configureWidgetAvailable(); 376 return extensionFactory->configureWidgetAvailable();
375#else //KAB_EMBEDDED 377#else //KAB_EMBEDDED
376 return mFactory->configureWidgetAvailable(); 378 return mFactory->configureWidgetAvailable();
377#endif //KAB_EMBEDDED 379#endif //KAB_EMBEDDED
378 380
379} 381}
380 382
381ExtensionFactory *ExtensionItem::factory() const 383ExtensionFactory *ExtensionItem::factory() const
382{ 384{
383#ifndef KAB_EMBEDDED 385#ifndef KAB_EMBEDDED
384 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); 386 KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() );
385 if ( !factory ) 387 if ( !factory )
386 return 0; 388 return 0;
387 389
388 return static_cast<ExtensionFactory*>( factory ); 390 return static_cast<ExtensionFactory*>( factory );
389#else //KAB_EMBEDDED 391#else //KAB_EMBEDDED
390 return mFactory; 392 return mFactory;
391#endif //KAB_EMBEDDED 393#endif //KAB_EMBEDDED
392} 394}
393 395
394QString ExtensionItem::text( int column ) const 396QString ExtensionItem::text( int column ) const
395{ 397{
396#ifndef KAB_EMBEDDED 398#ifndef KAB_EMBEDDED
397 if ( column == 0 ) 399 if ( column == 0 )
398 return mPtr->name(); 400 return mPtr->name();
399 else if ( column == 1 ) 401 else if ( column == 1 )
400 return mPtr->comment(); 402 return mPtr->comment();
401 else 403 else
402 return QString::null; 404 return QString::null;
403#else //KAB_EMBEDDED 405#else //KAB_EMBEDDED
404 if ( column == 0 ) 406 if ( column == 0 )
405 return mName; 407 return mName;
406 else if ( column == 1 ) 408 else if ( column == 1 )
407 return mComment; 409 return mComment;
408 else 410 else
409 return QString::null; 411 return QString::null;
410#endif //KAB_EMBEDDED 412#endif //KAB_EMBEDDED
411} 413}
412 414
413#ifndef KAB_EMBEDDED 415#ifndef KAB_EMBEDDED
414#include "kabconfigwidget.moc" 416#include "kabconfigwidget.moc"
415#endif //KAB_EMBEDDED 417#endif //KAB_EMBEDDED
416 418
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 40347cc..9cde5cf 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -1,1750 +1,1752 @@
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#include <kdialog.h> 23#include <kdialog.h>
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 <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.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 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kglobalsettings.h>
56 57
57#include <klineedit.h> 58#include <klineedit.h>
58 59
59 60
60#include "koprefs.h" 61#include "koprefs.h"
61 62
62#include "koprefsdialog.h" 63#include "koprefsdialog.h"
63//#include <kprefswidget.h> 64//#include <kprefswidget.h>
64 65
65 66
66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 67KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
67 KPrefsDialog(KOPrefs::instance(),parent,name,true) 68 KPrefsDialog(KOPrefs::instance(),parent,name,true)
68{ 69{
69 70
71 setFont( KGlobalSettings::generalFont() );
70 setCaption( i18n("Settings - some need a restart (nr)")); 72 setCaption( i18n("Settings - some need a restart (nr)"));
71 setupGlobalTab(); 73 setupGlobalTab();
72 setupMainTab(); 74 setupMainTab();
73 setupMailTab();; 75 setupMailTab();;
74 setupFontsTab(); 76 setupFontsTab();
75 readConfig(); 77 readConfig();
76#ifndef DESKTOP_VERSION 78#ifndef DESKTOP_VERSION
77 if ( QApplication::desktop()->height() == 480 ) 79 if ( QApplication::desktop()->height() == 480 )
78 hideButtons(); 80 hideButtons();
79#endif 81#endif
80 82
81#if 0 83#if 0
82 84
83 setupMainTab(); 85 setupMainTab();
84 setupLocaleTab(); 86 setupLocaleTab();
85 setupTimeZoneTab(); 87 setupTimeZoneTab();
86 setupTimeTab(); 88 setupTimeTab();
87 setupLocaleDateTab(); 89 setupLocaleDateTab();
88 setupFontsTab(); 90 setupFontsTab();
89 setupColorsTab(); 91 setupColorsTab();
90 setupViewsTab(); 92 setupViewsTab();
91 //setupSyncTab(); 93 //setupSyncTab();
92 //setupSyncAlgTab(); 94 //setupSyncAlgTab();
93 //setupPrinterTab(); 95 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 96 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 97 //setupGroupAutomationTab();
96#endif 98#endif
97} 99}
98 100
99#include "kpimglobalprefs.h" 101#include "kpimglobalprefs.h"
100 102
101KOPrefsDialog::~KOPrefsDialog() 103KOPrefsDialog::~KOPrefsDialog()
102{ 104{
103} 105}
104void KOPrefsDialog::setupGlobalTab() 106void KOPrefsDialog::setupGlobalTab()
105{ 107{
106 QFrame *topFrame = addPage(i18n("Global"),0,0); 108 QFrame *topFrame = addPage(i18n("Global"),0,0);
107 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 109 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
108 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 110 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
109 topLayout->addWidget( kdelibcfg ); 111 topLayout->addWidget( kdelibcfg );
110 112
111 113
112} 114}
113void KOPrefsDialog::setupMainTab() 115void KOPrefsDialog::setupMainTab()
114{ 116{
115 QFrame *topFrame = addPage(i18n("General"),0,0); 117 QFrame *topFrame = addPage(i18n("General"),0,0);
116 118
117 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 119 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
118 topLayout->setSpacing(spacingHint()); 120 topLayout->setSpacing(spacingHint());
119 topLayout->setMargin(marginHint()); 121 topLayout->setMargin(marginHint());
120 122
121 123
122 mNameEdit = new QLineEdit(topFrame); 124 mNameEdit = new QLineEdit(topFrame);
123 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 125 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
124 topLayout->addWidget(mNameLabel,0,0); 126 topLayout->addWidget(mNameLabel,0,0);
125 topLayout->addWidget(mNameEdit,0,1); 127 topLayout->addWidget(mNameEdit,0,1);
126 128
127 mEmailEdit = new QLineEdit(topFrame); 129 mEmailEdit = new QLineEdit(topFrame);
128 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 130 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
129 topLayout->addWidget(mEmailLabel,1,0); 131 topLayout->addWidget(mEmailLabel,1,0);
130 topLayout->addWidget(mEmailEdit,1,1); 132 topLayout->addWidget(mEmailEdit,1,1);
131 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); 133 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame);
132 topLayout->addMultiCellWidget(lab,2,2,0,1); 134 topLayout->addMultiCellWidget(lab,2,2,0,1);
133 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), 135 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"),
134 &(KOPrefs::instance()->mUseKapi),topFrame); 136 &(KOPrefs::instance()->mUseKapi),topFrame);
135 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); 137 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1);
136} 138}
137 139
138void KOPrefsDialog::setupMailTab() 140void KOPrefsDialog::setupMailTab()
139{ 141{
140 QFrame *topFrame = addPage(i18n("Mail"),0,0); 142 QFrame *topFrame = addPage(i18n("Mail"),0,0);
141 143
142 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 144 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
143 topLayout->setSpacing(spacingHint()); 145 topLayout->setSpacing(spacingHint());
144 topLayout->setMargin(marginHint()); 146 topLayout->setMargin(marginHint());
145 147
146 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), 148 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"),
147 &(KOPrefs::instance()->mViewAsHtml),topFrame); 149 &(KOPrefs::instance()->mViewAsHtml),topFrame);
148 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); 150 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1);
149 151
150 152
151 ttt = addWidBool(i18n("Send mails later"), 153 ttt = addWidBool(i18n("Send mails later"),
152 &(KOPrefs::instance()->mSendLater),topFrame); 154 &(KOPrefs::instance()->mSendLater),topFrame);
153 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); 155 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
154 ttt = addWidBool(i18n("Show \"To\" field in list view"), 156 ttt = addWidBool(i18n("Show \"To\" field in list view"),
155 &(KOPrefs::instance()->mShowToField),topFrame); 157 &(KOPrefs::instance()->mShowToField),topFrame);
156 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); 158 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1);
157 159
158 int iii =3; 160 int iii =3;
159 ttt = addWidBool(i18n("Show info fields at startup"), 161 ttt = addWidBool(i18n("Show info fields at startup"),
160 &(KOPrefs::instance()->mShowInfoStart),topFrame); 162 &(KOPrefs::instance()->mShowInfoStart),topFrame);
161 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 163 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
162 ++iii; 164 ++iii;
163 ttt = addWidBool(i18n("Show \"Subject\" info field"), 165 ttt = addWidBool(i18n("Show \"Subject\" info field"),
164 &(KOPrefs::instance()->mShowInfoSub),topFrame); 166 &(KOPrefs::instance()->mShowInfoSub),topFrame);
165 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 167 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
166 ++iii; 168 ++iii;
167 ttt = addWidBool(i18n("Show \"From\" info field"), 169 ttt = addWidBool(i18n("Show \"From\" info field"),
168 &(KOPrefs::instance()->mShowInfoFrom),topFrame); 170 &(KOPrefs::instance()->mShowInfoFrom),topFrame);
169 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 171 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
170 ++iii; 172 ++iii;
171 ttt = addWidBool(i18n("Show \"To\" info field"), 173 ttt = addWidBool(i18n("Show \"To\" info field"),
172 &(KOPrefs::instance()->mShowInfoTo),topFrame); 174 &(KOPrefs::instance()->mShowInfoTo),topFrame);
173 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 175 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
174 ++iii; 176 ++iii;
175 177
176 /* 178 /*
177 mCodecEdit = new QLineEdit(topFrame); 179 mCodecEdit = new QLineEdit(topFrame);
178 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); 180 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
179 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); 181 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
180 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); 182 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1);
181 */ 183 */
182} 184}
183void KOPrefsDialog::setupFontsTab() 185void KOPrefsDialog::setupFontsTab()
184{ 186{
185 187
186 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 188 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
187 // DesktopIcon("fonts",KIcon::SizeMedium)); 189 // DesktopIcon("fonts",KIcon::SizeMedium));
188 190
189 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 191 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
190 topLayout->setSpacing(1); 192 topLayout->setSpacing(1);
191 topLayout->setMargin(3); 193 topLayout->setMargin(3);
192 KPrefsDialogWidFont * tVFont; 194 KPrefsDialogWidFont * tVFont;
193 int i = 0; 195 int i = 0;
194 KPrefsDialogWidFont *timeLabelsFont = 196 KPrefsDialogWidFont *timeLabelsFont =
195 addWidFont(i18n("OK"),i18n("Application(nr)"), 197 addWidFont(i18n("OK"),i18n("Application(nr)"),
196 &(KOPrefs::instance()->mAppFont),topFrame); 198 &(KOPrefs::instance()->mAppFont),topFrame);
197 topLayout->addWidget(timeLabelsFont->label(),i,0); 199 topLayout->addWidget(timeLabelsFont->label(),i,0);
198 topLayout->addWidget(timeLabelsFont->preview(),i,1); 200 topLayout->addWidget(timeLabelsFont->preview(),i,1);
199 topLayout->addWidget(timeLabelsFont->button(),i,2); 201 topLayout->addWidget(timeLabelsFont->button(),i,2);
200 ++i; 202 ++i;
201 203
202 204
203 timeLabelsFont = 205 timeLabelsFont =
204 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), 206 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"),
205 &(KOPrefs::instance()->mComposeFont),topFrame); 207 &(KOPrefs::instance()->mComposeFont),topFrame);
206 topLayout->addWidget(timeLabelsFont->label(),i,0); 208 topLayout->addWidget(timeLabelsFont->label(),i,0);
207 topLayout->addWidget(timeLabelsFont->preview(),i,1); 209 topLayout->addWidget(timeLabelsFont->preview(),i,1);
208 topLayout->addWidget(timeLabelsFont->button(),i,2); 210 topLayout->addWidget(timeLabelsFont->button(),i,2);
209 ++i; 211 ++i;
210 212
211 KPrefsDialogWidFont *timeBarFont = 213 KPrefsDialogWidFont *timeBarFont =
212 addWidFont(i18n("Hello"),i18n("Read mail:"), 214 addWidFont(i18n("Hello"),i18n("Read mail:"),
213 &(KOPrefs::instance()->mReadFont),topFrame); 215 &(KOPrefs::instance()->mReadFont),topFrame);
214 topLayout->addWidget(timeBarFont->label(),i,0); 216 topLayout->addWidget(timeBarFont->label(),i,0);
215 topLayout->addWidget(timeBarFont->preview(),i,1); 217 topLayout->addWidget(timeBarFont->preview(),i,1);
216 topLayout->addWidget(timeBarFont->button(),i,2); 218 topLayout->addWidget(timeBarFont->button(),i,2);
217 ++i; 219 ++i;
218 220
219 topLayout->setColStretch(1,1); 221 topLayout->setColStretch(1,1);
220 topLayout->setRowStretch(4,1); 222 topLayout->setRowStretch(4,1);
221 223
222} 224}
223void KOPrefsDialog::usrReadConfig() 225void KOPrefsDialog::usrReadConfig()
224{ 226{
225 227
226 mNameEdit->setText(KOPrefs::instance()->mName); 228 mNameEdit->setText(KOPrefs::instance()->mName);
227 mEmailEdit->setText(KOPrefs::instance()->mEmail); 229 mEmailEdit->setText(KOPrefs::instance()->mEmail);
228 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); 230 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec);
229 kdelibcfg->readConfig(); 231 kdelibcfg->readConfig();
230} 232}
231void KOPrefsDialog::usrWriteConfig() 233void KOPrefsDialog::usrWriteConfig()
232{ 234{
233 KOPrefs::instance()->mName = mNameEdit->text(); 235 KOPrefs::instance()->mName = mNameEdit->text();
234 KOPrefs::instance()->mEmail = mEmailEdit->text(); 236 KOPrefs::instance()->mEmail = mEmailEdit->text();
235 //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); 237 //KOPrefs::instance()->mSendCodec = mCodecEdit->text();
236 kdelibcfg->writeConfig(); 238 kdelibcfg->writeConfig();
237 239
238 240
239} 241}
240 242
241#if 0 243#if 0
242void KOPrefsDialog::setupLocaleDateTab() 244void KOPrefsDialog::setupLocaleDateTab()
243{ 245{
244QFrame *topFrame = addPage(i18n("Date Format"),0,0); 246QFrame *topFrame = addPage(i18n("Date Format"),0,0);
245 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 247 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
246 topLayout->setSpacing(spacingHint()); 248 topLayout->setSpacing(spacingHint());
247 topLayout->setMargin(marginHint()); 249 topLayout->setMargin(marginHint());
248 int iii = 0; 250 int iii = 0;
249 251
250 252
251 KPrefsWidRadios *syncPrefsGroup = 253 KPrefsWidRadios *syncPrefsGroup =
252 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 254 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
253 QString format; 255 QString format;
254 if ( QApplication::desktop()->width() < 480 ) 256 if ( QApplication::desktop()->width() < 480 )
255 format = "(%d.%m.%Y)"; 257 format = "(%d.%m.%Y)";
256 else 258 else
257 format = "(%d.%m.%Y|%A %d %B %Y)"; 259 format = "(%d.%m.%Y|%A %d %B %Y)";
258 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 260 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
259 if ( QApplication::desktop()->width() < 480 ) 261 if ( QApplication::desktop()->width() < 480 )
260 format = "(%m.%d.%Y)"; 262 format = "(%m.%d.%Y)";
261 else 263 else
262 format = "(%m.%d.%Y|%A %B %d %Y)"; 264 format = "(%m.%d.%Y|%A %B %d %Y)";
263 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 265 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
264 if ( QApplication::desktop()->width() < 480 ) 266 if ( QApplication::desktop()->width() < 480 )
265 format = "(%Y-%m-%d)"; 267 format = "(%Y-%m-%d)";
266 else 268 else
267 format = "(%Y-%m-%d|%A %Y %B %d)"; 269 format = "(%Y-%m-%d|%A %Y %B %d)";
268 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 270 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
269 syncPrefsGroup->addRadio(i18n("User defined")); 271 syncPrefsGroup->addRadio(i18n("User defined"));
270 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 272 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
271 ++iii; 273 ++iii;
272 ++iii; 274 ++iii;
273 QLabel * lab; 275 QLabel * lab;
274 mUserDateFormatLong = new QLineEdit(topFrame); 276 mUserDateFormatLong = new QLineEdit(topFrame);
275 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 277 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
276 topLayout->addWidget(lab ,iii,0); 278 topLayout->addWidget(lab ,iii,0);
277 topLayout->addWidget(mUserDateFormatLong,iii,1); 279 topLayout->addWidget(mUserDateFormatLong,iii,1);
278 ++iii; 280 ++iii;
279 mUserDateFormatShort = new QLineEdit(topFrame); 281 mUserDateFormatShort = new QLineEdit(topFrame);
280 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 282 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
281 topLayout->addWidget(lab ,iii,0); 283 topLayout->addWidget(lab ,iii,0);
282 topLayout->addWidget(mUserDateFormatShort,iii,1); 284 topLayout->addWidget(mUserDateFormatShort,iii,1);
283 ++iii; 285 ++iii;
284 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 286 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
285 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 287 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
286 ++iii; 288 ++iii;
287 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 289 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
288 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 290 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
289 ++iii; 291 ++iii;
290 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 292 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
291 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 293 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
292 ++iii; 294 ++iii;
293 295
294} 296}
295 297
296void KOPrefsDialog::setupLocaleTab() 298void KOPrefsDialog::setupLocaleTab()
297{ 299{
298 QFrame *topFrame = addPage(i18n("Locale"),0,0); 300 QFrame *topFrame = addPage(i18n("Locale"),0,0);
299 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 301 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
300 topLayout->setSpacing(spacingHint()); 302 topLayout->setSpacing(spacingHint());
301 topLayout->setMargin(marginHint()); 303 topLayout->setMargin(marginHint());
302 int iii = 0; 304 int iii = 0;
303 KPrefsWidRadios *syncPrefsGroup = 305 KPrefsWidRadios *syncPrefsGroup =
304 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 306 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
305 syncPrefsGroup->addRadio(i18n("English")); 307 syncPrefsGroup->addRadio(i18n("English"));
306 syncPrefsGroup->addRadio(i18n("German")); 308 syncPrefsGroup->addRadio(i18n("German"));
307 syncPrefsGroup->addRadio(i18n("French")); 309 syncPrefsGroup->addRadio(i18n("French"));
308 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 310 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
309 if ( QApplication::desktop()->width() < 300 ) 311 if ( QApplication::desktop()->width() < 300 )
310 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 312 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
311 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 313 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
312 ++iii; 314 ++iii;
313 315
314 syncPrefsGroup = 316 syncPrefsGroup =
315 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 317 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
316 if ( QApplication::desktop()->width() > 300 ) 318 if ( QApplication::desktop()->width() > 300 )
317 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 319 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
318 syncPrefsGroup->addRadio(i18n("24:00")); 320 syncPrefsGroup->addRadio(i18n("24:00"));
319 syncPrefsGroup->addRadio(i18n("12:00am")); 321 syncPrefsGroup->addRadio(i18n("12:00am"));
320 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 322 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
321 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 323 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
322 ++iii; 324 ++iii;
323 KPrefsDialogWidBool *sb; 325 KPrefsDialogWidBool *sb;
324 if ( QApplication::desktop()->width() < 300 ) { 326 if ( QApplication::desktop()->width() < 300 ) {
325 sb = 327 sb =
326 addWidBool(i18n("Week starts on Sunday"), 328 addWidBool(i18n("Week starts on Sunday"),
327 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 329 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
328 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 330 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
329 ++iii; 331 ++iii;
330 sb = 332 sb =
331 addWidBool(i18n("Use short date in (WN/E) view"), 333 addWidBool(i18n("Use short date in (WN/E) view"),
332 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 334 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
333 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 335 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
334 } 336 }
335 else { 337 else {
336 QWidget * hb = new QWidget( topFrame ); 338 QWidget * hb = new QWidget( topFrame );
337 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 339 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
338 sb = 340 sb =
339 addWidBool(i18n("Week starts on Sunday"), 341 addWidBool(i18n("Week starts on Sunday"),
340 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 342 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
341 hbLayout->addWidget(sb->checkBox() ); 343 hbLayout->addWidget(sb->checkBox() );
342 sb = 344 sb =
343 addWidBool(i18n("Use short date in (WN/E) view"), 345 addWidBool(i18n("Use short date in (WN/E) view"),
344 &(KOPrefs::instance()->mShortDateInViewer),hb); 346 &(KOPrefs::instance()->mShortDateInViewer),hb);
345 hbLayout->addWidget(sb->checkBox() ); 347 hbLayout->addWidget(sb->checkBox() );
346 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 348 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
347 349
348 } 350 }
349 //#ifndef DESKTOP_VERSION 351 //#ifndef DESKTOP_VERSION
350#if 0 352#if 0
351 ++iii; 353 ++iii;
352 sb = 354 sb =
353 addWidBool(i18n("Quick load/save (w/o Unicode)"), 355 addWidBool(i18n("Quick load/save (w/o Unicode)"),
354 &(KOPrefs::instance()->mUseQuicksave),topFrame); 356 &(KOPrefs::instance()->mUseQuicksave),topFrame);
355 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 357 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
356#endif 358#endif
357} 359}
358void KOPrefsDialog::showSyncPage() 360void KOPrefsDialog::showSyncPage()
359{ 361{
360 showPage ( 2 ) ; 362 showPage ( 2 ) ;
361 363
362} 364}
363void KOPrefsDialog::setupSyncAlgTab() 365void KOPrefsDialog::setupSyncAlgTab()
364{ 366{
365#if 0 367#if 0
366 QLabel * lab; 368 QLabel * lab;
367 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 369 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
368 mSetupSyncAlgTab = topFrame; 370 mSetupSyncAlgTab = topFrame;
369 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 371 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
370 topLayout->setSpacing(spacingHint()); 372 topLayout->setSpacing(spacingHint());
371 topLayout->setMargin(marginHint()); 373 topLayout->setMargin(marginHint());
372 int iii = 0; 374 int iii = 0;
373 375
374 KPrefsDialogWidBool *sb = 376 KPrefsDialogWidBool *sb =
375 addWidBool(i18n("Ask for preferences before syncing"), 377 addWidBool(i18n("Ask for preferences before syncing"),
376 &(KOPrefs::instance()->mAskForPreferences),topFrame); 378 &(KOPrefs::instance()->mAskForPreferences),topFrame);
377 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 379 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
378 380
379 ++iii; 381 ++iii;
380 382
381 KPrefsWidRadios *syncPrefsGroup = 383 KPrefsWidRadios *syncPrefsGroup =
382 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 384 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
383 topFrame); 385 topFrame);
384 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 386 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
385 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 387 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
386 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 388 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
387 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 389 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
388 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 390 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
389 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 391 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
390 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 392 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
391 ++iii; 393 ++iii;
392 sb = 394 sb =
393 addWidBool(i18n("Show summary after syncing"), 395 addWidBool(i18n("Show summary after syncing"),
394 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 396 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
395 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 397 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
396 398
397 ++iii; 399 ++iii;
398#endif 400#endif
399 401
400 402
401 403
402} 404}
403 405
404 406
405void KOPrefsDialog::setupSyncTab() 407void KOPrefsDialog::setupSyncTab()
406{ 408{
407#if 0 409#if 0
408 QLabel * lab; 410 QLabel * lab;
409 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 411 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
410 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 412 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
411 topLayout->setSpacing(spacingHint()); 413 topLayout->setSpacing(spacingHint());
412 topLayout->setMargin(marginHint()); 414 topLayout->setMargin(marginHint());
413 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 415 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
414 int iii = 0; 416 int iii = 0;
415 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 417 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
416 ++iii; 418 ++iii;
417 419
418 mRemoteIPEdit = new QLineEdit(topFrame); 420 mRemoteIPEdit = new QLineEdit(topFrame);
419 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 421 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
420 topLayout->addWidget(lab ,iii,0); 422 topLayout->addWidget(lab ,iii,0);
421 topLayout->addWidget(mRemoteIPEdit,iii,1); 423 topLayout->addWidget(mRemoteIPEdit,iii,1);
422 ++iii; 424 ++iii;
423 mRemoteUser = new QLineEdit(topFrame); 425 mRemoteUser = new QLineEdit(topFrame);
424 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 426 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
425 topLayout->addWidget(lab ,iii,0); 427 topLayout->addWidget(lab ,iii,0);
426 topLayout->addWidget(mRemoteUser, iii,1); 428 topLayout->addWidget(mRemoteUser, iii,1);
427 ++iii; 429 ++iii;
428 430
429 mRemoteFile = new QLineEdit(topFrame); 431 mRemoteFile = new QLineEdit(topFrame);
430 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 432 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
431 topLayout->addWidget(lab ,iii,0); 433 topLayout->addWidget(lab ,iii,0);
432 topLayout->addWidget(mRemoteFile,iii,1); 434 topLayout->addWidget(mRemoteFile,iii,1);
433 ++iii; 435 ++iii;
434 436
435 mLocalTempFile = new QLineEdit(topFrame); 437 mLocalTempFile = new QLineEdit(topFrame);
436 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 438 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
437 topLayout->addWidget(lab ,iii,0); 439 topLayout->addWidget(lab ,iii,0);
438 topLayout->addWidget(mLocalTempFile,iii,1); 440 topLayout->addWidget(mLocalTempFile,iii,1);
439 ++iii; 441 ++iii;
440 442
441 KPrefsDialogWidBool *wb = 443 KPrefsDialogWidBool *wb =
442 addWidBool(i18n("Write back synced file"), 444 addWidBool(i18n("Write back synced file"),
443 &(KOPrefs::instance()->mWriteBackFile),topFrame); 445 &(KOPrefs::instance()->mWriteBackFile),topFrame);
444 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 446 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
445 ++iii; 447 ++iii;
446 wb = 448 wb =
447 addWidBool(i18n("Write back existing entries only"), 449 addWidBool(i18n("Write back existing entries only"),
448 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 450 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
449 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 451 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
450 ++iii; 452 ++iii;
451 453
452#endif 454#endif
453} 455}
454 456
455void KOPrefsDialog::setupMainTab() 457void KOPrefsDialog::setupMainTab()
456{ 458{
457 QFrame *topFrame = addPage(i18n("General"),0,0); 459 QFrame *topFrame = addPage(i18n("General"),0,0);
458 // DesktopIcon("identity",KIcon::SizeMedium)); 460 // DesktopIcon("identity",KIcon::SizeMedium));
459 461
460 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 462 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
461 topLayout->setSpacing(spacingHint()); 463 topLayout->setSpacing(spacingHint());
462 topLayout->setMargin(marginHint()); 464 topLayout->setMargin(marginHint());
463 465
464 // KPrefsDialogWidBool *emailControlCenter = 466 // KPrefsDialogWidBool *emailControlCenter =
465// addWidBool(i18n("&Use email settings from Control Center"), 467// addWidBool(i18n("&Use email settings from Control Center"),
466// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 468// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
467// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 469// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
468 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 470 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
469 // SLOT(toggleEmailSettings(bool))); 471 // SLOT(toggleEmailSettings(bool)));
470 472
471 mNameEdit = new QLineEdit(topFrame); 473 mNameEdit = new QLineEdit(topFrame);
472 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 474 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
473 topLayout->addWidget(mNameLabel,0,0); 475 topLayout->addWidget(mNameLabel,0,0);
474 topLayout->addWidget(mNameEdit,0,1); 476 topLayout->addWidget(mNameEdit,0,1);
475 477
476 mEmailEdit = new QLineEdit(topFrame); 478 mEmailEdit = new QLineEdit(topFrame);
477 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 479 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
478 topLayout->addWidget(mEmailLabel,1,0); 480 topLayout->addWidget(mEmailLabel,1,0);
479 topLayout->addWidget(mEmailEdit,1,1); 481 topLayout->addWidget(mEmailEdit,1,1);
480 KPrefsDialogWidBool *wb; 482 KPrefsDialogWidBool *wb;
481 QHBox *dummy; 483 QHBox *dummy;
482 if ( QApplication::desktop()->width() > 480 ) { 484 if ( QApplication::desktop()->width() > 480 ) {
483 dummy = new QHBox(topFrame); 485 dummy = new QHBox(topFrame);
484 } else { 486 } else {
485 dummy = new QVBox(topFrame); 487 dummy = new QVBox(topFrame);
486 } 488 }
487 489
488 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 490 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
489 addWidBool(i18n("Full menu bar(nr)"), 491 addWidBool(i18n("Full menu bar(nr)"),
490 &(KOPrefs::instance()->mShowFullMenu),dummy); 492 &(KOPrefs::instance()->mShowFullMenu),dummy);
491 493
492 494
493 addWidBool(i18n("Mini icons in toolbar(nr)"), 495 addWidBool(i18n("Mini icons in toolbar(nr)"),
494 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 496 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
495 497
496 498
497 dummy = new QHBox(topFrame); 499 dummy = new QHBox(topFrame);
498 new QLabel(i18n("Days in What's Next:"),dummy); 500 new QLabel(i18n("Days in What's Next:"),dummy);
499 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 501 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
500 502
501 topLayout->addMultiCellWidget(dummy,3,3,0,1); 503 topLayout->addMultiCellWidget(dummy,3,3,0,1);
502 504
503 505
504 506
505 dummy = new QHBox(topFrame); 507 dummy = new QHBox(topFrame);
506 new QLabel(i18n("Days in Next-X-Days:"),dummy); 508 new QLabel(i18n("Days in Next-X-Days:"),dummy);
507 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 509 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
508 510
509 topLayout->addMultiCellWidget(dummy,4,4,0,1); 511 topLayout->addMultiCellWidget(dummy,4,4,0,1);
510 512
511 QHBox *prioBox = new QHBox(topFrame); 513 QHBox *prioBox = new QHBox(topFrame);
512 // intervalBox->setSpacing(spacingHint()); 514 // intervalBox->setSpacing(spacingHint());
513 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 515 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
514 QString messa = i18n("Show topmost todo prios in What's Next:"); 516 QString messa = i18n("Show topmost todo prios in What's Next:");
515 517
516 if ( QApplication::desktop()->width() < 300 ) 518 if ( QApplication::desktop()->width() < 300 )
517 messa = i18n("Show topmost todo prios in What's N.:"); 519 messa = i18n("Show topmost todo prios in What's N.:");
518 QLabel *prioLabel = new QLabel(messa, prioBox); 520 QLabel *prioLabel = new QLabel(messa, prioBox);
519 mPrioSpin = new QSpinBox(0,5,1,prioBox); 521 mPrioSpin = new QSpinBox(0,5,1,prioBox);
520 if ( QApplication::desktop()->width() < 300 ) 522 if ( QApplication::desktop()->width() < 300 )
521 mPrioSpin->setFixedWidth( 40 ); 523 mPrioSpin->setFixedWidth( 40 );
522 524
523 // KPrefsDialogWidBool *bcc = 525 // KPrefsDialogWidBool *bcc =
524// addWidBool(i18n("Send copy to owner when mailing events"), 526// addWidBool(i18n("Send copy to owner when mailing events"),
525// &(KOPrefs::instance()->mBcc),topFrame); 527// &(KOPrefs::instance()->mBcc),topFrame);
526// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 528// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
527 529
528 530
529 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 531 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
530 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 532 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
531 533
532 // addWidBool(i18n("Enable automatic saving of calendar"), 534 // addWidBool(i18n("Enable automatic saving of calendar"),
533 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 535 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
534 536
535 QHBox *intervalBox = new QHBox(topFrame); 537 QHBox *intervalBox = new QHBox(topFrame);
536 // intervalBox->setSpacing(spacingHint()); 538 // intervalBox->setSpacing(spacingHint());
537 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 539 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
538 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 540 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
539 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 541 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
540 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 542 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
541 /* 543 /*
542 QHBox * agendasize = new QHBox ( topFrame ); 544 QHBox * agendasize = new QHBox ( topFrame );
543 545
544 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 546 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
545 547
546 548
547 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 549 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
548 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 550 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
549 */ 551 */
550 KPrefsDialogWidBool *verticalScreen = 552 KPrefsDialogWidBool *verticalScreen =
551 addWidBool(i18n("Show vertical screen (Needs restart)"), 553 addWidBool(i18n("Show vertical screen (Needs restart)"),
552 &(KOPrefs::instance()->mVerticalScreen),topFrame); 554 &(KOPrefs::instance()->mVerticalScreen),topFrame);
553 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 555 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
554 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); 556 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
555 557
556 KPrefsDialogWidBool *ask = 558 KPrefsDialogWidBool *ask =
557 addWidBool(i18n("Ask for quit when closing KO/Pi"), 559 addWidBool(i18n("Ask for quit when closing KO/Pi"),
558 &(KOPrefs::instance()->mAskForQuit),topFrame); 560 &(KOPrefs::instance()->mAskForQuit),topFrame);
559 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); 561 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
560 562
561 563
562 /* 564 /*
563 KPrefsDialogWidBool *confirmCheck = 565 KPrefsDialogWidBool *confirmCheck =
564 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 566 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
565 topFrame); 567 topFrame);
566 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 568 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
567 569
568 570
569 mEnableGroupScheduling = 571 mEnableGroupScheduling =
570 addWidBool(i18n("Enable group scheduling"), 572 addWidBool(i18n("Enable group scheduling"),
571 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 573 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
572 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 574 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
573 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 575 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
574 SLOT(warningGroupScheduling())); 576 SLOT(warningGroupScheduling()));
575 577
576 mEnableProjectView = 578 mEnableProjectView =
577 addWidBool(i18n("Enable project view"), 579 addWidBool(i18n("Enable project view"),
578 &(KOPrefs::instance()->mEnableProjectView),topFrame); 580 &(KOPrefs::instance()->mEnableProjectView),topFrame);
579 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 581 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
580 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 582 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
581 SLOT(warningProjectView())); 583 SLOT(warningProjectView()));
582 584
583 // Can't be disabled anymore 585 // Can't be disabled anymore
584 mEnableGroupScheduling->checkBox()->hide(); 586 mEnableGroupScheduling->checkBox()->hide();
585 587
586 // Disable setting, because this feature now becomes stable 588 // Disable setting, because this feature now becomes stable
587 mEnableProjectView->checkBox()->hide(); 589 mEnableProjectView->checkBox()->hide();
588 590
589 KPrefsWidRadios *defaultFormatGroup = 591 KPrefsWidRadios *defaultFormatGroup =
590 addWidRadios(i18n("Default Calendar Format"), 592 addWidRadios(i18n("Default Calendar Format"),
591 &(KOPrefs::instance()->mDefaultFormat),topFrame); 593 &(KOPrefs::instance()->mDefaultFormat),topFrame);
592 defaultFormatGroup->addRadio(i18n("vCalendar")); 594 defaultFormatGroup->addRadio(i18n("vCalendar"));
593 defaultFormatGroup->addRadio(i18n("iCalendar")); 595 defaultFormatGroup->addRadio(i18n("iCalendar"));
594 596
595 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 597 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
596 598
597 // Default format unconditionally is iCalendar 599 // Default format unconditionally is iCalendar
598 defaultFormatGroup->groupBox()->hide(); 600 defaultFormatGroup->groupBox()->hide();
599 601
600 KPrefsWidRadios *mailClientGroup = 602 KPrefsWidRadios *mailClientGroup =
601 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 603 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
602 topFrame); 604 topFrame);
603 mailClientGroup->addRadio(i18n("KMail")); 605 mailClientGroup->addRadio(i18n("KMail"));
604 mailClientGroup->addRadio(i18n("Sendmail")); 606 mailClientGroup->addRadio(i18n("Sendmail"));
605 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 607 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
606 608
607 KPrefsDialogWidBool *htmlsave = 609 KPrefsDialogWidBool *htmlsave =
608 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 610 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
609 topFrame); 611 topFrame);
610 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 612 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
611 613
612 KPrefsWidRadios *destinationGroup = 614 KPrefsWidRadios *destinationGroup =
613 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 615 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
614 topFrame); 616 topFrame);
615 destinationGroup->addRadio(i18n("be added to the standard resource")); 617 destinationGroup->addRadio(i18n("be added to the standard resource"));
616 destinationGroup->addRadio(i18n("be asked which resource to use")); 618 destinationGroup->addRadio(i18n("be asked which resource to use"));
617 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 619 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
618 620
619 topLayout->setRowStretch(14,1); 621 topLayout->setRowStretch(14,1);
620 */ 622 */
621} 623}
622 624
623 625
624void KOPrefsDialog::setupTimeTab() 626void KOPrefsDialog::setupTimeTab()
625{ 627{
626 QFrame *topFrame = addPage(i18n("Time"),0,0); 628 QFrame *topFrame = addPage(i18n("Time"),0,0);
627 // DesktopIcon("clock",KIcon::SizeMedium)); 629 // DesktopIcon("clock",KIcon::SizeMedium));
628 630
629 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 631 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
630 topLayout->setSpacing(spacingHint()); 632 topLayout->setSpacing(spacingHint());
631 topLayout->setMargin(marginHint()); 633 topLayout->setMargin(marginHint());
632 634
633 QHBox *dummy = new QHBox(topFrame); 635 QHBox *dummy = new QHBox(topFrame);
634 KPrefsWidTime *dayBegins = 636 KPrefsWidTime *dayBegins =
635 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 637 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
636 dummy); 638 dummy);
637 //topLayout->addWidget(dayBegins->label(),2,0); 639 //topLayout->addWidget(dayBegins->label(),2,0);
638 640
639 //topLayout->addWidget(dayBegins->spinBox(),2,1); 641 //topLayout->addWidget(dayBegins->spinBox(),2,1);
640 topLayout->addMultiCellWidget(dummy,0,0,0,1); 642 topLayout->addMultiCellWidget(dummy,0,0,0,1);
641 643
642 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 644 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
643 topFrame),1,0); 645 topFrame),1,0);
644 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 646 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
645 mStartTimeSpin->setSuffix(":00"); 647 mStartTimeSpin->setSuffix(":00");
646 topLayout->addWidget(mStartTimeSpin,1,1); 648 topLayout->addWidget(mStartTimeSpin,1,1);
647 649
648 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 650 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
649 topFrame),2,0); 651 topFrame),2,0);
650 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 652 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
651 mDefaultDurationSpin->setSuffix(":00"); 653 mDefaultDurationSpin->setSuffix(":00");
652 topLayout->addWidget(mDefaultDurationSpin,2,1); 654 topLayout->addWidget(mDefaultDurationSpin,2,1);
653 655
654 QStringList alarmList; 656 QStringList alarmList;
655 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 657 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
656 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 658 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
657 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 659 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
658 3,0); 660 3,0);
659 mAlarmTimeCombo = new QComboBox(topFrame); 661 mAlarmTimeCombo = new QComboBox(topFrame);
660 mAlarmTimeCombo->insertStringList(alarmList); 662 mAlarmTimeCombo->insertStringList(alarmList);
661 topLayout->addWidget(mAlarmTimeCombo,3,1); 663 topLayout->addWidget(mAlarmTimeCombo,3,1);
662 664
663 665
664 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 666 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
665 i18n("Working Hours"), 667 i18n("Working Hours"),
666 topFrame); 668 topFrame);
667 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 669 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
668 workingHoursGroup->layout()->setSpacing( 0 ); 670 workingHoursGroup->layout()->setSpacing( 0 );
669 workingHoursGroup->layout()->setMargin( 4 ); 671 workingHoursGroup->layout()->setMargin( 4 );
670 QHBox *workStartBox = new QHBox(workingHoursGroup); 672 QHBox *workStartBox = new QHBox(workingHoursGroup);
671 // workStartBox->setMargin( 0 ); 673 // workStartBox->setMargin( 0 );
672 addWidTime(i18n("Daily starting hour:"), 674 addWidTime(i18n("Daily starting hour:"),
673 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 675 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
674 676
675 QHBox *workEndBox = new QHBox(workingHoursGroup); 677 QHBox *workEndBox = new QHBox(workingHoursGroup);
676 //workEndBox->setMargin( 0 ); 678 //workEndBox->setMargin( 0 );
677 addWidTime(i18n("Daily ending hour:"), 679 addWidTime(i18n("Daily ending hour:"),
678 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 680 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
679 QVBox *excludeBox = new QVBox(workingHoursGroup); 681 QVBox *excludeBox = new QVBox(workingHoursGroup);
680 //excludeBox->setMargin( 0 ); 682 //excludeBox->setMargin( 0 );
681 addWidBool(i18n("Exclude holidays"), 683 addWidBool(i18n("Exclude holidays"),
682 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 684 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
683 685
684 addWidBool(i18n("Exclude Saturdays"), 686 addWidBool(i18n("Exclude Saturdays"),
685 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 687 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
686 688
687// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 689// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
688 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 690 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
689 // topFrame); 691 // topFrame);
690// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 692// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
691 693
692 // topLayout->setRowStretch(6,1); 694 // topLayout->setRowStretch(6,1);
693} 695}
694 696
695 697
696void KOPrefsDialog::setupViewsTab() 698void KOPrefsDialog::setupViewsTab()
697{ 699{
698 700
699 QFrame *topFrame = addPage(i18n("Views"),0,0); 701 QFrame *topFrame = addPage(i18n("Views"),0,0);
700 // DesktopIcon("viewmag",KIcon::SizeMedium)); 702 // DesktopIcon("viewmag",KIcon::SizeMedium));
701 703
702 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 704 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
703 topLayout->setSpacing(spacingHint()); 705 topLayout->setSpacing(spacingHint());
704 topLayout->setMargin(marginHint()); 706 topLayout->setMargin(marginHint());
705 707
706// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 708// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
707// topLayout->addLayout(dayBeginsLayout,0,0); 709// topLayout->addLayout(dayBeginsLayout,0,0);
708 710
709// KPrefsWidTime *dayBegins = 711// KPrefsWidTime *dayBegins =
710// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 712// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
711// topFrame); 713// topFrame);
712// dayBeginsLayout->addWidget(dayBegins->label()); 714// dayBeginsLayout->addWidget(dayBegins->label());
713// dayBeginsLayout->addStretch(1); 715// dayBeginsLayout->addStretch(1);
714// dayBeginsLayout->addWidget(dayBegins->spinBox()); 716// dayBeginsLayout->addWidget(dayBegins->spinBox());
715 717
716// QBoxLayout *nextDaysLayout = new QHBoxLayout; 718// QBoxLayout *nextDaysLayout = new QHBoxLayout;
717// topLayout->addLayout(nextDaysLayout,1,0); 719// topLayout->addLayout(nextDaysLayout,1,0);
718// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 720// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
719// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 721// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
720// nextDaysLayout->addStretch(1); 722// nextDaysLayout->addStretch(1);
721// nextDaysLayout->addWidget(mNextXDaysSpin); 723// nextDaysLayout->addWidget(mNextXDaysSpin);
722 724
723 725
724 int ii = 0; 726 int ii = 0;
725 KPrefsDialogWidBool *dummy = 727 KPrefsDialogWidBool *dummy =
726 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 728 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
727 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 729 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
728 topLayout->addWidget(dummy->checkBox(),ii++,0); 730 topLayout->addWidget(dummy->checkBox(),ii++,0);
729 731
730 dummy = 732 dummy =
731 addWidBool(i18n("Highlight current day in agenda"), 733 addWidBool(i18n("Highlight current day in agenda"),
732 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 734 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
733 topLayout->addWidget(dummy->checkBox(),ii++,0); 735 topLayout->addWidget(dummy->checkBox(),ii++,0);
734 736
735 dummy = 737 dummy =
736 addWidBool(i18n("Use light color for highlight current day"), 738 addWidBool(i18n("Use light color for highlight current day"),
737 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 739 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
738 topLayout->addWidget(dummy->checkBox(),ii++,0); 740 topLayout->addWidget(dummy->checkBox(),ii++,0);
739 741
740 KPrefsDialogWidBool *dailyRecur = 742 KPrefsDialogWidBool *dailyRecur =
741 addWidBool(i18n("Show events that recur daily in date nav."), 743 addWidBool(i18n("Show events that recur daily in date nav."),
742 &(KOPrefs::instance()->mDailyRecur),topFrame); 744 &(KOPrefs::instance()->mDailyRecur),topFrame);
743 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 745 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
744 746
745 KPrefsDialogWidBool *weeklyRecur = 747 KPrefsDialogWidBool *weeklyRecur =
746 addWidBool(i18n("Show ev. that recur weekly in date nav."), 748 addWidBool(i18n("Show ev. that recur weekly in date nav."),
747 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 749 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
748 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 750 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
749 if ( QApplication::desktop()->width() > 640 ) { 751 if ( QApplication::desktop()->width() > 640 ) {
750 752
751 KPrefsDialogWidBool *enableToolTips = 753 KPrefsDialogWidBool *enableToolTips =
752 addWidBool(i18n("Enable tooltips displaying summary of ev."), 754 addWidBool(i18n("Enable tooltips displaying summary of ev."),
753 &(KOPrefs::instance()->mEnableToolTips),topFrame); 755 &(KOPrefs::instance()->mEnableToolTips),topFrame);
754 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 756 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
755 757
756 } 758 }
757 KPrefsDialogWidBool *passwdk = 759 KPrefsDialogWidBool *passwdk =
758 addWidBool(i18n("Show parent To-Do's in What's Next view"), 760 addWidBool(i18n("Show parent To-Do's in What's Next view"),
759 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 761 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
760 topLayout->addWidget(passwdk->checkBox(), ii++,0); 762 topLayout->addWidget(passwdk->checkBox(), ii++,0);
761 763
762 passwdk = 764 passwdk =
763 addWidBool(i18n("Show location in What's Next view"), 765 addWidBool(i18n("Show location in What's Next view"),
764 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 766 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
765 topLayout->addWidget(passwdk->checkBox(), ii++,0); 767 topLayout->addWidget(passwdk->checkBox(), ii++,0);
766 768
767 passwdk = 769 passwdk =
768 addWidBool(i18n("Show Sync Events in WN/Agenda view"), 770 addWidBool(i18n("Show Sync Events in WN/Agenda view"),
769 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 771 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
770 topLayout->addWidget(passwdk->checkBox(), ii++,0); 772 topLayout->addWidget(passwdk->checkBox(), ii++,0);
771 773
772 774
773 KPrefsDialogWidBool *marcusBainsEnabled = 775 KPrefsDialogWidBool *marcusBainsEnabled =
774 addWidBool(i18n("Show Marcus Bains line"), 776 addWidBool(i18n("Show Marcus Bains line"),
775 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 777 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
776 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 778 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
777 779
778 780
779 // topLayout->addWidget(hourSizeGroup,ii++,0); 781 // topLayout->addWidget(hourSizeGroup,ii++,0);
780 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 782 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
781 //topLayout->setRowStretch(11,1); 783 //topLayout->setRowStretch(11,1);
782 784
783 785
784 786
785 787
786 788
787 789
788 topFrame = addPage(i18n("ViewChange"),0,0); 790 topFrame = addPage(i18n("ViewChange"),0,0);
789 // DesktopIcon("viewmag",KIcon::SizeMedium)); 791 // DesktopIcon("viewmag",KIcon::SizeMedium));
790 792
791 topLayout = new QGridLayout(topFrame,6,1); 793 topLayout = new QGridLayout(topFrame,6,1);
792 topLayout->setSpacing(spacingHint()); 794 topLayout->setSpacing(spacingHint());
793 topLayout->setMargin(marginHint()); 795 topLayout->setMargin(marginHint());
794 ii = 0; 796 ii = 0;
795 797
796 798
797 dummy = 799 dummy =
798 addWidBool(i18n("Hold fullscreen on view change"), 800 addWidBool(i18n("Hold fullscreen on view change"),
799 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 801 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
800 topLayout->addWidget(dummy->checkBox(),ii++,0); 802 topLayout->addWidget(dummy->checkBox(),ii++,0);
801 803
802 dummy = 804 dummy =
803 addWidBool(i18n("Hold non-fullscreen on view change"), 805 addWidBool(i18n("Hold non-fullscreen on view change"),
804 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 806 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
805 topLayout->addWidget(dummy->checkBox(),ii++,0); 807 topLayout->addWidget(dummy->checkBox(),ii++,0);
806 808
807 809
808 KPrefsDialogWidBool *fullViewTodo = 810 KPrefsDialogWidBool *fullViewTodo =
809 addWidBool(i18n("Event list view uses full window"), 811 addWidBool(i18n("Event list view uses full window"),
810 &(KOPrefs::instance()->mFullViewTodo),topFrame); 812 &(KOPrefs::instance()->mFullViewTodo),topFrame);
811 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 813 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
812 814
813 KPrefsDialogWidBool *fullViewMonth = 815 KPrefsDialogWidBool *fullViewMonth =
814 addWidBool(i18n("Next days view uses full window"), 816 addWidBool(i18n("Next days view uses full window"),
815 &(KOPrefs::instance()->mFullViewMonth),topFrame); 817 &(KOPrefs::instance()->mFullViewMonth),topFrame);
816 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 818 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
817 819
818 dummy = 820 dummy =
819 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 821 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
820 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 822 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
821 topLayout->addWidget(dummy->checkBox(),ii++,0); 823 topLayout->addWidget(dummy->checkBox(),ii++,0);
822 824
823 dummy = 825 dummy =
824 addWidBool(i18n("Set agenda to current time on change"), 826 addWidBool(i18n("Set agenda to current time on change"),
825 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 827 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
826 topLayout->addWidget(dummy->checkBox(),ii++,0); 828 topLayout->addWidget(dummy->checkBox(),ii++,0);
827 829
828 dummy = 830 dummy =
829 addWidBool(i18n("Listview uses monthly timespan"), 831 addWidBool(i18n("Listview uses monthly timespan"),
830 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 832 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
831 topLayout->addWidget(dummy->checkBox(),ii++,0); 833 topLayout->addWidget(dummy->checkBox(),ii++,0);
832 dummy = 834 dummy =
833 addWidBool(i18n("Highlight selection in Time Edit"), 835 addWidBool(i18n("Highlight selection in Time Edit"),
834 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 836 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
835 topLayout->addWidget( dummy->checkBox(), ii++,0); 837 topLayout->addWidget( dummy->checkBox(), ii++,0);
836 838
837 839
838 840
839 841
840 842
841 topFrame = addPage(i18n("Month View"),0,0); 843 topFrame = addPage(i18n("Month View"),0,0);
842 // DesktopIcon("viewmag",KIcon::SizeMedium)); 844 // DesktopIcon("viewmag",KIcon::SizeMedium));
843 845
844 topLayout = new QGridLayout(topFrame,5,1); 846 topLayout = new QGridLayout(topFrame,5,1);
845 topLayout->setSpacing(spacingHint()); 847 topLayout->setSpacing(spacingHint());
846 topLayout->setMargin(marginHint()); 848 topLayout->setMargin(marginHint());
847 ii = 0; 849 ii = 0;
848 QLabel *lab; 850 QLabel *lab;
849 QHBox *habo = new QHBox( topFrame ); 851 QHBox *habo = new QHBox( topFrame );
850 if ( QApplication::desktop()->width() < 320 ) { 852 if ( QApplication::desktop()->width() < 320 ) {
851 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 853 lab = new QLabel ( i18n("Show events that recur "), topFrame );
852 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 854 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
853 ii++; 855 ii++;
854 856
855 } else { 857 } else {
856 new QLabel ( i18n("Show events that recur "), habo ); 858 new QLabel ( i18n("Show events that recur "), habo );
857 859
858 } 860 }
859 dailyRecur = 861 dailyRecur =
860 addWidBool(i18n("daily"), 862 addWidBool(i18n("daily"),
861 &(KOPrefs::instance()->mMonthDailyRecur),habo); 863 &(KOPrefs::instance()->mMonthDailyRecur),habo);
862 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 864 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
863 865
864 weeklyRecur = 866 weeklyRecur =
865 addWidBool(i18n("weekly"), 867 addWidBool(i18n("weekly"),
866 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 868 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
867 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 869 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
868 ii++; 870 ii++;
869 871
870 872
871 habo = new QHBox( topFrame ); 873 habo = new QHBox( topFrame );
872 if ( QApplication::desktop()->width() < 320 ) { 874 if ( QApplication::desktop()->width() < 320 ) {
873 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 875 lab = new QLabel (i18n("Show in every cell ") , topFrame );
874 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 876 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
875 ii++; 877 ii++;
876 878
877 } else { 879 } else {
878 new QLabel ( i18n("Show in every cell "), habo ); 880 new QLabel ( i18n("Show in every cell "), habo );
879 } 881 }
880 weeklyRecur = 882 weeklyRecur =
881 addWidBool(i18n("short month"), 883 addWidBool(i18n("short month"),
882 &(KOPrefs::instance()->mMonthShowShort),habo); 884 &(KOPrefs::instance()->mMonthShowShort),habo);
883 weeklyRecur = 885 weeklyRecur =
884 addWidBool(i18n("icons"), 886 addWidBool(i18n("icons"),
885 &(KOPrefs::instance()->mMonthShowIcons),habo); 887 &(KOPrefs::instance()->mMonthShowIcons),habo);
886 888
887 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 889 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
888 ii++; 890 ii++;
889#ifdef DESKTOP_VERSION 891#ifdef DESKTOP_VERSION
890 KPrefsDialogWidBool *enableMonthScroll = 892 KPrefsDialogWidBool *enableMonthScroll =
891 addWidBool(i18n("Enable scrollbars in month view cells"), 893 addWidBool(i18n("Enable scrollbars in month view cells"),
892 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 894 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
893 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 895 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
894#endif 896#endif
895 897
896 dummy = 898 dummy =
897 addWidBool(i18n("Show Sat/Sun together"), 899 addWidBool(i18n("Show Sat/Sun together"),
898 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 900 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
899 topLayout->addWidget(dummy->checkBox(),ii++,0); 901 topLayout->addWidget(dummy->checkBox(),ii++,0);
900 902
901 KPrefsDialogWidBool *coloredCategoriesInMonthView = 903 KPrefsDialogWidBool *coloredCategoriesInMonthView =
902 addWidBool(i18n("Month view uses category colors"), 904 addWidBool(i18n("Month view uses category colors"),
903 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 905 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
904 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 906 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
905 907
906 dummy = 908 dummy =
907 addWidBool(i18n("Categorie colors are applied to text"), 909 addWidBool(i18n("Categorie colors are applied to text"),
908 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 910 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
909 topLayout->addWidget(dummy->checkBox(),ii++,0); 911 topLayout->addWidget(dummy->checkBox(),ii++,0);
910 coloredCategoriesInMonthView = 912 coloredCategoriesInMonthView =
911 addWidBool(i18n("Month view uses day colors"), 913 addWidBool(i18n("Month view uses day colors"),
912 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 914 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
913 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 915 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
914 916
915 KPrefsWidColor *holidayColor = 917 KPrefsWidColor *holidayColor =
916 addWidColor(i18n("Day color odd months"), 918 addWidColor(i18n("Day color odd months"),
917 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 919 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
918 topLayout->addWidget(holidayColor->label(),ii,0); 920 topLayout->addWidget(holidayColor->label(),ii,0);
919 topLayout->addWidget(holidayColor->button(),ii++,1); 921 topLayout->addWidget(holidayColor->button(),ii++,1);
920 922
921 holidayColor = 923 holidayColor =
922 addWidColor(i18n("Day color even months"), 924 addWidColor(i18n("Day color even months"),
923 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 925 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
924 topLayout->addWidget(holidayColor->label(),ii,0); 926 topLayout->addWidget(holidayColor->label(),ii,0);
925 topLayout->addWidget(holidayColor->button(),ii++,1); 927 topLayout->addWidget(holidayColor->button(),ii++,1);
926 928
927 929
928 holidayColor = 930 holidayColor =
929 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 931 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
930 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 932 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
931 topLayout->addWidget(holidayColor->label(),ii,0); 933 topLayout->addWidget(holidayColor->label(),ii,0);
932 topLayout->addWidget(holidayColor->button(),ii++,1); 934 topLayout->addWidget(holidayColor->button(),ii++,1);
933 935
934 // *********************** Todo View 936 // *********************** Todo View
935 937
936 topFrame = addPage(i18n("Todo View"),0,0); 938 topFrame = addPage(i18n("Todo View"),0,0);
937 // DesktopIcon("viewmag",KIcon::SizeMedium)); 939 // DesktopIcon("viewmag",KIcon::SizeMedium));
938 940
939 topLayout = new QGridLayout(topFrame,4,1); 941 topLayout = new QGridLayout(topFrame,4,1);
940 topLayout->setSpacing(spacingHint()); 942 topLayout->setSpacing(spacingHint());
941 topLayout->setMargin(marginHint()); 943 topLayout->setMargin(marginHint());
942 ii = 0; 944 ii = 0;
943 945
944 KPrefsDialogWidBool *showCompletedTodo = 946 KPrefsDialogWidBool *showCompletedTodo =
945 addWidBool(i18n("To-do view shows completed Todos"), 947 addWidBool(i18n("To-do view shows completed Todos"),
946 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 948 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
947 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 949 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
948 dummy = 950 dummy =
949 addWidBool(i18n("To-do view shows complete as 'xx %'"), 951 addWidBool(i18n("To-do view shows complete as 'xx %'"),
950 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 952 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
951 topLayout->addWidget(dummy->checkBox(),ii++,0); 953 topLayout->addWidget(dummy->checkBox(),ii++,0);
952 954
953 dummy = 955 dummy =
954 addWidBool(i18n("Small To-do view uses smaller font"), 956 addWidBool(i18n("Small To-do view uses smaller font"),
955 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 957 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
956 topLayout->addWidget(dummy->checkBox(),ii++,0); 958 topLayout->addWidget(dummy->checkBox(),ii++,0);
957 959
958 960
959 961
960 dummy = 962 dummy =
961 addWidBool(i18n("Todo view uses category colors"), 963 addWidBool(i18n("Todo view uses category colors"),
962 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 964 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
963 topLayout->addWidget(dummy->checkBox(),ii++,0); 965 topLayout->addWidget(dummy->checkBox(),ii++,0);
964 966
965 967
966 QWidget* wid = new QWidget( topFrame ); 968 QWidget* wid = new QWidget( topFrame );
967 // Todo due today color 969 // Todo due today color
968 KPrefsWidColor *todoDueTodayColor = 970 KPrefsWidColor *todoDueTodayColor =
969 addWidColor(i18n("Todo due today color:"), 971 addWidColor(i18n("Todo due today color:"),
970 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 972 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
971 QHBoxLayout *widLayout = new QHBoxLayout(wid); 973 QHBoxLayout *widLayout = new QHBoxLayout(wid);
972 widLayout->addWidget( todoDueTodayColor->label() ); 974 widLayout->addWidget( todoDueTodayColor->label() );
973 widLayout->addWidget( todoDueTodayColor->button() ); 975 widLayout->addWidget( todoDueTodayColor->button() );
974 topLayout->addWidget(wid,ii++,0); 976 topLayout->addWidget(wid,ii++,0);
975 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 977 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
976 978
977 // Todo overdue color 979 // Todo overdue color
978 wid = new QWidget( topFrame ); 980 wid = new QWidget( topFrame );
979 widLayout = new QHBoxLayout(wid); 981 widLayout = new QHBoxLayout(wid);
980 KPrefsWidColor *todoOverdueColor = 982 KPrefsWidColor *todoOverdueColor =
981 addWidColor(i18n("Todo overdue color:"), 983 addWidColor(i18n("Todo overdue color:"),
982 &(KOPrefs::instance()->mTodoOverdueColor),wid); 984 &(KOPrefs::instance()->mTodoOverdueColor),wid);
983 widLayout->addWidget(todoOverdueColor->label()); 985 widLayout->addWidget(todoOverdueColor->label());
984 widLayout->addWidget(todoOverdueColor->button()); 986 widLayout->addWidget(todoOverdueColor->button());
985 topLayout->addWidget(wid,ii++,0); 987 topLayout->addWidget(wid,ii++,0);
986 988
987 dummy = 989 dummy =
988 addWidBool(i18n("Colors are applied to text"), 990 addWidBool(i18n("Colors are applied to text"),
989 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 991 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
990 topLayout->addWidget(dummy->checkBox(),ii++,0); 992 topLayout->addWidget(dummy->checkBox(),ii++,0);
991 993
992 dummy = 994 dummy =
993 addWidBool(i18n("Allday Agenda view shows todos"), 995 addWidBool(i18n("Allday Agenda view shows todos"),
994 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 996 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
995 topLayout->addWidget(dummy->checkBox(),ii++,0); 997 topLayout->addWidget(dummy->checkBox(),ii++,0);
996 998
997 999
998 1000
999 1001
1000 topFrame = addPage(i18n("Alarm"),0,0); 1002 topFrame = addPage(i18n("Alarm"),0,0);
1001 // DesktopIcon("viewmag",KIcon::SizeMedium)); 1003 // DesktopIcon("viewmag",KIcon::SizeMedium));
1002 1004
1003 topLayout = new QGridLayout(topFrame,2,1); 1005 topLayout = new QGridLayout(topFrame,2,1);
1004 topLayout->setSpacing(spacingHint()); 1006 topLayout->setSpacing(spacingHint());
1005 topLayout->setMargin(marginHint()); 1007 topLayout->setMargin(marginHint());
1006 int iii = 0; 1008 int iii = 0;
1007 1009
1008 dummy = 1010 dummy =
1009 addWidBool(i18n("Use internal alarm notification"), 1011 addWidBool(i18n("Use internal alarm notification"),
1010 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 1012 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
1011 topLayout->addWidget(dummy->checkBox(),iii++,0); 1013 topLayout->addWidget(dummy->checkBox(),iii++,0);
1012 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 1014 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
1013 1015
1014 topLayout->addWidget(lab ,iii++,0); 1016 topLayout->addWidget(lab ,iii++,0);
1015#ifndef DESKTOP_VERSION 1017#ifndef DESKTOP_VERSION
1016 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1018 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
1017#else 1019#else
1018 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1020 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
1019 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1021 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1020#endif 1022#endif
1021 1023
1022 QHBox* dummyBox = new QHBox(topFrame); 1024 QHBox* dummyBox = new QHBox(topFrame);
1023 new QLabel(i18n("Play beeps count:"),dummyBox); 1025 new QLabel(i18n("Play beeps count:"),dummyBox);
1024 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 1026 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
1025 topLayout->addWidget(dummyBox,iii++,0); 1027 topLayout->addWidget(dummyBox,iii++,0);
1026 1028
1027 dummyBox = new QHBox(topFrame); 1029 dummyBox = new QHBox(topFrame);
1028 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 1030 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
1029 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 1031 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
1030 topLayout->addWidget(dummyBox,iii++,0); 1032 topLayout->addWidget(dummyBox,iii++,0);
1031 1033
1032 dummyBox = new QHBox(topFrame); 1034 dummyBox = new QHBox(topFrame);
1033 new QLabel(i18n("Default suspend time in min:"),dummyBox); 1035 new QLabel(i18n("Default suspend time in min:"),dummyBox);
1034 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 1036 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
1035 topLayout->addWidget(dummyBox,iii++,0); 1037 topLayout->addWidget(dummyBox,iii++,0);
1036 1038
1037 dummyBox = new QHBox(topFrame); 1039 dummyBox = new QHBox(topFrame);
1038 new QLabel(i18n("Auto suspend count:"),dummyBox); 1040 new QLabel(i18n("Auto suspend count:"),dummyBox);
1039 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1041 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
1040 topLayout->addWidget(dummyBox,iii++,0); 1042 topLayout->addWidget(dummyBox,iii++,0);
1041 1043
1042 1044
1043 1045
1044 1046
1045 1047
1046 1048
1047 1049
1048 QHBox* hbo = new QHBox ( topFrame ); 1050 QHBox* hbo = new QHBox ( topFrame );
1049 mDefaultAlarmFile = new QLineEdit(hbo); 1051 mDefaultAlarmFile = new QLineEdit(hbo);
1050 QPushButton * loadTemplate = new QPushButton(hbo); 1052 QPushButton * loadTemplate = new QPushButton(hbo);
1051 QPixmap icon; 1053 QPixmap icon;
1052 if ( QApplication::desktop()->width() < 321 ) 1054 if ( QApplication::desktop()->width() < 321 )
1053 icon = SmallIcon("fileimport16"); 1055 icon = SmallIcon("fileimport16");
1054 else 1056 else
1055 icon = SmallIcon("fileimport"); 1057 icon = SmallIcon("fileimport");
1056 loadTemplate->setIconSet (icon ) ; 1058 loadTemplate->setIconSet (icon ) ;
1057 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1059 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
1058 int size = loadTemplate->sizeHint().height(); 1060 int size = loadTemplate->sizeHint().height();
1059 loadTemplate->setFixedSize( size, size ); 1061 loadTemplate->setFixedSize( size, size );
1060 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1062 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
1061 // topLayout->addWidget(lab ,iii++,0); 1063 // topLayout->addWidget(lab ,iii++,0);
1062 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 1064 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
1063 topLayout->addWidget(lab ,iii++,0); 1065 topLayout->addWidget(lab ,iii++,0);
1064 topLayout->addWidget(hbo,iii++,0); 1066 topLayout->addWidget(hbo,iii++,0);
1065 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 1067 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
1066 1068
1067// topLayout->addWidget(lab ,iii++,0); 1069// topLayout->addWidget(lab ,iii++,0);
1068// #ifndef DESKTOP_VERSION 1070// #ifndef DESKTOP_VERSION
1069// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1071// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
1070// #else 1072// #else
1071// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1073// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
1072// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1074// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
1073// #endif 1075// #endif
1074 1076
1075 1077
1076} 1078}
1077 1079
1078void KOPrefsDialog::selectSoundFile() 1080void KOPrefsDialog::selectSoundFile()
1079{ 1081{
1080 QString fileName = mDefaultAlarmFile->text(); 1082 QString fileName = mDefaultAlarmFile->text();
1081 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1083 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1082 if ( fileName.length() > 0 ) 1084 if ( fileName.length() > 0 )
1083 mDefaultAlarmFile->setText( fileName ); 1085 mDefaultAlarmFile->setText( fileName );
1084} 1086}
1085void KOPrefsDialog::setupFontsTab() 1087void KOPrefsDialog::setupFontsTab()
1086{ 1088{
1087 1089
1088 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1090 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1089 // DesktopIcon("fonts",KIcon::SizeMedium)); 1091 // DesktopIcon("fonts",KIcon::SizeMedium));
1090 1092
1091 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1093 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1092 topLayout->setSpacing(1); 1094 topLayout->setSpacing(1);
1093 topLayout->setMargin(3); 1095 topLayout->setMargin(3);
1094 KPrefsDialogWidFont * tVFont; 1096 KPrefsDialogWidFont * tVFont;
1095 int i = 0; 1097 int i = 0;
1096 KPrefsDialogWidFont *timeLabelsFont = 1098 KPrefsDialogWidFont *timeLabelsFont =
1097 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1099 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1098 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1100 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1099 topLayout->addWidget(timeLabelsFont->label(),i,0); 1101 topLayout->addWidget(timeLabelsFont->label(),i,0);
1100 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1102 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1101 topLayout->addWidget(timeLabelsFont->button(),i,2); 1103 topLayout->addWidget(timeLabelsFont->button(),i,2);
1102 ++i; 1104 ++i;
1103 1105
1104 1106
1105 timeLabelsFont = 1107 timeLabelsFont =
1106 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1108 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1107 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1109 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1108 topLayout->addWidget(timeLabelsFont->label(),i,0); 1110 topLayout->addWidget(timeLabelsFont->label(),i,0);
1109 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1111 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1110 topLayout->addWidget(timeLabelsFont->button(),i,2); 1112 topLayout->addWidget(timeLabelsFont->button(),i,2);
1111 ++i; 1113 ++i;
1112 1114
1113 KPrefsDialogWidFont *timeBarFont = 1115 KPrefsDialogWidFont *timeBarFont =
1114 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1116 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1115 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1117 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1116 topLayout->addWidget(timeBarFont->label(),i,0); 1118 topLayout->addWidget(timeBarFont->label(),i,0);
1117 topLayout->addWidget(timeBarFont->preview(),i,1); 1119 topLayout->addWidget(timeBarFont->preview(),i,1);
1118 topLayout->addWidget(timeBarFont->button(),i,2); 1120 topLayout->addWidget(timeBarFont->button(),i,2);
1119 ++i; 1121 ++i;
1120 1122
1121 1123
1122 KPrefsDialogWidFont *marcusBainsFont = 1124 KPrefsDialogWidFont *marcusBainsFont =
1123 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1125 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1124 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1126 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1125 topLayout->addWidget(marcusBainsFont->label(),i,0); 1127 topLayout->addWidget(marcusBainsFont->label(),i,0);
1126 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1128 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1127 topLayout->addWidget(marcusBainsFont->button(),i,2); 1129 topLayout->addWidget(marcusBainsFont->button(),i,2);
1128 ++i; 1130 ++i;
1129 1131
1130 tVFont = 1132 tVFont =
1131 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1133 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1132 &(KOPrefs::instance()->mEventViewFont),topFrame); 1134 &(KOPrefs::instance()->mEventViewFont),topFrame);
1133 topLayout->addWidget(tVFont->label(),i,0); 1135 topLayout->addWidget(tVFont->label(),i,0);
1134 topLayout->addWidget(tVFont->preview(),i,1); 1136 topLayout->addWidget(tVFont->preview(),i,1);
1135 topLayout->addWidget(tVFont->button(),i,2); 1137 topLayout->addWidget(tVFont->button(),i,2);
1136 ++i; 1138 ++i;
1137 1139
1138 1140
1139 1141
1140 tVFont = 1142 tVFont =
1141 addWidFont(i18n("Details"),i18n("EditorBox:"), 1143 addWidFont(i18n("Details"),i18n("EditorBox:"),
1142 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1144 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1143 topLayout->addWidget(tVFont->label(),i,0); 1145 topLayout->addWidget(tVFont->label(),i,0);
1144 topLayout->addWidget(tVFont->preview(),i,1); 1146 topLayout->addWidget(tVFont->preview(),i,1);
1145 topLayout->addWidget(tVFont->button(),i,2); 1147 topLayout->addWidget(tVFont->button(),i,2);
1146 ++i; 1148 ++i;
1147 1149
1148 1150
1149 1151
1150 topLayout->setColStretch(1,1); 1152 topLayout->setColStretch(1,1);
1151 topLayout->setRowStretch(4,1); 1153 topLayout->setRowStretch(4,1);
1152 1154
1153 1155
1154 i = 0; 1156 i = 0;
1155 topFrame = addPage(i18n("View Fonts"),0, 1157 topFrame = addPage(i18n("View Fonts"),0,
1156 DesktopIcon("fonts",KIcon::SizeMedium)); 1158 DesktopIcon("fonts",KIcon::SizeMedium));
1157 1159
1158 topLayout = new QGridLayout(topFrame,7,3); 1160 topLayout = new QGridLayout(topFrame,7,3);
1159 topLayout->setSpacing(1); 1161 topLayout->setSpacing(1);
1160 topLayout->setMargin(3); 1162 topLayout->setMargin(3);
1161 1163
1162 tVFont = 1164 tVFont =
1163 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1165 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1164 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1166 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1165 topLayout->addWidget(tVFont->label(),i,0); 1167 topLayout->addWidget(tVFont->label(),i,0);
1166 topLayout->addWidget(tVFont->preview(),i,1); 1168 topLayout->addWidget(tVFont->preview(),i,1);
1167 topLayout->addWidget(tVFont->button(),i,2); 1169 topLayout->addWidget(tVFont->button(),i,2);
1168 ++i; 1170 ++i;
1169 KPrefsDialogWidFont *agendaViewFont = 1171 KPrefsDialogWidFont *agendaViewFont =
1170 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1172 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1171 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1173 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1172 topLayout->addWidget(agendaViewFont->label(),i,0); 1174 topLayout->addWidget(agendaViewFont->label(),i,0);
1173 topLayout->addWidget(agendaViewFont->preview(),i,1); 1175 topLayout->addWidget(agendaViewFont->preview(),i,1);
1174 topLayout->addWidget(agendaViewFont->button(),i,2); 1176 topLayout->addWidget(agendaViewFont->button(),i,2);
1175 ++i; 1177 ++i;
1176 1178
1177 1179
1178 KPrefsDialogWidFont *monthViewFont = 1180 KPrefsDialogWidFont *monthViewFont =
1179 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1181 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1180 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1182 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1181 topLayout->addWidget(monthViewFont->label(),i,0); 1183 topLayout->addWidget(monthViewFont->label(),i,0);
1182 topLayout->addWidget(monthViewFont->preview(),i,1); 1184 topLayout->addWidget(monthViewFont->preview(),i,1);
1183 topLayout->addWidget(monthViewFont->button(),i,2); 1185 topLayout->addWidget(monthViewFont->button(),i,2);
1184 ++i; 1186 ++i;
1185 1187
1186 1188
1187 KPrefsDialogWidFont *lVFont = 1189 KPrefsDialogWidFont *lVFont =
1188 addWidFont(i18n("Event"),i18n("List View:"), 1190 addWidFont(i18n("Event"),i18n("List View:"),
1189 &(KOPrefs::instance()->mListViewFont),topFrame); 1191 &(KOPrefs::instance()->mListViewFont),topFrame);
1190 topLayout->addWidget(lVFont->label(),i,0); 1192 topLayout->addWidget(lVFont->label(),i,0);
1191 topLayout->addWidget(lVFont->preview(),i,1); 1193 topLayout->addWidget(lVFont->preview(),i,1);
1192 topLayout->addWidget(lVFont->button(),i,2); 1194 topLayout->addWidget(lVFont->button(),i,2);
1193 ++i; 1195 ++i;
1194 1196
1195 1197
1196 tVFont = 1198 tVFont =
1197 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1199 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1198 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1200 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1199 topLayout->addWidget(tVFont->label(),i,0); 1201 topLayout->addWidget(tVFont->label(),i,0);
1200 topLayout->addWidget(tVFont->preview(),i,1); 1202 topLayout->addWidget(tVFont->preview(),i,1);
1201 topLayout->addWidget(tVFont->button(),i,2); 1203 topLayout->addWidget(tVFont->button(),i,2);
1202 ++i; 1204 ++i;
1203 1205
1204 1206
1205 tVFont = 1207 tVFont =
1206 addWidFont(i18n("Today"),i18n("JournalView:"), 1208 addWidFont(i18n("Today"),i18n("JournalView:"),
1207 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1209 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1208 topLayout->addWidget(tVFont->label(),i,0); 1210 topLayout->addWidget(tVFont->label(),i,0);
1209 topLayout->addWidget(tVFont->preview(),i,1); 1211 topLayout->addWidget(tVFont->preview(),i,1);
1210 topLayout->addWidget(tVFont->button(),i,2); 1212 topLayout->addWidget(tVFont->button(),i,2);
1211 ++i; 1213 ++i;
1212 1214
1213 1215
1214 1216
1215 1217
1216 topLayout->setColStretch(1,1); 1218 topLayout->setColStretch(1,1);
1217 topLayout->setRowStretch(4,1); 1219 topLayout->setRowStretch(4,1);
1218 1220
1219 1221
1220 1222
1221 1223
1222} 1224}
1223 1225
1224void KOPrefsDialog::setupColorsTab() 1226void KOPrefsDialog::setupColorsTab()
1225{ 1227{
1226 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1228 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1227 // DesktopIcon("colorize",KIcon::SizeMedium)); 1229 // DesktopIcon("colorize",KIcon::SizeMedium));
1228 1230
1229 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1231 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1230 // topLayout->setSpacing(spacingHint()); 1232 // topLayout->setSpacing(spacingHint());
1231 // topLayout->setMargin(marginHint()); 1233 // topLayout->setMargin(marginHint());
1232 1234
1233 topLayout->setSpacing(2); 1235 topLayout->setSpacing(2);
1234 topLayout->setMargin(3); 1236 topLayout->setMargin(3);
1235 1237
1236 int ii = 1; 1238 int ii = 1;
1237 QGroupBox *categoryGroup ; 1239 QGroupBox *categoryGroup ;
1238 1240
1239 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1241 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1240 topFrame); 1242 topFrame);
1241 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1243 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1242 1244
1243 mCategoryCombo = new QComboBox(categoryGroup); 1245 mCategoryCombo = new QComboBox(categoryGroup);
1244 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1246 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1245 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1247 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1246 1248
1247 mCategoryButton = new KColorButton(categoryGroup); 1249 mCategoryButton = new KColorButton(categoryGroup);
1248 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1250 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1249 updateCategoryColor(); 1251 updateCategoryColor();
1250 1252
1251 1253
1252 // Holiday Color 1254 // Holiday Color
1253 1255
1254 KPrefsWidColor *holidayColor = 1256 KPrefsWidColor *holidayColor =
1255 addWidColor(i18n("Holiday color:"), 1257 addWidColor(i18n("Holiday color:"),
1256 &(KOPrefs::instance()->mHolidayColor),topFrame); 1258 &(KOPrefs::instance()->mHolidayColor),topFrame);
1257 topLayout->addWidget(holidayColor->label(),ii,0); 1259 topLayout->addWidget(holidayColor->label(),ii,0);
1258 topLayout->addWidget(holidayColor->button(),ii++,1); 1260 topLayout->addWidget(holidayColor->button(),ii++,1);
1259 1261
1260 // Highlight Color 1262 // Highlight Color
1261 KPrefsWidColor *highlightColor = 1263 KPrefsWidColor *highlightColor =
1262 addWidColor(i18n("Highlight color:"), 1264 addWidColor(i18n("Highlight color:"),
1263 &(KOPrefs::instance()->mHighlightColor),topFrame); 1265 &(KOPrefs::instance()->mHighlightColor),topFrame);
1264 topLayout->addWidget(highlightColor->label(),ii,0); 1266 topLayout->addWidget(highlightColor->label(),ii,0);
1265 topLayout->addWidget(highlightColor->button(),ii++,1); 1267 topLayout->addWidget(highlightColor->button(),ii++,1);
1266 1268
1267 // Event color 1269 // Event color
1268 KPrefsWidColor *eventColor = 1270 KPrefsWidColor *eventColor =
1269 addWidColor(i18n("Default event color:"), 1271 addWidColor(i18n("Default event color:"),
1270 &(KOPrefs::instance()->mEventColor),topFrame); 1272 &(KOPrefs::instance()->mEventColor),topFrame);
1271 topLayout->addWidget(eventColor->label(),ii,0); 1273 topLayout->addWidget(eventColor->label(),ii,0);
1272 topLayout->addWidget(eventColor->button(),ii++,1); 1274 topLayout->addWidget(eventColor->button(),ii++,1);
1273 1275
1274 // agenda view background color 1276 // agenda view background color
1275 KPrefsWidColor *agendaBgColor = 1277 KPrefsWidColor *agendaBgColor =
1276 addWidColor(i18n("Agenda view background color:"), 1278 addWidColor(i18n("Agenda view background color:"),
1277 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1279 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1278 topLayout->addWidget(agendaBgColor->label(),ii,0); 1280 topLayout->addWidget(agendaBgColor->label(),ii,0);
1279 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1281 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1280 1282
1281 // working hours color 1283 // working hours color
1282 KPrefsWidColor *workingHoursColor = 1284 KPrefsWidColor *workingHoursColor =
1283 addWidColor(i18n("Working hours color:"), 1285 addWidColor(i18n("Working hours color:"),
1284 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1286 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1285 topLayout->addWidget(workingHoursColor->label(),ii,0); 1287 topLayout->addWidget(workingHoursColor->label(),ii,0);
1286 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1288 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1287 1289
1288 KPrefsDialogWidBool *sb = 1290 KPrefsDialogWidBool *sb =
1289 addWidBool(i18n("Use colors for application:"), 1291 addWidBool(i18n("Use colors for application:"),
1290 &(KOPrefs::instance()->mUseAppColors),topFrame); 1292 &(KOPrefs::instance()->mUseAppColors),topFrame);
1291 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1293 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1292 1294
1293 ii++; 1295 ii++;
1294 KPrefsWidColor * workingHoursColor1 = 1296 KPrefsWidColor * workingHoursColor1 =
1295 addWidColor(i18n("Buttons, menus, etc.:"), 1297 addWidColor(i18n("Buttons, menus, etc.:"),
1296 &(KOPrefs::instance()->mAppColor1),topFrame); 1298 &(KOPrefs::instance()->mAppColor1),topFrame);
1297 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1299 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1298 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1300 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1299 1301
1300 KPrefsWidColor * workingHoursColor2 = 1302 KPrefsWidColor * workingHoursColor2 =
1301 addWidColor(i18n("Frames, labels, etc.:"), 1303 addWidColor(i18n("Frames, labels, etc.:"),
1302 &(KOPrefs::instance()->mAppColor2),topFrame); 1304 &(KOPrefs::instance()->mAppColor2),topFrame);
1303 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1305 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1304 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1306 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1305 1307
1306 1308
1307 1309
1308} 1310}
1309 1311
1310void KOPrefsDialog::setCategoryColor() 1312void KOPrefsDialog::setCategoryColor()
1311{ 1313{
1312 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1314 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1313} 1315}
1314 1316
1315void KOPrefsDialog::updateCategoryColor() 1317void KOPrefsDialog::updateCategoryColor()
1316{ 1318{
1317 QString cat = mCategoryCombo->currentText(); 1319 QString cat = mCategoryCombo->currentText();
1318 QColor *color = mCategoryDict.find(cat); 1320 QColor *color = mCategoryDict.find(cat);
1319 if (!color) { 1321 if (!color) {
1320 color = KOPrefs::instance()->categoryColor(cat); 1322 color = KOPrefs::instance()->categoryColor(cat);
1321 } 1323 }
1322 if (color) { 1324 if (color) {
1323 mCategoryButton->setColor(*color); 1325 mCategoryButton->setColor(*color);
1324 } 1326 }
1325} 1327}
1326 1328
1327void KOPrefsDialog::setupPrinterTab() 1329void KOPrefsDialog::setupPrinterTab()
1328{ 1330{
1329 mPrinterTab = addPage(i18n("Printing"),0, 1331 mPrinterTab = addPage(i18n("Printing"),0,
1330 DesktopIcon("fileprint",KIcon::SizeMedium)); 1332 DesktopIcon("fileprint",KIcon::SizeMedium));
1331 1333
1332 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1334 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1333 topLayout->setSpacing(spacingHint()); 1335 topLayout->setSpacing(spacingHint());
1334 topLayout->setMargin(marginHint()); 1336 topLayout->setMargin(marginHint());
1335 1337
1336 topLayout->setRowStretch(4,1); 1338 topLayout->setRowStretch(4,1);
1337} 1339}
1338 1340
1339void KOPrefsDialog::setupGroupSchedulingTab() 1341void KOPrefsDialog::setupGroupSchedulingTab()
1340{ 1342{
1341#if 0 1343#if 0
1342 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1344 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1343 DesktopIcon("personal",KIcon::SizeMedium)); 1345 DesktopIcon("personal",KIcon::SizeMedium));
1344 1346
1345 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1347 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1346 topLayout->setSpacing(spacingHint()); 1348 topLayout->setSpacing(spacingHint());
1347 topLayout->setMargin(marginHint()); 1349 topLayout->setMargin(marginHint());
1348 1350
1349#if 0 1351#if 0
1350 KPrefsWidRadios *schedulerGroup = 1352 KPrefsWidRadios *schedulerGroup =
1351 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1353 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1352 topFrame); 1354 topFrame);
1353 schedulerGroup->addRadio("Dummy"); // Only for debugging 1355 schedulerGroup->addRadio("Dummy"); // Only for debugging
1354 schedulerGroup->addRadio(i18n("Mail client")); 1356 schedulerGroup->addRadio(i18n("Mail client"));
1355 1357
1356 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1358 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1357#endif 1359#endif
1358 1360
1359 KPrefsWidRadios *sendGroup = 1361 KPrefsWidRadios *sendGroup =
1360 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1362 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1361 topFrame); 1363 topFrame);
1362 sendGroup->addRadio(i18n("Send to outbox")); 1364 sendGroup->addRadio(i18n("Send to outbox"));
1363 sendGroup->addRadio(i18n("Send directly")); 1365 sendGroup->addRadio(i18n("Send directly"));
1364 1366
1365 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1367 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1366 1368
1367 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1369 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1368 mAMails = new QListView(topFrame); 1370 mAMails = new QListView(topFrame);
1369 mAMails->addColumn(i18n("Email"),300); 1371 mAMails->addColumn(i18n("Email"),300);
1370 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1372 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1371 1373
1372 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1374 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1373 aEmailsEdit = new QLineEdit(topFrame); 1375 aEmailsEdit = new QLineEdit(topFrame);
1374 aEmailsEdit->setEnabled(false); 1376 aEmailsEdit->setEnabled(false);
1375 topLayout->addWidget(aEmailsEdit,4,1); 1377 topLayout->addWidget(aEmailsEdit,4,1);
1376 1378
1377 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1379 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1378 topLayout->addWidget(add,5,0); 1380 topLayout->addWidget(add,5,0);
1379 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1381 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1380 topLayout->addWidget(del,5,1); 1382 topLayout->addWidget(del,5,1);
1381 1383
1382 //topLayout->setRowStretch(2,1); 1384 //topLayout->setRowStretch(2,1);
1383 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1385 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1384 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1386 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1385 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1387 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1386 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1388 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1387#endif 1389#endif
1388} 1390}
1389 1391
1390void KOPrefsDialog::setupGroupAutomationTab() 1392void KOPrefsDialog::setupGroupAutomationTab()
1391{ 1393{
1392 return; 1394 return;
1393 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1395 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1394 DesktopIcon("personal",KIcon::SizeMedium)); 1396 DesktopIcon("personal",KIcon::SizeMedium));
1395 1397
1396 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1398 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1397 topLayout->setSpacing(spacingHint()); 1399 topLayout->setSpacing(spacingHint());
1398 topLayout->setMargin(marginHint()); 1400 topLayout->setMargin(marginHint());
1399 1401
1400 KPrefsWidRadios *autoRefreshGroup = 1402 KPrefsWidRadios *autoRefreshGroup =
1401 addWidRadios(i18n("Auto Send Refresh"), 1403 addWidRadios(i18n("Auto Send Refresh"),
1402 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1404 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1403 autoRefreshGroup->addRadio(i18n("Never")); 1405 autoRefreshGroup->addRadio(i18n("Never"));
1404 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1406 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1405 //autoRefreshGroup->addRadio(i18n("selected emails")); 1407 //autoRefreshGroup->addRadio(i18n("selected emails"));
1406 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1408 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1407 1409
1408 KPrefsWidRadios *autoInsertGroup = 1410 KPrefsWidRadios *autoInsertGroup =
1409 addWidRadios(i18n("Auto Insert IMIP Replies"), 1411 addWidRadios(i18n("Auto Insert IMIP Replies"),
1410 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1412 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1411 autoInsertGroup->addRadio(i18n("Never")); 1413 autoInsertGroup->addRadio(i18n("Never"));
1412 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1414 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1413 //autoInsertGroup->addRadio(i18n("selected emails")); 1415 //autoInsertGroup->addRadio(i18n("selected emails"));
1414 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1416 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1415 1417
1416 KPrefsWidRadios *autoRequestGroup = 1418 KPrefsWidRadios *autoRequestGroup =
1417 addWidRadios(i18n("Auto Insert IMIP Requests"), 1419 addWidRadios(i18n("Auto Insert IMIP Requests"),
1418 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1420 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1419 autoRequestGroup->addRadio(i18n("Never")); 1421 autoRequestGroup->addRadio(i18n("Never"));
1420 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1422 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1421 //autoInsertGroup->addRadio(i18n("selected emails")); 1423 //autoInsertGroup->addRadio(i18n("selected emails"));
1422 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1424 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1423 1425
1424 KPrefsWidRadios *autoFreeBusyGroup = 1426 KPrefsWidRadios *autoFreeBusyGroup =
1425 addWidRadios(i18n("Auto Send FreeBusy Information"), 1427 addWidRadios(i18n("Auto Send FreeBusy Information"),
1426 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1428 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1427 autoFreeBusyGroup->addRadio(i18n("Never")); 1429 autoFreeBusyGroup->addRadio(i18n("Never"));
1428 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1430 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1429 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1431 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1430 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1432 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1431 1433
1432 KPrefsWidRadios *autoFreeBusyReplyGroup = 1434 KPrefsWidRadios *autoFreeBusyReplyGroup =
1433 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1435 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1434 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1436 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1435 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1437 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1436 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1438 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1437 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1439 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1438 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1440 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1439} 1441}
1440 1442
1441void KOPrefsDialog::showPrinterTab() 1443void KOPrefsDialog::showPrinterTab()
1442{ 1444{
1443 showPage(pageIndex(mPrinterTab)); 1445 showPage(pageIndex(mPrinterTab));
1444} 1446}
1445 1447
1446 1448
1447void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1449void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1448 const QStringList *tags) 1450 const QStringList *tags)
1449{ 1451{
1450 if (tags) { 1452 if (tags) {
1451 int i = tags->findIndex(text); 1453 int i = tags->findIndex(text);
1452 if (i > 0) combo->setCurrentItem(i); 1454 if (i > 0) combo->setCurrentItem(i);
1453 } else { 1455 } else {
1454 for(int i=0;i<combo->count();++i) { 1456 for(int i=0;i<combo->count();++i) {
1455 if (combo->text(i) == text) { 1457 if (combo->text(i) == text) {
1456 combo->setCurrentItem(i); 1458 combo->setCurrentItem(i);
1457 break; 1459 break;
1458 } 1460 }
1459 } 1461 }
1460 } 1462 }
1461} 1463}
1462 1464
1463void KOPrefsDialog::usrReadConfig() 1465void KOPrefsDialog::usrReadConfig()
1464{ 1466{
1465 mNameEdit->setText(KOPrefs::instance()->fullName()); 1467 mNameEdit->setText(KOPrefs::instance()->fullName());
1466 mEmailEdit->setText(KOPrefs::instance()->email()); 1468 mEmailEdit->setText(KOPrefs::instance()->email());
1467 1469
1468 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1470 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1469 QDate current ( 2001, 1,1); 1471 QDate current ( 2001, 1,1);
1470 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1472 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1471 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1473 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1472 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1474 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1473 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1475 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1474 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1476 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1475 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1477 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1476 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1478 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1477 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1479 // if (KOPrefs::instance()->mAllDaySize > 47 )
1478 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1480 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1479 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1481 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1480 1482
1481 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1483 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1482 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1484 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1483 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1485 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1484 // mAMails->clear(); 1486 // mAMails->clear();
1485 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1487 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1486// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1488// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1487// QListViewItem *item = new QListViewItem(mAMails); 1489// QListViewItem *item = new QListViewItem(mAMails);
1488// item->setText(0,*it); 1490// item->setText(0,*it);
1489// mAMails->insertItem(item); 1491// mAMails->insertItem(item);
1490// } 1492// }
1491 1493
1492 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1494 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1493 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1495 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1494 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1496 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1495 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1497 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1496 1498
1497 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1499 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1498 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1500 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1499 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1501 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1500 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1502 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1501 dummy = KOPrefs::instance()->mUserDateFormatShort; 1503 dummy = KOPrefs::instance()->mUserDateFormatShort;
1502 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1504 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1503 updateCategories(); 1505 updateCategories();
1504 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1506 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1505 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1507 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1506 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1508 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1507 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1509 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1508} 1510}
1509 1511
1510 1512
1511void KOPrefsDialog::usrWriteConfig() 1513void KOPrefsDialog::usrWriteConfig()
1512{ 1514{
1513 1515
1514 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1516 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1515 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1517 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1516 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1518 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1517 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1519 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1518 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1520 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1519 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1521 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1520 1522
1521 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1523 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1522 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1524 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1523 KOPrefs::instance()->setFullName(mNameEdit->text()); 1525 KOPrefs::instance()->setFullName(mNameEdit->text());
1524 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1526 KOPrefs::instance()->setEmail(mEmailEdit->text());
1525 1527
1526 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1528 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1527 1529
1528 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1530 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1529 QDate date; 1531 QDate date;
1530 date = mStartDateSavingEdit->date(); 1532 date = mStartDateSavingEdit->date();
1531 int sub = 0; 1533 int sub = 0;
1532 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1534 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1533 sub = 1; 1535 sub = 1;
1534 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1536 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1535 date = mEndDateSavingEdit->date(); 1537 date = mEndDateSavingEdit->date();
1536 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1538 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1537 sub = 1; 1539 sub = 1;
1538 else 1540 else
1539 sub = 0; 1541 sub = 0;
1540 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1542 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1541 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1543 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1542 1544
1543 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1545 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1544 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1546 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1545 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1547 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1546 1548
1547 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1549 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1548 1550
1549 QDictIterator<QColor> it(mCategoryDict); 1551 QDictIterator<QColor> it(mCategoryDict);
1550 while (it.current()) { 1552 while (it.current()) {
1551 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1553 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1552 ++it; 1554 ++it;
1553 } 1555 }
1554 1556
1555 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1557 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1556 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1558 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1557 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1559 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1558 1560
1559 KOPrefs::instance()->mAdditionalMails.clear(); 1561 KOPrefs::instance()->mAdditionalMails.clear();
1560 // QListViewItem *item; 1562 // QListViewItem *item;
1561 // item = mAMails->firstChild(); 1563 // item = mAMails->firstChild();
1562 // while (item) 1564 // while (item)
1563 // { 1565 // {
1564 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1566 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1565 // item = item->nextSibling(); 1567 // item = item->nextSibling();
1566 // } 1568 // }
1567 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1569 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1568 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1570 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1569 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1571 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1570 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1572 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1571 1573
1572} 1574}
1573 1575
1574void KOPrefsDialog::updateCategories() 1576void KOPrefsDialog::updateCategories()
1575{ 1577{
1576 mCategoryCombo->clear(); 1578 mCategoryCombo->clear();
1577 mCategoryDict.clear(); 1579 mCategoryDict.clear();
1578 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1580 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1579 updateCategoryColor(); 1581 updateCategoryColor();
1580} 1582}
1581 1583
1582void KOPrefsDialog::warningGroupScheduling() 1584void KOPrefsDialog::warningGroupScheduling()
1583{ 1585{
1584 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1586 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1585} 1587}
1586 1588
1587void KOPrefsDialog::warningProjectView() 1589void KOPrefsDialog::warningProjectView()
1588{ 1590{
1589 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1591 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1590} 1592}
1591 1593
1592void KOPrefsDialog::warningExperimental(bool on) 1594void KOPrefsDialog::warningExperimental(bool on)
1593{ 1595{
1594 if (on) { 1596 if (on) {
1595 KMessageBox::information(this,i18n("This is an experimental feature. " 1597 KMessageBox::information(this,i18n("This is an experimental feature. "
1596 "It may not work, it may do nothing useful and it may cause data loss. " 1598 "It may not work, it may do nothing useful and it may cause data loss. "
1597 "Use with care.\n" 1599 "Use with care.\n"
1598 "You have to restart KOrganizer for this setting to take effect.")); 1600 "You have to restart KOrganizer for this setting to take effect."));
1599 } else { 1601 } else {
1600 KMessageBox::information(this, 1602 KMessageBox::information(this,
1601 i18n("You have to restart KOrganizer for this setting to take effect.")); 1603 i18n("You have to restart KOrganizer for this setting to take effect."));
1602 } 1604 }
1603} 1605}
1604 1606
1605void KOPrefsDialog::toggleEmailSettings(bool on) 1607void KOPrefsDialog::toggleEmailSettings(bool on)
1606{ 1608{
1607 if (on) { 1609 if (on) {
1608 mEmailEdit->setEnabled(false); 1610 mEmailEdit->setEnabled(false);
1609 mNameEdit->setEnabled(false); 1611 mNameEdit->setEnabled(false);
1610 mEmailLabel->setEnabled(false); 1612 mEmailLabel->setEnabled(false);
1611 mNameLabel->setEnabled(false); 1613 mNameLabel->setEnabled(false);
1612 1614
1613 KEMailSettings settings; 1615 KEMailSettings settings;
1614 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1616 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1615 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1617 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1616 } else { 1618 } else {
1617 mEmailEdit->setEnabled(true); 1619 mEmailEdit->setEnabled(true);
1618 mNameEdit->setEnabled(true); 1620 mNameEdit->setEnabled(true);
1619 mEmailLabel->setEnabled(true); 1621 mEmailLabel->setEnabled(true);
1620 mNameLabel->setEnabled(true); 1622 mNameLabel->setEnabled(true);
1621 } 1623 }
1622} 1624}
1623 1625
1624void KOPrefsDialog::addItem() 1626void KOPrefsDialog::addItem()
1625{ 1627{
1626 // aEmailsEdit->setEnabled(true); 1628 // aEmailsEdit->setEnabled(true);
1627// QListViewItem *item = new QListViewItem(mAMails); 1629// QListViewItem *item = new QListViewItem(mAMails);
1628// mAMails->insertItem(item); 1630// mAMails->insertItem(item);
1629// mAMails->setSelected(item,true); 1631// mAMails->setSelected(item,true);
1630// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1632// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1631} 1633}
1632 1634
1633void KOPrefsDialog::removeItem() 1635void KOPrefsDialog::removeItem()
1634{ 1636{
1635// QListViewItem *item; 1637// QListViewItem *item;
1636// item = mAMails->selectedItem(); 1638// item = mAMails->selectedItem();
1637// if (!item) return; 1639// if (!item) return;
1638// mAMails->takeItem(item); 1640// mAMails->takeItem(item);
1639// item = mAMails->selectedItem(); 1641// item = mAMails->selectedItem();
1640// if (!item) { 1642// if (!item) {
1641// aEmailsEdit->setText(""); 1643// aEmailsEdit->setText("");
1642// aEmailsEdit->setEnabled(false); 1644// aEmailsEdit->setEnabled(false);
1643// } 1645// }
1644// if (mAMails->childCount() == 0) { 1646// if (mAMails->childCount() == 0) {
1645// aEmailsEdit->setEnabled(false); 1647// aEmailsEdit->setEnabled(false);
1646// } 1648// }
1647} 1649}
1648 1650
1649void KOPrefsDialog::updateItem() 1651void KOPrefsDialog::updateItem()
1650{ 1652{
1651 // QListViewItem *item; 1653 // QListViewItem *item;
1652// item = mAMails->selectedItem(); 1654// item = mAMails->selectedItem();
1653// if (!item) return; 1655// if (!item) return;
1654// item->setText(0,aEmailsEdit->text()); 1656// item->setText(0,aEmailsEdit->text());
1655} 1657}
1656 1658
1657void KOPrefsDialog::updateInput() 1659void KOPrefsDialog::updateInput()
1658{ 1660{
1659// QListViewItem *item; 1661// QListViewItem *item;
1660// item = mAMails->selectedItem(); 1662// item = mAMails->selectedItem();
1661// if (!item) return; 1663// if (!item) return;
1662// aEmailsEdit->setEnabled(true); 1664// aEmailsEdit->setEnabled(true);
1663// aEmailsEdit->setText(item->text(0)); 1665// aEmailsEdit->setText(item->text(0));
1664} 1666}
1665void KOPrefsDialog::updateTimezoneOffset( int index ) 1667void KOPrefsDialog::updateTimezoneOffset( int index )
1666{ 1668{
1667 /* 1669 /*
1668 qDebug("updateTimezoneOffset %d ", index); 1670 qDebug("updateTimezoneOffset %d ", index);
1669 if ( index < 24 ) { 1671 if ( index < 24 ) {
1670 mTimezoneOffsetSpin->setEnabled ( false ); 1672 mTimezoneOffsetSpin->setEnabled ( false );
1671 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); 1673 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1672 1674
1673 1675
1674 } else { 1676 } else {
1675 if ( index == 24 ) { 1677 if ( index == 24 ) {
1676 mTimezoneOffsetSpin->setEnabled ( true ); 1678 mTimezoneOffsetSpin->setEnabled ( true );
1677 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1679 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1678 1680
1679 } else { 1681 } else {
1680 mTimezoneOffsetSpin->setEnabled ( false ); 1682 mTimezoneOffsetSpin->setEnabled ( false );
1681 mTimezoneOffsetSpin->setValue( 0 ); 1683 mTimezoneOffsetSpin->setValue( 0 );
1682 } 1684 }
1683 } 1685 }
1684 */ 1686 */
1685} 1687}
1686 1688
1687void KOPrefsDialog::setupTimeZoneTab() 1689void KOPrefsDialog::setupTimeZoneTab()
1688{ 1690{
1689 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1691 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1690 // DesktopIcon("clock",KIcon::SizeMedium)); 1692 // DesktopIcon("clock",KIcon::SizeMedium));
1691 1693
1692 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1694 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1693 topLayout->setSpacing(spacingHint()); 1695 topLayout->setSpacing(spacingHint());
1694 topLayout->setMargin(marginHint()); 1696 topLayout->setMargin(marginHint());
1695 1697
1696 QHBox *timeZoneBox = new QHBox( topFrame ); 1698 QHBox *timeZoneBox = new QHBox( topFrame );
1697 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1699 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1698 1700
1699 new QLabel( i18n("Timezone:"), timeZoneBox ); 1701 new QLabel( i18n("Timezone:"), timeZoneBox );
1700 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1702 mTimeZoneCombo = new QComboBox( timeZoneBox );
1701 if ( QApplication::desktop()->width() < 300 ) { 1703 if ( QApplication::desktop()->width() < 300 ) {
1702 mTimeZoneCombo->setMaximumWidth(150); 1704 mTimeZoneCombo->setMaximumWidth(150);
1703 } 1705 }
1704 1706
1705 QStringList list; 1707 QStringList list;
1706 list = KGlobal::locale()->timeZoneList(); 1708 list = KGlobal::locale()->timeZoneList();
1707 mTimeZoneCombo->insertStringList(list); 1709 mTimeZoneCombo->insertStringList(list);
1708 1710
1709 // find the currently set time zone and select it 1711 // find the currently set time zone and select it
1710 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; 1712 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1711 int nCurrentlySet = 11; 1713 int nCurrentlySet = 11;
1712 for (int i = 0; i < mTimeZoneCombo->count(); i++) 1714 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1713 { 1715 {
1714 if (mTimeZoneCombo->text(i) == sCurrentlySet) 1716 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1715 { 1717 {
1716 nCurrentlySet = i; 1718 nCurrentlySet = i;
1717 break; 1719 break;
1718 } 1720 }
1719 } 1721 }
1720 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 1722 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1721 int iii = 1; 1723 int iii = 1;
1722 KPrefsDialogWidBool *sb = 1724 KPrefsDialogWidBool *sb =
1723 addWidBool(i18n("Timezone has daylight saving"), 1725 addWidBool(i18n("Timezone has daylight saving"),
1724 &(KOPrefs::instance()->mUseDaylightsaving),topFrame); 1726 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1725 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 1727 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1726 ++iii; 1728 ++iii;
1727 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 1729 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1728 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1730 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1729 ++iii; 1731 ++iii;
1730 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 1732 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1731 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1733 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1732 ++iii; 1734 ++iii;
1733 lab = new QLabel( i18n("Daylight start:"), topFrame ); 1735 lab = new QLabel( i18n("Daylight start:"), topFrame );
1734 topLayout->addWidget(lab, iii,0); 1736 topLayout->addWidget(lab, iii,0);
1735 mStartDateSavingEdit = new KDateEdit(topFrame); 1737 mStartDateSavingEdit = new KDateEdit(topFrame);
1736 topLayout->addWidget(mStartDateSavingEdit, iii,1); 1738 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1737 ++iii; 1739 ++iii;
1738 1740
1739 lab = new QLabel( i18n("Daylight end:"), topFrame ); 1741 lab = new QLabel( i18n("Daylight end:"), topFrame );
1740 topLayout->addWidget(lab, iii,0); 1742 topLayout->addWidget(lab, iii,0);
1741 mEndDateSavingEdit = new KDateEdit(topFrame); 1743 mEndDateSavingEdit = new KDateEdit(topFrame);
1742 topLayout->addWidget(mEndDateSavingEdit, iii,1); 1744 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1743 ++iii; 1745 ++iii;
1744 QDate current ( 2001, 1,1); 1746 QDate current ( 2001, 1,1);
1745 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1747 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1746 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1748 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1747 1749
1748 1750
1749} 1751}
1750#endif 1752#endif
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp
index 4daa4ff..bb41b18 100644
--- a/microkde/kutils/kcmultidialog.cpp
+++ b/microkde/kutils/kcmultidialog.cpp
@@ -1,227 +1,229 @@
1/* 1/*
2 Copyright (c) 2000 Matthias Elter <elter@kde.org> 2 Copyright (c) 2000 Matthias Elter <elter@kde.org>
3 Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org> 3 Copyright (c) 2003 Daniel Molkentin <molkentin@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 21
22#include <qhbox.h> 22#include <qhbox.h>
23#include <qvbox.h> 23#include <qvbox.h>
24#include <qcursor.h> 24#include <qcursor.h>
25#include <qlayout.h> 25#include <qlayout.h>
26 26
27#include <klocale.h> 27#include <klocale.h>
28#include <kglobal.h> 28#include <kglobal.h>
29#include <kdebug.h> 29#include <kdebug.h>
30#include <kiconloader.h> 30#include <kiconloader.h>
31#include <kmessagebox.h> 31#include <kmessagebox.h>
32//US #include <klibloader.h> 32//US #include <klibloader.h>
33#include <krun.h> 33#include <krun.h>
34#include <kprocess.h> 34#include <kprocess.h>
35#include <kglobalsettings.h>
35 36
36#include "kcmultidialog.h" 37#include "kcmultidialog.h"
37//US #include "kcmultidialog.moc" 38//US #include "kcmultidialog.moc"
38//US #include "kcmoduleloader.h" 39//US #include "kcmoduleloader.h"
39 40
40KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) 41KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal)
41 : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok, 42 : KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok,
42 parent, name, modal, true), d(0L) 43 parent, name, modal, true), d(0L)
43{ 44{
45 setFont( KGlobalSettings::generalFont() );
44 enableButton(Apply, false); 46 enableButton(Apply, false);
45 //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *))); 47 //connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *)));
46 48
47 connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) ); 49 connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) );
48 50
49 _baseGroup = baseGroup; 51 _baseGroup = baseGroup;
50 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed ); 52 mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed );
51 setMainWidget(mMainWidget ); 53 setMainWidget(mMainWidget );
52#ifdef DESKTOP_VERSION 54#ifdef DESKTOP_VERSION
53 resize(640,480); 55 resize(640,480);
54#else 56#else
55 //resize(640,480); 57 //resize(640,480);
56 //setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480)); 58 //setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480));
57 resize(800,800); 59 resize(800,800);
58 setMaximumSize( 800, 800 ); 60 setMaximumSize( 800, 800 );
59 //showMaximized(); 61 //showMaximized();
60#endif 62#endif
61 63
62} 64}
63 65
64KCMultiDialog::~KCMultiDialog() 66KCMultiDialog::~KCMultiDialog()
65{ 67{
66//US moduleDict.setAutoDelete(true); 68//US moduleDict.setAutoDelete(true);
67} 69}
68 70
69void KCMultiDialog::slotDefault() 71void KCMultiDialog::slotDefault()
70{ 72{
71 73
72 int curPageIndex = activePageIndex(); 74 int curPageIndex = activePageIndex();
73 75
74 QPtrListIterator<KCModule> it(modules); 76 QPtrListIterator<KCModule> it(modules);
75 for (; it.current(); ++it) 77 for (; it.current(); ++it)
76 { 78 {
77 if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex) 79 if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex)
78 { 80 {
79 (*it)->defaults(); 81 (*it)->defaults();
80 clientChanged(true); 82 clientChanged(true);
81 return; 83 return;
82 } 84 }
83 } 85 }
84 86
85} 87}
86void KCMultiDialog::accept() 88void KCMultiDialog::accept()
87{ 89{
88 slotOk(); 90 slotOk();
89} 91}
90void KCMultiDialog::slotApply() 92void KCMultiDialog::slotApply()
91{ 93{
92 QPtrListIterator<KCModule> it(modules); 94 QPtrListIterator<KCModule> it(modules);
93 for (; it.current(); ++it) 95 for (; it.current(); ++it)
94 (*it)->save(); 96 (*it)->save();
95 clientChanged(false); 97 clientChanged(false);
96 98
97 emit applyClicked(); 99 emit applyClicked();
98 100
99} 101}
100 102
101 103
102void KCMultiDialog::slotOk() 104void KCMultiDialog::slotOk()
103{ 105{
104qDebug("KCMultiDialog::slotOk clicked"); 106qDebug("KCMultiDialog::slotOk clicked");
105 107
106 QPtrListIterator<KCModule> it(modules); 108 QPtrListIterator<KCModule> it(modules);
107 for (; it.current(); ++it) 109 for (; it.current(); ++it)
108 (*it)->save(); 110 (*it)->save();
109 QDialog::accept(); 111 QDialog::accept();
110 112
111 emit okClicked(); 113 emit okClicked();
112} 114}
113 115
114void KCMultiDialog::slotHelp() 116void KCMultiDialog::slotHelp()
115{ 117{
116/*US 118/*US
117 KURL url( KURL("help:/"), _docPath ); 119 KURL url( KURL("help:/"), _docPath );
118 120
119 if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") { 121 if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") {
120 KProcess process; 122 KProcess process;
121 process << "khelpcenter" 123 process << "khelpcenter"
122 << url.url(); 124 << url.url();
123 process.start(KProcess::DontCare); 125 process.start(KProcess::DontCare);
124 process.detach(); 126 process.detach();
125 } else { 127 } else {
126 new KRun(url); 128 new KRun(url);
127 } 129 }
128*/ 130*/
129} 131}
130 132
131void KCMultiDialog::clientChanged(bool state) 133void KCMultiDialog::clientChanged(bool state)
132{ 134{
133 enableButton(Apply, state); 135 enableButton(Apply, state);
134} 136}
135 137
136/*US 138/*US
137void KCMultiDialog::addModule(const QString& path, bool withfallback) 139void KCMultiDialog::addModule(const QString& path, bool withfallback)
138{ 140{
139 kdDebug(1208) << "KCMultiDialog::addModule " << path << endl; 141 kdDebug(1208) << "KCMultiDialog::addModule " << path << endl;
140 142
141 KCModuleInfo info(path, _baseGroup); 143 KCModuleInfo info(path, _baseGroup);
142 144
143 QHBox* page = addHBoxPage(info.moduleName(), info.comment(), 145 QHBox* page = addHBoxPage(info.moduleName(), info.comment(),
144 KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium)); 146 KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium));
145 if(!page) { 147 if(!page) {
146 KCModuleLoader::unloadModule(info); 148 KCModuleLoader::unloadModule(info);
147 return; 149 return;
148 } 150 }
149 moduleDict.insert(page, new LoadInfo(path, withfallback)); 151 moduleDict.insert(page, new LoadInfo(path, withfallback));
150 if (modules.isEmpty()) 152 if (modules.isEmpty())
151 slotAboutToShow(page); 153 slotAboutToShow(page);
152} 154}
153*/ 155*/
154QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) 156QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename )
155{ 157{
156 QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() ); 158 QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() );
157 return page; 159 return page;
158 160
159} 161}
160//US special method for microkde. We dop noty want to load everything dynamically. 162//US special method for microkde. We dop noty want to load everything dynamically.
161void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) 163void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname)
162{ 164{
163 165
164 modules.append(module); 166 modules.append(module);
165 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); 167 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
166//US 168//US
167 module->load(); 169 module->load();
168 170
169 171
170} 172}
171 173
172void KCMultiDialog::slotAboutToShow(QWidget *page) 174void KCMultiDialog::slotAboutToShow(QWidget *page)
173{ 175{
174/*US 176/*US
175 LoadInfo *loadInfo = moduleDict[page]; 177 LoadInfo *loadInfo = moduleDict[page];
176 if (!loadInfo) 178 if (!loadInfo)
177 return; 179 return;
178 180
179 QApplication::setOverrideCursor(Qt::WaitCursor); 181 QApplication::setOverrideCursor(Qt::WaitCursor);
180 182
181 moduleDict.remove(page); 183 moduleDict.remove(page);
182 184
183 KCModuleInfo info(loadInfo->path, _baseGroup); 185 KCModuleInfo info(loadInfo->path, _baseGroup);
184 186
185 KCModule *module = KCModuleLoader::loadModule(info, loadInfo->withfallback); 187 KCModule *module = KCModuleLoader::loadModule(info, loadInfo->withfallback);
186 188
187 if (!module) 189 if (!module)
188 { 190 {
189 QApplication::restoreOverrideCursor(); 191 QApplication::restoreOverrideCursor();
190 KCModuleLoader::showLastLoaderError(this); 192 KCModuleLoader::showLastLoaderError(this);
191 delete loadInfo; 193 delete loadInfo;
192 return; 194 return;
193 } 195 }
194 196
195 module->reparent(page,0,QPoint(0,0),true); 197 module->reparent(page,0,QPoint(0,0),true);
196 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool))); 198 connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
197 //setHelp( docpath, QString::null ); 199 //setHelp( docpath, QString::null );
198 _docPath = info.docPath(); 200 _docPath = info.docPath();
199 modules.append(module); 201 modules.append(module);
200 202
201 //KCGlobal::repairAccels( topLevelWidget() ); 203 //KCGlobal::repairAccels( topLevelWidget() );
202 204
203 delete loadInfo; 205 delete loadInfo;
204 206
205 QApplication::restoreOverrideCursor(); 207 QApplication::restoreOverrideCursor();
206*/ 208*/
207 209
208qDebug("KCMultiDialog::slotAboutToShow not implemented"); 210qDebug("KCMultiDialog::slotAboutToShow not implemented");
209} 211}
210 212
211 213
212bool KCMultiDialog::showPage( int index ) 214bool KCMultiDialog::showPage( int index )
213{ 215{
214 return(mMainWidget->showPage(index) ); 216 return(mMainWidget->showPage(index) );
215} 217}
216 218
217 219
218int KCMultiDialog::activePageIndex() const 220int KCMultiDialog::activePageIndex() const
219{ 221{
220 return( mMainWidget->activePageIndex() ); 222 return( mMainWidget->activePageIndex() );
221} 223}
222 224
223 225
224int KCMultiDialog::pageIndex( QWidget *widget ) const 226int KCMultiDialog::pageIndex( QWidget *widget ) const
225{ 227{
226 return( mMainWidget->pageIndex( widget) ); 228 return( mMainWidget->pageIndex( widget) );
227} 229}