-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/phoneeditwidget.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index d895ea1..f52cedb 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp | |||
@@ -62,34 +62,34 @@ PhoneEditWidget::PhoneEditWidget( QWidget *parent, const char *name ) | |||
62 | temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); | 62 | temp->setPixmap( KGlobal::iconLoader()->loadIcon( "kaddressbook", KIcon::Desktop, 0 ) ); |
63 | gridLayout->addWidget( temp, 1, 0 ); | 63 | gridLayout->addWidget( temp, 1, 0 ); |
64 | QPushButton *addBut = new QPushButton ( "add", this ); | 64 | QPushButton *addBut = new QPushButton ( "add", this ); |
65 | addBut->setPixmap ( SmallIcon("plus")); | 65 | addBut->setPixmap ( SmallIcon("plus")); |
66 | addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); | 66 | addBut->setMaximumSize( addBut->sizeHint().height(),addBut->sizeHint().height() ); |
67 | connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); | 67 | connect(addBut,SIGNAL(clicked ()),SLOT(addNumber())); |
68 | gridLayout->addWidget( addBut, 0, 0 ); | 68 | gridLayout->addWidget( addBut, 0, 0 ); |
69 | 69 | ||
70 | sv = new QScrollView( this ); | 70 | sv = new QScrollView( this ); |
71 | sv->setFrameStyle ( QFrame::Panel | QFrame::Plain ); | 71 | sv->setFrameStyle ( QFrame::Panel | QFrame::Plain ); |
72 | sv->setLineWidth ( 1 ); | 72 | sv->setLineWidth ( 1 ); |
73 | sv->setMidLineWidth ( 1 ); | 73 | sv->setMidLineWidth ( 1 ); |
74 | mw = new QWidget ( sv->viewport() ); | 74 | mw = new QWidget ( sv->viewport() ); |
75 | sv->addChild(mw); | 75 | sv->addChild(mw); |
76 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 76 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
77 | mainLayout = new QVBoxLayout ( mw ); | 77 | mainLayout = new QVBoxLayout ( mw ); |
78 | mainLayout->setMargin( 2 ); | 78 | mainLayout->setMargin( 0 ); |
79 | mainLayout->setSpacing( 2 ); | 79 | mainLayout->setSpacing( 0 ); |
80 | gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); | 80 | gridLayout->addMultiCellWidget( sv, 0, 1, 1,1 ); |
81 | setDefaults(); | 81 | setDefaults(); |
82 | mTypeNumberEditList.setAutoDelete( true ); | 82 | mTypeNumberEditList.setAutoDelete( true ); |
83 | mPopup = new QPopupMenu( this ); | 83 | mPopup = new QPopupMenu( this ); |
84 | QStringList list = PhoneNumber::supportedTypeListNames(); | 84 | QStringList list = PhoneNumber::supportedTypeListNames(); |
85 | mPopupCount = list.count(); | 85 | mPopupCount = list.count(); |
86 | int i = 0; | 86 | int i = 0; |
87 | while ( i < mPopupCount ) { | 87 | while ( i < mPopupCount ) { |
88 | mPopup->insertItem( list[ i ], i ); | 88 | mPopup->insertItem( list[ i ], i ); |
89 | ++i; | 89 | ++i; |
90 | } | 90 | } |
91 | connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int))); | 91 | connect(mPopup,SIGNAL(activated(int)),this,SLOT(addNumberInt( int))); |
92 | 92 | ||
93 | } | 93 | } |
94 | 94 | ||
95 | PhoneEditWidget::~PhoneEditWidget() | 95 | PhoneEditWidget::~PhoneEditWidget() |
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h index df5aff9..0477b6c 100644 --- a/kaddressbook/phoneeditwidget.h +++ b/kaddressbook/phoneeditwidget.h | |||
@@ -194,38 +194,39 @@ private: | |||
194 | KABC::PhoneNumber mPhoneNumber; | 194 | KABC::PhoneNumber mPhoneNumber; |
195 | KABC::PhoneNumber::TypeList mTypeList; | 195 | KABC::PhoneNumber::TypeList mTypeList; |
196 | 196 | ||
197 | QButtonGroup *mGroup; | 197 | QButtonGroup *mGroup; |
198 | QCheckBox *mPreferredBox; | 198 | QCheckBox *mPreferredBox; |
199 | KLineEdit *mNumber; | 199 | KLineEdit *mNumber; |
200 | }; | 200 | }; |
201 | #endif | 201 | #endif |
202 | 202 | ||
203 | class PhoneTypeNumberEdit : public QWidget | 203 | class PhoneTypeNumberEdit : public QWidget |
204 | { | 204 | { |
205 | Q_OBJECT | 205 | Q_OBJECT |
206 | public: | 206 | public: |
207 | PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) | 207 | PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) |
208 | { | 208 | { |
209 | QHBoxLayout * lay = new QHBoxLayout( this ); | 209 | QHBoxLayout * lay = new QHBoxLayout( this ); |
210 | lay->setSpacing( KDialogBase::spacingHintSmall() ); | 210 | lay->setSpacing( 2 ); |
211 | lay->setMargin( KDialogBase::marginHintSmall() ); | 211 | lay->setMargin( 0 ); |
212 | mMinusButton = new QPushButton ( this ); | 212 | mMinusButton = new QPushButton ( this ); |
213 | mMinusButton->setPixmap ( SmallIcon("minus")); | 213 | mMinusButton->setPixmap ( SmallIcon("minus")); |
214 | mCombo = new KComboBox( this ); | 214 | mCombo = new KComboBox( this ); |
215 | mNumber = new KLineEdit( this ); | 215 | mNumber = new KLineEdit( this ); |
216 | mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); | ||
216 | lay->addWidget( mMinusButton ); | 217 | lay->addWidget( mMinusButton ); |
217 | lay->addWidget( mCombo ); | 218 | lay->addWidget( mCombo ); |
218 | lay->addWidget( mNumber ); | 219 | lay->addWidget( mNumber ); |
219 | connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); | 220 | connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); |
220 | connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) ); | 221 | connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) ); |
221 | connect( mNumber , SIGNAL ( textChanged ( const QString & ) ), | 222 | connect( mNumber , SIGNAL ( textChanged ( const QString & ) ), |
222 | this, SLOT ( textChanged ( const QString & ) ) ); | 223 | this, SLOT ( textChanged ( const QString & ) ) ); |
223 | mCombo->insertStringList( PhoneNumber::supportedTypeListNames() ); | 224 | mCombo->insertStringList( PhoneNumber::supportedTypeListNames() ); |
224 | } | 225 | } |
225 | ~PhoneTypeNumberEdit() { | 226 | ~PhoneTypeNumberEdit() { |
226 | // qDebug("~PhoneTypeNumberEdit() "); | 227 | // qDebug("~PhoneTypeNumberEdit() "); |
227 | } | 228 | } |
228 | void setPhoneNumber( const KABC::PhoneNumber &phoneNumber ) | 229 | void setPhoneNumber( const KABC::PhoneNumber &phoneNumber ) |
229 | { | 230 | { |
230 | mPhoneNumber = phoneNumber; | 231 | mPhoneNumber = phoneNumber; |
231 | int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() ); | 232 | int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() ); |