Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manager: Added dps.report column #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ArcdpsLogManager/Sections/LogList.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using Eto.Drawing;
Expand Down Expand Up @@ -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; }
Expand Down Expand Up @@ -401,6 +403,41 @@ private GridView<LogData> ConstructLogGridView(LogDetailPanel detailPanel, Multi
}
});

var dpsReportColumn = new GridColumn()
{
HeaderText = "dps.report",
DataCell = new TextBoxCell
{
Binding = new DelegateBinding<LogData, string>(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);
Expand Down
Loading