summaryrefslogtreecommitdiffabout
path: root/kaddressbook/phoneeditwidget.h
Unidiff
Diffstat (limited to 'kaddressbook/phoneeditwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.h24
1 files changed, 14 insertions, 10 deletions
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index 5bb4226..2be3e2b 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -22,26 +22,30 @@
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <kdialogbase.h> 26#include <kdialogbase.h>
27#include <kiconloader.h> 27#include <kiconloader.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qpopupmenu.h> 30#include <q3popupmenu.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <QDesktopWidget>
32 33
33#include <qptrlist.h> 34#include <q3ptrlist.h>
34#include <qscrollview.h> 35#include <q3scrollview.h>
36//Added by qt3to4:
37#include <Q3HBoxLayout>
38#include <Q3VBoxLayout>
35 39
36#include "addresseeconfig.h" 40#include "addresseeconfig.h"
37#include "typecombo.h" 41#include "typecombo.h"
38 42
39class QButtonGroup; 43class Q3ButtonGroup;
40class QCheckBox; 44class QCheckBox;
41class PhoneTypeNumberEdit; 45class PhoneTypeNumberEdit;
42 46
43#include <klineedit.h> 47#include <klineedit.h>
44#include <kcombobox.h> 48#include <kcombobox.h>
45#include <kabc/phonenumber.h> 49#include <kabc/phonenumber.h>
46 50
47typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo; 51typedef TypeCombo<KABC::PhoneNumber> PhoneTypeCombo;
@@ -71,43 +75,43 @@ class PhoneEditWidget : public QWidget
71 void bottomVisible(); 75 void bottomVisible();
72 void addNumberInt( int ); 76 void addNumberInt( int );
73 void deleteEdit( PhoneTypeNumberEdit* ew ); 77 void deleteEdit( PhoneTypeNumberEdit* ew );
74 void addNumber(); 78 void addNumber();
75 void pendingDelete(); 79 void pendingDelete();
76 protected: 80 protected:
77 81
78 private: 82 private:
79 QScrollView* sv; 83 Q3ScrollView* sv;
80 QPopupMenu *mPopup; 84 Q3PopupMenu *mPopup;
81 int mPopupCount; 85 int mPopupCount;
82 PhoneTypeNumberEdit* mPendingDelete; 86 PhoneTypeNumberEdit* mPendingDelete;
83 void setDefaults(); 87 void setDefaults();
84 PhoneTypeNumberEdit* appendEditCombo(); 88 PhoneTypeNumberEdit* appendEditCombo();
85 QWidget* mw; 89 QWidget* mw;
86 QVBoxLayout* mainLayout; 90 Q3VBoxLayout* mainLayout;
87 QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; 91 Q3PtrList <PhoneTypeNumberEdit> mTypeNumberEditList;
88 92
89}; 93};
90 94
91 95
92class PhoneTypeNumberEdit : public QWidget 96class PhoneTypeNumberEdit : public QWidget
93{ 97{
94 Q_OBJECT 98 Q_OBJECT
95public: 99public:
96 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) 100 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent )
97 { 101 {
98 QHBoxLayout * lay = new QHBoxLayout( this ); 102 Q3HBoxLayout * lay = new Q3HBoxLayout( this );
99 lay->setSpacing( 2 ); 103 lay->setSpacing( 2 );
100 lay->setMargin( 0 ); 104 lay->setMargin( 0 );
101 mMinusButton = new QPushButton ( this ); 105 mMinusButton = new QPushButton ( this );
102 mMinusButton->setPixmap ( SmallIcon("minus")); 106 mMinusButton->setPixmap ( SmallIcon("minus"));
103 mCombo = new KComboBox( this ); 107 mCombo = new KComboBox( this );
104 if ( QApplication::desktop()->width() <= 640 ) 108 if ( QApplication::desktop()->width() <= 640 )
105 mCombo->setSizeLimit ( 6 ); 109 mCombo->setMaxVisibleItems ( 6 );
106 mNumber = new KLineEdit( this ); 110 mNumber = new KLineEdit( this );
107 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); 111 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6);
108 lay->addWidget( mMinusButton ); 112 lay->addWidget( mMinusButton );
109 lay->addWidget( mCombo ); 113 lay->addWidget( mCombo );
110 lay->addWidget( mNumber ); 114 lay->addWidget( mNumber );
111 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); 115 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) );
112 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) ); 116 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) );
113 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ), 117 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ),