From 9f605cf2ea770846da726158b2190b2795930377 Mon Sep 17 00:00:00 2001 From: Linkaaaaa Date: Sun, 9 Jun 2024 21:04:13 +0200 Subject: [PATCH] Manager: Added dps.report column --- ArcdpsLogManager/Sections/LogList.cs | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/ArcdpsLogManager/Sections/LogList.cs b/ArcdpsLogManager/Sections/LogList.cs index f3e7eaa5..f6b1fec2 100644 --- a/ArcdpsLogManager/Sections/LogList.cs +++ b/ArcdpsLogManager/Sections/LogList.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Globalization; using System.Linq; using Eto.Drawing; @@ -44,6 +45,7 @@ public class LogList : Panel { "Instabilities", "Fractals of the Mists" }, { "Scale", "Fractals of the Mists" }, { "", "Encounter Icon" }, + { "dps.report", "Open log" }, }; public bool ReadOnly { get; init; } @@ -401,6 +403,41 @@ private GridView ConstructLogGridView(LogDetailPanel detailPanel, Multi } }); + var dpsReportColumn = new GridColumn() + { + HeaderText = "dps.report", + DataCell = new TextBoxCell + { + Binding = new DelegateBinding(x => !string.IsNullOrEmpty(x.DpsReportEIUpload.Url) ? "🔗 Open" : "") + }, + }; + + gridView.CellDoubleClick += (sender, args) => + { + if (args.GridColumn == dpsReportColumn) + { + var data = (LogData)args.Item; + + try + { + if (!string.IsNullOrEmpty(data.DpsReportEIUpload.Url)) + { + Process.Start(new ProcessStartInfo + { + FileName = data.DpsReportEIUpload.Url, + UseShellExecute = true + }); + } + } + catch (Exception ex) + { + MessageBox.Show($"Failed to open report: {ex.Message}"); + } + } + }; + + gridView.Columns.Add(dpsReportColumn); + foreach (var column in gridView.Columns) { column.Visible = !Settings.HiddenLogListColumns.Contains(column.HeaderText);