Diffstat (limited to 'kaddressbook/addresseditwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/addresseditwidget.cpp | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/kaddressbook/addresseditwidget.cpp b/kaddressbook/addresseditwidget.cpp index 3dcd592..83908d0 100644 --- a/kaddressbook/addresseditwidget.cpp +++ b/kaddressbook/addresseditwidget.cpp | |||
@@ -23,22 +23,29 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qbuttongroup.h> | 25 | #include <q3buttongroup.h> |
26 | #include <qcheckbox.h> | 26 | #include <qcheckbox.h> |
27 | #include <qhbox.h> | 27 | #include <q3hbox.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qlistbox.h> | 30 | #include <q3listbox.h> |
31 | #include <qlistview.h> | 31 | #include <q3listview.h> |
32 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
33 | #include <qsignal.h> | 33 | #include <q3signal.h> |
34 | #include <qstring.h> | 34 | #include <qstring.h> |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #include <QDesktopWidget> | ||
37 | |||
38 | #include <Q3VBoxLayout> | ||
39 | #include <Q3GridLayout> | ||
36 | 40 | ||
37 | #ifndef KAB_EMBEDDED | 41 | #ifndef KAB_EMBEDDED |
38 | #include <qtextedit.h> | 42 | #include <q3textedit.h> |
43 | //Added by qt3to4: | ||
44 | #include <Q3ValueList> | ||
45 | #include <Q3VBoxLayout> | ||
39 | #include <kaccelmanager.h> | 46 | #include <kaccelmanager.h> |
40 | #include <kbuttonbox.h> | 47 | #include <kbuttonbox.h> |
41 | #else //KAB_EMBEDDED | 48 | #else //KAB_EMBEDDED |
42 | #include <qmultilineedit.h> | 49 | #include <q3multilineedit.h> |
43 | #endif //KAB_EMBEDDED | 50 | #endif //KAB_EMBEDDED |
44 | 51 | ||
@@ -68,7 +75,7 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) | |||
68 | 75 | ||
69 | mConfig = AddresseeConfig::instance(); | 76 | mConfig = AddresseeConfig::instance(); |
70 | QVBoxLayout *layout = new QVBoxLayout( this ); | 77 | Q3VBoxLayout *layout = new Q3VBoxLayout( this ); |
71 | layout->setSpacing( KDialog::spacingHintSmall() ); | 78 | layout->setSpacing( KDialog::spacingHintSmall() ); |
72 | QHBox *b1 = new QHBox( this); | 79 | Q3HBox *b1 = new Q3HBox( this); |
73 | //QLabel * label = new QLabel( b1 ); | 80 | //QLabel * label = new QLabel( b1 ); |
74 | //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); | 81 | //label->setPixmap( KGlobal::iconLoader()->loadIcon( "gohome", KIcon::Desktop, 0 ) ); |
@@ -85,9 +92,9 @@ AddressEditWidget::AddressEditWidget( QWidget *parent, const char *name ) | |||
85 | 92 | ||
86 | #ifndef KAB_EMBEDDED | 93 | #ifndef KAB_EMBEDDED |
87 | mAddressTextEdit = new QTextEdit( this ); | 94 | mAddressTextEdit = new Q3TextEdit( this ); |
88 | mAddressTextEdit->setReadOnly( true ); | 95 | mAddressTextEdit->setReadOnly( true ); |
89 | mAddressTextEdit->setMinimumHeight( 20 ); | 96 | mAddressTextEdit->setMinimumHeight( 20 ); |
90 | #else //KAB_EMBEDDED | 97 | #else //KAB_EMBEDDED |
91 | mAddressTextEdit = new QMultiLineEdit( this ); | 98 | mAddressTextEdit = new Q3MultiLineEdit( this ); |
92 | mAddressTextEdit->setReadOnly( true ); | 99 | mAddressTextEdit->setReadOnly( true ); |
93 | mAddressTextEdit->setMinimumHeight( 20 ); | 100 | mAddressTextEdit->setMinimumHeight( 20 ); |
@@ -127,11 +134,11 @@ void AddressEditWidget::setAddresses( const KABC::Addressee &addr, | |||
127 | mTypeCombo->insertTypeList( list ); | 134 | mTypeCombo->insertTypeList( list ); |
128 | 135 | ||
129 | QValueList<int> defaultTypes; | 136 | Q3ValueList<int> defaultTypes; |
130 | defaultTypes << KABC::Address::Home; | 137 | defaultTypes << KABC::Address::Home; |
131 | defaultTypes << KABC::Address::Work; | 138 | defaultTypes << KABC::Address::Work; |
132 | 139 | ||
133 | mConfig->setUid( mAddressee.uid() ); | 140 | mConfig->setUid( mAddressee.uid() ); |
134 | QValueList<int> configList = mConfig->noDefaultAddrTypes(); | 141 | Q3ValueList<int> configList = mConfig->noDefaultAddrTypes(); |
135 | QValueList<int>::ConstIterator it; | 142 | Q3ValueList<int>::ConstIterator it; |
136 | for ( it = configList.begin(); it != configList.end(); ++it ) | 143 | for ( it = configList.begin(); it != configList.end(); ++it ) |
137 | defaultTypes.remove( *it ); | 144 | defaultTypes.remove( *it ); |
@@ -182,5 +189,5 @@ void AddressEditWidget::edit() | |||
182 | 189 | ||
183 | mConfig->setUid( mAddressee.uid() ); | 190 | mConfig->setUid( mAddressee.uid() ); |
184 | QValueList<int> configList; | 191 | Q3ValueList<int> configList; |
185 | if ( !hasHome ) { | 192 | if ( !hasHome ) { |
186 | configList << KABC::Address::Home; | 193 | configList << KABC::Address::Home; |
@@ -256,5 +263,5 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, | |||
256 | QWidget *page = plainPage(); | 263 | QWidget *page = plainPage(); |
257 | 264 | ||
258 | QGridLayout *topLayout = new QGridLayout( page, 8, 2 ); | 265 | Q3GridLayout *topLayout = new Q3GridLayout( page, 8, 2 ); |
259 | topLayout->setSpacing( spacingHintSmall() ); | 266 | topLayout->setSpacing( spacingHintSmall() ); |
260 | 267 | ||
@@ -267,7 +274,7 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, | |||
267 | 274 | ||
268 | #ifndef KAB_EMBEDDED | 275 | #ifndef KAB_EMBEDDED |
269 | mStreetTextEdit = new QTextEdit( page ); | 276 | mStreetTextEdit = new Q3TextEdit( page ); |
270 | #else //KAB_EMBEDDED | 277 | #else //KAB_EMBEDDED |
271 | mStreetTextEdit = new QMultiLineEdit( page ); | 278 | mStreetTextEdit = new Q3MultiLineEdit( page ); |
272 | //US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); | 279 | //US qDebug("AddressEditDialog::AddressEditDialog has to be changed"); |
273 | #endif //KAB_EMBEDDED | 280 | #endif //KAB_EMBEDDED |
@@ -312,5 +319,5 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, | |||
312 | label->setBuddy( mCountryCombo ); | 319 | label->setBuddy( mCountryCombo ); |
313 | topLayout->addWidget( mCountryCombo, 6, 1 ); | 320 | topLayout->addWidget( mCountryCombo, 6, 1 ); |
314 | mCountryCombo->setSizeLimit( 8); | 321 | mCountryCombo->setMaxVisibleItems( 8); |
315 | mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); | 322 | mPreferredCheckBox = new QCheckBox( i18n( "This is the preferred address" ), page ); |
316 | topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); | 323 | topLayout->addMultiCellWidget( mPreferredCheckBox, 7, 7, 0, 1 ); |
@@ -319,5 +326,5 @@ AddressEditDialog::AddressEditDialog( const KABC::Address::List &list, | |||
319 | topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); | 326 | topLayout->addMultiCellWidget( sep, 8, 8, 0, 1 ); |
320 | */ | 327 | */ |
321 | QHBox *buttonBox = new QHBox( page ); | 328 | Q3HBox *buttonBox = new Q3HBox( page ); |
322 | buttonBox->setSpacing( spacingHint() ); | 329 | buttonBox->setSpacing( spacingHint() ); |
323 | topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); | 330 | topLayout->addMultiCellWidget( buttonBox, 9, 9, 0, 1 ); |
@@ -584,7 +591,7 @@ AddressTypeDialog::AddressTypeDialog( int type, QWidget *parent ) | |||
584 | { | 591 | { |
585 | QWidget *page = plainPage(); | 592 | QWidget *page = plainPage(); |
586 | QVBoxLayout *layout = new QVBoxLayout( page ); | 593 | Q3VBoxLayout *layout = new Q3VBoxLayout( page ); |
587 | 594 | ||
588 | mGroup = new QButtonGroup( 2, Horizontal, i18n( "Address Types" ), page ); | 595 | mGroup = new Q3ButtonGroup( 2, Qt::Horizontal, i18n( "Address Types" ), page ); |
589 | layout->addWidget( mGroup ); | 596 | layout->addWidget( mGroup ); |
590 | 597 | ||
@@ -618,5 +625,5 @@ int AddressTypeDialog::type() const | |||
618 | } | 625 | } |
619 | 626 | ||
620 | #ifndef KAB_EMBEDDED | 627 | #ifndef KAB_EMBEDDED_ |
621 | #include "addresseditwidget.moc" | 628 | #include "moc_addresseditwidget.cpp" |
622 | #endif //KAB_EMBEDDED | 629 | #endif //KAB_EMBEDDED |