author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kaddressbook/phoneeditwidget.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kaddressbook/phoneeditwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index df3b551..3661677 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp | |||
@@ -22,23 +22,29 @@ | |||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
27 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qcheckbox.h> | 28 | #include <qcheckbox.h> |
29 | #include <qstring.h> | 29 | #include <qstring.h> |
30 | #include <qlistbox.h> | 30 | #include <q3listbox.h> |
31 | #include <qlistview.h> | 31 | #include <q3listview.h> |
32 | #include <qbuttongroup.h> | 32 | #include <q3buttongroup.h> |
33 | #include <qhbox.h> | 33 | #include <q3hbox.h> |
34 | #include <qcursor.h> | 34 | #include <qcursor.h> |
35 | #include <qtimer.h> | 35 | #include <qtimer.h> |
36 | #include <qapplication.h> | 36 | #include <qapplication.h> |
37 | //Added by qt3to4: | ||
38 | #include <Q3ValueList> | ||
39 | #include <Q3GridLayout> | ||
40 | #include <Q3Frame> | ||
41 | #include <Q3PopupMenu> | ||
42 | #include <Q3VBoxLayout> | ||
37 | 43 | ||
38 | #include <kbuttonbox.h> | 44 | #include <kbuttonbox.h> |
39 | #include <klistview.h> | 45 | #include <klistview.h> |
40 | #include <kapplication.h> | 46 | #include <kapplication.h> |
41 | #include <qapplication.h> | 47 | #include <qapplication.h> |
42 | #include <kconfig.h> | 48 | #include <kconfig.h> |
43 | #include <kmessagebox.h> | 49 | #include <kmessagebox.h> |
44 | #include <klineedit.h> | 50 | #include <klineedit.h> |
@@ -52,50 +58,50 @@ | |||
52 | 58 | ||
53 | #include "typecombo.h" | 59 | #include "typecombo.h" |
54 | 60 | ||
55 | #include "phoneeditwidget.h" | 61 | #include "phoneeditwidget.h" |
56 | 62 | ||
57 | PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) | 63 | PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) |
58 | : QWidget(parent,name) | 64 | : QWidget(parent,name) |
59 | { | 65 | { |
60 | QGridLayout* gridLayout = new QGridLayout ( this, 2,2 ); | 66 | Q3GridLayout* gridLayout = new Q3GridLayout ( this, 2,2 ); |
61 | 67 | ||
62 | QLabel *temp = new QLabel( "", this ); | 68 | QLabel *temp = new QLabel( "", this ); |
63 | temp->setAlignment( Qt::AlignCenter ); | 69 | temp->setAlignment( Qt::AlignCenter ); |
64 | temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 70 | temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
65 | QPushButton *addBut = new QPushButton ( "add", this ); | 71 | QPushButton *addBut = new QPushButton ( "add", this ); |
66 | addBut->setPixmap ( SmallIcon("plus")); | 72 | addBut->setPixmap ( SmallIcon("plus")); |
67 | addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); | 73 | addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); |
68 | connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); | 74 | connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); |
69 | 75 | ||
70 | sv = new QScrollView( this ); | 76 | sv = new Q3ScrollView( this ); |
71 | sv->setFrameStyle ( QFrame::Plain ); | 77 | sv->setFrameStyle ( Q3Frame::Plain ); |
72 | sv->setLineWidth ( 0 ); | 78 | sv->setLineWidth ( 0 ); |
73 | sv->setMidLineWidth ( 0 ); | 79 | sv->setMidLineWidth ( 0 ); |
74 | mw = new QWidget ( sv->viewport() ); | 80 | mw = new QWidget ( sv->viewport() ); |
75 | sv->addChild(mw); | 81 | sv->addChild(mw); |
76 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 82 | sv->setResizePolicy( Q3ScrollView::AutoOneFit ); |
77 | mainLayout = new QVBoxLayout ( mw ); | 83 | mainLayout = new Q3VBoxLayout ( mw ); |
78 | mainLayout->setMargin( 0 ); | 84 | mainLayout->setMargin( 0 ); |
79 | mainLayout->setSpacing( 0 ); | 85 | mainLayout->setSpacing( 0 ); |
80 | gridLayout->setMargin( 2 ); | 86 | gridLayout->setMargin( 2 ); |
81 | gridLayout->setSpacing( 4 ); | 87 | gridLayout->setSpacing( 4 ); |
82 | if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) { | 88 | if ( QApplication::desktop()->width() == 240 || QApplication::desktop()->width() == 480 ) { |
83 | gridLayout->addWidget( addBut, 0, 0 ); | 89 | gridLayout->addWidget( addBut, 0, 0 ); |
84 | gridLayout->addWidget( temp, 0, 1 ); | 90 | gridLayout->addWidget( temp, 0, 1 ); |
85 | gridLayout->addMultiCellWidget( sv, 1,1 , 0,1 ); | 91 | gridLayout->addMultiCellWidget( sv, 1,1 , 0,1 ); |
86 | } else { | 92 | } else { |
87 | gridLayout->addWidget( temp, 1, 0 ); | 93 | gridLayout->addWidget( temp, 1, 0 ); |
88 | gridLayout->addWidget( addBut, 0, 0 ); | 94 | gridLayout->addWidget( addBut, 0, 0 ); |
89 | gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); | 95 | gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); |
90 | } | 96 | } |
91 | setDefaults(); | 97 | setDefaults(); |
92 | mTypeNumberEditList.setAutoDelete( true ); | 98 | mTypeNumberEditList.setAutoDelete( true ); |
93 | mPopup = new QPopupMenu( this ); | 99 | mPopup = new Q3PopupMenu( this ); |
94 | QStringList list = PhoneNumber::supportedTypeListNames(); | 100 | QStringList list = PhoneNumber::supportedTypeListNames(); |
95 | mPopupCount = list.count(); | 101 | mPopupCount = list.count(); |
96 | int i = 0; | 102 | int i = 0; |
97 | while ( i < mPopupCount ) { | 103 | while ( i < mPopupCount ) { |
98 | mPopup->insertItem( list[ i ], i ); | 104 | mPopup->insertItem( list[ i ], i ); |
99 | ++i; | 105 | ++i; |
100 | } | 106 | } |
101 | connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int))); | 107 | connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int))); |
@@ -221,27 +227,27 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() | |||
221 | } | 227 | } |
222 | return retList; | 228 | return retList; |
223 | } | 229 | } |
224 | 230 | ||
225 | #if 0 | 231 | #if 0 |
226 | PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) | 232 | PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) |
227 | : QWidget( parent, name ) | 233 | : QWidget( parent, name ) |
228 | { | 234 | { |
229 | QGridLayout *layout = new QGridLayout( this, 4, 1 ); | 235 | Q3GridLayout *layout = new Q3GridLayout( this, 4, 1 ); |
230 | //US layout->setSpacing( KDialog::spacingHint() ); | 236 | //US layout->setSpacing( KDialog::spacingHint() ); |
231 | layout->setSpacing( KDialogBase::spacingHintSmall() ); | 237 | layout->setSpacing( KDialogBase::spacingHintSmall() ); |
232 | 238 | ||
233 | 239 | ||
234 | 240 | ||
235 | QLabel* label = new QLabel( this ); | 241 | QLabel* label = new QLabel( this ); |
236 | //US loadIcon call is ambiguous. Add one more parameter | 242 | //US loadIcon call is ambiguous. Add one more parameter |
237 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); | 243 | //US label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop ) ); |
238 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 244 | label->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
239 | label->setAlignment( AlignCenter ); | 245 | label->setAlignment( Qt::AlignCenter ); |
240 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); | 246 | //US layout->addMultiCellWidget( label, 0, 1, 3, 3 ); |
241 | layout->addWidget( label, 0, 0 ); | 247 | layout->addWidget( label, 0, 0 ); |
242 | 248 | ||
243 | QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ), | 249 | QPushButton *editButton = new QPushButton( i18n( "Edit Phone Numbers..." ), |
244 | this ); | 250 | this ); |
245 | if ( QApplication::desktop()->width() < 640 ) | 251 | if ( QApplication::desktop()->width() < 640 ) |
246 | layout->addWidget( editButton, 0, 1 ); | 252 | layout->addWidget( editButton, 0, 1 ); |
247 | else | 253 | else |
@@ -322,27 +328,27 @@ PhoneEditWidget::~PhoneEditWidget() | |||
322 | 328 | ||
323 | void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) | 329 | void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &list ) |
324 | { | 330 | { |
325 | mPhoneList.clear(); | 331 | mPhoneList.clear(); |
326 | 332 | ||
327 | // Insert types for existing numbers. | 333 | // Insert types for existing numbers. |
328 | mPrefCombo->insertTypeList( list ); | 334 | mPrefCombo->insertTypeList( list ); |
329 | 335 | ||
330 | QValueList<int> defaultTypes; | 336 | Q3ValueList<int> defaultTypes; |
331 | defaultTypes << KABC::PhoneNumber::Home; | 337 | defaultTypes << KABC::PhoneNumber::Home; |
332 | defaultTypes << KABC::PhoneNumber::Work; | 338 | defaultTypes << KABC::PhoneNumber::Work; |
333 | defaultTypes << KABC::PhoneNumber::Cell; | 339 | defaultTypes << KABC::PhoneNumber::Cell; |
334 | defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); | 340 | defaultTypes << ( KABC::PhoneNumber::Work | KABC::PhoneNumber::Fax ); |
335 | defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax ); | 341 | defaultTypes << ( KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax ); |
336 | 342 | ||
337 | // Insert default types. | 343 | // Insert default types. |
338 | // Doing this for mPrefCombo is enough because the list is shared by all | 344 | // Doing this for mPrefCombo is enough because the list is shared by all |
339 | // combos. | 345 | // combos. |
340 | QValueList<int>::ConstIterator it; | 346 | Q3ValueList<int>::ConstIterator it; |
341 | for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { | 347 | for( it = defaultTypes.begin(); it != defaultTypes.end(); ++it ) { |
342 | if ( !mPrefCombo->hasType( *it ) ) | 348 | if ( !mPrefCombo->hasType( *it ) ) |
343 | mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); | 349 | mPrefCombo->insertType( list, *it, PhoneNumber( "", *it ) ); |
344 | } | 350 | } |
345 | 351 | ||
346 | updateCombos(); | 352 | updateCombos(); |
347 | 353 | ||
348 | mPrefCombo->selectType( defaultTypes[ 0 ] ); | 354 | mPrefCombo->selectType( defaultTypes[ 0 ] ); |
@@ -482,20 +488,20 @@ void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *ot | |||
482 | if ( combo->currentItem() == otherCombo->currentItem() ) { | 488 | if ( combo->currentItem() == otherCombo->currentItem() ) { |
483 | updateEdit( otherCombo ); | 489 | updateEdit( otherCombo ); |
484 | } | 490 | } |
485 | } | 491 | } |
486 | 492 | ||
487 | /////////////////////////////////////////// | 493 | /////////////////////////////////////////// |
488 | // PhoneEditDialog | 494 | // PhoneEditDialog |
489 | 495 | ||
490 | class PhoneViewItem : public QListViewItem | 496 | class PhoneViewItem : public Q3ListViewItem |
491 | { | 497 | { |
492 | public: | 498 | public: |
493 | PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); | 499 | PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ); |
494 | 500 | ||
495 | void setPhoneNumber( const KABC::PhoneNumber &number ) | 501 | void setPhoneNumber( const KABC::PhoneNumber &number ) |
496 | { | 502 | { |
497 | mPhoneNumber = number; | 503 | mPhoneNumber = number; |
498 | makeText(); | 504 | makeText(); |
499 | } | 505 | } |
500 | 506 | ||
501 | QString key() { return mPhoneNumber.id(); } | 507 | QString key() { return mPhoneNumber.id(); } |
@@ -506,18 +512,18 @@ public: | |||
506 | KABC::PhoneNumber phoneNumber() { return mPhoneNumber; } | 512 | KABC::PhoneNumber phoneNumber() { return mPhoneNumber; } |
507 | 513 | ||
508 | private: | 514 | private: |
509 | void makeText(); | 515 | void makeText(); |
510 | 516 | ||
511 | KABC::PhoneNumber mPhoneNumber; | 517 | KABC::PhoneNumber mPhoneNumber; |
512 | }; | 518 | }; |
513 | 519 | ||
514 | PhoneViewItem::PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ) | 520 | PhoneViewItem::PhoneViewItem( Q3ListView *parent, const KABC::PhoneNumber &number ) |
515 | : QListViewItem( parent ), mPhoneNumber( number ) | 521 | : Q3ListViewItem( parent ), mPhoneNumber( number ) |
516 | { | 522 | { |
517 | #ifdef DESKTOP_VERSION | 523 | #ifdef DESKTOP_VERSION |
518 | setRenameEnabled ( 0, true ); | 524 | setRenameEnabled ( 0, true ); |
519 | #endif | 525 | #endif |
520 | makeText(); | 526 | makeText(); |
521 | } | 527 | } |
522 | 528 | ||
523 | void PhoneViewItem::makeText() | 529 | void PhoneViewItem::makeText() |
@@ -539,38 +545,38 @@ PhoneEditDialog::PhoneEditDialog( const KABC::PhoneNumber::List &list, QWidget * | |||
539 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Numbers" ), | 545 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Numbers" ), |
540 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, | 546 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, |
541 | parent, name, true) | 547 | parent, name, true) |
542 | { | 548 | { |
543 | mPhoneNumberList = list; | 549 | mPhoneNumberList = list; |
544 | 550 | ||
545 | QWidget *page = plainPage(); | 551 | QWidget *page = plainPage(); |
546 | 552 | ||
547 | QGridLayout *layout = new QGridLayout( page, 1, 2 ); | 553 | Q3GridLayout *layout = new Q3GridLayout( page, 1, 2 ); |
548 | layout->setSpacing( spacingHint() ); | 554 | layout->setSpacing( spacingHint() ); |
549 | 555 | ||
550 | mListView = new KListView( page ); | 556 | mListView = new KListView( page ); |
551 | mListView->setAllColumnsShowFocus( true ); | 557 | mListView->setAllColumnsShowFocus( true ); |
552 | mListView->addColumn( i18n( "Number" ) ); | 558 | mListView->addColumn( i18n( "Number" ) ); |
553 | mListView->addColumn( i18n( "Type" ) ); | 559 | mListView->addColumn( i18n( "Type" ) ); |
554 | 560 | ||
555 | KButtonBox *buttonBox = new KButtonBox( page, Vertical ); | 561 | KButtonBox *buttonBox = new KButtonBox( page, Qt::Vertical ); |
556 | 562 | ||
557 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); | 563 | buttonBox->addButton( i18n( "&Add..." ), this, SLOT( slotAddPhoneNumber() ) ); |
558 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); | 564 | mEditButton = buttonBox->addButton( i18n( "&Edit..." ), this, SLOT( slotEditPhoneNumber() ) ); |
559 | mEditButton->setEnabled( false ); | 565 | mEditButton->setEnabled( false ); |
560 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) ); | 566 | mRemoveButton = buttonBox->addButton( i18n( "&Remove" ), this, SLOT( slotRemovePhoneNumber() ) ); |
561 | mRemoveButton->setEnabled( false ); | 567 | mRemoveButton->setEnabled( false ); |
562 | buttonBox->layout(); | 568 | buttonBox->layout(); |
563 | 569 | ||
564 | layout->addWidget( mListView, 0, 0 ); | 570 | layout->addWidget( mListView, 0, 0 ); |
565 | layout->addWidget( buttonBox, 0, 1 ); | 571 | layout->addWidget( buttonBox, 0, 1 ); |
566 | 572 | ||
567 | connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); | 573 | connect( mListView, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()) ); |
568 | connect( mListView, SIGNAL(doubleClicked( QListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); | 574 | connect( mListView, SIGNAL(doubleClicked( Q3ListViewItem *, const QPoint &, int )), this, SLOT( slotEditPhoneNumber())); |
569 | 575 | ||
570 | KABC::PhoneNumber::List::Iterator it; | 576 | KABC::PhoneNumber::List::Iterator it; |
571 | for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) | 577 | for ( it = mPhoneNumberList.begin(); it != mPhoneNumberList.end(); ++it ) |
572 | new PhoneViewItem( mListView, *it ); | 578 | new PhoneViewItem( mListView, *it ); |
573 | if (QApplication::desktop()->width() < 480 ) | 579 | if (QApplication::desktop()->width() < 480 ) |
574 | showMaximized(); | 580 | showMaximized(); |
575 | else | 581 | else |
576 | resize( 400, 400 ); | 582 | resize( 400, 400 ); |
@@ -583,17 +589,17 @@ PhoneEditDialog::~PhoneEditDialog() | |||
583 | } | 589 | } |
584 | 590 | ||
585 | void PhoneEditDialog::slotAddPhoneNumber() | 591 | void PhoneEditDialog::slotAddPhoneNumber() |
586 | { | 592 | { |
587 | KABC::PhoneNumber tmp( "", 0 ); | 593 | KABC::PhoneNumber tmp( "", 0 ); |
588 | PhoneTypeDialog dlg( tmp, this ); | 594 | PhoneTypeDialog dlg( tmp, this ); |
589 | 595 | ||
590 | if ( dlg.exec() ) { | 596 | if ( dlg.exec() ) { |
591 | QListViewItem* i = mListView->firstChild(); | 597 | Q3ListViewItem* i = mListView->firstChild(); |
592 | KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); | 598 | KABC::PhoneNumber phoneNumber = dlg.phoneNumber(); |
593 | bool insert = true; | 599 | bool insert = true; |
594 | while ( i ) { | 600 | while ( i ) { |
595 | PhoneViewItem* p = ( PhoneViewItem* ) i; | 601 | PhoneViewItem* p = ( PhoneViewItem* ) i; |
596 | KABC::PhoneNumber pn = p->phoneNumber(); | 602 | KABC::PhoneNumber pn = p->phoneNumber(); |
597 | if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) { | 603 | if ( (pn.type() | KABC::PhoneNumber::Pref) == (phoneNumber.type() | KABC::PhoneNumber::Pref) ) { |
598 | if ( p->text(0).isEmpty()) { | 604 | if ( p->text(0).isEmpty()) { |
599 | p->setPhoneNumber( phoneNumber ); | 605 | p->setPhoneNumber( phoneNumber ); |
@@ -615,17 +621,17 @@ void PhoneEditDialog::slotAddPhoneNumber() | |||
615 | 621 | ||
616 | void PhoneEditDialog::slotRemovePhoneNumber() | 622 | void PhoneEditDialog::slotRemovePhoneNumber() |
617 | { | 623 | { |
618 | PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() ); | 624 | PhoneViewItem *item = static_cast<PhoneViewItem*>( mListView->currentItem() ); |
619 | if ( !item ) | 625 | if ( !item ) |
620 | return; | 626 | return; |
621 | 627 | ||
622 | mPhoneNumberList.remove( item->phoneNumber() ); | 628 | mPhoneNumberList.remove( item->phoneNumber() ); |
623 | QListViewItem *currItem = mListView->currentItem(); | 629 | Q3ListViewItem *currItem = mListView->currentItem(); |
624 | mListView->takeItem( currItem ); | 630 | mListView->takeItem( currItem ); |
625 | delete currItem; | 631 | delete currItem; |
626 | 632 | ||
627 | mChanged = true; | 633 | mChanged = true; |
628 | } | 634 | } |
629 | 635 | ||
630 | void PhoneEditDialog::slotEditPhoneNumber() | 636 | void PhoneEditDialog::slotEditPhoneNumber() |
631 | { | 637 | { |
@@ -668,27 +674,27 @@ bool PhoneEditDialog::changed() const | |||
668 | PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, | 674 | PhoneTypeDialog::PhoneTypeDialog( const KABC::PhoneNumber &phoneNumber, |
669 | QWidget *parent, const char *name) | 675 | QWidget *parent, const char *name) |
670 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ), | 676 | : KDialogBase( KDialogBase::Plain, i18n( "Edit Phone Number" ), |
671 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, | 677 | KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, |
672 | parent, name, true), mPhoneNumber( phoneNumber ) | 678 | parent, name, true), mPhoneNumber( phoneNumber ) |
673 | { | 679 | { |
674 | QWidget *page = plainPage(); | 680 | QWidget *page = plainPage(); |
675 | QLabel *label = 0; | 681 | QLabel *label = 0; |
676 | QGridLayout *layout = new QGridLayout( page, 3, 2, marginHint(), spacingHint() ); | 682 | Q3GridLayout *layout = new Q3GridLayout( page, 3, 2, marginHint(), spacingHint() ); |
677 | 683 | ||
678 | label = new QLabel( i18n( "Number:" ), page ); | 684 | label = new QLabel( i18n( "Number:" ), page ); |
679 | layout->addWidget( label, 0, 0 ); | 685 | layout->addWidget( label, 0, 0 ); |
680 | mNumber = new KLineEdit( page ); | 686 | mNumber = new KLineEdit( page ); |
681 | layout->addWidget( mNumber, 0, 1 ); | 687 | layout->addWidget( mNumber, 0, 1 ); |
682 | 688 | ||
683 | mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); | 689 | mPreferredBox = new QCheckBox( i18n( "This is the preferred phone number" ), page ); |
684 | layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); | 690 | layout->addMultiCellWidget( mPreferredBox, 1, 1, 0, 1 ); |
685 | 691 | ||
686 | mGroup = new QButtonGroup( 2, Horizontal, i18n( "Types" ), page ); | 692 | mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Types" ), page ); |
687 | layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); | 693 | layout->addMultiCellWidget( mGroup, 2, 2, 0, 1 ); |
688 | 694 | ||
689 | // fill widgets | 695 | // fill widgets |
690 | mNumber->setText( mPhoneNumber.number() ); | 696 | mNumber->setText( mPhoneNumber.number() ); |
691 | 697 | ||
692 | mTypeList = KABC::PhoneNumber::typeList(); | 698 | mTypeList = KABC::PhoneNumber::typeList(); |
693 | mTypeList.remove( KABC::PhoneNumber::Pref ); | 699 | mTypeList.remove( KABC::PhoneNumber::Pref ); |
694 | 700 | ||
@@ -721,11 +727,11 @@ KABC::PhoneNumber PhoneTypeDialog::phoneNumber() | |||
721 | if ( mPreferredBox->isChecked() ) | 727 | if ( mPreferredBox->isChecked() ) |
722 | mPhoneNumber.setType( type | KABC::PhoneNumber::Pref ); | 728 | mPhoneNumber.setType( type | KABC::PhoneNumber::Pref ); |
723 | else | 729 | else |
724 | mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref ); | 730 | mPhoneNumber.setType( type & ~KABC::PhoneNumber::Pref ); |
725 | 731 | ||
726 | return mPhoneNumber; | 732 | return mPhoneNumber; |
727 | } | 733 | } |
728 | #endif | 734 | #endif |
729 | #ifndef KAB_EMBEDDED | 735 | #ifndef KAB_EMBEDDED_ |
730 | #include "phoneeditwidget.moc" | 736 | #include "moc_phoneeditwidget.cpp" |
731 | #endif //KAB_EMBEDDED | 737 | #endif //KAB_EMBEDDED |