-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 4 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 4 | ||||
-rw-r--r-- | microkde/kutils/kcmultidialog.cpp | 4 |
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 | ||
59 | class ExtensionItem : public QCheckListItem | 60 | class 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 | ||
88 | KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) | 89 | KABConfigWidget::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 | ||
202 | void KABConfigWidget::usrReadConfig() | 204 | void 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 | ||
225 | void KABConfigWidget::usrWriteConfig() | 227 | void 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 | ||
244 | void KABConfigWidget::restoreExtensionSettings() | 246 | void 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 | ||
286 | void KABConfigWidget::saveExtensionSettings() | 288 | void 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 | ||
304 | void KABConfigWidget::configureExtension() | 306 | void 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 | ||
323 | void KABConfigWidget::selectionChanged( QListViewItem *i ) | 325 | void 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 | ||
332 | void KABConfigWidget::itemClicked( QListViewItem *item ) | 334 | void 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 |
339 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) | 341 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) |
340 | : QCheckListItem( parent, text, CheckBox ) | 342 | : QCheckListItem( parent, text, CheckBox ) |
341 | { | 343 | { |
342 | } | 344 | } |
343 | 345 | ||
344 | void ExtensionItem::setService( const KService::Ptr &ptr ) | 346 | void ExtensionItem::setService( const KService::Ptr &ptr ) |
345 | { | 347 | { |
346 | mPtr = ptr; | 348 | mPtr = ptr; |
347 | } | 349 | } |
348 | #else //KAB_EMBEDDED | 350 | #else //KAB_EMBEDDED |
349 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) | 351 | ExtensionItem::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 | ||
357 | void ExtensionItem::setFactory( ExtensionFactory* fac ) | 359 | void ExtensionItem::setFactory( ExtensionFactory* fac ) |
358 | { | 360 | { |
359 | mFactory = fac; | 361 | mFactory = fac; |
360 | } | 362 | } |
361 | #endif //KAB_EMBEDDED | 363 | #endif //KAB_EMBEDDED |
362 | 364 | ||
363 | bool ExtensionItem::configWidgetAvailable() const | 365 | bool 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 | ||
381 | ExtensionFactory *ExtensionItem::factory() const | 383 | ExtensionFactory *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 | ||
394 | QString ExtensionItem::text( int column ) const | 396 | QString 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,453 +1,455 @@ | |||
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 | ||
66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 67 | KOPrefsDialog::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 | ||
101 | KOPrefsDialog::~KOPrefsDialog() | 103 | KOPrefsDialog::~KOPrefsDialog() |
102 | { | 104 | { |
103 | } | 105 | } |
104 | void KOPrefsDialog::setupGlobalTab() | 106 | void 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 | } |
113 | void KOPrefsDialog::setupMainTab() | 115 | void 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 | ||
138 | void KOPrefsDialog::setupMailTab() | 140 | void 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 | } |
183 | void KOPrefsDialog::setupFontsTab() | 185 | void 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 | } |
223 | void KOPrefsDialog::usrReadConfig() | 225 | void 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 | } |
231 | void KOPrefsDialog::usrWriteConfig() | 233 | void 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 |
242 | void KOPrefsDialog::setupLocaleDateTab() | 244 | void KOPrefsDialog::setupLocaleDateTab() |
243 | { | 245 | { |
244 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 246 | QFrame *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 | ||
296 | void KOPrefsDialog::setupLocaleTab() | 298 | void 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 | } |
358 | void KOPrefsDialog::showSyncPage() | 360 | void KOPrefsDialog::showSyncPage() |
359 | { | 361 | { |
360 | showPage ( 2 ) ; | 362 | showPage ( 2 ) ; |
361 | 363 | ||
362 | } | 364 | } |
363 | void KOPrefsDialog::setupSyncAlgTab() | 365 | void 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 | ||
405 | void KOPrefsDialog::setupSyncTab() | 407 | void 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 | } |
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 | ||
40 | KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal) | 41 | KCMultiDialog::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 | ||
64 | KCMultiDialog::~KCMultiDialog() | 66 | KCMultiDialog::~KCMultiDialog() |
65 | { | 67 | { |
66 | //US moduleDict.setAutoDelete(true); | 68 | //US moduleDict.setAutoDelete(true); |
67 | } | 69 | } |
68 | 70 | ||
69 | void KCMultiDialog::slotDefault() | 71 | void 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 | } |
86 | void KCMultiDialog::accept() | 88 | void KCMultiDialog::accept() |
87 | { | 89 | { |
88 | slotOk(); | 90 | slotOk(); |
89 | } | 91 | } |
90 | void KCMultiDialog::slotApply() | 92 | void 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 | ||
102 | void KCMultiDialog::slotOk() | 104 | void KCMultiDialog::slotOk() |
103 | { | 105 | { |
104 | qDebug("KCMultiDialog::slotOk clicked"); | 106 | qDebug("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 | ||
114 | void KCMultiDialog::slotHelp() | 116 | void 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 | ||
131 | void KCMultiDialog::clientChanged(bool state) | 133 | void KCMultiDialog::clientChanged(bool state) |
132 | { | 134 | { |
133 | enableButton(Apply, state); | 135 | enableButton(Apply, state); |
134 | } | 136 | } |
135 | 137 | ||
136 | /*US | 138 | /*US |
137 | void KCMultiDialog::addModule(const QString& path, bool withfallback) | 139 | void 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 | */ |
154 | QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename ) | 156 | QVBox * 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. |
161 | void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname) | 163 | void 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 | ||
172 | void KCMultiDialog::slotAboutToShow(QWidget *page) | 174 | void 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 | ||
208 | qDebug("KCMultiDialog::slotAboutToShow not implemented"); | 210 | qDebug("KCMultiDialog::slotAboutToShow not implemented"); |
209 | } | 211 | } |
210 | 212 | ||
211 | 213 | ||
212 | bool KCMultiDialog::showPage( int index ) | 214 | bool KCMultiDialog::showPage( int index ) |
213 | { | 215 | { |
214 | return(mMainWidget->showPage(index) ); | 216 | return(mMainWidget->showPage(index) ); |
215 | } | 217 | } |
216 | 218 | ||
217 | 219 | ||
218 | int KCMultiDialog::activePageIndex() const | 220 | int KCMultiDialog::activePageIndex() const |
219 | { | 221 | { |
220 | return( mMainWidget->activePageIndex() ); | 222 | return( mMainWidget->activePageIndex() ); |
221 | } | 223 | } |
222 | 224 | ||
223 | 225 | ||
224 | int KCMultiDialog::pageIndex( QWidget *widget ) const | 226 | int KCMultiDialog::pageIndex( QWidget *widget ) const |
225 | { | 227 | { |
226 | return( mMainWidget->pageIndex( widget) ); | 228 | return( mMainWidget->pageIndex( widget) ); |
227 | } | 229 | } |