| 23 |
#include "OneFamilyLinkHandler.hh" |
#include "OneFamilyLinkHandler.hh" |
| 24 |
#include "OneChildToFamilyLink.hh" |
#include "OneChildToFamilyLink.hh" |
| 25 |
#include "OneChildToFamilyLinkHandler.hh" |
#include "OneChildToFamilyLinkHandler.hh" |
| 26 |
|
#include "MMIMenuLinkEditor.hh" |
| 27 |
|
|
| 28 |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
| 29 |
_mmi_childtofamilylink(mmi) |
_mmi_childtofamilylink(mmi) |
| 46 |
get_document()->AddParents(_parent_entity); |
get_document()->AddParents(_parent_entity); |
| 47 |
} |
} |
| 48 |
save_to_document(); |
save_to_document(); |
| 49 |
|
load_from_document(); //FIXME |
| 50 |
return; |
return; |
| 51 |
} |
} |
| 52 |
|
|
| 82 |
if (ManageFamilyLinkHandler(famc_id, families, individuals, &familyrecord, &familylink_handler)) |
if (ManageFamilyLinkHandler(famc_id, families, individuals, &familyrecord, &familylink_handler)) |
| 83 |
{ |
{ |
| 84 |
OneFamilyLink * new_family_link = _mmi_childtofamilylink->addFamilyLink(*familylink_handler); |
OneFamilyLink * new_family_link = _mmi_childtofamilylink->addFamilyLink(*familylink_handler); |
| 85 |
|
new_family_link->LinkEdited().connect(SigC::slot(this, &ViewChildToFamilyLink::family_edited)); |
| 86 |
ManageFamilyLinkNote(new_family_link, (*iter).getPtr()); |
ManageFamilyLinkNote(new_family_link, (*iter).getPtr()); |
| 87 |
ManageFamilyRecordNote(new_family_link, familyrecord); |
ManageFamilyRecordNote(new_family_link, familyrecord); |
| 88 |
} |
} |
| 105 |
{ |
{ |
| 106 |
|
|
| 107 |
bool res; |
bool res; |
| 108 |
|
std::string * father_id = 0; |
| 109 |
|
std::string * mother_id = 0; |
| 110 |
GEDCOMParser::FamilyRecords_t::const_iterator family_iter = families.find(family_record_id); |
GEDCOMParser::FamilyRecords_t::const_iterator family_iter = families.find(family_record_id); |
| 111 |
if (family_iter != families.end()) |
if (family_iter != families.end()) |
| 112 |
{ |
{ |
| 113 |
res = true; |
res = true; |
| 114 |
*familyrecord = (*family_iter).second.getPtr(); |
*familyrecord = (*family_iter).second.getPtr(); |
| 115 |
std::string * father_id = new std::string((*family_iter).second->getHusb()); |
father_id = new std::string((*family_iter).second->getHusb()); |
| 116 |
std::string * mother_id = new std::string((*family_iter).second->getWife()); |
mother_id = new std::string((*family_iter).second->getWife()); |
| 117 |
std::string father = get_name_individual(individuals, *father_id); |
std::string father = get_name_individual(individuals, *father_id); |
| 118 |
std::string mother = get_name_individual(individuals, *mother_id); |
std::string mother = get_name_individual(individuals, *mother_id); |
| 119 |
OneFamilyLinkHandler::SlotHandler_t * slot_father = getSlotHandler(father_id); |
std::string * individu_id = new std::string(_parent_entity->getId()); |
| 120 |
OneFamilyLinkHandler::SlotHandler_t * slot_mother = getSlotHandler(mother_id); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_father = getNavigationSlotHandler(father_id); |
| 121 |
OneFamilyLinkHandler * familylink_handler_tmp = new OneChildToFamilyLinkHandler(father, mother, slot_father, slot_mother); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_mother = getNavigationSlotHandler(mother_id); |
| 122 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_father = getPopdownLinkEditionSlotHandler(individu_id); |
| 123 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_mother = getPopdownLinkEditionSlotHandler(individu_id); |
| 124 |
|
|
| 125 |
|
OneFamilyLinkHandler * familylink_handler_tmp = new OneChildToFamilyLinkHandler(father, mother, navigation_slot_father, navigation_slot_mother, popdownlinkedition_slot_father, popdownlinkedition_slot_mother); |
| 126 |
*familylink_handler = familylink_handler_tmp; |
*familylink_handler = familylink_handler_tmp; |
| 127 |
} |
} |
| 128 |
else |
else |
| 132 |
return res; |
return res; |
| 133 |
} |
} |
| 134 |
|
|
| 135 |
|
MMIFamilyLink * BakeryGateway::ViewChildToFamilyLink::getMMIFamilyLink(void) const |
| 136 |
|
{ |
| 137 |
|
return _mmi_childtofamilylink; |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
void BakeryGateway::ViewChildToFamilyLink::family_edited(std::string id) |
| 141 |
|
{ |
| 142 |
|
std::cerr << "Family edited : individu id = " << id << std::endl; |
| 143 |
|
return; |
| 144 |
|
} |