Skip to content

Commit

Permalink
Added call to detailed information about places in the place manageme…
Browse files Browse the repository at this point in the history
…nt tool
  • Loading branch information
Serg-Norseman committed Feb 19, 2024
1 parent b8adf64 commit 877d648
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 7 deletions.
7 changes: 7 additions & 0 deletions locales/help_enu/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

<h1>Change log</h1>

<p>
<b>28.02.2024 [v2.29.1 &amp; v3.5.1]</b><ul>
<li>Added call to detailed information about places in the place management tool (pop-up menu).
<li>Fixed loading of some jpeg images.
</ul>
</p>

<p>
<b>14.02.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Updated localizations: Hungarian [Kékesi Lajos], German [Christian Bettinger], Dutch [Annelotte], Japanese [難波鷹史] and Czech [Jerry Verner].
Expand Down
7 changes: 7 additions & 0 deletions locales/help_rus/gkhHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

<h1>История версий</h1>

<p>
<b>28.02.2024 [v2.29.1 &amp; v3.5.1]</b><ul>
<li>Добавлен вызов детальной информации о местах в инструмент управления местами (всплывающее меню).
<li>Исправлена загрузка некоторых изображений jpeg.
</ul>
</p>

<p>
<b>14.02.2024 [v2.29.0 &amp; v3.5.0]</b><ul>
<li>Обновлены венгерская [Kékesi Lajos], немецкая [Christian Bettinger], нидерландская [Annelotte], японская [難波鷹史] и чешская [Jerry Verner] локализации.
Expand Down
12 changes: 11 additions & 1 deletion projects/GKCore/GKCore/Controllers/BaseController.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 @@ -56,6 +56,16 @@ public static async void ViewRecordInfo(IView owner, IBaseWindow baseWin, GDMRec
}
}

public static async void ViewTextInfo(IView owner, IBaseWindow baseWin, string text)
{
if (string.IsNullOrEmpty(text)) return;

using (var dlg = AppHost.ResolveDialog<IRecordInfoDlg>(baseWin)) {
dlg.HyperView.Lines.Text = text;
await AppHost.Instance.ShowModalAsync(dlg, owner, false);
}
}

#region Modify routines

public static async Task<ModificationResult<GDMMultimediaRecord>> ModifyMedia(IView owner, IBaseWindow baseWin, GDMMultimediaRecord mediaRec)
Expand Down
30 changes: 27 additions & 3 deletions projects/GKCore/GKCore/Controllers/PlacesManagerController.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 All @@ -21,8 +21,8 @@
using System.Collections.Generic;
using BSLib;
using GDModel;
using GKCore.Design.Controls;
using GKCore.Design;
using GKCore.Design.Controls;
using GKCore.Design.Views;
using GKCore.Tools;
using GKCore.Types;
Expand Down Expand Up @@ -52,12 +52,36 @@ public void Clear()
fPlaces.Dispose();
}

public void ShowDetails()
{
var placeObj = fView.PlacesList.GetSelectedData() as PlaceObj;
if (placeObj == null) return;

var strList = new StringList();
strList.Add("[u][b][size=+1]" + placeObj.Name + "[/size][/b][/u]");
strList.Add("");
strList.Add(LangMan.LS(LSID.Events) + ":");
for (int i = 0; i < placeObj.Facts.Count; i++) {
var evt = placeObj.Facts[i];
strList.Add("");

string st = GKUtils.GetEventName(evt);
strList.Add(" " + st + ": " + GKUtils.GetEventDesc(fBase.Context.Tree, evt));
}
strList.Add("");

string result = strList.Text;

BaseController.ViewTextInfo(fView, fBase, result);
}

public void CheckPlaces()
{
fView.PlacesList.BeginUpdate();
try {
string fltText = fView.FilterBox.Text;
AppHost.Instance.ExecuteWork((controller) => {
TreeTools.SearchPlaces(fBase.Context.Tree, fPlaces, controller, fView.FilterBox.Text);
TreeTools.SearchPlaces(fBase.Context.Tree, fPlaces, controller, fltText);
});

fView.PlacesList.ClearItems();
Expand Down
4 changes: 2 additions & 2 deletions projects/GKCore/GKCore/GKUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1999,7 +1999,7 @@ private static void ShowAddressSummary(GDMAddress address, StringList summary)
}
}

