| 68 |
if (ManageFamilyLinkHandler(fams_id, families, individuals, &familyrecord, &union_event, &familylink_handler)) |
if (ManageFamilyLinkHandler(fams_id, families, individuals, &familyrecord, &union_event, &familylink_handler)) |
| 69 |
{ |
{ |
| 70 |
OneFamilyLink * new_family_link = _mmi_spousetofamilylink->addFamilyLink(*familylink_handler); |
OneFamilyLink * new_family_link = _mmi_spousetofamilylink->addFamilyLink(*familylink_handler); |
| 71 |
|
new_family_link->LinkEdited().connect(SigC::slot(this, &ViewSpouseToFamilyLink::family_edited)); |
| 72 |
ManageFamilyLinkNote(new_family_link, (*iter).getPtr()); |
ManageFamilyLinkNote(new_family_link, (*iter).getPtr()); |
| 73 |
ManageFamilyRecordNote(new_family_link, familyrecord); |
ManageFamilyRecordNote(new_family_link, familyrecord); |
| 74 |
ManageUnionEventNote(new_family_link, union_event); |
ManageUnionEventNote(new_family_link, union_event); |
| 86 |
get_document()->AddSpouse(_parent_entity); |
get_document()->AddSpouse(_parent_entity); |
| 87 |
} |
} |
| 88 |
save_to_document(); |
save_to_document(); |
| 89 |
|
load_from_document(); //FIXME : this should be done automatically |
| 90 |
|
//- save_to_document should refresh all views |
| 91 |
return; |
return; |
| 92 |
} |
} |
| 93 |
|
|
| 107 |
std::string place_old_value; |
std::string place_old_value; |
| 108 |
std::string place_new_value; |
std::string place_new_value; |
| 109 |
|
|
| 110 |
int family_index = tab_index - 1; |
int family_index = tab_index; |
| 111 |
OneFamilyLink * tmp = _mmi_spousetofamilylink->getOneFamilyLink(tab_index); |
OneFamilyLink * tmp = _mmi_spousetofamilylink->getOneFamilyLink(tab_index); |
| 112 |
if (tmp != 0) |
if (tmp != 0) |
| 113 |
{ |
{ |
| 206 |
bool BakeryGateway::ViewSpouseToFamilyLink::ManageFamilyLinkHandler(std::string const &family_record_id, GEDCOMParser::FamilyRecords_t const &families, GEDCOMParser::IndividualRecords_t const &individuals, GEDCOMParser::FamilyRecord ** familyrecord, GEDCOMParser::Event ** union_event, OneFamilyLinkHandler ** familylink_handler) |
bool BakeryGateway::ViewSpouseToFamilyLink::ManageFamilyLinkHandler(std::string const &family_record_id, GEDCOMParser::FamilyRecords_t const &families, GEDCOMParser::IndividualRecords_t const &individuals, GEDCOMParser::FamilyRecord ** familyrecord, GEDCOMParser::Event ** union_event, OneFamilyLinkHandler ** familylink_handler) |
| 207 |
{ |
{ |
| 208 |
bool res; |
bool res; |
| 209 |
|
std::string * husband_id = 0; |
| 210 |
|
std::string * wife_id = 0; |
| 211 |
|
|
| 212 |
GEDCOMParser::FamilyRecords_t::const_iterator family_iter = families.find(family_record_id); |
GEDCOMParser::FamilyRecords_t::const_iterator family_iter = families.find(family_record_id); |
| 213 |
if (family_iter != families.end()) |
if (family_iter != families.end()) |
| 234 |
} |
} |
| 235 |
*union_event = union_event_tmp; |
*union_event = union_event_tmp; |
| 236 |
} |
} |
| 237 |
std::string * husband_id = new std::string((*family_iter).second->getHusb()); |
husband_id = new std::string((*family_iter).second->getHusb()); |
| 238 |
std::string * wife_id = new std::string((*family_iter).second->getWife()); |
wife_id = new std::string((*family_iter).second->getWife()); |
| 239 |
std::string husband = get_name_individual(individuals, *husband_id); |
std::string husband = get_name_individual(individuals, *husband_id); |
| 240 |
std::string wife = get_name_individual(individuals, *wife_id); |
std::string wife = get_name_individual(individuals, *wife_id); |
| 241 |
OneFamilyLinkHandler::SlotHandler_t * slot_husband = getSlotHandler(husband_id); |
std::string * individu_id = new std::string(_parent_entity->getId()); |
| 242 |
OneFamilyLinkHandler::SlotHandler_t * slot_wife = getSlotHandler(wife_id); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_husband = getNavigationSlotHandler(husband_id); |
| 243 |
|
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_wife = getNavigationSlotHandler(wife_id); |
| 244 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_husband = getPopdownLinkEditionSlotHandler(individu_id); |
| 245 |
|
OneFamilyLinkHandler::PopdownLinkEditionSlotHandler_t * popdownlinkedition_slot_wife = getPopdownLinkEditionSlotHandler(individu_id); |
| 246 |
|
|
| 247 |
std::vector<std::string> children; |
std::vector<std::string> children; |
| 248 |
std::vector < OneFamilyLinkHandler::SlotHandler_t * > slots_children; |
std::vector < OneFamilyLinkHandler::NavigationSlotHandler_t * > navigation_slots_children; |
| 249 |
GEDCOMParser::ChildXrefs_t children_ids = (*family_iter).second->getChilXrefs(); |
GEDCOMParser::ChildXrefs_t children_ids = (*family_iter).second->getChilXrefs(); |
| 250 |
for (GEDCOMParser::ChildXrefs_t::const_iterator child_iter = children_ids.begin(); child_iter != children_ids.end(); child_iter++) |
for (GEDCOMParser::ChildXrefs_t::const_iterator child_iter = children_ids.begin(); child_iter != children_ids.end(); child_iter++) |
| 251 |
{ |
{ |
| 252 |
std::string * child_id = new std::string(*child_iter); |
std::string * child_id = new std::string(*child_iter); |
| 253 |
std::string child = get_name_individual(individuals, *child_id); |
std::string child = get_name_individual(individuals, *child_id); |
| 254 |
children.push_back(child); |
children.push_back(child); |
| 255 |
OneFamilyLinkHandler::SlotHandler_t * slot_child = new OneFamilyLinkHandler::SlotHandler_t(SigC::bind(SigC::slot(this, &BakeryGateway::ViewSpouseToFamilyLink::ButtonPressed), child_id)); |
OneFamilyLinkHandler::NavigationSlotHandler_t * navigation_slot_child = new OneFamilyLinkHandler::NavigationSlotHandler_t(SigC::bind(SigC::slot(this, &BakeryGateway::ViewSpouseToFamilyLink::LeftButtonPressed), child_id)); |
| 256 |
slots_children.push_back(slot_child); |
navigation_slots_children.push_back(navigation_slot_child); |
| 257 |
} |
} |
| 258 |
OneFamilyLinkHandler * familylink_handler_tmp = new OneSpouseToFamilyLinkHandler(*union_date, *union_place, husband, wife, children, slot_husband, slot_wife, slots_children); |
OneFamilyLinkHandler * familylink_handler_tmp = new OneSpouseToFamilyLinkHandler(*union_date, *union_place, husband, wife, children, navigation_slot_husband, navigation_slot_wife, popdownlinkedition_slot_husband, popdownlinkedition_slot_wife, navigation_slots_children); |
| 259 |
*familylink_handler = familylink_handler_tmp; |
*familylink_handler = familylink_handler_tmp; |
| 260 |
} |
} |
| 261 |
else |
else |
| 264 |
} |
} |
| 265 |
return res; |
return res; |
| 266 |
} |
} |
| 267 |
|
|
| 268 |
|
MMIFamilyLink * BakeryGateway::ViewSpouseToFamilyLink::getMMIFamilyLink(void) const |
| 269 |
|
{ |
| 270 |
|
return _mmi_spousetofamilylink; |
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
void BakeryGateway::ViewSpouseToFamilyLink::family_edited(std::string id) |
| 274 |
|
{ |
| 275 |
|
std::cerr << "Family edited : individu id = " << id << std::endl; |
| 276 |
|
return; |
| 277 |
|
} |