author | ulf69 <ulf69> | 2004-08-02 22:34:27 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-02 22:34:27 (UTC) |
commit | 5e9c7a34f68d9e41d73ca5c9238d69252a80595f (patch) (unidiff) | |
tree | 2000ebdb5946fdcef245342e1518c4194ceb2053 | |
parent | caccbdef7506ed596669c35009bd6d5634ee6ee1 (diff) | |
download | kdepimpi-5e9c7a34f68d9e41d73ca5c9238d69252a80595f.zip kdepimpi-5e9c7a34f68d9e41d73ca5c9238d69252a80595f.tar.gz kdepimpi-5e9c7a34f68d9e41d73ca5c9238d69252a80595f.tar.bz2 |
changed the layout to run on SL5500
-rw-r--r-- | kaddressbook/xxportselectdialog.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp index e0da3b2..41c999b 100644 --- a/kaddressbook/xxportselectdialog.cpp +++ b/kaddressbook/xxportselectdialog.cpp | |||
@@ -1,71 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk> | 3 | Copyright (c) 2002 Anders Lund <anders.lund@lund.tdcadsl.dk> |
4 | Tobias Koenig <tokoe@kde.org> | 4 | Tobias Koenig <tokoe@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | /* | 25 | /* |
26 | Enhanced Version of the file for platform independent KDE tools. | 26 | Enhanced Version of the file for platform independent KDE tools. |
27 | Copyright (c) 2004 Ulf Schenk | 27 | Copyright (c) 2004 Ulf Schenk |
28 | 28 | ||
29 | $Id$ | 29 | $Id$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kapplication.h> | 33 | #include <kapplication.h> |
34 | #include <kcombobox.h> | 34 | #include <kcombobox.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kglobal.h> | 36 | #include <kglobal.h> |
37 | 37 | ||
38 | #include <qbuttongroup.h> | 38 | #include <qbuttongroup.h> |
39 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
40 | #include <qheader.h> | 40 | #include <qheader.h> |
41 | #include <qlabel.h> | 41 | #include <qlabel.h> |
42 | #include <qlayout.h> | 42 | #include <qlayout.h> |
43 | #include <qlistview.h> | 43 | #include <qlistview.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qradiobutton.h> | 45 | #include <qradiobutton.h> |
46 | #include <qstringlist.h> | 46 | #include <qstringlist.h> |
47 | #include <qwhatsthis.h> | 47 | #include <qwhatsthis.h> |
48 | 48 | ||
49 | #include "kabcore.h" | 49 | #include "kabcore.h" |
50 | #include "kabprefs.h" | 50 | #include "kabprefs.h" |
51 | 51 | ||
52 | #include "xxportselectdialog.h" | 52 | #include "xxportselectdialog.h" |
53 | 53 | ||
54 | XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, | 54 | XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, |
55 | QWidget* parent, const char* name ) | 55 | QWidget* parent, const char* name ) |
56 | : KDialogBase( Plain, i18n( "Choose which contacts to export" ), Help | Ok | Cancel, | 56 | : KDialogBase( Plain, i18n( "Choose which contacts to export" ), Help | Ok | Cancel, |
57 | Ok, parent, name, true, true ), mCore( core ), | 57 | Ok, parent, name, true, true ), mCore( core ), |
58 | mUseSorting( sort ) | 58 | mUseSorting( sort ) |
59 | { | 59 | { |
60 | initGUI(); | 60 | initGUI(); |
61 | 61 | ||
62 | connect( mFiltersCombo, SIGNAL( activated( int ) ), | 62 | connect( mFiltersCombo, SIGNAL( activated( int ) ), |
63 | SLOT( filterChanged( int ) ) ); | 63 | SLOT( filterChanged( int ) ) ); |
64 | connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), | 64 | connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), |
65 | SLOT( categoryClicked( QListViewItem* ) ) ); | 65 | SLOT( categoryClicked( QListViewItem* ) ) ); |
66 | 66 | ||
67 | // setup filters | 67 | // setup filters |
68 | #ifndef KAB_EMBEDDED | 68 | #ifndef KAB_EMBEDDED |
69 | mFilters = Filter::restore( kapp->config(), "Filter" ); | 69 | mFilters = Filter::restore( kapp->config(), "Filter" ); |
70 | Filter::List::iterator filterIt; | 70 | Filter::List::iterator filterIt; |
71 | #else //KAB_EMBEDDED | 71 | #else //KAB_EMBEDDED |
@@ -153,127 +153,127 @@ KABC::AddresseeList XXPortSelectDialog::contacts() | |||
153 | } | 153 | } |
154 | 154 | ||
155 | QStringList XXPortSelectDialog::categories() const | 155 | QStringList XXPortSelectDialog::categories() const |
156 | { | 156 | { |
157 | QStringList list; | 157 | QStringList list; |
158 | 158 | ||
159 | QListViewItemIterator it( mCategoriesView ); | 159 | QListViewItemIterator it( mCategoriesView ); |
160 | for ( ; it.current(); ++it ) { | 160 | for ( ; it.current(); ++it ) { |
161 | QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); | 161 | QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); |
162 | if ( qcli->isOn() ) | 162 | if ( qcli->isOn() ) |
163 | list.append( it.current()->text( 0 ) ); | 163 | list.append( it.current()->text( 0 ) ); |
164 | } | 164 | } |
165 | 165 | ||
166 | return list; | 166 | return list; |
167 | } | 167 | } |
168 | 168 | ||
169 | void XXPortSelectDialog::filterChanged( int ) | 169 | void XXPortSelectDialog::filterChanged( int ) |
170 | { | 170 | { |
171 | mUseFilters->setChecked( true ); | 171 | mUseFilters->setChecked( true ); |
172 | } | 172 | } |
173 | 173 | ||
174 | void XXPortSelectDialog::categoryClicked( QListViewItem *i ) | 174 | void XXPortSelectDialog::categoryClicked( QListViewItem *i ) |
175 | { | 175 | { |
176 | QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); | 176 | QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); |
177 | if ( qcli->isOn() ) | 177 | if ( qcli->isOn() ) |
178 | mUseCategories->setChecked( true ); | 178 | mUseCategories->setChecked( true ); |
179 | } | 179 | } |
180 | 180 | ||
181 | void XXPortSelectDialog::slotHelp() | 181 | void XXPortSelectDialog::slotHelp() |
182 | { | 182 | { |
183 | #ifndef KAB_EMBEDDED | 183 | #ifndef KAB_EMBEDDED |
184 | kapp->invokeHelp( "import-and-export" ); | 184 | kapp->invokeHelp( "import-and-export" ); |
185 | #else //KAB_EMBEDDED | 185 | #else //KAB_EMBEDDED |
186 | qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); | 186 | qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); |
187 | #endif //KAB_EMBEDDED | 187 | #endif //KAB_EMBEDDED |
188 | 188 | ||
189 | } | 189 | } |
190 | 190 | ||
191 | void XXPortSelectDialog::initGUI() | 191 | void XXPortSelectDialog::initGUI() |
192 | { | 192 | { |
193 | QFrame *page = plainPage(); | 193 | QFrame *page = plainPage(); |
194 | 194 | ||
195 | QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHint(), | 195 | QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHint(), |
196 | KDialog::spacingHint() ); | 196 | KDialog::spacingHint() ); |
197 | 197 | ||
198 | QLabel *label = new QLabel( i18n( "Which contacts do you want to export?" ), page ); | 198 | QLabel *label = new QLabel( i18n( "Which contacts do you want to export?" ), page ); |
199 | topLayout->addWidget( label ); | 199 | topLayout->addWidget( label ); |
200 | 200 | ||
201 | mButtonGroup = new QButtonGroup( i18n( "Selection" ), page ); | 201 | mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); |
202 | mButtonGroup->setColumnLayout( 0, Qt::Vertical ); | 202 | mButtonGroup->setColumnLayout( 0, Qt::Vertical ); |
203 | mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); | 203 | mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); |
204 | mButtonGroup->layout()->setMargin( KDialog::marginHint() ); | 204 | mButtonGroup->layout()->setMargin( KDialog::marginHint() ); |
205 | 205 | ||
206 | QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); | 206 | QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); |
207 | groupLayout->setAlignment( Qt::AlignTop ); | 207 | groupLayout->setAlignment( Qt::AlignTop ); |
208 | 208 | ||
209 | mUseWholeBook = new QRadioButton( i18n( "&All contacts" ), mButtonGroup ); | 209 | mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); |
210 | mUseWholeBook->setChecked( true ); | 210 | mUseWholeBook->setChecked( true ); |
211 | QWhatsThis::add( mUseWholeBook, i18n( "Export the entire address book" ) ); | 211 | QWhatsThis::add( mUseWholeBook, i18n( "Export the entire address book" ) ); |
212 | groupLayout->addWidget( mUseWholeBook, 0, 0 ); | 212 | groupLayout->addWidget( mUseWholeBook, 0, 0 ); |
213 | 213 | ||
214 | mUseSelection = new QRadioButton( i18n( "&Selected contacts" ), mButtonGroup ); | 214 | mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); |
215 | QWhatsThis::add( mUseSelection, i18n( "Only export contacts selected in KAddressBook.\n" | 215 | QWhatsThis::add( mUseSelection, i18n( "Only export contacts selected in KAddressBook.\n" |
216 | "This option is disabled if no contacts are selected." ) ); | 216 | "This option is disabled if no contacts are selected." ) ); |
217 | groupLayout->addWidget( mUseSelection, 1, 0 ); | 217 | groupLayout->addWidget( mUseSelection, 1, 0 ); |
218 | 218 | ||
219 | mUseFilters = new QRadioButton( i18n( "Contacts matching &filter" ), mButtonGroup ); | 219 | mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); |
220 | QWhatsThis::add( mUseFilters, i18n( "Only export contacts matching the selected filter.\n" | 220 | QWhatsThis::add( mUseFilters, i18n( "Only export contacts matching the selected filter.\n" |
221 | "This option is disabled if you haven't defined any filters" ) ); | 221 | "This option is disabled if you haven't defined any filters" ) ); |
222 | groupLayout->addWidget( mUseFilters, 2, 0 ); | 222 | groupLayout->addWidget( mUseFilters, 2, 0 ); |
223 | 223 | ||
224 | mUseCategories = new QRadioButton( i18n( "Category &members" ), mButtonGroup ); | 224 | mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); |
225 | QWhatsThis::add( mUseCategories, i18n( "Only export contacts who are members of a category that is checked on the list to the left.\n" | 225 | QWhatsThis::add( mUseCategories, i18n( "Only export contacts who are members of a category that is checked on the list to the left.\n" |
226 | "This option is disabled if you have no categories." ) ); | 226 | "This option is disabled if you have no categories." ) ); |
227 | groupLayout->addWidget( mUseCategories, 3, 0 ); | 227 | groupLayout->addWidget( mUseCategories, 3, 0 ); |
228 | 228 | ||
229 | mFiltersCombo = new QComboBox( false, mButtonGroup ); | 229 | mFiltersCombo = new QComboBox( false, mButtonGroup ); |
230 | QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to export." ) ); | 230 | QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to export." ) ); |
231 | groupLayout->addWidget( mFiltersCombo, 2, 1 ); | 231 | groupLayout->addWidget( mFiltersCombo, 2, 1 ); |
232 | 232 | ||
233 | mCategoriesView = new QListView( mButtonGroup ); | 233 | mCategoriesView = new QListView( mButtonGroup ); |
234 | mCategoriesView->addColumn( "" ); | 234 | mCategoriesView->addColumn( "" ); |
235 | mCategoriesView->header()->hide(); | 235 | mCategoriesView->header()->hide(); |
236 | QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to export." ) ); | 236 | QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to export." ) ); |
237 | groupLayout->addWidget( mCategoriesView, 3, 1 ); | 237 | groupLayout->addWidget( mCategoriesView, 3, 1 ); |
238 | 238 | ||
239 | topLayout->addWidget( mButtonGroup ); | 239 | topLayout->addWidget( mButtonGroup ); |
240 | 240 | ||
241 | QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); | 241 | QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); |
242 | sortingGroup->setColumnLayout( 0, Qt::Vertical ); | 242 | sortingGroup->setColumnLayout( 0, Qt::Vertical ); |
243 | QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, | 243 | QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, |
244 | KDialog::spacingHint() ); | 244 | KDialog::spacingHint() ); |
245 | sortLayout->setAlignment( Qt::AlignTop ); | 245 | sortLayout->setAlignment( Qt::AlignTop ); |
246 | 246 | ||
247 | label = new QLabel( i18n( "Criterion:" ), sortingGroup ); | 247 | label = new QLabel( i18n( "Criterion:" ), sortingGroup ); |
248 | sortLayout->addWidget( label, 0, 0 ); | 248 | sortLayout->addWidget( label, 0, 0 ); |
249 | 249 | ||
250 | #ifndef KAB_EMBEDDED | 250 | #ifndef KAB_EMBEDDED |
251 | mFieldCombo = new KComboBox( false, sortingGroup ); | 251 | mFieldCombo = new KComboBox( false, sortingGroup ); |
252 | #else //KAB_EMBEDDED | 252 | #else //KAB_EMBEDDED |
253 | //US Combobox is not editable anyway | 253 | //US Combobox is not editable anyway |
254 | mFieldCombo = new KComboBox( sortingGroup ); | 254 | mFieldCombo = new KComboBox( sortingGroup ); |
255 | #endif //KAB_EMBEDDED | 255 | #endif //KAB_EMBEDDED |
256 | sortLayout->addWidget( mFieldCombo, 0, 1 ); | 256 | sortLayout->addWidget( mFieldCombo, 0, 1 ); |
257 | 257 | ||
258 | label = new QLabel( i18n( "Order:" ), sortingGroup ); | 258 | label = new QLabel( i18n( "Order:" ), sortingGroup ); |
259 | sortLayout->addWidget( label, 1, 0 ); | 259 | sortLayout->addWidget( label, 1, 0 ); |
260 | 260 | ||
261 | #ifndef KAB_EMBEDDED | 261 | #ifndef KAB_EMBEDDED |
262 | mSortTypeCombo = new KComboBox( false, sortingGroup ); | 262 | mSortTypeCombo = new KComboBox( false, sortingGroup ); |
263 | #else //KAB_EMBEDDED | 263 | #else //KAB_EMBEDDED |
264 | //US Combobox is not editable anyway | 264 | //US Combobox is not editable anyway |
265 | mSortTypeCombo = new KComboBox( sortingGroup ); | 265 | mSortTypeCombo = new KComboBox( sortingGroup ); |
266 | #endif //KAB_EMBEDDED | 266 | #endif //KAB_EMBEDDED |
267 | sortLayout->addWidget( mSortTypeCombo, 1, 1 ); | 267 | sortLayout->addWidget( mSortTypeCombo, 1, 1 ); |
268 | 268 | ||
269 | topLayout->addWidget( sortingGroup ); | 269 | topLayout->addWidget( sortingGroup ); |
270 | 270 | ||
271 | if ( !mUseSorting ) | 271 | if ( !mUseSorting ) |
272 | sortingGroup->hide(); | 272 | sortingGroup->hide(); |
273 | } | 273 | } |
274 | 274 | ||
275 | #ifndef KAB_EMBEDDED | 275 | #ifndef KAB_EMBEDDED |
276 | #include "xxportselectdialog.moc" | 276 | #include "xxportselectdialog.moc" |
277 | #endif //KAB_EMBEDDED | 277 | #endif //KAB_EMBEDDED |
278 | 278 | ||
279 | 279 | ||