Skip to content

Commit

Permalink
Merge pull request #119 from Lion-Craft/staging
Browse files Browse the repository at this point in the history
Merge staging into master
  • Loading branch information
Lion-Craft authored Nov 2, 2023
2 parents 3f5a202 + f3d311d commit 4f520f4
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Tinyinfo/MainWindow.Designer.cs

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

44 changes: 35 additions & 9 deletions Tinyinfo/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public partial class MainWindow : Form
public MainWindow()
{
InitializeComponent();

// Load saved Theme settings
LoadTheme();
}

// Create Splash
Expand All @@ -44,6 +41,9 @@ public MainWindow()
/// </summary>
public void Startup(object sender, EventArgs e)
{
// Load saved Theme settings
LoadTheme();

// Show Splash
splash.Show();

Expand Down Expand Up @@ -254,7 +254,15 @@ private void LoadVideoControllerData()

string descriptionInfo = $"\t\tDescription: {gpu.VideoProcessor}{nl}";

string videoModeInfo = $"\t\tVideo Mode: {gpu.VideoModeDescription} x {gpu.CurrentRefreshRate}Hz x {gpu.CurrentBitsPerPixel} Bit{nl}";
string videoModeInfo;
if (gpu.VideoModeDescription == "")
{
videoModeInfo = $"\t\tVideo Mode: No Display attached{nl}";
}
else
{
videoModeInfo = $"\t\tVideo Mode: {gpu.VideoModeDescription} x {gpu.CurrentRefreshRate}Hz x {gpu.CurrentBitsPerPixel} Bit{nl}";
}

string vramAmountInfo = $"\t\tVRAM Amount: {vmemSizeGB:F2}GB{nl}";

Expand Down Expand Up @@ -315,8 +323,16 @@ private void LoadVideoControllerData()
string memoryBus = $"\tMemory Bus: {nvgpu.MemoryInformation.FrameBufferBandwidth} Bit{nl}";
// Get Memory Size
string memorySize = $"\tPhysical Memory Size: {nvgpu.MemoryInformation.PhysicalFrameBufferSizeInkB / 1000}MB{nl}";
// Get Memory Type (Note: Result of "14" appears to be GDDR6)
string memoryType = $"\tMemory Type: {nvgpu.MemoryInformation.RAMType}{nl}";
// Get Memory Type
string memoryType;
if (nvgpu.MemoryInformation.RAMType.ToString() == "14")
{
memoryType = $"\tMemory Type: GDDR6{nl}";
}
else
{
memoryType = $"\tMemory Type: {nvgpu.MemoryInformation.RAMType}{nl}";
}
// Get Memory manufacturer
string memoryManufacturer = $"\tMemory Manufacturer: {nvgpu.MemoryInformation.RAMMaker}{nl}";
// Get ECC Memory Support state
Expand Down Expand Up @@ -734,15 +750,21 @@ private void onTopCheckbox_CheckedChanged(object sender, EventArgs e)
public void LoadTheme()
{
// Check if file exists, if it doesnt create it with default settings
if (!File.Exists("./tinyinfo.ini"))
if (File.Exists("./tinyinfo.ini") == false)
{
File.WriteAllText("./tinyinfo.ini", "[tinyinfo]\ntheme=light\nrefresh=500\nfontsize=10\nfontname=Segoe UI\nfontstyle=FontStyle.Regular\ntransparentsplash=false");
File.WriteAllText("./tinyinfo.ini", "[tinyinfo]\ntheme=light\nrefresh=500\nfontsize=10\nfontname=Segoe UI\nfontstyle=Regular\ntransparentsplash=false");
}

// Create ini parser and read ini file
var parser = new FileIniDataParser();
IniData data = parser.ReadFile("./tinyinfo.ini");

// See if keys new to v3 exist, if not overwrite file with default settings
if (data.GetKey("tinyinfo.refresh") == null || data.GetKey("tinyinfo.fontsize") == null || data.GetKey("tinyinfo.fontname") == null || data.GetKey("tinyinfo.fontstyle") == null || data.GetKey("tinyinfo.transparentsplash") == null)
{
File.WriteAllText("./tinyinfo.ini", "[tinyinfo]\ntheme=light\nrefresh=500\nfontsize=10\nfontname=Segoe UI\nfontstyle=Regular\ntransparentsplash=false");
}

// Read Settings
// Set theme
if (data.GetKey("tinyinfo.theme") == "dark")
Expand Down Expand Up @@ -872,6 +894,9 @@ private void exportItem_Click(object sender, EventArgs e)
/// </summary>
private void btnExportAsJSON_Click(object sender, EventArgs e)
{
// Show Warning Message
MessageBox.Show("JSON Export is not fully working at this time.", "Tinyinfo - Export Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);

ExportToTextFile(1);
}

Expand Down Expand Up @@ -915,7 +940,8 @@ private void ExportToTextFile(int mode)

using (StreamWriter writer = new StreamWriter(filePath))
{
string outputText = cpuOutputBox.Text;
string nl = Environment.NewLine;
string outputText = cpuOutputBox.Text + ramOutputBox.Text + gpuOutputBox.Text + nvapiOutputBox.Text + boardOutputBox.Text + biosOutputBox.Text + battOutputBox.Text + diskOutputBox.Text + netOutputBox.Text;

writer.Write(outputText);
}
Expand Down
Binary file modified Tinyinfo/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Tinyinfo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyFileVersion("3.0.0")]
[assembly: AssemblyFileVersion("3.0.1")]
2 changes: 1 addition & 1 deletion Tinyinfo/SettingsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void refreshTheme()
// Check if file exists, if it doesnt create it with default settings
if (File.Exists("./tinyinfo.ini") == false)
{
File.WriteAllText("./tinyinfo.ini", "[tinyinfo]\ntheme=light\nrefresh=500\nfontsize=10\nfontname=Segoe UI\nfontstyle=FontStyle.Regular\ntransparentsplash=false");
File.WriteAllText("./tinyinfo.ini", "[tinyinfo]\ntheme=light\nrefresh=500\nfontsize=10\nfontname=Segoe UI\nfontstyle=Regular\ntransparentsplash=false");
}

// Create ini parser and read ini file
Expand Down
4 changes: 0 additions & 4 deletions Tinyinfo/Tinyinfo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@
<Reference Include="INIFileParser, Version=2.5.2.0, Culture=neutral, PublicKeyToken=79af7b307b65cf3c, processorArchitecture=MSIL">
<HintPath>..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Interop.Excel1">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Microsoft Visual Studio\Shared\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="Microsoft.Win32.Registry, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Registry.5.0.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
</Reference>
Expand Down

0 comments on commit 4f520f4

Please sign in to comment.