22 |
#include "BakeryGateway/ViewChildToFamilyLink.hh" |
#include "BakeryGateway/ViewChildToFamilyLink.hh" |
23 |
#include "BakeryGateway/ViewFamilyRecordNoteFactory.hh" |
#include "BakeryGateway/ViewFamilyRecordNoteFactory.hh" |
24 |
|
|
25 |
|
|
26 |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
BakeryGateway::ViewChildToFamilyLink::ViewChildToFamilyLink(MMIChildToFamilyLink * mmi) : |
27 |
_mmi_childtofamilylink(mmi), |
_mmi_childtofamilylink(mmi), |
28 |
_during_load(false) |
_during_load(false) |
42 |
{ |
{ |
43 |
if ((! _during_load) && (_parent_entity != 0)) |
if ((! _during_load) && (_parent_entity != 0)) |
44 |
{ |
{ |
|
std::cerr << "enter save_to_document" << std::endl; |
|
45 |
GEDCOMParser::ChildToFamilyLink * new_family_link = _parent_entity->addChildToFamilyLink(); |
GEDCOMParser::ChildToFamilyLink * new_family_link = _parent_entity->addChildToFamilyLink(); |
46 |
if (new_family_link != 0) |
if (new_family_link != 0) |
47 |
{ |
{ |
|
std::cerr << "new_family_link created" << std::endl; |
|
48 |
GEDCOMParser::FamilyRecord * new_family = get_document()->addFamilyRecord(); |
GEDCOMParser::FamilyRecord * new_family = get_document()->addFamilyRecord(); |
|
std::cerr << "new_family created" << std::endl; |
|
49 |
new_family->addChilXref(_parent_entity->getId()); |
new_family->addChilXref(_parent_entity->getId()); |
|
std::cerr << "new_family->addChilXref OK" << std::endl; |
|
50 |
std::string new_family_id = new_family->getId(); |
std::string new_family_id = new_family->getId(); |
|
std::cerr << "new_family->getId() OK" << std::endl; |
|
51 |
new_family_link->setFamcXref(new_family_id); |
new_family_link->setFamcXref(new_family_id); |
|
std::cerr << "new_family_link->setFamcXref OK" << std::endl; |
|
52 |
} |
} |
53 |
} |
} |
54 |
return; |
return; |
102 |
std::string * mother_id = new std::string((*famc_iter).second->getWife()); |
std::string * mother_id = new std::string((*famc_iter).second->getWife()); |
103 |
father = get_name_individual(individuals, *father_id); |
father = get_name_individual(individuals, *father_id); |
104 |
mother = get_name_individual(individuals, *mother_id); |
mother = get_name_individual(individuals, *mother_id); |
105 |
SigC::Slot0<void> * slot_father = new SigC::Slot0<void>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::Navigate), father_id)); |
SigC::Slot1<int, GdkEventButton *> * slot_father = new SigC::Slot1<int, GdkEventButton *>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), father_id)); |
106 |
SigC::Slot0<void> * slot_mother = new SigC::Slot0<void>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::Navigate), mother_id)); |
SigC::Slot1<int, GdkEventButton *> * slot_mother = new SigC::Slot1<int, GdkEventButton *>(SigC::bind(SigC::slot(this, &BakeryGateway::ViewChildToFamilyLink::ButtonPressed), mother_id)); |
107 |
OneChildToFamilyLink * new_family_link = _mmi_childtofamilylink->addChildToFamilyLink(father, mother, slot_father, slot_mother); |
OneChildToFamilyLink * new_family_link = _mmi_childtofamilylink->addChildToFamilyLink(father, mother, slot_father, slot_mother); |
108 |
Bakery::View<BakeryGateway::Document> * note_view = _view_factory->createView(new_family_link->OneChildToFamilyLinkNote); |
Bakery::View<BakeryGateway::Document> * note_view = _view_factory->createView(new_family_link->OneChildToFamilyLinkNote); |
109 |
subscribe_view(note_view); |
subscribe_view(note_view); |
123 |
return; |
return; |
124 |
} |
} |
125 |
|
|
126 |
void BakeryGateway::ViewChildToFamilyLink::Navigate(std::string const * key) |
int BakeryGateway::ViewChildToFamilyLink::ButtonPressed(GdkEventButton * event, std::string const * key) |
127 |
{ |
{ |
128 |
BakeryExtras::View_Navigator<BakeryGateway::Document, std::string >::Navigate(*key); |
bool new_win = false; |
129 |
return; |
if (event->state & GDK_CONTROL_MASK) |
130 |
|
{ |
131 |
|
new_win = true; |
132 |
|
} |
133 |
|
Navigate(*key, new_win); |
134 |
|
return false; |
135 |
} |
} |
136 |
|
|
137 |
std::string BakeryGateway::ViewChildToFamilyLink::get_name_individual(GEDCOMParser::IndividualRecords_t const &individuals, std::string const &individual_id) const |
std::string BakeryGateway::ViewChildToFamilyLink::get_name_individual(GEDCOMParser::IndividualRecords_t const &individuals, std::string const &individual_id) const |