Skip to content

Commit

Permalink
Various improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Serg-Norseman committed Jul 8, 2024
1 parent fd925af commit b32efde
Show file tree
Hide file tree
Showing 30 changed files with 110 additions and 15 deletions.
13 changes: 12 additions & 1 deletion build_v2.mswin.x86.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
set CONFIG_TYPE=Debug
for %%a in (release Release RELEASE) do if (%%a)==(%1) SET CONFIG_TYPE=Release

set MSBDIR=@%WINDIR%\Microsoft.NET\Framework\v4.0.30319
set MSBDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
@if exist %MSBDIR%\msbuild.exe goto build

set MSBDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
@if exist %MSBDIR%\msbuild.exe goto build

echo Build is not possible!
goto quit

:build
%MSBDIR%\msbuild.exe projects\GKv2\GEDKeeper2.sln /p:Configuration=%CONFIG_TYPE% /p:Platform="x86" /t:Rebuild /p:TargetFrameworkVersion=v4.7.1

set BUILD_STATUS=%ERRORLEVEL%
Expand All @@ -21,3 +30,5 @@ set NUNIT="nunit_not_found"
%NUNIT% projects\GKTests\bin\Debug\GKTests.dll
pause
exit /b 0

:quit
20 changes: 16 additions & 4 deletions fast_run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,24 @@

call clean.cmd

rem set MSBDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin
rem set MSBDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
rem set MSBDIR=C:\Program Files (x86)\MSBuild\14.0\Bin
set MSBDIR="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
@if exist %MSBDIR%\msbuild.exe goto build

set MSBDIR=@%WINDIR%\Microsoft.NET\Framework\v4.0.30319
set MSBDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
@if exist %MSBDIR%\msbuild.exe goto build

echo Build is not possible!
goto quit

rem Don't build with wf4.7.1 and lang7.3, only for 1-6
rem set MSBDIR="C:\Program Files (x86)\MSBuild\14.0\Bin"
rem Don't build with wf4.7.1 and lang7.3, only for 1-5
rem set MSBDIR=@%WINDIR%\Microsoft.NET\Framework\v4.0.30319

:build
%MSBDIR%\msbuild.exe projects\GKv2\GEDKeeper2.sln /verbosity:quiet /p:Configuration="Debug" /p:Platform="x86" /t:Rebuild /p:TargetFrameworkVersion=v4.7.1

:start
start .\bin\GEDKeeper2.exe

:quit
1 change: 1 addition & 0 deletions locales/Afrikaans.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Belarusian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Chinese Simplified.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Dutch.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/English.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners ; tree border style

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Hungarian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Icelandic.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Japanese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Kazakh (Cyrillic).lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Portuguese.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Serbian (Latin).lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/Spanish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/czech.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/french.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/german.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
2 changes: 2 additions & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ <h1>Change log</h1>

<p>
<b>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Added a section for links to subordinate locations in the location information panel.
<li>Added function for duplicating location records.
<li>The feature of selecting and exporting a separate list of records (notes, multimedia, locations) to a GEDCOM file has been added to the database splitting tool.
<li>Added saving of column width settings for all lists.
<li>Completed Spanish localization [Miguel Á. Pérez Valdenebro].
Expand Down
2 changes: 2 additions & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ <h1>История версий</h1>

<p>
<b>14.06.2024 [v2.30.1 &amp; v3.6.1]</b><ul>
<li>Добавлена секция ссылок на подчиненные места в панель информации мест.
<li>Добавлена функция дублирования записей локаций.
<li>В инструмент разделения базы данных добавлена фича выбора и экспорта отдельного списка записей (заметки, мультимедиа, локации) в GEDCOM-файл.
<li>Добавлено запоминание настроек ширины столбцов всех списков.
<li>Завершена локализация на испанский язык [Miguel Á. Pérez Valdenebro].
Expand Down
1 change: 1 addition & 0 deletions locales/italian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/polish.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
1 change: 1 addition & 0 deletions locales/russian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Перекрестные углы

983=Выбрать список
984=Ссылки на подчиненные места
1 change: 1 addition & 0 deletions locales/ukrainian.lng
Original file line number Diff line number Diff line change
Expand Up @@ -994,3 +994,4 @@
982=Cross Corners

