summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeeditorwidget.cpp
Unidiff
Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp46
1 files changed, 25 insertions, 21 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 4313998..a95db03 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -19,29 +19,33 @@
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qhbox.h> 25#include <q3hbox.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlistbox.h> 28#include <q3listbox.h>
29#include <qpushbutton.h> 29#include <qpushbutton.h>
30#include <qtabwidget.h> 30#include <qtabwidget.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#ifndef KAB_EMBEDDED 33#ifndef KAB_EMBEDDED
34#include <qtextedit.h> 34#include <q3textedit.h>
35//Added by qt3to4:
36#include <Q3GridLayout>
37#include <Q3PopupMenu>
38#include <Q3VBoxLayout>
35 39
36#include <kaccelmanager.h> 40#include <kaccelmanager.h>
37#include "keywidget.h" 41#include "keywidget.h"
38#include "soundwidget.h" 42#include "soundwidget.h"
39 43
40#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
41#include <qmultilineedit.h> 45#include <q3multilineedit.h>
42#endif //KAB_EMBEDDED 46#endif //KAB_EMBEDDED
43 47
44 48
45#include "keywidget.h" 49#include "keywidget.h"
46#include "geowidget.h" 50#include "geowidget.h"
47#include "imagewidget.h" 51#include "imagewidget.h"
@@ -127,13 +131,13 @@ void AddresseeEditorWidget::textChanged( const QString& )
127{ 131{
128 emitModified(); 132 emitModified();
129} 133}
130 134
131void AddresseeEditorWidget::initGUI() 135void AddresseeEditorWidget::initGUI()
132{ 136{
133 QVBoxLayout *layout = new QVBoxLayout( this ); 137 Q3VBoxLayout *layout = new Q3VBoxLayout( this );
134 138
135 mTabWidget = new QTabWidget( this ); 139 mTabWidget = new QTabWidget( this );
136 layout->addWidget( mTabWidget ); 140 layout->addWidget( mTabWidget );
137 141
138 setupTab1(); 142 setupTab1();
139 setupTab1_1(); 143 setupTab1_1();
@@ -157,13 +161,13 @@ void AddresseeEditorWidget::setupTab1()
157 bool horLayout = false; 161 bool horLayout = false;
158 int maxCol = 1; 162 int maxCol = 1;
159 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) { 163 if ( QApplication::desktop()->width() == 640 || QApplication::desktop()->width() == 320 ) {
160 horLayout = true; 164 horLayout = true;
161 maxCol = 3; 165 maxCol = 3;
162 } 166 }
163 QGridLayout *layout = new QGridLayout( tab1, 7-maxCol, maxCol ); 167 Q3GridLayout *layout = new Q3GridLayout( tab1, 7-maxCol, maxCol );
164 168
165 layout->setMargin( KDialogBase::marginHintSmall() ); 169 layout->setMargin( KDialogBase::marginHintSmall() );
166 layout->setSpacing( KDialogBase::spacingHintSmall() ); 170 layout->setSpacing( KDialogBase::spacingHintSmall() );
167 171
168 QLabel *label; 172 QLabel *label;
169 KSeparator* bar; 173 KSeparator* bar;
@@ -324,23 +328,23 @@ void AddresseeEditorWidget::setupTab1()
324 layout->addColSpacing( 6, 50 ); 328 layout->addColSpacing( 6, 50 );
325 329
326 bar = new KSeparator( KSeparator::HLine, tab1 ); 330 bar = new KSeparator( KSeparator::HLine, tab1 );
327 layout->addMultiCellWidget( bar, 10, 10, 0, 6 ); 331 layout->addMultiCellWidget( bar, 10, 10, 0, 6 );
328*/ 332*/
329 /////////////////////////////////////// 333 ///////////////////////////////////////
330 QHBox *categoryBox = new QHBox( tab1 ,"cato"); 334 Q3HBox *categoryBox = new Q3HBox( tab1 ,"cato");
331 categoryBox->setSpacing( KDialogBase::spacingHint() ); 335 categoryBox->setSpacing( KDialogBase::spacingHint() );
332 categoryBox->setMargin( KDialogBase::marginHintSmall() ); 336 categoryBox->setMargin( KDialogBase::marginHintSmall() );
333 337
334 // Categories 338 // Categories
335 button = new QPushButton( i18n( "Categories" )+":", categoryBox ); 339 button = new QPushButton( i18n( "Categories" )+":", categoryBox );
336 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) ); 340 connect( button, SIGNAL( clicked() ), SLOT( categoryButtonClicked() ) );
337 341
338 mCategoryEdit = new QPushButton ( categoryBox ); 342 mCategoryEdit = new QPushButton ( categoryBox );
339 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) ); 343 mCategoryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
340 mCatPopup = new QPopupMenu ( categoryBox ); 344 mCatPopup = new Q3PopupMenu ( categoryBox );
341 mCategoryEdit->setPopup( mCatPopup ); 345 mCategoryEdit->setPopup( mCatPopup );
342 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 346 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
343 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 347 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
344 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ), 348 //connect( mCategoryEdit, SIGNAL( textChanged( const QString& ) ),
345 // SLOT( textChanged( const QString& ) ) ); 349 // SLOT( textChanged( const QString& ) ) );
346 350
@@ -408,13 +412,13 @@ void AddresseeEditorWidget::setCompany2FN()
408void AddresseeEditorWidget::setupTab1_1() 412void AddresseeEditorWidget::setupTab1_1()
409{ 413{
410 // This is the Address tab 414 // This is the Address tab
411 QWidget *tab1_1 = new QWidget( mTabWidget ); 415 QWidget *tab1_1 = new QWidget( mTabWidget );
412 416
413//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 ); 417//US QGridLayout *layout = new QGridLayout( tab1_1, 11, 7 );
414 QGridLayout *layout = new QGridLayout( tab1_1, 7, 2 ); 418 Q3GridLayout *layout = new Q3GridLayout( tab1_1, 7, 2 );
415 layout->setMargin( KDialogBase::marginHintSmall() ); 419 layout->setMargin( KDialogBase::marginHintSmall() );
416 layout->setSpacing( KDialogBase::spacingHintSmall() ); 420 layout->setSpacing( KDialogBase::spacingHintSmall() );
417 421
418 QLabel *label; 422 QLabel *label;
419 KSeparator* bar; 423 KSeparator* bar;
420 QPushButton *button; 424 QPushButton *button;
@@ -609,13 +613,13 @@ qDebug("AddresseeEditorWidget::setupTab1 has to be changed");
609 613
610void AddresseeEditorWidget::setupTab2() 614void AddresseeEditorWidget::setupTab2()
611{ 615{
612 // This is the Details tab 616 // This is the Details tab
613 QWidget *tab2 = new QWidget( mTabWidget ); 617 QWidget *tab2 = new QWidget( mTabWidget );
614 618
615 QGridLayout *layout = new QGridLayout( tab2, 8, 3 ); 619 Q3GridLayout *layout = new Q3GridLayout( tab2, 8, 3 );
616 layout->setMargin( KDialogBase::marginHintSmall() ); 620 layout->setMargin( KDialogBase::marginHintSmall() );
617 layout->setSpacing( KDialogBase::spacingHintSmall() ); 621 layout->setSpacing( KDialogBase::spacingHintSmall() );
618 622
619 QLabel *label; 623 QLabel *label;
620 KSeparator* bar; 624 KSeparator* bar;
621 625
@@ -688,13 +692,13 @@ void AddresseeEditorWidget::setupTab2()
688 //layout->addMultiCellWidget( label, 6, 7, 0, 0 ); 692 //layout->addMultiCellWidget( label, 6, 7, 0, 0 );
689 693
690 694
691 int iii = 6; 695 int iii = 6;
692 696
693 if ( QApplication::desktop()->width() == 640 ) { 697 if ( QApplication::desktop()->width() == 640 ) {
694 QHBox * nbox = new QHBox ( tab2 ); 698 Q3HBox * nbox = new Q3HBox ( tab2 );
695 label = new QLabel( i18n( "Nick name:" )+" ", nbox ); 699 label = new QLabel( i18n( "Nick name:" )+" ", nbox );
696 mNicknameEdit = new KLineEdit( nbox ); 700 mNicknameEdit = new KLineEdit( nbox );
697 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ), 701 connect( mNicknameEdit, SIGNAL( textChanged( const QString& ) ),
698 SLOT( textChanged( const QString& ) ) ); 702 SLOT( textChanged( const QString& ) ) );
699 label->setBuddy( mNicknameEdit ); 703 label->setBuddy( mNicknameEdit );
700 704
@@ -732,13 +736,13 @@ void AddresseeEditorWidget::setupTab2()
732 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ), 736 connect( mChildEdit, SIGNAL( textChanged( const QString& ) ),
733 SLOT( textChanged( const QString& ) ) ); 737 SLOT( textChanged( const QString& ) ) );
734 label->setBuddy( mChildEdit ); 738 label->setBuddy( mChildEdit );
735 layout->addWidget( mChildEdit, iii, 2 ); 739 layout->addWidget( mChildEdit, iii, 2 );
736 ++iii; 740 ++iii;
737 if ( QApplication::desktop()->width() == 640 ) { 741 if ( QApplication::desktop()->width() == 640 ) {
738 QHBox * nbox = new QHBox ( tab2 ); 742 Q3HBox * nbox = new Q3HBox ( tab2 );
739 label = new QLabel( i18n( "Birthday:" )+" ", nbox ); 743 label = new QLabel( i18n( "Birthday:" )+" ", nbox );
740 mBirthdayPicker = new KDateEdit( nbox ); 744 mBirthdayPicker = new KDateEdit( nbox );
741 //mBirthdayPicker->toggleDateFormat(); 745 //mBirthdayPicker->toggleDateFormat();
742 mBirthdayPicker->setHandleInvalid( true ); 746 mBirthdayPicker->setHandleInvalid( true );
743 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ), 747 connect( mBirthdayPicker, SIGNAL( dateChanged( QDate ) ),
744 SLOT( dateChanged( QDate ) ) ); 748 SLOT( dateChanged( QDate ) ) );
@@ -801,13 +805,13 @@ void AddresseeEditorWidget::setupTab2()
801 805
802void AddresseeEditorWidget::setupTab2_1() 806void AddresseeEditorWidget::setupTab2_1()
803{ 807{
804 // This is the Details tab 808 // This is the Details tab
805 QWidget *tab2_2 = new QWidget( mTabWidget ); 809 QWidget *tab2_2 = new QWidget( mTabWidget );
806 810
807 QGridLayout *layout = new QGridLayout( tab2_2, 1, 2 ); 811 Q3GridLayout *layout = new Q3GridLayout( tab2_2, 1, 2 );
808 layout->setMargin( KDialogBase::marginHintSmall() ); 812 layout->setMargin( KDialogBase::marginHintSmall() );
809 layout->setSpacing( KDialogBase::spacingHintSmall() ); 813 layout->setSpacing( KDialogBase::spacingHintSmall() );
810 814
811 QLabel *label; 815 QLabel *label;
812 KSeparator* bar; 816 KSeparator* bar;
813 817
@@ -923,18 +927,18 @@ void AddresseeEditorWidget::setupTab2_1()
923 // Notes 927 // Notes
924 label = new QLabel( i18n( "Note:" ), tab2_2 ); 928 label = new QLabel( i18n( "Note:" ), tab2_2 );
925 label->setAlignment( Qt::AlignTop | Qt::AlignLeft ); 929 label->setAlignment( Qt::AlignTop | Qt::AlignLeft );
926//US layout->addWidget( label, 7, 0 ); 930//US layout->addWidget( label, 7, 0 );
927 layout->addWidget( label, 0, 0 ); 931 layout->addWidget( label, 0, 0 );
928#ifndef KAB_EMBEDDED 932#ifndef KAB_EMBEDDED
929 mNoteEdit = new QTextEdit( tab2_2 ); 933 mNoteEdit = new Q3TextEdit( tab2_2 );
930 mNoteEdit->setWordWrap( QTextEdit::WidgetWidth ); 934 mNoteEdit->setWordWrap( Q3TextEdit::WidgetWidth );
931 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
932#else //KAB_EMBEDDED 936#else //KAB_EMBEDDED
933 mNoteEdit = new QMultiLineEdit( tab2_2 ); 937 mNoteEdit = new Q3MultiLineEdit( tab2_2 );
934 mNoteEdit->setWordWrap( QMultiLineEdit::WidgetWidth ); 938 mNoteEdit->setWordWrap( Q3MultiLineEdit::WidgetWidth );
935 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() ); 939 mNoteEdit->setMinimumSize( mNoteEdit->sizeHint() );
936#endif //KAB_EMBEDDED 940#endif //KAB_EMBEDDED
937 941
938 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) ); 942 connect( mNoteEdit, SIGNAL( textChanged() ), SLOT( emitModified() ) );
939 label->setBuddy( mNoteEdit ); 943 label->setBuddy( mNoteEdit );
940//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 ); 944//US layout->addMultiCellWidget( mNoteEdit, 7, 7, 1, 5 );
@@ -950,13 +954,13 @@ void AddresseeEditorWidget::setupTab2_1()
950 954
951void AddresseeEditorWidget::setupTab3() 955void AddresseeEditorWidget::setupTab3()
952{ 956{
953 // This is the Misc tab 957 // This is the Misc tab
954 QWidget *tab3 = new QWidget( mTabWidget ); 958 QWidget *tab3 = new QWidget( mTabWidget );
955 959
956 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 960 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
957 layout->setMargin( KDialogBase::marginHintSmall() ); 961 layout->setMargin( KDialogBase::marginHintSmall() );
958 layout->setSpacing( KDialogBase::spacingHintSmall() ); 962 layout->setSpacing( KDialogBase::spacingHintSmall() );
959//US layout->setColStretch( 2, 1 ); 963//US layout->setColStretch( 2, 1 );
960 964
961 ////////////////////////////////////// 965 //////////////////////////////////////
962 // Geo 966 // Geo
@@ -1002,13 +1006,13 @@ qDebug("AddresseeEditorWidget::setupTab2 sound part is not supported = has to be
1002void AddresseeEditorWidget::setupTab3_1() 1006void AddresseeEditorWidget::setupTab3_1()
1003{ 1007{
1004 // This is the Misc tab 1008 // This is the Misc tab
1005 QWidget *tab3 = new QWidget( mTabWidget ); 1009 QWidget *tab3 = new QWidget( mTabWidget );
1006 1010
1007//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 ); 1011//US QGridLayout *layout = new QGridLayout( tab3, 2, 3 );
1008 QGridLayout *layout = new QGridLayout( tab3, 1, 1 ); 1012 Q3GridLayout *layout = new Q3GridLayout( tab3, 1, 1 );
1009 layout->setMargin( KDialogBase::marginHint() ); 1013 layout->setMargin( KDialogBase::marginHint() );
1010 layout->setSpacing( KDialogBase::spacingHint() ); 1014 layout->setSpacing( KDialogBase::spacingHint() );
1011//US layout->setColStretch( 2, 1 ); 1015//US layout->setColStretch( 2, 1 );
1012 1016
1013/*US 1017/*US
1014 ////////////////////////////////////// 1018 //////////////////////////////////////
@@ -1427,9 +1431,9 @@ QString AddresseeEditorWidget::title() const
1427 1431
1428QString AddresseeEditorWidget::identifier() const 1432QString AddresseeEditorWidget::identifier() const
1429{ 1433{
1430 return i18n( "contact_editor" ); 1434 return i18n( "contact_editor" );
1431} 1435}
1432 1436
1433#ifndef KAB_EMBEDDED 1437#ifndef KAB_EMBEDDED_
1434#include "addresseeeditorwidget.moc" 1438#include "moc_addresseeeditorwidget.cpp"
1435#endif //KAB_EMBEDDED 1439#endif //KAB_EMBEDDED