private static void ShowDetailCause(GDMCustomEvent evt, StringList summary)
public static void ShowDetailCause(GDMCustomEvent evt, StringList summary)
{
string cause = GetEventCause(evt);
if (summary != null && !string.IsNullOrEmpty(cause)) {
Expand Down Expand Up @@ -2416,7 +2416,7 @@ private static void RecListIndividualEventsRefresh(IBaseContext baseContext, GDM
}
}

private static string GetFactValueStr(GDMCustomEvent evt)
public static string GetFactValueStr(GDMCustomEvent evt)
{
string result = evt.StringValue;
if (result.StartsWith(GKData.INFO_HTTP_PREFIX)) {
Expand Down
18 changes: 17 additions & 1 deletion projects/GKv2/GEDKeeper2/GKUI/Forms/TTPlacesManagerDlg.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 All @@ -19,6 +19,8 @@
*/

using System;
using System.Windows.Forms;
using GKCore;
using GKCore.Controllers;
using GKCore.Design.Controls;
using GKCore.Design.Views;
Expand All @@ -30,6 +32,7 @@ namespace GKUI.Forms
public sealed partial class TTPlacesManagerDlg : CommonDialog<IPlacesManagerDlg, PlacesManagerController>, IPlacesManagerDlg
{
private GKListView ListPlaces;
private ContextMenuStrip contextMenu;

#region View Interface

Expand All @@ -51,8 +54,16 @@ public TTPlacesManagerDlg(IBaseWindow baseWin)

btnClose.Image = UIHelper.LoadResourceImage("Resources.btn_cancel.gif");

var miDetails = new ToolStripMenuItem();
miDetails.Text = LangMan.LS(LSID.Details);
miDetails.Click += miDetails_Click;

contextMenu = new ContextMenuStrip();
contextMenu.Items.AddRange(new ToolStripItem[] { miDetails });

ListPlaces = UIHelper.CreateListView(Panel4);
ListPlaces.DoubleClick += ListPlaces_DblClick;
ListPlaces.ContextMenuStrip = contextMenu;

fController = new PlacesManagerController(this);
fController.Init(baseWin);
Expand All @@ -66,6 +77,11 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

private void miDetails_Click(object sender, EventArgs e)
{
fController.ShowDetails();
}

private void btnAnalysePlaces_Click(object sender, EventArgs e)
{
fController.CheckPlaces();
Expand Down
16 changes: 16 additions & 0 deletions projects/GKv3/GEDKeeper3/GKUI/Forms/TTPlacesManagerDlg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System;
using Eto.Forms;
using Eto.Serialization.Xaml;
using GKCore;
using GKCore.Controllers;
using GKCore.Design.Controls;
using GKCore.Design.Views;
Expand All @@ -42,6 +43,7 @@ public sealed partial class TTPlacesManagerDlg : CommonDialog<IPlacesManagerDlg,
private GKListView ListPlaces;
private Label lblFilter;
private TextBox txtFilter;
private ContextMenu contextMenu;

#pragma warning restore CS0169, CS0649, IDE0044, IDE0051
#endregion
Expand All @@ -64,6 +66,15 @@ public TTPlacesManagerDlg(IBaseWindow baseWin)
{
XamlReader.Load(this);

var miDetails = new ButtonMenuItem();
miDetails.Text = LangMan.LS(LSID.Details);
miDetails.Click += miDetails_Click;

contextMenu = new ContextMenu();
contextMenu.Items.AddRange(new MenuItem[] { miDetails });

ListPlaces.ContextMenu = contextMenu;

fController = new PlacesManagerController(this);
fController.Init(baseWin);
}
Expand All @@ -76,6 +87,11 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}

private void miDetails_Click(object sender, EventArgs e)
{
fController.ShowDetails();
}

private void btnAnalysePlaces_Click(object sender, EventArgs e)
{
fController.CheckPlaces();
Expand Down
1 change: 1 addition & 0 deletions projects/GKvX/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Samsung Galaxy Note 10 Lite | 6.7" (1080x2400) | 393 PPI | xh | Android 13
ASUS Zenfone 8 | 5.9" (1080x2400) | 446 PPI | xh | Android 12 (API 31) | 2021
Samsung Galaxy A32 | 6.6" (1080x2340) | 390 PPI | xh | Android 13 (API 33) | 2022
Google Pixel 6a | 6.1" (1080x2400) | 431 PPI | xh | Android 14 (API 34) | 2022
Xiaomi 13T | 6.7" (2712x1220) | 446 ppi | xh | Android 14 (API 34) | 2023

# Incomprehensible problems

Expand Down

0 comments on commit 877d648

Please sign in to comment.