From b195e743d309d829ee20cca632d094f3e415228b Mon Sep 17 00:00:00 2001 From: "Sergey V. Zhdanovskih" Date: Wed, 29 May 2024 22:39:19 +0300 Subject: [PATCH] Added display of multimedia and notes on the info-panel for events (fix #559) --- locales/help_enu/gkhHistory.html | 1 + locales/help_rus/gkhHistory.html | 1 + projects/GKCore/GKCore/GKUtils.cs | 31 +++++++++++++++++-------------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/locales/help_enu/gkhHistory.html b/locales/help_enu/gkhHistory.html index 524395eb7..dd86e821e 100644 --- a/locales/help_enu/gkhHistory.html +++ b/locales/help_enu/gkhHistory.html @@ -12,6 +12,7 @@

Change log

14.06.2024 [v2.30.1 & v3.6.1]

diff --git a/locales/help_rus/gkhHistory.html b/locales/help_rus/gkhHistory.html index 7c685f6c8..1960e4979 100644 --- a/locales/help_rus/gkhHistory.html +++ b/locales/help_rus/gkhHistory.html @@ -12,6 +12,7 @@

История версий

14.06.2024 [v2.30.1 & v3.6.1]

diff --git a/projects/GKCore/GKCore/GKUtils.cs b/projects/GKCore/GKCore/GKUtils.cs index 88c091063..55f28b7f9 100644 --- a/projects/GKCore/GKCore/GKUtils.cs +++ b/projects/GKCore/GKCore/GKUtils.cs @@ -2270,23 +2270,23 @@ public static StringList SearchPortraits(GDMTree tree, GDMMultimediaRecord mmRec return result; } - private static void RecListMediaRefresh(IBaseContext baseContext, GDMRecord record, StringList summary) + private static void RecListMediaRefresh(IBaseContext baseContext, IGDMStructWithMultimediaLinks structWML, StringList summary, string indent = "") { - if (record == null || summary == null) return; + if (structWML == null || summary == null) return; try { - if (record.HasMultimediaLinks) { + if (structWML.HasMultimediaLinks) { summary.Add(""); - summary.Add(LangMan.LS(LSID.RPMultimedia) + " (" + record.MultimediaLinks.Count.ToString() + "):"); + summary.Add(indent + LangMan.LS(LSID.RPMultimedia) + " (" + structWML.MultimediaLinks.Count.ToString() + "):"); - int num = record.MultimediaLinks.Count; + int num = structWML.MultimediaLinks.Count; for (int i = 0; i < num; i++) { - GDMMultimediaLink mmLink = record.MultimediaLinks[i]; + GDMMultimediaLink mmLink = structWML.MultimediaLinks[i]; GDMMultimediaRecord mmRec = baseContext.Tree.GetPtrValue(mmLink); if (mmRec == null || mmRec.FileReferences.Count == 0) continue; string st = mmRec.FileReferences[0].Title; - summary.Add(" " + HyperLink(mmRec.XRef, st) + " (" + + summary.Add(indent + " " + HyperLink(mmRec.XRef, st) + " (" + HyperLink(GKData.INFO_HREF_VIEW + mmRec.XRef, LangMan.LS(LSID.MediaView)) + ")"); } } @@ -2295,25 +2295,25 @@ private static void RecListMediaRefresh(IBaseContext baseContext, GDMRecord reco } } - private static void RecListNotesRefresh(IBaseContext baseContext, GDMRecord record, StringList summary) + private static void RecListNotesRefresh(IBaseContext baseContext, IGDMStructWithNotes structWN, StringList summary, string indent = "") { - if (record == null || summary == null) return; + if (structWN == null || summary == null) return; try { - if (record.HasNotes) { + if (structWN.HasNotes) { summary.Add(""); - summary.Add(LangMan.LS(LSID.RPNotes) + " (" + record.Notes.Count.ToString() + "):"); + summary.Add(indent + LangMan.LS(LSID.RPNotes) + " (" + structWN.Notes.Count.ToString() + "):"); - int num = record.Notes.Count; + int num = structWN.Notes.Count; for (int i = 0; i < num; i++) { if (i > 0) { summary.Add(""); } - GDMLines noteLines = baseContext.Tree.GetNoteLines(record.Notes[i]); + GDMLines noteLines = baseContext.Tree.GetNoteLines(structWN.Notes[i]); int num2 = noteLines.Count; for (int k = 0; k < num2; k++) { - summary.Add(noteLines[k]); + summary.Add(indent + noteLines[k]); } } } @@ -2408,7 +2408,10 @@ private static void RecListIndividualEventsRefresh(IBaseContext baseContext, GDM if (evt.HasAddress) { ShowAddressSummary(evt.Address, summary); } + RecListSourcesRefresh(baseContext, evt, summary, " "); + RecListNotesRefresh(baseContext, evt, summary, " "); + RecListMediaRefresh(baseContext, evt, summary, " "); } } } catch (Exception ex) {