Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Serg-Norseman/GEDKeeper i…
Browse files Browse the repository at this point in the history
…nto test-carbuna
  • Loading branch information
hazzik committed Jun 28, 2024
2 parents 9b98ab9 + ebb7c55 commit 3fe62b6
Show file tree
Hide file tree
Showing 51 changed files with 739 additions and 238 deletions.
1 change: 1 addition & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>Change log</h1>

<p>
<b>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Added saving of column width settings for all lists.
<li>Completed Spanish localization [Miguel Á. Pérez Valdenebro].
<li>Added remembering and the feature to select from a list of causes and agencies of events.
<li>Added an option to select list filtering methods (differences in speed).
Expand Down
1 change: 1 addition & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h1>История версий</h1>

<p>
<b>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Добавлено запоминание настроек ширины столбцов всех списков.
<li>Завершена локализация на испанский язык [Miguel Á. Pérez Valdenebro].
<li>Добавлено запоминание и возможность выбора из списка причин и удостоверяющих организаций событий.
<li>Добавлена опция выбора методов фильтрации списков (различия по скорости).
Expand Down
14 changes: 6 additions & 8 deletions projects/GKCore/GKCore/Controllers/BaseWinController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,9 @@ public void RestoreListsSettings()
for (var rt = GDMRecordType.rtIndividual; rt <= GDMRecordType.rtLocation; rt++) {
IListView rView = fTabParts[(int)rt].ListView;
if (rView != null) {
rView.SetSortColumn(globOptions.ListOptions[rt].SortColumn, false);
if (rt == GDMRecordType.rtIndividual) {
globOptions.IndividualListColumns.CopyTo(rView.ListMan.ListColumns);
}
var columnOpts = globOptions.ListOptions[rt];
rView.SetSortColumn(columnOpts.SortColumn, false);
columnOpts.Columns.CopyTo(rView.ListMan.ListColumns);
}
}
}
Expand All @@ -633,10 +632,9 @@ public void SaveListsSettings()
for (var rt = GDMRecordType.rtIndividual; rt <= GDMRecordType.rtLocation; rt++) {
IListView rView = fTabParts[(int)rt].ListView;
if (rView != null) {
globOptions.ListOptions[rt].SortColumn = rView.SortColumn;
if (rt == GDMRecordType.rtIndividual) {
rView.ListMan.ListColumns.CopyTo(globOptions.IndividualListColumns);
}
var columnOpts = globOptions.ListOptions[rt];
columnOpts.SortColumn = rView.SortColumn;
rView.ListMan.ListColumns.CopyTo(columnOpts.Columns);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -73,6 +73,12 @@ public override void Init(IBaseWindow baseWin)
fView.MediaList.ListModel = new MediaLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
7 changes: 7 additions & 0 deletions projects/GKCore/GKCore/Controllers/EventEditDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ public override void Init(IBaseWindow baseWin)
fView.SourcesList.ListModel = new SourceCitationsListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
fView.SourcesList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
13 changes: 11 additions & 2 deletions projects/GKCore/GKCore/Controllers/FamilyEditDlgController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -65,12 +65,21 @@ public override void Init(IBaseWindow baseWin)
base.Init(baseWin);

fView.ChildrenList.ListModel = new FamilyChildrenListModel(fView, baseWin, fLocalUndoman);
fView.EventsList.ListModel = new EventsListModel(fView, baseWin, fLocalUndoman, false);
fView.EventsList.ListModel = new EventsListModel(fView, baseWin, fLocalUndoman);
fView.NotesList.ListModel = new NoteLinksListModel(fView, baseWin, fLocalUndoman);
fView.MediaList.ListModel = new MediaLinksListModel(fView, baseWin, fLocalUndoman);
fView.SourcesList.ListModel = new SourceCitationsListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.ChildrenList.ListModel.SaveSettings();
fView.EventsList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
fView.SourcesList.ListModel.SaveSettings();
}

public void SetTarget(TargetMode targetType, GDMIndividualRecord target)
{
if (targetType == TargetMode.tmNone || target == null) return;
Expand Down
9 changes: 8 additions & 1 deletion projects/GKCore/GKCore/Controllers/GroupEditDlgController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -62,6 +62,13 @@ public override void Init(IBaseWindow baseWin)
fView.MediaList.ListModel = new MediaLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.MembersList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ public override void Init(IBaseWindow baseWin)
fView.NamesList.OnModify += ModifyNamesSheet;
}

public override void Done()
{
fView.NamesList.ListModel.SaveSettings();
fView.LinksList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
}

private void ModifyNamesSheet(object sender, ModifyEventArgs eArgs)
{
fView.Name.Text = fLocationRecord.LocationName;
Expand Down
8 changes: 7 additions & 1 deletion projects/GKCore/GKCore/Controllers/MediaEditDlgController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -69,6 +69,12 @@ public override void Init(IBaseWindow baseWin)
fView.SourcesList.ListModel = new SourceCitationsListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.NotesList.ListModel.SaveSettings();
fView.SourcesList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
7 changes: 4 additions & 3 deletions projects/GKCore/GKCore/Controllers/OptionsDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

using System.Threading.Tasks;
using GDModel;
using GKCore.Design;
using GKCore.Design.Controls;
using GKCore.Design.Views;
Expand Down Expand Up @@ -50,7 +51,7 @@ public IListColumns TempColumns
public OptionsDlgController(IOptionsDlg view) : base(view)
{
fOptions = GlobalOptions.Instance;
fTempColumns = IndividualListModel.CreateIndividualListColumns();
fTempColumns = IndividualListModel.CreateListColumns();

FillGeoSearchCountries();

Expand Down Expand Up @@ -120,7 +121,7 @@ public void AcceptColumnsList()
fTempColumns.OrderedColumns[i].CurActive = listView.Items[i].Checked;
}

fTempColumns.CopyTo(fOptions.IndividualListColumns);
fTempColumns.CopyTo(fOptions.ListOptions[GDMRecordType.rtIndividual].Columns);
}

public void UpdateProxyOptions()
Expand Down Expand Up @@ -774,7 +775,7 @@ public override void UpdateView()
UpdateInterfaceOptions();
UpdateWomanSurnameFormat();

fOptions.IndividualListColumns.CopyTo(fTempColumns);
fOptions.ListOptions[GDMRecordType.rtIndividual].Columns.CopyTo(fTempColumns);
UpdateColumnsList();

// pedigrees
Expand Down
16 changes: 15 additions & 1 deletion projects/GKCore/GKCore/Controllers/PersonEditDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public override void Init(IBaseWindow baseWin)
{
base.Init(baseWin);

fView.EventsList.ListModel = new EventsListModel(fView, baseWin, fLocalUndoman, true);
fView.EventsList.ListModel = new EventsListModel(fView, baseWin, fLocalUndoman);
fView.NotesList.ListModel = new NoteLinksListModel(fView, baseWin, fLocalUndoman);
fView.MediaList.ListModel = new MediaLinksListModel(fView, baseWin, fLocalUndoman);
fView.SourcesList.ListModel = new SourceCitationsListModel(fView, baseWin, fLocalUndoman);
Expand All @@ -105,6 +105,20 @@ public override void Init(IBaseWindow baseWin)
fView.ParentsList.ListModel = new IndiParentsListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.EventsList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
fView.SourcesList.ListModel.SaveSettings();
fView.AssociationsList.ListModel.SaveSettings();
fView.GroupsList.ListModel.SaveSettings();
fView.NamesList.ListModel.SaveSettings();
fView.SpousesList.ListModel.SaveSettings();
fView.UserRefList.ListModel.SaveSettings();
fView.ParentsList.ListModel.SaveSettings();
}

private bool IsExtendedWomanSurname()
{
var selectedSex = fView.SexCombo.GetSelectedTag<GDMSex>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -60,6 +60,11 @@ public override void Init(IBaseWindow baseWin)
fView.NotesList.ListModel = new NoteLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.NotesList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
10 changes: 9 additions & 1 deletion projects/GKCore/GKCore/Controllers/ResearchEditDlgController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -69,6 +69,14 @@ public override void Init(IBaseWindow baseWin)
fView.NotesList.ListModel = new NoteLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.TasksList.ListModel.SaveSettings();
fView.CommunicationsList.ListModel.SaveSettings();
fView.GroupsList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
7 changes: 7 additions & 0 deletions projects/GKCore/GKCore/Controllers/SourceEditDlgController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ public override void Init(IBaseWindow baseWin)
fView.MediaList.ListModel = new MediaLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.RepositoriesList.ListModel.SaveSettings();
fView.NotesList.ListModel.SaveSettings();
fView.MediaList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -39,6 +39,13 @@ public override void Init(IBaseWindow baseWin)
fView.ChildrenList.ListModel = new IndividualChildrenListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
base.Done();

fView.ChildrenList.ListModel.SaveSettings();
}

protected override void UpdateListModels(GDMIndividualRecord indiRec)
{
base.UpdateListModels(indiRec);
Expand Down
7 changes: 6 additions & 1 deletion projects/GKCore/GKCore/Controllers/TaskEditDlgController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -70,6 +70,11 @@ public override void Init(IBaseWindow baseWin)
fView.NotesList.ListModel = new NoteLinksListModel(fView, baseWin, fLocalUndoman);
}

public override void Done()
{
fView.NotesList.ListModel.SaveSettings();
}

public override bool Accept()
{
try {
Expand Down
13 changes: 10 additions & 3 deletions projects/GKCore/GKCore/Design/DialogController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -81,11 +81,18 @@ protected void RollbackChanges()
/// <returns>if `true`, discard dialog closing events</returns>
public async Task<bool> CheckChangesPersistence()
{
bool result;
if (GlobalOptions.Instance.DialogClosingWarn && fLocalUndoman != null && fLocalUndoman.HasChanges()) {
return (await AppHost.StdDialogs.ShowQuestion(LangMan.LS(LSID.WarningOfDialogUnsavedChanges)));
result = (await AppHost.StdDialogs.ShowQuestion(LangMan.LS(LSID.WarningOfDialogUnsavedChanges)));
} else {
return false;
result = false;
}

if (!result) {
Done();
}

return result;
}

public override void Init(IBaseWindow baseWin)
Expand Down
6 changes: 5 additions & 1 deletion projects/GKCore/GKCore/Design/FormController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* "GEDKeeper", the personal genealogical database editor.
* Copyright (C) 2009-2023 by Sergey V. Zhdanovskih.
* Copyright (C) 2009-2024 by Sergey V. Zhdanovskih.
*
* This file is part of "GEDKeeper".
*
Expand Down Expand Up @@ -50,6 +50,10 @@ public virtual void Init(IBaseWindow baseWin)
fBase = baseWin;
}

public virtual void Done()
{
}

protected T GetControl<T>(string controlName) where T : class, IControl
{
return fControlsManager.GetControl<T>(controlName);
Expand Down
11 changes: 11 additions & 0 deletions projects/GKCore/GKCore/GKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,17 @@ public static string GetEventName(GDMCustomEvent evt)
return result;
}

public static string GetEventPlaceAndAttributeValues(GDMCustomEvent evt)
{
string st = evt.HasPlace ? evt.Place.StringValue : string.Empty;

if (evt.StringValue != "") {
st = st + " [" + evt.StringValue + "]";
}

return st;
}

public static string GetAttributeStr(GDMIndividualAttribute iAttr)
{
if (iAttr == null)
Expand Down
Loading

0 comments on commit 3fe62b6

Please sign in to comment.