| 21 |
**/ |
**/ |
| 22 |
#include "BakeryGateway/ViewChildToFamilyLink.hh" |
#include "BakeryGateway/ViewChildToFamilyLink.hh" |
| 23 |
#include "BakeryGateway/ViewFamilyRecordNoteFactory.hh" |
#include "BakeryGateway/ViewFamilyRecordNoteFactory.hh" |
| 24 |
|
#include "OneFamilyLinkHandler.hh" |
| 25 |
|
#include "OneChildToFamilyLink.hh" |
| 26 |
|
#include "OneChildToFamilyLinkHandler.hh" |
| 27 |
|
|
| 28 |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
| 29 |
_mmi_childtofamilylink(mmi), |
_mmi_childtofamilylink(mmi), |
| 104 |
std::string * mother_id = new std::string((*famc_iter).second->getWife()); |
std::string * mother_id = new std::string((*famc_iter).second->getWife()); |
| 105 |
father = get_name_individual(individuals, *father_id); |
father = get_name_individual(individuals, *father_id); |
| 106 |
mother = get_name_individual(individuals, *mother_id); |
mother = get_name_individual(individuals, *mother_id); |
| 107 |
SigC::Slot1<int, GdkEventButton *> * slot_father = new SigC::Slot1<int, GdkEventButton *>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), father_id)); |
OneFamilyLinkHandler::SlotHandler_t * slot_father = new OneFamilyLinkHandler::SlotHandler_t(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), father_id)); |
| 108 |
SigC::Slot1<int, GdkEventButton *> * slot_mother = new SigC::Slot1<int, GdkEventButton *>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), mother_id)); |
OneFamilyLinkHandler::SlotHandler_t * slot_mother = new OneFamilyLinkHandler::SlotHandler_t(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), mother_id)); |
| 109 |
OneChildToFamilyLink * new_family_link = _mmi_childtofamilylink->addChildToFamilyLink(father, mother, slot_father, slot_mother); |
OneChildToFamilyLinkHandler new_handler(father, mother, slot_father, slot_mother); |
| 110 |
Bakery::View<BakeryGateway::Document> * note_view = _view_factory->createView(new_family_link->OneChildToFamilyLinkNote); |
OneFamilyLink * new_family_link; |
| 111 |
|
new_family_link = _mmi_childtofamilylink->addFamilyLink(new_handler); |
| 112 |
|
Bakery::View<BakeryGateway::Document> * note_view = _view_factory->createView(new_family_link->getFamilyNote()); |
| 113 |
subscribe_view(note_view); |
subscribe_view(note_view); |
| 114 |
BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::ChildToFamilyLink > * tmp = dynamic_cast < BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::ChildToFamilyLink > * > (note_view); |
BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::ChildToFamilyLink > * tmp = dynamic_cast < BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::ChildToFamilyLink > * > (note_view); |
| 115 |
tmp->set_parent_entity((*iter).getPtr()); |
tmp->set_parent_entity((*iter).getPtr()); |
| 116 |
|
|
| 117 |
BakeryGateway::ViewFamilyRecordNoteFactory familyrecord_note_factory; |
BakeryGateway::ViewFamilyRecordNoteFactory familyrecord_note_factory; |
| 118 |
|
|
| 119 |
Bakery::View<BakeryGateway::Document> * family_note_view = familyrecord_note_factory.createView(new_family_link->MMIParentsFamilyNote); |
Bakery::View<BakeryGateway::Document> * family_note_view = familyrecord_note_factory.createView(new_family_link->getFamilyNote()); |
| 120 |
subscribe_view(family_note_view); |
subscribe_view(family_note_view); |
| 121 |
BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::FamilyRecord > * tmp2 = dynamic_cast < BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::FamilyRecord > * > (family_note_view); |
BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::FamilyRecord > * tmp2 = dynamic_cast < BakeryExtras::View_Linked < BakeryGateway::Document, GEDCOMParser::FamilyRecord > * > (family_note_view); |
| 122 |
tmp2->set_parent_entity(famc_iter->second.getPtr()); |
tmp2->set_parent_entity(famc_iter->second.getPtr()); |
| 127 |
return; |
return; |
| 128 |
} |
} |
| 129 |
|
|
| 130 |
int BakeryGateway::ViewChildToFamilyLink::ButtonPressed(GdkEventButton * event, std::string const * key) |
OneFamilyLinkHandler::ReturnHandler_t BakeryGateway::ViewChildToFamilyLink::ButtonPressed(GdkEventButton * event, std::string const * key) |
| 131 |
{ |
{ |
| 132 |
bool new_win = false; |
bool new_win = false; |
| 133 |
if (event->state & GDK_CONTROL_MASK) |
if (event->state & GDK_CONTROL_MASK) |