+#include "contactmodifyer.h"
+#include "contact.h"
+
+
+//QT included
+#include <qlineedit.h>
+/*
+ * Constructs a ContactModifier which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'
+ *
+ * The dialog will by default be modeless, unless you set 'modal' to
+ * TRUE to construct a modal dialog.
+ */
+ContactModifier::ContactModifier(CContact* contact, QWidget* parent, const char* name, bool modal, WFlags fl )
+ : ContactModifierBase( parent, name, modal, fl )
+{
+ m_contact = contact;
+
+ if (m_contact != '\0')
+ {
+ FirstnameLine->setText(contact->firstname());
+ LastnameLine->setText(contact->lastname());
+ AdressLine->setText(contact->adress());
+ PhoneNumberLine->setText(contact->phoneNumber());
+ }
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+ContactModifier::~ContactModifier()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
+/*
+ * public slot
+ */
+void ContactModifier::slotOK()
+{
+ (void) new CContact( FirstnameLine->text(), LastnameLine->text(), AdressLine->text(), PhoneNumberLine->text());
+
+ if (m_contact != '\0')
+ {
+ delete m_contact;
+ }
+
+ accept();
+}
+