983=Select list
984=Links to subordinate locations
15 changes: 12 additions & 3 deletions projects/GKCore/GKCore/Controllers/BaseWinController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,24 @@ public void NotifyRecord(GDMRecord record, RecordAction action)
public void DuplicateRecord()
{
GDMRecord original = GetSelectedRecordEx();
if (original == null || original.RecordType != GDMRecordType.rtIndividual) return;
if (original == null) return;

if (original.RecordType != GDMRecordType.rtIndividual && original.RecordType != GDMRecordType.rtLocation) return;

AppHost.StdDialogs.ShowWarning(LangMan.LS(LSID.DuplicateWarning));

GDMIndividualRecord target;
GDMRecord target;
try {
fContext.BeginUpdate();

target = fContext.Tree.CreateIndividual();
if (original.RecordType == GDMRecordType.rtIndividual) {
target = fContext.Tree.CreateIndividual();
} else if (original.RecordType == GDMRecordType.rtLocation) {
target = fContext.Tree.CreateLocation();
} else {
return;
}

target.Assign(original);

NotifyRecord(target, RecordAction.raAdd);
Expand Down
38 changes: 36 additions & 2 deletions projects/GKCore/GKCore/GKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,28 @@ public static StringList GetLocationLinks(GDMTree tree, GDMLocationRecord locRec
return linksList;
}

public static StringList GetLocationSubordinateLinks(GDMTree tree, GDMLocationRecord locRec)
{
var linksList = new StringList();
if (locRec == null) return linksList;

for (int i = 0, num = tree.RecordsCount; i < num; i++) {
var locTemp = tree[i] as GDMLocationRecord;
if (locTemp == null) continue;

for (int j = 0, num2 = locTemp.TopLevels.Count; j < num2; j++) {
var topLink = locTemp.TopLevels[j];

if (topLink.XRef == locRec.XRef) {
linksList.AddObject(GetRecordName(tree, locTemp, false), locTemp);
break;
}
}
}

return linksList;
}

public static string HyperLink(string xref, string text)
{
string result;
Expand Down Expand Up @@ -3005,7 +3027,7 @@ public static void ShowLocationInfo(IBaseContext baseContext, GDMLocationRecord
var topLev = locRec.TopLevels[i];
var topLoc = tree.GetPtrValue<GDMLocationRecord>(topLev);

string st = HyperLink(topLev.XRef, topLoc.GetNameByDate(topLev.Date.Value, ATDEnumeration.fStL));
string st = HyperLink(topLev.XRef, topLoc.GetNameByDate(topLev.Date.Value));
if (!string.IsNullOrEmpty(st)) {
summary.Add(" " + st);
}
Expand Down Expand Up @@ -3037,7 +3059,6 @@ public static void ShowLocationInfo(IBaseContext baseContext, GDMLocationRecord
}

linkList = GetLocationLinks(tree, locRec);

if (linkList.Count > 0) {
linkList.Sort();

Expand All @@ -3053,6 +3074,19 @@ public static void ShowLocationInfo(IBaseContext baseContext, GDMLocationRecord

RecListNotesRefresh(baseContext, locRec, summary);
RecListMediaRefresh(baseContext, locRec, summary);

var subLinks = GetLocationSubordinateLinks(tree, locRec);
if (subLinks.Count > 0) {
subLinks.Sort();

summary.Add("");
summary.Add(LangMan.LS(LSID.SubordinateLocationsLinks) + ":");

for (int i = 0, num = subLinks.Count; i < num; i++) {
GDMRecord rec = subLinks.GetObject(i) as GDMRecord;
summary.Add(" " + HyperLink(rec.XRef, subLinks[i]));
}
}
}
} finally {
if (linkList != null) linkList.Dispose();
Expand Down
2 changes: 2 additions & 0 deletions projects/GKCore/GKCore/LangMan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,7 @@ public enum LSID
/* 982 */ TBS_CrossCorners,

/* 983 */ SelList,
/* 984 */ SubordinateLocationsLinks,

/* 000 */ Last = SelList
}
Expand Down Expand Up @@ -2071,6 +2072,7 @@ public static class LangMan
/* 982 */ "Cross Corners",

/* 983 */ "Select list",
/* 984 */ "Links to subordinate locations",
};

private static readonly LangManager fLangMan = new LangManager();
Expand Down
3 changes: 2 additions & 1 deletion projects/GKCore/GKCore/Lists/ListColumns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public sealed class ListColumn
public readonly bool DefActive;
public readonly string Format;
public readonly NumberFormatInfo NumFmt;
public readonly bool Autosize;

public bool Autosize;

public int CurWidth;
public bool CurActive;
Expand Down
1 change: 1 addition & 0 deletions projects/GKCore/GKCore/Lists/ListSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public virtual void ChangeColumnWidth(int colIndex, int colWidth)

if (props != null) {
props.CurWidth = colWidth;
props.Autosize = false;
}
}

Expand Down
4 changes: 2 additions & 2 deletions projects/GKCore/GKCore/Lists/LocationListModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static ListColumns CreateListColumns()

result.AddColumn(LSID.NumberSym, DataType.dtInteger, 50, true);
result.AddColumn(LSID.Title, DataType.dtString, 300, true, true);
result.AddColumn("Ext", DataType.dtString, 60, true, true);
result.AddColumn("Ext", DataType.dtString, 60, true, false);
result.AddColumn(LSID.Latitude, DataType.dtFloat, 120, true, false, GEDCOMUtils.CoordFormat, GEDCOMUtils.CoordNumberFormatInfo);
result.AddColumn(LSID.Longitude, DataType.dtFloat, 120, true, false, GEDCOMUtils.CoordFormat, GEDCOMUtils.CoordNumberFormatInfo);
result.AddColumn(LSID.Changed, DataType.dtDateTime, 150, true);
Expand Down Expand Up @@ -118,7 +118,7 @@ protected override object GetColumnValueEx(int colType, int colSubtype, bool isV
break;

case ColumnType.ctName:
result = fFetchedRec.GetNameByDate(null, ATDEnumeration.fLtS, true);
result = fFetchedRec.GetNameByDate(null, true);
break;

case ColumnType.ctExt:
Expand Down
6 changes: 4 additions & 2 deletions projects/GKv2/GEDKeeper2/GKUI/Forms/BaseWinSDI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,11 @@ private void Form_KeyDown(object sender, KeyEventArgs e)

private void contextMenu_Opening(object sender, CancelEventArgs e)
{
IListView recView = contextMenu.SourceControl as GKListView;
//IListView recView = contextMenu.SourceControl as GKListView;
// (recView == fController.GetRecordsViewByType(GDMRecordType.rtIndividual))

miContRecordDuplicate.Enabled = (recView == fController.GetRecordsViewByType(GDMRecordType.rtIndividual));
var selectedRecType = fController.GetSelectedRecordType();
miContRecordDuplicate.Enabled = (selectedRecType == GDMRecordType.rtIndividual || selectedRecType == GDMRecordType.rtLocation);
}

private void miRecordAdd_Click(object sender, EventArgs e)
Expand Down

0 comments on commit b32efde

Please sign in to comment.