summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-06-03 13:37:47 (UTC)
committer zautrix <zautrix>2005-06-03 13:37:47 (UTC)
commit7aa43257ffb63e772342f24c1f7945e285171ee6 (patch) (unidiff)
tree7d68896cbbd5ae699bce7905e17824939022a488 /kaddressbook
parentf0554322b2f27e1fa60dc79a5d76ef0741bf3423 (diff)
downloadkdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.zip
kdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.tar.gz
kdepimpi-7aa43257ffb63e772342f24c1f7945e285171ee6.tar.bz2
export kapi fix
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxportselectdialog.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index e134f97..278cab0 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -1,338 +1,342 @@
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/*
26Enhanced Version of the file for platform independent KDE tools. 26Enhanced Version of the file for platform independent KDE tools.
27Copyright (c) 2004 Ulf Schenk 27Copyright (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 <qapplication.h> 38#include <qapplication.h>
39#include <qbuttongroup.h> 39#include <qbuttongroup.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qheader.h> 41#include <qheader.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qlistview.h> 44#include <qlistview.h>
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qradiobutton.h> 46#include <qradiobutton.h>
47#include <qstringlist.h> 47#include <qstringlist.h>
48#include <qwhatsthis.h> 48#include <qwhatsthis.h>
49 49
50#include "kabcore.h" 50#include "kabcore.h"
51#include "kabprefs.h" 51#include "kabprefs.h"
52 52
53#include "xxportselectdialog.h" 53#include "xxportselectdialog.h"
54 54
55XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort, 55XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
56 QWidget* parent, const char* name ) 56 QWidget* parent, const char* name )
57 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel, 57 : KDialogBase( Plain, i18n( "Choose contact selection" ), Help | Ok | Cancel,
58 Ok, parent, name, true, true ), mCore( core ), 58 Ok, parent, name, true, true ), mCore( core ),
59 mUseSorting( sort ) 59 mUseSorting( sort )
60{ 60{
61 initGUI(); 61 initGUI();
62 62
63 connect( mFiltersCombo, SIGNAL( activated( int ) ), 63 connect( mFiltersCombo, SIGNAL( activated( int ) ),
64 SLOT( filterChanged( int ) ) ); 64 SLOT( filterChanged( int ) ) );
65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), 65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ),
66 SLOT( categoryClicked( QListViewItem* ) ) ); 66 SLOT( categoryClicked( QListViewItem* ) ) );
67 67
68 // setup filters 68 // setup filters
69#ifndef KAB_EMBEDDED 69#ifndef KAB_EMBEDDED
70 mFilters = Filter::restore( kapp->config(), "Filter" ); 70 mFilters = Filter::restore( kapp->config(), "Filter" );
71 Filter::List::iterator filterIt; 71 Filter::List::iterator filterIt;
72#else //KAB_EMBEDDED 72#else //KAB_EMBEDDED
73 mFilters = Filter::restore( KGlobal::config(), "Filter" ); 73 mFilters = Filter::restore( KGlobal::config(), "Filter" );
74 Filter::List::Iterator filterIt; 74 Filter::List::Iterator filterIt;
75#endif //KAB_EMBEDDED 75#endif //KAB_EMBEDDED
76 QStringList filters; 76 QStringList filters;
77 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 77 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
78 filters.append( (*filterIt).name() ); 78 filters.append( (*filterIt).name() );
79 79
80 mFiltersCombo->insertStringList( filters ); 80 mFiltersCombo->insertStringList( filters );
81 mUseFilters->setEnabled( filters.count() > 0 ); 81 mUseFilters->setEnabled( filters.count() > 0 );
82 82
83 // setup categories 83 // setup categories
84 QStringList categories = KABPrefs::instance()->mCustomCategories; 84 QStringList categories = KABPrefs::instance()->mCustomCategories;
85 QStringList::Iterator it; 85 QStringList::Iterator it;
86 for ( it = categories.begin(); it != categories.end(); ++it ) 86 for ( it = categories.begin(); it != categories.end(); ++it )
87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); 87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox );
88 mUseCategories->setEnabled( categories.count() > 0 ); 88 mUseCategories->setEnabled( categories.count() > 0 );
89 89
90 int count = mCore->selectedUIDs().count(); 90 int count = mCore->selectedUIDs().count();
91 mUseSelection->setEnabled( count != 0 ); 91 mUseSelection->setEnabled( count != 0 );
92 mUseSelection->setChecked( count > 1 ); 92 mUseSelection->setChecked( count > 1 );
93 93
94 mSortTypeCombo->insertItem( i18n( "Ascending" ) ); 94 mSortTypeCombo->insertItem( i18n( "Ascending" ) );
95 mSortTypeCombo->insertItem( i18n( "Descending" ) ); 95 mSortTypeCombo->insertItem( i18n( "Descending" ) );
96 96
97 mFields = mCore->addressBook()->fields( KABC::Field::All ); 97 mFields = mCore->addressBook()->fields( KABC::Field::All );
98 KABC::Field::List::Iterator fieldIt; 98 KABC::Field::List::Iterator fieldIt;
99 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt ) 99 for ( fieldIt = mFields.begin(); fieldIt != mFields.end(); ++fieldIt )
100 mFieldCombo->insertItem( (*fieldIt)->label() ); 100 mFieldCombo->insertItem( (*fieldIt)->label() );
101} 101}
102 102
103QStringList XXPortSelectDialog::uids() 103QStringList XXPortSelectDialog::uids()
104{ 104{
105 QStringList uidlist; 105 QStringList uidlist;
106 KABC::AddresseeList list = contacts(); 106 KABC::AddresseeList list = contacts();
107 KABC::Addressee::List::Iterator it; 107 KABC::Addressee::List::Iterator it;
108 for ( it = list.begin(); it != list.end(); ++it ) 108 for ( it = list.begin(); it != list.end(); ++it )
109 uidlist.append((*it).uid()); 109 uidlist.append((*it).uid());
110 return uidlist; 110 return uidlist;
111} 111}
112void XXPortSelectDialog::tagSelected() 112void XXPortSelectDialog::tagSelected()
113{ 113{
114 if ( mUseSelection->isChecked() ) { 114 if ( mUseSelection->isChecked() ) {
115 115
116 QStringList selection = mCore->selectedUIDs(); 116 QStringList selection = mCore->selectedUIDs();
117 KABC::AddressBook::Iterator it; 117 KABC::AddressBook::Iterator it;
118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 118 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
119 if ( selection.findIndex((*it).uid()) >= 0 ) 119 if ( selection.findIndex((*it).uid()) >= 0 )
120 (*it).setTagged( true ); 120 (*it).setTagged( true );
121 } 121 }
122 } else if ( mUseFilters->isChecked() ) { 122 } else if ( mUseFilters->isChecked() ) {
123 // find contacts that can pass selected filter 123 // find contacts that can pass selected filter
124 Filter::List::Iterator filterIt; 124 Filter::List::Iterator filterIt;
125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 125 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
126 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 126 if ( (*filterIt).name() == mFiltersCombo->currentText() )
127 break; 127 break;
128 KABC::AddressBook::Iterator it; 128 KABC::AddressBook::Iterator it;
129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 129 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
130 if ( (*filterIt).filterAddressee( *it ) ) 130 if ( (*filterIt).filterAddressee( *it ) )
131 (*it).setTagged( true ); 131 (*it).setTagged( true );
132 } 132 }
133 } else if ( mUseCategories->isChecked() ) { 133 } else if ( mUseCategories->isChecked() ) {
134 QStringList categorieList = categories(); 134 QStringList categorieList = categories();
135 KABC::AddressBook::Iterator it; 135 KABC::AddressBook::Iterator it;
136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 136 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
137 QStringList tmp( (*it).categories() ); 137 QStringList tmp( (*it).categories() );
138 QStringList::Iterator tmpIt; 138 QStringList::Iterator tmpIt;
139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 139 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
140 if ( categorieList.contains( *tmpIt ) ) { 140 if ( categorieList.contains( *tmpIt ) ) {
141 (*it).setTagged( true ); 141 (*it).setTagged( true );
142 break; 142 break;
143 } 143 }
144 } 144 }
145 } else { 145 } else {
146 // create a string list of all entries: 146 // create a string list of all entries:
147 KABC::AddressBook::Iterator it; 147 KABC::AddressBook::Iterator it;
148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 148 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
149 (*it).setTagged( true ); 149 (*it).setTagged( true );
150 } 150 }
151} 151}
152KABC::AddresseeList XXPortSelectDialog::contacts() 152KABC::AddresseeList XXPortSelectDialog::contacts()
153{ 153{
154 154
155 KABC::AddresseeList list; 155 KABC::AddresseeList list;
156 if ( mUseSelection->isChecked() ) { 156 if ( mUseSelection->isChecked() ) {
157 QStringList::Iterator it; 157 QStringList::Iterator it;
158 QStringList selection = mCore->selectedUIDs(); 158 QStringList selection = mCore->selectedUIDs();
159 for ( it = selection.begin(); it != selection.end(); ++it ) { 159 for ( it = selection.begin(); it != selection.end(); ++it ) {
160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it ); 160 KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
161 if ( !addr.isEmpty() ) 161 if ( !addr.isEmpty() )
162 list.append( addr ); 162 if ( addr.uid().left( 19 ) != QString("last-syncAddressee-") )
163 list.append( addr );
163 } 164 }
164 } else if ( mUseFilters->isChecked() ) { 165 } else if ( mUseFilters->isChecked() ) {
165 // find contacts that can pass selected filter 166 // find contacts that can pass selected filter
166 Filter::List::Iterator filterIt; 167 Filter::List::Iterator filterIt;
167 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt ) 168 for ( filterIt = mFilters.begin(); filterIt != mFilters.end(); ++filterIt )
168 if ( (*filterIt).name() == mFiltersCombo->currentText() ) 169 if ( (*filterIt).name() == mFiltersCombo->currentText() )
169 break; 170 break;
170 171
171 KABC::AddressBook::Iterator it; 172 KABC::AddressBook::Iterator it;
172 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 173 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
173 if ( (*filterIt).filterAddressee( *it ) ) 174 if ( (*filterIt).filterAddressee( *it ) )
174 list.append( *it ); 175 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
176 list.append( *it );
175 } 177 }
176 } else if ( mUseCategories->isChecked() ) { 178 } else if ( mUseCategories->isChecked() ) {
177 QStringList categorieList = categories(); 179 QStringList categorieList = categories();
178 KABC::AddressBook::Iterator it; 180 KABC::AddressBook::Iterator it;
179 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) { 181 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) {
180 QStringList tmp( (*it).categories() ); 182 QStringList tmp( (*it).categories() );
181 QStringList::Iterator tmpIt; 183 QStringList::Iterator tmpIt;
182 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt ) 184 for ( tmpIt = tmp.begin(); tmpIt != tmp.end(); ++tmpIt )
183 if ( categorieList.contains( *tmpIt ) ) { 185 if ( categorieList.contains( *tmpIt ) ) {
184 list.append( *it ); 186 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
187 list.append( *it );
185 break; 188 break;
186 } 189 }
187 } 190 }
188 } else { 191 } else {
189 // create a string list of all entries: 192 // create a string list of all entries:
190 KABC::AddressBook::Iterator it; 193 KABC::AddressBook::Iterator it;
191 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it ) 194 for ( it = mCore->addressBook()->begin(); it != mCore->addressBook()->end(); ++it )
192 list.append( *it ); 195 if ((*it).uid().left( 19 ) != QString("last-syncAddressee-") )
196 list.append( *it );
193 } 197 }
194 198
195 if ( mUseSorting ) { 199 if ( mUseSorting ) {
196 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 ); 200 list.setReverseSorting( mSortTypeCombo->currentItem() == 1 );
197 uint pos = mFieldCombo->currentItem(); 201 uint pos = mFieldCombo->currentItem();
198 if ( pos < mFields.count() ) 202 if ( pos < mFields.count() )
199 list.sortByField( mFields[ pos ] ); 203 list.sortByField( mFields[ pos ] );
200 } 204 }
201 205
202 return list; 206 return list;
203} 207}
204 208
205QStringList XXPortSelectDialog::categories() const 209QStringList XXPortSelectDialog::categories() const
206{ 210{
207 QStringList list; 211 QStringList list;
208 212
209 QListViewItemIterator it( mCategoriesView ); 213 QListViewItemIterator it( mCategoriesView );
210 for ( ; it.current(); ++it ) { 214 for ( ; it.current(); ++it ) {
211 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current());
212 if ( qcli->isOn() ) 216 if ( qcli->isOn() )
213 list.append( it.current()->text( 0 ) ); 217 list.append( it.current()->text( 0 ) );
214 } 218 }
215 219
216 return list; 220 return list;
217} 221}
218 222
219void XXPortSelectDialog::filterChanged( int ) 223void XXPortSelectDialog::filterChanged( int )
220{ 224{
221 mUseFilters->setChecked( true ); 225 mUseFilters->setChecked( true );
222} 226}
223 227
224void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 228void XXPortSelectDialog::categoryClicked( QListViewItem *i )
225{ 229{
226 QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); 230 QCheckListItem *qcli = static_cast<QCheckListItem*>( i );
227 if ( qcli->isOn() ) 231 if ( qcli->isOn() )
228 mUseCategories->setChecked( true ); 232 mUseCategories->setChecked( true );
229} 233}
230 234
231void XXPortSelectDialog::slotHelp() 235void XXPortSelectDialog::slotHelp()
232{ 236{
233#ifndef KAB_EMBEDDED 237#ifndef KAB_EMBEDDED
234 kapp->invokeHelp( "import-and-export" ); 238 kapp->invokeHelp( "import-and-export" );
235#else //KAB_EMBEDDED 239#else //KAB_EMBEDDED
236 qDebug("XXPortSelectDialog::slotHelp is not implemented yet"); 240 qDebug("XXPortSelectDialog::slotHelp is not implemented yet");
237#endif //KAB_EMBEDDED 241#endif //KAB_EMBEDDED
238 242
239} 243}
240 244
241void XXPortSelectDialog::initGUI() 245void XXPortSelectDialog::initGUI()
242{ 246{
243 QFrame *page = plainPage(); 247 QFrame *page = plainPage();
244 248
245 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), 249 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(),
246 KDialog::spacingHintSmall() ); 250 KDialog::spacingHintSmall() );
247 251
248 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); 252 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page );
249 topLayout->addWidget( label ); 253 topLayout->addWidget( label );
250 254
251 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); 255 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page );
252 mButtonGroup->setColumnLayout( 0, Qt::Vertical ); 256 mButtonGroup->setColumnLayout( 0, Qt::Vertical );
253 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); 257 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
254 mButtonGroup->layout()->setMargin( KDialog::marginHint() ); 258 mButtonGroup->layout()->setMargin( KDialog::marginHint() );
255 259
256 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); 260 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() );
257 groupLayout->setAlignment( Qt::AlignTop ); 261 groupLayout->setAlignment( Qt::AlignTop );
258 262
259 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 263 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
260 mUseWholeBook->setChecked( true ); 264 mUseWholeBook->setChecked( true );
261 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 265 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
262 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 266 groupLayout->addWidget( mUseWholeBook, 0, 0 );
263 267
264 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 268 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
265 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 269 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
266 "This option is disabled if no contacts are selected." ) ); 270 "This option is disabled if no contacts are selected." ) );
267 groupLayout->addWidget( mUseSelection, 1, 0 ); 271 groupLayout->addWidget( mUseSelection, 1, 0 );
268 272
269 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 273 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
270 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 274 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
271 "This option is disabled if you haven't defined any filters" ) ); 275 "This option is disabled if you haven't defined any filters" ) );
272 groupLayout->addWidget( mUseFilters, 2, 0 ); 276 groupLayout->addWidget( mUseFilters, 2, 0 );
273 277
274 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 278 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
275 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 279 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
276 "This option is disabled if you have no categories." ) ); 280 "This option is disabled if you have no categories." ) );
277 groupLayout->addWidget( mUseCategories, 3, 0 ); 281 groupLayout->addWidget( mUseCategories, 3, 0 );
278 282
279 mFiltersCombo = new QComboBox( false, mButtonGroup ); 283 mFiltersCombo = new QComboBox( false, mButtonGroup );
280 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 284 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
281 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 285 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
282 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 286 groupLayout->addWidget( mFiltersCombo, 2, 1 );
283 287
284 mCategoriesView = new QListView( mButtonGroup ); 288 mCategoriesView = new QListView( mButtonGroup );
285 mCategoriesView->addColumn( "" ); 289 mCategoriesView->addColumn( "" );
286 mCategoriesView->header()->hide(); 290 mCategoriesView->header()->hide();
287 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 291 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
288 groupLayout->addWidget( mCategoriesView, 3, 1 ); 292 groupLayout->addWidget( mCategoriesView, 3, 1 );
289 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); 293 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
290 //if (QApplication::desktop()->height() == 480 ) 294 //if (QApplication::desktop()->height() == 480 )
291 // mCategoriesView->setMaximumHeight( 240 ); 295 // mCategoriesView->setMaximumHeight( 240 );
292 topLayout->addWidget( mButtonGroup ); 296 topLayout->addWidget( mButtonGroup );
293 297
294 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); 298 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page );
295 sortingGroup->setColumnLayout( 0, Qt::Vertical ); 299 sortingGroup->setColumnLayout( 0, Qt::Vertical );
296 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, 300 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2,
297 KDialog::spacingHint() ); 301 KDialog::spacingHint() );
298 sortLayout->setAlignment( Qt::AlignTop ); 302 sortLayout->setAlignment( Qt::AlignTop );
299 303
300 label = new QLabel( i18n( "Criterion:" ), sortingGroup ); 304 label = new QLabel( i18n( "Criterion:" ), sortingGroup );
301 sortLayout->addWidget( label, 0, 0 ); 305 sortLayout->addWidget( label, 0, 0 );
302 306
303#ifndef KAB_EMBEDDED 307#ifndef KAB_EMBEDDED
304 mFieldCombo = new KComboBox( false, sortingGroup ); 308 mFieldCombo = new KComboBox( false, sortingGroup );
305#else //KAB_EMBEDDED 309#else //KAB_EMBEDDED
306 //US Combobox is not editable anyway 310 //US Combobox is not editable anyway
307 mFieldCombo = new KComboBox( sortingGroup ); 311 mFieldCombo = new KComboBox( sortingGroup );
308#endif //KAB_EMBEDDED 312#endif //KAB_EMBEDDED
309 sortLayout->addWidget( mFieldCombo, 0, 1 ); 313 sortLayout->addWidget( mFieldCombo, 0, 1 );
310 314
311 label = new QLabel( i18n( "Order:" ), sortingGroup ); 315 label = new QLabel( i18n( "Order:" ), sortingGroup );
312 sortLayout->addWidget( label, 1, 0 ); 316 sortLayout->addWidget( label, 1, 0 );
313 317
314#ifndef KAB_EMBEDDED 318#ifndef KAB_EMBEDDED
315 mSortTypeCombo = new KComboBox( false, sortingGroup ); 319 mSortTypeCombo = new KComboBox( false, sortingGroup );
316#else //KAB_EMBEDDED 320#else //KAB_EMBEDDED
317 //US Combobox is not editable anyway 321 //US Combobox is not editable anyway
318 mSortTypeCombo = new KComboBox( sortingGroup ); 322 mSortTypeCombo = new KComboBox( sortingGroup );
319#endif //KAB_EMBEDDED 323#endif //KAB_EMBEDDED
320 sortLayout->addWidget( mSortTypeCombo, 1, 1 ); 324 sortLayout->addWidget( mSortTypeCombo, 1, 1 );
321 325
322 topLayout->addWidget( sortingGroup ); 326 topLayout->addWidget( sortingGroup );
323 327
324 if ( !mUseSorting ) 328 if ( !mUseSorting )
325 sortingGroup->hide(); 329 sortingGroup->hide();
326 if (QApplication::desktop()->width() <= 640 ) { 330 if (QApplication::desktop()->width() <= 640 ) {
327 showMaximized(); 331 showMaximized();
328#ifndef DESKTOP_VERSION 332#ifndef DESKTOP_VERSION
329 hideButtons(); 333 hideButtons();
330#endif 334#endif
331 } 335 }
332} 336}
333 337
334#ifndef KAB_EMBEDDED 338#ifndef KAB_EMBEDDED
335#include "xxportselectdialog.moc" 339#include "xxportselectdialog.moc"
336#endif //KAB_EMBEDDED 340#endif //KAB_EMBEDDED
337 341
338 342