Skip to content

Commit

Permalink
add in directory saving and also attempt to fix http not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeraphinx committed Jan 23, 2022
1 parent 2f8e846 commit 48446af
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NyaDesktop/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</startup>
<userSettings>
<NyaDesktop.Properties.Settings>
<setting name="test" serializeAs="String">
<setting name="path" serializeAs="String">
<value />
</setting>
</NyaDesktop.Properties.Settings>
Expand Down
6 changes: 6 additions & 0 deletions NyaDesktop/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public Form1(DiscordRpcClient client)
DiscordClient = client;
DiscordClient.Initialize();
updatePrecense();
if (Properties.Settings.Default.path != "")
{
save_path = Properties.Settings.Default.path;
}
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -67,6 +71,8 @@ private void button1_Click(object sender, EventArgs e)
{
save_path = folderBrowserDialog1.SelectedPath;
button2.Enabled = true;
Properties.Settings.Default.path = save_path;
Properties.Settings.Default.Save();
}
}

Expand Down
2 changes: 1 addition & 1 deletion NyaDesktop/NyaAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace NyaDesktop
{
class NyaAPI
{
private static readonly HttpClient client = new HttpClient();
private static readonly System.Net.Http.HttpClient client = new HttpClient();

// HttpClient is intended to be instantiated once per application, rather than per-use. See Remarks.
public static async Task<String> PullNyaImageURL(string type, string endpoint)
Expand Down
11 changes: 11 additions & 0 deletions NyaDesktop/NyaDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,14 @@
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.Net.Sockets, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -245,6 +247,11 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
Expand All @@ -264,6 +271,10 @@
<None Include="favicon.ico" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
Expand Down
38 changes: 38 additions & 0 deletions NyaDesktop/Properties/Settings.Designer.cs

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

9 changes: 9 additions & 0 deletions NyaDesktop/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="NyaDesktop.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="path" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion NyaDesktop/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="Costura.Fody" version="5.7.0" targetFramework="net472" developmentDependency="true" />
<package id="DiscordRichPresence" version="1.0.175" targetFramework="net472" />
<package id="Fody" version="6.6.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.NETCore.Platforms" version="6.0.0" targetFramework="net472" />
<package id="Microsoft.NETCore.Platforms" version="6.0.1" targetFramework="net472" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net472" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
Expand Down

0 comments on commit 48446af

Please sign in to comment.