summaryrefslogtreecommitdiffabout
path: root/kaddressbook/phoneeditwidget.h
Side-by-side diff
Diffstat (limited to 'kaddressbook/phoneeditwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/phoneeditwidget.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/kaddressbook/phoneeditwidget.h b/kaddressbook/phoneeditwidget.h
index 6a514ed..c730c7b 100644
--- a/kaddressbook/phoneeditwidget.h
+++ b/kaddressbook/phoneeditwidget.h
@@ -65,12 +65,15 @@ class PhoneEditWidget : public QScrollView
void modified();
void typeChange( int oldType, int newType );
private slots:
- void addNumber();
+ void deleteEdit( PhoneTypeNumberEdit* ew );
+ void addNumber();
+ void pendingDelete();
protected:
private:
+ PhoneTypeNumberEdit* mPendingDelete;
void setDefaults();
PhoneTypeNumberEdit* appendEditCombo();
QWidget* mw;
QVBoxLayout* mainLayout;
@@ -211,18 +214,18 @@ public:
connect( mCombo , SIGNAL ( activated ( int ) ), this, SLOT ( comboTypeChange( int ) ) );
connect( mNumber , SIGNAL ( textChanged ( const QString & ) ),
this, SLOT ( textChanged ( const QString & ) ) );
mCombo->insertStringList( PhoneNumber::supportedTypeListNames() );
- mIsValid = true;
}
-
+ ~PhoneTypeNumberEdit() {
+ // qDebug("~PhoneTypeNumberEdit() ");
+ }
void setPhoneNumber( const KABC::PhoneNumber &phoneNumber )
{
mPhoneNumber = phoneNumber;
int index = PhoneNumber::typeListIndex4Type( mPhoneNumber.type() );
mCombo->setCurrentItem( index );
mNumber->setText( mPhoneNumber.number() );
- mIsValid = true;
show();
}
KABC::PhoneNumber phoneNumber()
@@ -233,9 +236,8 @@ public:
return mPhoneNumber;
}
bool isValid()
{
- if ( !mIsValid ) return false;
if ( mNumber->text().isEmpty() )return false;
return true;
}
private slots:
@@ -248,11 +250,9 @@ public:
}
}
void deleteNumber()
{
- emit modified();
- hide();
- mIsValid = false;
+ emit deleteMe( this );
}
void comboTypeChange( int index )
{
int old = mPhoneNumber.type();
@@ -274,11 +274,11 @@ public:
}
signals:
void typeChange( int oldType, int newType );
void modified();
+ void deleteMe( PhoneTypeNumberEdit* );
private:
- bool mIsValid;
KABC::PhoneNumber mPhoneNumber;
QPushButton* mMinusButton;
KComboBox *mCombo;
KLineEdit *mNumber;