summaryrefslogtreecommitdiffabout
path: root/kaddressbook/phoneeditwidget.h
Unidiff
Diffstat (limited to 'kaddressbook/phoneeditwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index fbf9fe7..f61087b 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -79,48 +79,50 @@ class PhoneEditWidget : public QWidget
79 QPopupMenu *mPopup; 79 QPopupMenu *mPopup;
80 int mPopupCount; 80 int mPopupCount;
81 PhoneTypeNumberEdit* mPendingDelete; 81 PhoneTypeNumberEdit* mPendingDelete;
82 void setDefaults(); 82 void setDefaults();
83 PhoneTypeNumberEdit* appendEditCombo(); 83 PhoneTypeNumberEdit* appendEditCombo();
84 QWidget* mw; 84 QWidget* mw;
85 QVBoxLayout* mainLayout; 85 QVBoxLayout* mainLayout;
86 QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList; 86 QPtrList <PhoneTypeNumberEdit> mTypeNumberEditList;
87 87
88}; 88};
89 89
90 90
91class PhoneTypeNumberEdit : public QWidget 91class PhoneTypeNumberEdit : public QWidget
92{ 92{
93 Q_OBJECT 93 Q_OBJECT
94public: 94public:
95 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent ) 95 PhoneTypeNumberEdit( QWidget *parent, const char *name = 0 ) :QWidget( parent )
96 { 96 {
97 QHBoxLayout * lay = new QHBoxLayout( this ); 97 QHBoxLayout * lay = new QHBoxLayout( this );
98 lay->setSpacing( 2 ); 98 lay->setSpacing( 2 );
99 lay->setMargin( 0 ); 99 lay->setMargin( 0 );
100 mMinusButton = new QPushButton ( this ); 100 mMinusButton = new QPushButton ( this );
101 mMinusButton->setPixmap ( SmallIcon("minus")); 101 mMinusButton->setPixmap ( SmallIcon("minus"));
102 mCombo = new KComboBox( this ); 102 mCombo = new KComboBox( this );
103 if ( QApplication::desktop()->width() <= 640 )
104 mCombo->setSizeLimit ( 6 );
103 mNumber = new KLineEdit( this ); 105 mNumber = new KLineEdit( this );
104 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6); 106 mMinusButton->setMaximumHeight( mNumber->sizeHint().height() + 6);
105 lay->addWidget( mMinusButton ); 107 lay->addWidget( mMinusButton );
106 lay->addWidget( mCombo ); 108 lay->addWidget( mCombo );
107 lay->addWidget( mNumber ); 109 lay->addWidget( mNumber );
108 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) ); 110 connect( mMinusButton , SIGNAL ( clicked() ), this, SLOT ( deleteNumber() ) );
109 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) ); 111 connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) );
110 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ), 112 connect( mNumber , SIGNAL ( textChanged ( const QString & ) ),
111 this, SLOT ( textChanged ( const QString & ) ) ); 113 this, SLOT ( textChanged ( const QString & ) ) );
112 mCombo->insertStringList( PhoneNumber::supportedTypeListNames() ); 114 mCombo->insertStringList( PhoneNumber::supportedTypeListNames() );
113 } 115 }
114 ~PhoneTypeNumberEdit() { 116 ~PhoneTypeNumberEdit() {
115 // qDebug("~PhoneTypeNumberEdit() "); 117 // qDebug("~PhoneTypeNumberEdit() ");
116 } 118 }
117 void setPhoneNumber( const KABC::PhoneNumber &phoneNumber ) 119 void setPhoneNumber( const KABC::PhoneNumber &phoneNumber )
118 { 120 {
119 mPhoneNumber = phoneNumber; 121 mPhoneNumber = phoneNumber;
120 int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() ); 122 int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() );
121 mCombo->setCurrentItem( index ); 123 mCombo->setCurrentItem( index );
122 mNumber->setText( mPhoneNumber.number() ); 124 mNumber->setText( mPhoneNumber.number() );
123 show(); 125 show();
124 mNumber->setFocus(); 126 mNumber->setFocus();
125 } 127 }
126 KABC::PhoneNumber phoneNumber() 128 KABC::PhoneNumber phoneNumber()