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

UI Cleanup #600

Merged
merged 4 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
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
28 changes: 25 additions & 3 deletions MBBSEmu/UI/Main/MainView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public override void Setup()
"https://www.mbbsemu.com", "OK")),
})
});
menu.Text = "Test";
menu.TextAlignment = TextAlignment.Right;
MainWindow.Add(menu);

//Audit Log Window
Expand All @@ -102,6 +100,17 @@ public override void Setup()
PreserveTrailingSpaces = false,
Style = new TableView.TableStyle { AlwaysShowHeaders = true }
};

//Use local Function to return new ColumnStyle with specified MinWidth and MaxWidth
TableView.ColumnStyle GetAuditLogStyle(int minWidth, int maxWidth) => new()
{
MinWidth = minWidth,
MaxWidth = maxWidth
};

_auditLogTableView.Style.ColumnStyles.Add(_auditLogTableView.Table.Columns["Summary"], GetAuditLogStyle(20, 20));
_auditLogTableView.Style.ColumnStyles.Add(_auditLogTableView.Table.Columns["Detail"], GetAuditLogStyle(50, 50));

auditLogContainer.Add(_auditLogTableView);
MainWindow.Add(auditLogContainer);

Expand Down Expand Up @@ -264,9 +273,22 @@ private void UpdateApplicationLog()
{
var logDate = ((DateTime)entry[0]).ToString("HH:mm:ss.fff");
var logClass = (entry[1].ToString())?[8..];
var logLevel = ((LogLevel)entry[2]).ToString();
var logLevel = string.Empty;
var logMessage = (string)entry[3];

//Evaluate message LogLevel and set string to be the level name up to 5 characters
logLevel = (LogLevel)entry[2] switch
{
LogLevel.Trace => "TRACE",
LogLevel.Debug => "DEBUG",
LogLevel.Information => "INFO",
LogLevel.Warning => "WARN",
LogLevel.Error => "ERROR",
LogLevel.Critical => "CRIT",
LogLevel.None => "NONE",
_ => logLevel
};

_logTable.Rows.Add(
logDate, logClass, logLevel, logMessage);
}
Expand Down
15 changes: 15 additions & 0 deletions MBBSEmu/UI/Setup/SetupView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ public SetupView() : base()

public override void Setup()
{
//Setup an outer view for the Initial Setup Wizard
var outerView = new Window()
{
X = 0,
Y = 0,
Width = Dim.Fill(),
Height = Dim.Fill(),
Border = new Border
{
BorderStyle = BorderStyle.Double,
BorderBrush = Color.BrightCyan,
Title= "MBBSEmu Initial Setup"
},
};
MainWindow.Add(outerView);

var wizard = new Wizard("Initial Setup Wizard")
{
Expand Down
Loading