#############################################################################
# Makefile for building adress
-# Generated by tmake at 15:20, 2000/12/02
+# Generated by tmake at 15:56, 2000/12/02
# Project: adress
# Template: app
#############################################################################
####### Files
HEADERS = contact.h \
+ contactmodifyer.h \
mainwindow.h
SOURCES = contact.cpp \
+ contactmodifyer.cpp \
main.cpp \
mainwindow.cpp
OBJECTS = contact.o \
+ contactmodifyer.o \
main.o \
mainwindow.o \
ui/contactmodifyerbase.o \
UICIMPLS = ui/contactmodifyerbase.cpp \
ui/mainwindowbase.cpp \
ui/searchresultbase.cpp
-SRCMOC = moc_mainwindow.cpp \
+SRCMOC = moc_contactmodifyer.cpp \
+ moc_mainwindow.cpp \
ui/moc_contactmodifyerbase.cpp \
ui/moc_mainwindowbase.cpp \
ui/moc_searchresultbase.cpp
-OBJMOC = moc_mainwindow.o \
+OBJMOC = moc_contactmodifyer.o \
+ moc_mainwindow.o \
ui/moc_contactmodifyerbase.o \
ui/moc_mainwindowbase.o \
ui/moc_searchresultbase.o
contact.o: contact.cpp \
contact.h
+contactmodifyer.o: contactmodifyer.cpp \
+ contactmodifyer.h \
+ ui/contactmodifyerbase.h \
+ contact.h
+
main.o: main.cpp \
mainwindow.h \
ui/mainwindowbase.h \
ui/searchresultbase.o: ui/searchresultbase.cpp
+moc_contactmodifyer.o: moc_contactmodifyer.cpp \
+ contactmodifyer.h \
+ ui/contactmodifyerbase.h
+
moc_mainwindow.o: moc_mainwindow.cpp \
mainwindow.h \
ui/mainwindowbase.h \
ui/moc_searchresultbase.o: ui/moc_searchresultbase.cpp \
ui/searchresultbase.h
+moc_contactmodifyer.cpp: contactmodifyer.h
+ $(MOC) contactmodifyer.h -o moc_contactmodifyer.cpp
+
moc_mainwindow.cpp: mainwindow.h
$(MOC) mainwindow.h -o moc_mainwindow.cpp
TEMPLATE = app
CONFIG = qt warn_on debug
HEADERS = contact.h \
+ contactmodifyer.h \
mainwindow.h
SOURCES = contact.cpp \
+ contactmodifyer.cpp \
main.cpp \
mainwindow.cpp
INTERFACES = ui/contactmodifyerbase.ui \
--- /dev/null
+#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();
+}
+
--- /dev/null
+#ifndef CONTACTMODIFIER_H
+#define CONTACTMODIFIER_H
+#include "ui/contactmodifyerbase.h"
+
+class CContact;
+
+class ContactModifier : public ContactModifierBase
+{
+ Q_OBJECT
+
+public:
+ ContactModifier(CContact* contact = 0, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+ ~ContactModifier();
+
+
+public slots:
+ void slotOK();
+
+protected:
+ CContact* m_contact;
+
+};
+
+#endif // CONTACTMODIFIER_H