mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Log Window enhancements (#95)
* Split type combobox into system combobox and disc type combobox * corrected indentation for xaml file * fixed merge with head * fixed format * fixed issues for PR, added KnownSystem.CUSTOM * removed Updater.cs which ended by error in commit * fixed GetOuptutName() for new drive/system combobox * created LogWindow and first tests of output gathering * integrated all the proof of concept related to stream fetching of DIC output into LogWindow * working on LogWindow\ncreated more efficient output matching management, improved handling of process termination * created Tasks file\nmoved some methods there, created DumpEnvironment to manage are arguments * moved additional methods to Tasks to make it more modular * changed StartDumping flow to avoid returning if extra tools are not found * moved main dump workflow into Tasks class * created specific DumpResult class for better error reporting/management * fixes * fixes Dispatcher thread issue with progress bar * continued refactor - split EnsureDiscInformation into an additional EnsureCorrectInformationForSystemAndMediaType - proof of concept of using custom extensions to enum types to give better functionality (and encapsulation) - changed cmb_MediaType to keep a List<MediaType?> and got rid of Tuple<string, MediaType?> * restored GetDiscType functionality * fixed btn_StartStop enabled on EnsureCorrect... error * fixed whitespace * fixed indentation * merged conflicts * moved log window * working on LogWindow resize/location behavior * working on message logging in LogWindow * added working integration between MenuItem for LogWindow and its visibility status, fixes issues with positioning and visibility, correctly bound Verbose flag to property * finished integrating LogWindow, added some verbose logs * added logs * fixed include order * added option to show log window at startup, removed useless QuietMode property from MainWindow * added precise calculation of MainWindow position when LogWindow is shown and fixed topmost cheat
This commit is contained in:
committed by
Matt Nadareski
parent
b39c96cdd2
commit
5bcde889b3
@@ -76,6 +76,7 @@
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Management.Instrumentation" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
{
|
||||
public const string StartDumping = "Start Dumping";
|
||||
public const string StopDumping = "Stop Dumping";
|
||||
|
||||
public const int LogWindowMarginFromMainWindow = 10;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,6 +16,7 @@ using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using DICUI.Data;
|
||||
using DICUI.UI;
|
||||
|
||||
namespace DICUI
|
||||
@@ -135,7 +136,7 @@ namespace DICUI
|
||||
public void AdjustPositionToMainWindow()
|
||||
{
|
||||
this.Left = _mainWindow.Left;
|
||||
this.Top = _mainWindow.Top + _mainWindow.Height + 10;
|
||||
this.Top = _mainWindow.Top + _mainWindow.Height + UIElements.LogWindowMarginFromMainWindow;
|
||||
}
|
||||
|
||||
private void GracefullyTerminateProcess()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
xmlns:utilities="clr-namespace:DICUI.Utilities"
|
||||
mc:Ignorable="d"
|
||||
Title="Disc Image Creator GUI" Height="450" Width="600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"
|
||||
LocationChanged="MainWindowLocationChanged" Activated="MainWindowLocationActivated" Closing="MainWindowClosing">
|
||||
LocationChanged="MainWindowLocationChanged" Activated="MainWindowActivated" Closing="MainWindowClosing">
|
||||
|
||||
<Window.Resources>
|
||||
<utilities:EnumDescriptionConverter x:Key="enumConverter" />
|
||||
|
||||
@@ -44,6 +44,17 @@ namespace DICUI
|
||||
StartStopButton.IsEnabled = false;
|
||||
DiskScanButton.IsEnabled = false;
|
||||
CopyProtectScanButton.IsEnabled = false;
|
||||
|
||||
if (_options.OpenLogWindowAtStartup)
|
||||
{
|
||||
System.Drawing.Rectangle bounds = WinForms.Screen.PrimaryScreen.WorkingArea;
|
||||
|
||||
this.WindowStartupLocation = WindowStartupLocation.Manual;
|
||||
double combinedHeight = this.Height + _logWindow.Height + UIElements.LogWindowMarginFromMainWindow;
|
||||
|
||||
this.Left = bounds.Left + (bounds.Width - this.Width) / 2;
|
||||
this.Top = bounds.Top + (bounds.Height - combinedHeight) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -164,12 +175,12 @@ namespace DICUI
|
||||
_logWindow.AdjustPositionToMainWindow();
|
||||
}
|
||||
|
||||
private void MainWindowLocationActivated(object sender, EventArgs e)
|
||||
private void MainWindowActivated(object sender, EventArgs e)
|
||||
{
|
||||
if (_logWindow.IsVisible)
|
||||
if (_logWindow.IsVisible && !this.Topmost)
|
||||
{
|
||||
_logWindow.Topmost = true;
|
||||
this.Topmost = true;
|
||||
_logWindow.Topmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user