summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxportselectdialog.cpp
Unidiff
Diffstat (limited to 'kaddressbook/xxportselectdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxportselectdialog.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/kaddressbook/xxportselectdialog.cpp b/kaddressbook/xxportselectdialog.cpp
index 278cab0..088bffa 100644
--- a/kaddressbook/xxportselectdialog.cpp
+++ b/kaddressbook/xxportselectdialog.cpp
@@ -36,16 +36,21 @@ $Id$
36#include <kglobal.h> 36#include <kglobal.h>
37 37
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qbuttongroup.h> 39#include <QDesktopWidget>
40#include <q3buttongroup.h>
40#include <qcombobox.h> 41#include <qcombobox.h>
41#include <qheader.h> 42#include <q3header.h>
42#include <qlabel.h> 43#include <qlabel.h>
43#include <qlayout.h> 44#include <qlayout.h>
44#include <qlistview.h> 45#include <q3listview.h>
45#include <qpushbutton.h> 46#include <qpushbutton.h>
46#include <qradiobutton.h> 47#include <qradiobutton.h>
47#include <qstringlist.h> 48#include <qstringlist.h>
48#include <qwhatsthis.h> 49#include <q3whatsthis.h>
50//Added by qt3to4:
51#include <Q3GridLayout>
52#include <Q3Frame>
53#include <Q3VBoxLayout>
49 54
50#include "kabcore.h" 55#include "kabcore.h"
51#include "kabprefs.h" 56#include "kabprefs.h"
@@ -62,8 +67,8 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
62 67
63 connect( mFiltersCombo, SIGNAL( activated( int ) ), 68 connect( mFiltersCombo, SIGNAL( activated( int ) ),
64 SLOT( filterChanged( int ) ) ); 69 SLOT( filterChanged( int ) ) );
65 connect( mCategoriesView, SIGNAL( clicked( QListViewItem* ) ), 70 connect( mCategoriesView, SIGNAL( clicked( Q3ListViewItem* ) ),
66 SLOT( categoryClicked( QListViewItem* ) ) ); 71 SLOT( categoryClicked( Q3ListViewItem* ) ) );
67 72
68 // setup filters 73 // setup filters
69#ifndef KAB_EMBEDDED 74#ifndef KAB_EMBEDDED
@@ -84,7 +89,7 @@ XXPortSelectDialog::XXPortSelectDialog( KABCore *core, bool sort,
84 QStringList categories = KABPrefs::instance()->mCustomCategories; 89 QStringList categories = KABPrefs::instance()->mCustomCategories;
85 QStringList::Iterator it; 90 QStringList::Iterator it;
86 for ( it = categories.begin(); it != categories.end(); ++it ) 91 for ( it = categories.begin(); it != categories.end(); ++it )
87 new QCheckListItem( mCategoriesView, *it, QCheckListItem::CheckBox ); 92 new Q3CheckListItem( mCategoriesView, *it, Q3CheckListItem::CheckBox );
88 mUseCategories->setEnabled( categories.count() > 0 ); 93 mUseCategories->setEnabled( categories.count() > 0 );
89 94
90 int count = mCore->selectedUIDs().count(); 95 int count = mCore->selectedUIDs().count();
@@ -210,9 +215,9 @@ QStringList XXPortSelectDialog::categories() const
210{ 215{
211 QStringList list; 216 QStringList list;
212 217
213 QListViewItemIterator it( mCategoriesView ); 218 Q3ListViewItemIterator it( mCategoriesView );
214 for ( ; it.current(); ++it ) { 219 for ( ; it.current(); ++it ) {
215 QCheckListItem* qcli = static_cast<QCheckListItem*>(it.current()); 220 Q3CheckListItem* qcli = static_cast<Q3CheckListItem*>(it.current());
216 if ( qcli->isOn() ) 221 if ( qcli->isOn() )
217 list.append( it.current()->text( 0 ) ); 222 list.append( it.current()->text( 0 ) );
218 } 223 }
@@ -225,9 +230,9 @@ void XXPortSelectDialog::filterChanged( int )
225 mUseFilters->setChecked( true ); 230 mUseFilters->setChecked( true );
226} 231}
227 232
228void XXPortSelectDialog::categoryClicked( QListViewItem *i ) 233void XXPortSelectDialog::categoryClicked( Q3ListViewItem *i )
229{ 234{
230 QCheckListItem *qcli = static_cast<QCheckListItem*>( i ); 235 Q3CheckListItem *qcli = static_cast<Q3CheckListItem*>( i );
231 if ( qcli->isOn() ) 236 if ( qcli->isOn() )
232 mUseCategories->setChecked( true ); 237 mUseCategories->setChecked( true );
233} 238}
@@ -244,60 +249,60 @@ void XXPortSelectDialog::slotHelp()
244 249
245void XXPortSelectDialog::initGUI() 250void XXPortSelectDialog::initGUI()
246{ 251{
247 QFrame *page = plainPage(); 252 Q3Frame *page = plainPage();
248 253
249 QVBoxLayout *topLayout = new QVBoxLayout( page, KDialog::marginHintSmall(), 254 Q3VBoxLayout *topLayout = new Q3VBoxLayout( page, KDialog::marginHintSmall(),
250 KDialog::spacingHintSmall() ); 255 KDialog::spacingHintSmall() );
251 256
252 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page ); 257 QLabel *label = new QLabel( i18n( "Which contacts do you want to select?" ), page );
253 topLayout->addWidget( label ); 258 topLayout->addWidget( label );
254 259
255 mButtonGroup = new QButtonGroup( i18n( "Contact Selection" ), page ); 260 mButtonGroup = new Q3ButtonGroup( i18n( "Contact Selection" ), page );
256 mButtonGroup->setColumnLayout( 0, Qt::Vertical ); 261 mButtonGroup->setColumnLayout( 0, Qt::Vertical );
257 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() ); 262 mButtonGroup->layout()->setSpacing( KDialog::spacingHint() );
258 mButtonGroup->layout()->setMargin( KDialog::marginHint() ); 263 mButtonGroup->layout()->setMargin( KDialog::marginHint() );
259 264
260 QGridLayout *groupLayout = new QGridLayout( mButtonGroup->layout() ); 265 Q3GridLayout *groupLayout = new Q3GridLayout( mButtonGroup->layout() );
261 groupLayout->setAlignment( Qt::AlignTop ); 266 groupLayout->setAlignment( Qt::AlignTop );
262 267
263 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup ); 268 mUseWholeBook = new QRadioButton( i18n( "&All" ), mButtonGroup );
264 mUseWholeBook->setChecked( true ); 269 mUseWholeBook->setChecked( true );
265 QWhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) ); 270 Q3WhatsThis::add( mUseWholeBook, i18n( "Select the entire address book" ) );
266 groupLayout->addWidget( mUseWholeBook, 0, 0 ); 271 groupLayout->addWidget( mUseWholeBook, 0, 0 );
267 272
268 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup ); 273 mUseSelection = new QRadioButton( i18n( "&Selected" ), mButtonGroup );
269 QWhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n" 274 Q3WhatsThis::add( mUseSelection, i18n( "Only contacts selected in KAddressBook.\n"
270 "This option is disabled if no contacts are selected." ) ); 275 "This option is disabled if no contacts are selected." ) );
271 groupLayout->addWidget( mUseSelection, 1, 0 ); 276 groupLayout->addWidget( mUseSelection, 1, 0 );
272 277
273 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup ); 278 mUseFilters = new QRadioButton( i18n( "By matching &filter" ), mButtonGroup );
274 QWhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n" 279 Q3WhatsThis::add( mUseFilters, i18n( "Only contacts matching the selected filter.\n"
275 "This option is disabled if you haven't defined any filters" ) ); 280 "This option is disabled if you haven't defined any filters" ) );
276 groupLayout->addWidget( mUseFilters, 2, 0 ); 281 groupLayout->addWidget( mUseFilters, 2, 0 );
277 282
278 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup ); 283 mUseCategories = new QRadioButton( i18n( "By Cate&gories" ), mButtonGroup );
279 QWhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n" 284 Q3WhatsThis::add( mUseCategories, i18n( "Only contacts who are members of a category that is checked on the list to the left.\n"
280 "This option is disabled if you have no categories." ) ); 285 "This option is disabled if you have no categories." ) );
281 groupLayout->addWidget( mUseCategories, 3, 0 ); 286 groupLayout->addWidget( mUseCategories, 3, 0 );
282 287
283 mFiltersCombo = new QComboBox( false, mButtonGroup ); 288 mFiltersCombo = new QComboBox( false, mButtonGroup );
284 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); 289 mFiltersCombo->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
285 QWhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) ); 290 Q3WhatsThis::add( mFiltersCombo, i18n( "Select a filter to decide which contacts to select." ) );
286 groupLayout->addWidget( mFiltersCombo, 2, 1 ); 291 groupLayout->addWidget( mFiltersCombo, 2, 1 );
287 292
288 mCategoriesView = new QListView( mButtonGroup ); 293 mCategoriesView = new Q3ListView( mButtonGroup );
289 mCategoriesView->addColumn( "" ); 294 mCategoriesView->addColumn( "" );
290 mCategoriesView->header()->hide(); 295 mCategoriesView->header()->hide();
291 QWhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) ); 296 Q3WhatsThis::add( mCategoriesView, i18n( "Check the categories whose members you want to select." ) );
292 groupLayout->addWidget( mCategoriesView, 3, 1 ); 297 groupLayout->addWidget( mCategoriesView, 3, 1 );
293 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) ); 298 mCategoriesView->setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
294 //if (QApplication::desktop()->height() == 480 ) 299 //if (QApplication::desktop()->height() == 480 )
295 // mCategoriesView->setMaximumHeight( 240 ); 300 // mCategoriesView->setMaximumHeight( 240 );
296 topLayout->addWidget( mButtonGroup ); 301 topLayout->addWidget( mButtonGroup );
297 302
298 QButtonGroup *sortingGroup = new QButtonGroup( i18n( "Sorting" ), page ); 303 Q3ButtonGroup *sortingGroup = new Q3ButtonGroup( i18n( "Sorting" ), page );
299 sortingGroup->setColumnLayout( 0, Qt::Vertical ); 304 sortingGroup->setColumnLayout( 0, Qt::Vertical );
300 QGridLayout *sortLayout = new QGridLayout( sortingGroup->layout(), 2, 2, 305 Q3GridLayout *sortLayout = new Q3GridLayout( sortingGroup->layout(), 2, 2,
301 KDialog::spacingHint() ); 306 KDialog::spacingHint() );
302 sortLayout->setAlignment( Qt::AlignTop ); 307 sortLayout->setAlignment( Qt::AlignTop );
303 308
@@ -335,8 +340,6 @@ void XXPortSelectDialog::initGUI()
335 } 340 }
336} 341}
337 342
338#ifndef KAB_EMBEDDED 343#ifndef KAB_EMBEDDED_
339#include "xxportselectdialog.moc" 344#include "moc_xxportselectdialog.cpp"
340#endif //KAB_EMBEDDED 345#endif //KAB_EMBEDDED
341
342