Skip to content

Commit

Permalink
Move AmaiSosu to AmaiSosu.GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
MirisWisdom committed Nov 23, 2018
1 parent cec39b0 commit ff5c8d3
Show file tree
Hide file tree
Showing 25 changed files with 70 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,4 @@ ASALocalRun/
.localhistory/

# Version
/AmaiSosu/Resources/Version.txt
/AmaiSosu.GUI/Resources/Version.txt
4 changes: 2 additions & 2 deletions AmaiSosu/AmaiSosu.csproj → AmaiSosu.GUI/AmaiSosu.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4AB5A870-7A84-4206-994B-EAB91473CD6C}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>AmaiSosu</RootNamespace>
<AssemblyName>AmaiSosu</AssemblyName>
<RootNamespace>AmaiSosu.GUI</RootNamespace>
<AssemblyName>AmaiSosu.GUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion AmaiSosu/App.xaml → AmaiSosu.GUI/App.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Application x:Class="AmaiSosu.App"
<Application x:Class="AmaiSosu.GUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
Expand Down
2 changes: 1 addition & 1 deletion AmaiSosu/App.xaml.cs → AmaiSosu.GUI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AmaiSosu
namespace AmaiSosu.GUI
{
/// <summary>
/// Interaction logic for App.xaml
Expand Down
2 changes: 1 addition & 1 deletion AmaiSosu/IO/Copy.cs → AmaiSosu.GUI/IO/Copy.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.IO;

namespace AmaiSosu.IO
namespace AmaiSosu.GUI.IO
{
/// <summary>
/// Copy a directory and its contents. Adapted from the MSDN CopyAll method.
Expand Down
2 changes: 1 addition & 1 deletion AmaiSosu/IO/Move.cs → AmaiSosu.GUI/IO/Move.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace AmaiSosu.IO
namespace AmaiSosu.GUI.IO
{
/// <summary>
/// Abstract representing a type that conducts data migration.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;

namespace AmaiSosu.IO
namespace AmaiSosu.GUI.IO
{
/// <inheritdoc />
public class MoveDirectory : Move
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.IO;

namespace AmaiSosu.IO
namespace AmaiSosu.GUI.IO
{
/// <summary>
/// Returns Move instances built using the inbound arguments. This factory is designed for backing up or
Expand Down
2 changes: 1 addition & 1 deletion AmaiSosu/IO/MoveFile.cs → AmaiSosu.GUI/IO/MoveFile.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;

namespace AmaiSosu.IO
namespace AmaiSosu.GUI.IO
{
/// <inheritdoc />
public class MoveFile : Move
Expand Down
29 changes: 14 additions & 15 deletions AmaiSosu/Main.cs → AmaiSosu.GUI/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using AmaiSosu.IO;
using AmaiSosu.Properties;
using AmaiSosu.GUI.IO;
using AmaiSosu.GUI.Properties;
using AmaiSosu.GUI.Resources;
using Atarashii.API;
using static AmaiSosu.Resources.FileNames;
using static AmaiSosu.Resources.Messages;

namespace AmaiSosu
namespace AmaiSosu.GUI
{
/// <summary>
/// Main AmaiSosu model.
Expand All @@ -26,7 +25,7 @@ public sealed class Main : INotifyPropertyChanged
/// <summary>
/// Current state of the OpenSauce installation.
/// </summary>
private string _installState = BrowseHce;
private string _installState = Messages.BrowseHce;

/// <summary>
/// Installation path.
Expand All @@ -42,7 +41,7 @@ public string Version
get
{
using (var stream = Assembly.GetExecutingAssembly()
.GetManifestResourceStream(AmaiSosuVersion))
.GetManifestResourceStream(FileNames.AmaiSosuVersion))
using (var reader = new StreamReader(stream ?? throw new FileNotFoundException()))
{
return reader.ReadToEnd().Trim();
Expand Down Expand Up @@ -107,7 +106,7 @@ public void Initialise()
}
catch (Exception)
{
InstallText = BrowseHce;
InstallText = Messages.BrowseHce;
}
}

Expand All @@ -118,13 +117,13 @@ public void Install()
{
try
{
var backupDir = System.IO.Path.Combine(_path, AmaiSosuBackup + '.' + Guid.NewGuid());
var backupDir = System.IO.Path.Combine(_path, FileNames.AmaiSosuBackup + '.' + Guid.NewGuid());

CommitBackups(backupDir);
OpenSauce.Install(Path);
FinishInstall(backupDir);

InstallText = InstallSuccess;
InstallText = Messages.InstallSuccess;
}
catch (Exception e)
{
Expand Down Expand Up @@ -164,9 +163,9 @@ private void FinishInstall(string backupDir)

var source =
System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
OpenSauceDeveloper, OpenSauceDirectory, OpenSauceIDE);
FileNames.OpenSauceDeveloper, FileNames.OpenSauceDirectory, FileNames.OpenSauceIDE);

var target = System.IO.Path.Combine(Path, OpenSauceIDE);
var target = System.IO.Path.Combine(Path, FileNames.OpenSauceIDE);

Copy.All(new DirectoryInfo(source), new DirectoryInfo(target));
Directory.Delete(source, true);
Expand All @@ -180,10 +179,10 @@ private void FinishInstall(string backupDir)
/// </summary>
private void OnPathChanged()
{
CanInstall = Directory.Exists(Path) && File.Exists(System.IO.Path.Combine(Path, HceExecutable));
CanInstall = Directory.Exists(Path) && File.Exists(System.IO.Path.Combine(Path, FileNames.HceExecutable));
InstallText = CanInstall
? InstallReady
: BrowseHce;
? Messages.InstallReady
: Messages.BrowseHce;
}

[NotifyPropertyChangedInvocator]
Expand Down
5 changes: 3 additions & 2 deletions AmaiSosu/MainWindow.xaml → AmaiSosu.GUI/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Window x:Class="AmaiSosu.MainWindow"
<Window x:Class="AmaiSosu.GUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:amaiSosu="clr-namespace:AmaiSosu"
xmlns:gui="clr-namespace:AmaiSosu.GUI"
mc:Ignorable="d"
Title="HCE.AmaiSosu | OpenSauce Installer"
Width="860"
Expand All @@ -16,7 +17,7 @@
<ImageBrush ImageSource="Resources/background.png" Stretch="None" AlignmentX="Left" AlignmentY="Top" />
</Window.Background>
<Window.DataContext>
<amaiSosu:Main />
<gui:Main />
</Window.DataContext>
<Window.Resources>
<Style TargetType="{x:Type Button}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows;
using Microsoft.Win32;

namespace AmaiSosu
namespace AmaiSosu.GUI
{
public partial class MainWindow : Window
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// ReSharper disable MemberCanBeProtected.Global
// ReSharper disable InconsistentNaming

namespace AmaiSosu.Properties
namespace AmaiSosu.GUI.Properties
{
/// <summary>
/// Indicates that the value of the marked element could be <c>null</c> sometimes,
Expand Down
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<value>AmaiSosu.Backup</value>
</data>
<data name="AmaiSosuVersion" xml:space="preserve">
<value>AmaiSosu.Resources.Version.txt</value>
<value>AmaiSosu.GUI.Resources.Version.txt</value>
</data>
<data name="HceExecutable" xml:space="preserve">
<value>haloce.exe</value>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions AmaiSosu.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@ ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmaiSosu", "AmaiSosu\AmaiSosu.csproj", "{4AB5A870-7A84-4206-994B-EAB91473CD6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atarashii.API", "Atarashii\Atarashii.API\Atarashii.API.csproj", "{2C5D2B0E-FEA7-43F2-9960-215280CCA7B7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Atarashii", "Atarashii", "{E25ADF8A-11C3-435C-A767-E74F2335FEE8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Atarashii", "Atarashii\Atarashii\Atarashii.csproj", "{9665535F-B184-41F6-AC56-85DB14FD3B79}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmaiSosu.GUI", "AmaiSosu.GUI\AmaiSosu.GUI.csproj", "{4AB5A870-7A84-4206-994B-EAB91473CD6C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Release|Any CPU.Build.0 = Release|Any CPU
{2C5D2B0E-FEA7-43F2-9960-215280CCA7B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2C5D2B0E-FEA7-43F2-9960-215280CCA7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2C5D2B0E-FEA7-43F2-9960-215280CCA7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -31,6 +27,10 @@ Global
{9665535F-B184-41F6-AC56-85DB14FD3B79}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9665535F-B184-41F6-AC56-85DB14FD3B79}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9665535F-B184-41F6-AC56-85DB14FD3B79}.Release|Any CPU.Build.0 = Release|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4AB5A870-7A84-4206-994B-EAB91473CD6C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{2C5D2B0E-FEA7-43F2-9960-215280CCA7B7} = {E25ADF8A-11C3-435C-A767-E74F2335FEE8}
Expand Down

0 comments on commit ff5c8d3

Please sign in to comment.