Compare commits

..

No commits in common. "7158a9340a0323e75e703bdd2115de2988a119a1" and "7909f111cbeac6448a4c25262a2f17acffd096d5" have entirely different histories.

4 changed files with 143 additions and 82 deletions

View File

@ -6,13 +6,6 @@ namespace FireWalletLite;
public partial class Loader : Form
{
#region Constants
private readonly MainForm mainForm = new();
private readonly bool hideScreen = true; // Hide screen or not (for debug)
private readonly Process HSDProcess;
#endregion
public Loader()
{
InitializeComponent();
@ -69,6 +62,14 @@ public partial class Loader : Form
mainForm.Show();
}
#region Constants
private readonly MainForm mainForm = new();
private readonly bool hideScreen = true;
private readonly Process HSDProcess;
#endregion
#region Git
public void CloneRepository(string repositoryUrl, string destinationPath)
@ -183,36 +184,30 @@ public partial class Loader : Form
mainForm.AddLog(ex.Message);
if (ex.Message.Contains("to start process 'git'"))
{
var notifyForm = new NotifyForm("Git is not installed\nPlease install it to install HSD dependencies",
"Install", "https://git-scm.com/download/win");
var notifyForm = new NotifyForm("Git needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
Environment.Exit(21);
}
else if (ex.Message.Contains("to start process 'node'"))
{
var notifyForm = new NotifyForm("Node is not installed\nPlease install it to install HSD dependencies",
"Install", "https://nodejs.org/en/download");
var notifyForm = new NotifyForm("Node needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
Environment.Exit(22);
}
else if (ex.Message.Contains("to start process 'npm'"))
{
var notifyForm = new NotifyForm("NPM is not installed\nPlease install it to install HSD dependencies",
"Install", "https://docs.npmjs.com/downloading-and-installing-node-js-and-npm");
var notifyForm = new NotifyForm("NPM needs to be installed\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
Environment.Exit(23);
}
else
{
var notifyForm = new NotifyForm("Git/NPM Install FAILED\nCheck logs for more details");
notifyForm.ShowDialog();
notifyForm.Dispose();
Environment.Exit(24);
}
Environment.Exit(24);
}
}

View File

@ -8,14 +8,11 @@ public partial class NotifyForm : Form
private bool allowClose = true;
private readonly string altLink;
private readonly string dir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\FireWallet\\";
private readonly bool Linkcopy;
public Dictionary<string, string> Theme { get; set; } = new()
{
{ "background", "#000000" },
{ "foreground", "#8e05c2"},
{ "background-alt", "#3e065f"},
{ "foreground-alt", "#ffffff"}
};
private Dictionary<string, string> theme;
public NotifyForm(string Message)
{
@ -103,34 +100,150 @@ public partial class NotifyForm : Form
private void UpdateTheme()
{
if (!Theme.ContainsKey("background") || !Theme.ContainsKey("background-alt") ||
!Theme.ContainsKey("foreground") || !Theme.ContainsKey("foreground-alt")) return;
// Check if file exists
if (!Directory.Exists(dir)) CreateConfig(dir);
if (!File.Exists(dir + "theme.txt")) CreateConfig(dir);
// Apply Theme
BackColor = ColorTranslator.FromHtml(Theme["background"]);
// Read file
var sr = new StreamReader(dir + "theme.txt");
theme = new Dictionary<string, string>();
while (!sr.EndOfStream)
{
var line = sr.ReadLine();
var split = line.Split(':');
theme.Add(split[0].Trim(), split[1].Trim());
}
sr.Dispose();
if (!theme.ContainsKey("background") || !theme.ContainsKey("background-alt") ||
!theme.ContainsKey("foreground") || !theme.ContainsKey("foreground-alt")) return;
// Apply theme
BackColor = ColorTranslator.FromHtml(theme["background"]);
// Foreground
ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
ForeColor = ColorTranslator.FromHtml(theme["foreground"]);
// Need to specify this for each groupbox to override the black text
foreach (Control c in Controls) ThemeControl(c);
// Transparancy
applyTransparency(theme);
}
private void ThemeControl(Control c)
{
if (c.GetType() == typeof(GroupBox) || c.GetType() == typeof(Panel))
{
c.ForeColor = ColorTranslator.FromHtml(Theme["foreground"]);
c.ForeColor = ColorTranslator.FromHtml(theme["foreground"]);
foreach (Control sub in c.Controls) ThemeControl(sub);
}
if (c.GetType() == typeof(TextBox) || c.GetType() == typeof(Button)
|| c.GetType() == typeof(ComboBox) || c.GetType() == typeof(StatusStrip))
{
c.ForeColor = ColorTranslator.FromHtml(Theme["foreground-alt"]);
c.BackColor = ColorTranslator.FromHtml(Theme["background-alt"]);
c.ForeColor = ColorTranslator.FromHtml(theme["foreground-alt"]);
c.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
}
}
private void applyTransparency(Dictionary<string, string> theme)
{
if (theme.ContainsKey("transparent-mode"))
switch (theme["transparent-mode"])
{
case "mica":
var accent = new AccentPolicy { AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND };
var accentStructSize = Marshal.SizeOf(accent);
var accentPtr = Marshal.AllocHGlobal(accentStructSize);
Marshal.StructureToPtr(accent, accentPtr, false);
var data = new WindowCompositionAttributeData
{
Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY,
SizeOfData = accentStructSize,
Data = accentPtr
};
User32.SetWindowCompositionAttribute(Handle, ref data);
Marshal.FreeHGlobal(accentPtr);
break;
case "key":
if (theme.ContainsKey("transparency-key"))
switch (theme["transparency-key"])
{
case "alt":
TransparencyKey = ColorTranslator.FromHtml(theme["background-alt"]);
break;
case "main":
TransparencyKey = ColorTranslator.FromHtml(theme["background"]);
break;
default:
TransparencyKey = ColorTranslator.FromHtml(theme["transparency-key"]);
break;
}
break;
case "percent":
if (theme.ContainsKey("transparency-percent"))
Opacity = Convert.ToDouble(theme["transparency-percent"]) / 100;
break;
}
}
private void CreateConfig(string dir)
{
if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
var sw = new StreamWriter(dir + "theme.txt");
sw.WriteLine("background: #000000");
sw.WriteLine("foreground: #8e05c2");
sw.WriteLine("background-alt: #3e065f");
sw.WriteLine("foreground-alt: #ffffff");
sw.WriteLine("transparent-mode: off");
sw.WriteLine("transparency-key: main");
sw.WriteLine("transparency-percent: 90");
sw.Dispose();
}
// Required for mica effect
internal enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
ACCENT_INVALID_STATE = 4
}
internal enum WindowCompositionAttribute
{
WCA_ACCENT_POLICY = 19
}
[StructLayout(LayoutKind.Sequential)]
internal struct AccentPolicy
{
public AccentState AccentState;
public int AccentFlags;
public int GradientColor;
public int AnimationId;
}
[StructLayout(LayoutKind.Sequential)]
internal struct WindowCompositionAttributeData
{
public WindowCompositionAttribute Attribute;
public IntPtr Data;
public int SizeOfData;
}
internal static class User32
{
[DllImport("user32.dll")]
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
}
#endregion
}

View File

@ -37,27 +37,6 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2"
{
"Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.7.2"
}
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.NetCore.DesktopRuntime.6.0.x64"
{
"Name" = "8:.NET Desktop Runtime 6.0.18 (x64)"
"ProductCode" = "8:Microsoft.NetCore.DesktopRuntime.6.0.x64"
}
}
}
}
"Release"
{
@ -74,22 +53,6 @@
"PrivateKeyFile" = "8:"
"TimeStampServer" = "8:"
"InstallerBootstrapper" = "3:2"
"BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
{
"Enabled" = "11:TRUE"
"PromptEnabled" = "11:TRUE"
"PrerequisitesLocation" = "2:1"
"Url" = "8:"
"ComponentsUrl" = "8:"
"Items"
{
"{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2"
{
"Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)"
"ProductCode" = "8:.NETFramework,Version=v4.7.2"
}
}
}
}
}
"Deployable"
@ -178,7 +141,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:FireWalletLite"
"ProductCode" = "8:{23670E44-E1CD-40B5-881D-40657BD30860}"
"PackageCode" = "8:{2CCCD1E4-40D9-4E58-8D3A-2039BD1CD215}"
"PackageCode" = "8:{EBE2AF53-E970-4708-9E43-05366A939681}"
"UpgradeCode" = "8:{6966FD44-6B8C-43C0-981A-E36449BF2DA8}"
"AspNetVersion" = "8:"
"RestartWWWService" = "11:FALSE"

View File

@ -1,9 +1,6 @@
# FireWalletLite
A lite wallet for Handshake.
This is aimed to be mainly used for holding HNS and domains without sending anything.
For example if you want to gift a domain to someone, you can have them use this wallet to store the wallet.
You will still need to renew the domains at least every 2 years.
## Features
First run flow:
@ -32,10 +29,3 @@ This wallet does not (and will never) support
If you want to use a wallet with more features, please use [Fire Wallet](https://firewallet.au) or [Bob Wallet](https://bobwallet.io) instead.
## Install
FireWalletLite is available for Windows only.
You can download the latest prebuilt release from [here](https://git.woodburn.au/nathanwoodburn/FireWalletLite/releases).
You should download the `FireWalletLite.zip` file and extract it to a folder then run the `setup.exe` file as this file will install the .net runtime if it is not already installed.
**You can also build it yourself by cloning this repo and building it in Visual Studio.**