Skip to content

Commit

Permalink
Merge pull request #477 from se-sss/master
Browse files Browse the repository at this point in the history
"Swap" button in RelationshipCalculator dialog.
  • Loading branch information
Serg-Norseman authored Jul 3, 2023
2 parents f650a7a + 8bd63eb commit db78860
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -909,3 +909,4 @@
905=Identifiers (XRef)
906=father's wife
907=mother's husband
908=Swap
1 change: 1 addition & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -909,3 +909,4 @@
905=Идентификаторы (XRef)
906=жена отца
907=муж матери
908=Поменять местами
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public void SetRec2(GDMIndividualRecord value)
Solve();
}

public void Swap()
{
GDMIndividualRecord fRecTmp = fRec1;
fRec1 = fRec2;
fRec2 = fRecTmp;
Solve();
}

private void Solve()
{
fResult = "???";
Expand Down Expand Up @@ -113,6 +121,7 @@ public override void SetLocale()
GetControl<IButton>("btnRec1Select").Text = LangMan.LS(LSID.LSID_DlgSelect) + @"...";
GetControl<IButton>("btnRec2Select").Text = LangMan.LS(LSID.LSID_DlgSelect) + @"...";
GetControl<ILabel>("lblKinship").Text = LangMan.LS(LSID.LSID_Kinship);
GetControl<IButton>("btnSwap").Text = LangMan.LS(LSID.LSID_Swap);
}
}
}
5 changes: 4 additions & 1 deletion projects/GKCore/GKCore/LangMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -969,8 +969,10 @@ public enum LSID

/* 906 */ LSID_RK_FathersWife,
/* 907 */ LSID_RK_MothersHusband,
/* 908 */ LSID_Swap,

/* 000 */ LSID_Last = LSID_RK_MothersHusband
/* 000 */
LSID_Last = LSID_Swap
}


Expand Down Expand Up @@ -1896,6 +1898,7 @@ public static class LangMan

/* 906 */ "father's wife",
/* 907 */ "mother's husband",
/* 908 */ "Swap",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ private void btnRec2Select_Click(object sender, EventArgs e)
{
fController.SelectRec2();
}

private void btnSwap_Click(object sender, EventArgs e)
{
fController.Swap();
}
}
}

0 comments on commit db78860

Please sign in to comment.