Do not initialize console before loading GUI.

This commit is contained in:
2019-07-17 16:29:44 +01:00
parent 53230564e5
commit ccb27ef822
5 changed files with 98 additions and 121 deletions

View File

@@ -1,7 +1,6 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Database; using DiscImageChef.Database;
using DiscImageChef.Gui.Forms; using DiscImageChef.Gui.Forms;
@@ -30,10 +29,6 @@ namespace DiscImageChef.Gtk
AssemblyInformationalVersionAttribute; AssemblyInformationalVersionAttribute;
AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
DicConsole.WriteLineEvent += System.Console.WriteLine;
DicConsole.WriteEvent += System.Console.Write;
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
Settings.Settings.LoadSettings(); Settings.Settings.LoadSettings();
DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath); DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath);

View File

@@ -100,10 +100,6 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
<Project>{ccaa7afe-c094-4d82-a66d-630de8a3f545}</Project>
<Name>DiscImageChef.Console</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Core\DiscImageChef.Core.csproj"> <ProjectReference Include="..\DiscImageChef.Core\DiscImageChef.Core.csproj">
<Project>{679659b8-25d0-4279-b632-56ef8f94adc0}</Project> <Project>{679659b8-25d0-4279-b632-56ef8f94adc0}</Project>
<Name>DiscImageChef.Core</Name> <Name>DiscImageChef.Core</Name>
@@ -122,53 +118,53 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" />
<ItemGroup> <ItemGroup>
<None Include="..\TODO.md"> <None Include="..\TODO.md">
<Link>TODO.md</Link> <Link>TODO.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\README.md"> <None Include="..\README.md">
<Link>README.md</Link> <Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\.travis.yml"> <None Include="..\.travis.yml">
<Link>.travis.yml</Link> <Link>.travis.yml</Link>
</None> </None>
<None Include="..\CONTRIBUTING.md"> <None Include="..\CONTRIBUTING.md">
<Link>CONTRIBUTING.md</Link> <Link>CONTRIBUTING.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\DONATING.md"> <None Include="..\DONATING.md">
<Link>DONATING.md</Link> <Link>DONATING.md</Link>
</None> </None>
<None Include="..\NEEDINFO.md"> <None Include="..\NEEDINFO.md">
<Link>NEEDINFO.md</Link> <Link>NEEDINFO.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\Changelog.md"> <None Include="..\Changelog.md">
<Link>Changelog.md</Link> <Link>Changelog.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="..\LICENSE.MIT"> <EmbeddedResource Include="..\LICENSE.MIT">
<Link>LICENSE.MIT</Link> <Link>LICENSE.MIT</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="..\LICENSE.LGPL"> <EmbeddedResource Include="..\LICENSE.LGPL">
<Link>LICENSE.LGPL</Link> <Link>LICENSE.LGPL</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<Folder Include="..\LICENSE"> <Folder Include="..\LICENSE">
<Link>LICENSE</Link> <Link>LICENSE</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Folder> </Folder>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\.github\CODE_OF_CONDUCT.md"/> <None Include="..\.github\CODE_OF_CONDUCT.md" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="..\.github\ISSUE_TEMPLATE.md"/> <Content Include="..\.github\ISSUE_TEMPLATE.md" />
<Content Include="..\.github\PULL_REQUEST_TEMPLATE.md"/> <Content Include="..\.github\PULL_REQUEST_TEMPLATE.md" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -32,7 +32,6 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Database; using DiscImageChef.Database;
using DiscImageChef.Gui.Forms; using DiscImageChef.Gui.Forms;
@@ -61,10 +60,6 @@ namespace DiscImageChef.Gtk
AssemblyInformationalVersionAttribute; AssemblyInformationalVersionAttribute;
AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
DicConsole.WriteLineEvent += System.Console.WriteLine;
DicConsole.WriteEvent += System.Console.Write;
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
Settings.Settings.LoadSettings(); Settings.Settings.LoadSettings();
DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath); DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath);

View File

@@ -81,10 +81,6 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
<Project>{ccaa7afe-c094-4d82-a66d-630de8a3f545}</Project>
<Name>DiscImageChef.Console</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Core\DiscImageChef.Core.csproj"> <ProjectReference Include="..\DiscImageChef.Core\DiscImageChef.Core.csproj">
<Project>{679659b8-25d0-4279-b632-56ef8f94adc0}</Project> <Project>{679659b8-25d0-4279-b632-56ef8f94adc0}</Project>
<Name>DiscImageChef.Core</Name> <Name>DiscImageChef.Core</Name>
@@ -116,53 +112,53 @@
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>
<None Include="..\TODO.md"> <None Include="..\TODO.md">
<Link>TODO.md</Link> <Link>TODO.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\README.md"> <None Include="..\README.md">
<Link>README.md</Link> <Link>README.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\.travis.yml"> <None Include="..\.travis.yml">
<Link>.travis.yml</Link> <Link>.travis.yml</Link>
</None> </None>
<None Include="..\CONTRIBUTING.md"> <None Include="..\CONTRIBUTING.md">
<Link>CONTRIBUTING.md</Link> <Link>CONTRIBUTING.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\DONATING.md"> <None Include="..\DONATING.md">
<Link>DONATING.md</Link> <Link>DONATING.md</Link>
</None> </None>
<None Include="..\NEEDINFO.md"> <None Include="..\NEEDINFO.md">
<Link>NEEDINFO.md</Link> <Link>NEEDINFO.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="..\Changelog.md"> <None Include="..\Changelog.md">
<Link>Changelog.md</Link> <Link>Changelog.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="..\LICENSE.MIT"> <EmbeddedResource Include="..\LICENSE.MIT">
<Link>LICENSE.MIT</Link> <Link>LICENSE.MIT</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="..\LICENSE.LGPL"> <EmbeddedResource Include="..\LICENSE.LGPL">
<Link>LICENSE.LGPL</Link> <Link>LICENSE.LGPL</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
<Folder Include="..\LICENSE"> <Folder Include="..\LICENSE">
<Link>LICENSE</Link> <Link>LICENSE</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Folder> </Folder>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\.github\CODE_OF_CONDUCT.md"/> <None Include="..\.github\CODE_OF_CONDUCT.md" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="..\.github\ISSUE_TEMPLATE.md"/> <Content Include="..\.github\ISSUE_TEMPLATE.md" />
<Content Include="..\.github\PULL_REQUEST_TEMPLATE.md"/> <Content Include="..\.github\PULL_REQUEST_TEMPLATE.md" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,7 +1,6 @@
using System; using System;
using System.Reflection; using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using DiscImageChef.Console;
using DiscImageChef.Core; using DiscImageChef.Core;
using DiscImageChef.Database; using DiscImageChef.Database;
using DiscImageChef.Gui.Forms; using DiscImageChef.Gui.Forms;
@@ -30,10 +29,6 @@ namespace DiscImageChef.Wpf
AssemblyInformationalVersionAttribute; AssemblyInformationalVersionAttribute;
AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
DicConsole.WriteLineEvent += System.Console.WriteLine;
DicConsole.WriteEvent += System.Console.Write;
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
Settings.Settings.LoadSettings(); Settings.Settings.LoadSettings();
DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath); DicContext ctx = DicContext.Create(Settings.Settings.LocalDbPath);