Skip to content

Commit

Permalink
Full-Install support and other minor changes
Browse files Browse the repository at this point in the history
- Full-Install support
- Error messages are easier to read
  • Loading branch information
mullak99 committed Sep 3, 2020
1 parent 58c772f commit 2fd1967
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 47 deletions.
14 changes: 8 additions & 6 deletions FileAES/MenuPanels/DecryptPanel.Designer.cs

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

16 changes: 12 additions & 4 deletions FileAES/MenuPanels/DecryptPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,29 @@ public bool SetFileToDecrypt(FAES_File faesFile)
private void SetNote(string note, int severity)
{
Logging.Log(String.Format("FAES_GUI(SetNote({1})): '{0}'", note, severity), Severity.DEBUG);
string message;

switch (severity)
{
case 1:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Warning: " + note; }));
message = "Warning: " + note;
break;
case 2:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Important: " + note; }));
message = "Important: " + note;
break;
case 3:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Error: " + note; }));
message = "Error: " + note;
break;
default:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Note: " + note; }));
message = "Note: " + note;
break;
}

statusInformation.Invoke(new MethodInvoker(delegate
{
this.statusInformation.Text = message;
this.toolTip.SetToolTip(statusInformation, message);
}));
}

private void SetMetaData()
Expand Down Expand Up @@ -157,6 +164,7 @@ private void Decrypt()
FileAES_Decrypt decrypt = new FileAES_Decrypt(_fileToDecrypt, passTextbox.Text);
decrypt.SetDeleteAfterDecrypt(deleteOriginal.Checked);
decrypt.SetOverwriteDuplicate(overwriteDuplicate.Checked);
decrypt.DebugMode = FileAES_Utilities.GetVerboseLogging();
Thread dThread = new Thread(() =>
{
Expand Down
3 changes: 3 additions & 0 deletions FileAES/MenuPanels/DecryptPanel.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@
<metadata name="decryptionTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>592, 27</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>733, 27</value>
</metadata>
</root>
12 changes: 7 additions & 5 deletions FileAES/MenuPanels/EncryptPanel.Designer.cs

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

17 changes: 13 additions & 4 deletions FileAES/MenuPanels/EncryptPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,29 @@ public bool SetFileToEncrypt(FAES_File faesFile)
private void SetNote(string note, int severity)
{
Logging.Log(String.Format("FAES_GUI(SetNote({1})): '{0}'", note, severity), Severity.DEBUG);
string message;

switch (severity)
{
case 1:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Warning: " + note; }));
message = "Warning: " + note;
break;
case 2:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Important: " + note; }));
message = "Important: " + note;
break;
case 3:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Error: " + note; }));
message = "Error: " + note;
break;
default:
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Note: " + note; }));
message = "Note: " + note;
break;
}

statusInformation.Invoke(new MethodInvoker(delegate
{
this.statusInformation.Text = message;
this.toolTip.SetToolTip(statusInformation, message);
}));
}

private void Locked(bool lockChanges)
Expand Down Expand Up @@ -150,10 +157,12 @@ private void Encrypt()
{
try
{
FileAES_Encrypt encrypt = new FileAES_Encrypt(_fileToEncrypt, passTextbox.Text, passHintTextbox.Text);
encrypt.SetCompressionMode(FAES.Packaging.CompressionUtils.GetAllOptimiseModes()[compressMode.SelectedIndex]);
encrypt.SetDeleteAfterEncrypt(deleteOriginal.Checked);
encrypt.SetOverwriteDuplicate(overwriteDuplicate.Checked);
encrypt.DebugMode = FileAES_Utilities.GetVerboseLogging();
Thread eThread = new Thread(() =>
{
Expand Down
3 changes: 3 additions & 0 deletions FileAES/MenuPanels/EncryptPanel.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,7 @@
<metadata name="encryptionTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>451, 27</value>
</metadata>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>592, 27</value>
</metadata>
</root>
17 changes: 13 additions & 4 deletions FileAES/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace FAES_GUI
{
static class Program
{
private const string devAppendTag = "BETA 4";
private const string betaAppendTag = "";
private const string devAppendTag = "";
private const string betaAppendTag = "BETA 5";

private static bool _verbose = false;
private static bool _purgeTemp = false;
Expand All @@ -24,6 +24,8 @@ static class Program
private static bool _showProgress = false;
private static bool _overwriteDuplicates = false;
private static bool _deleteOriginalFile = true;
private static bool _genFullInstallConfig = false;
private static string _installBranch;
private static string _directory = null;
private static string _password;
private static string _passwordHint = null;
Expand Down Expand Up @@ -74,6 +76,8 @@ static void Main(string[] args)
else if ((strippedArg == "level" || strippedArg == "compressionlevel" || strippedArg == "l") && !string.IsNullOrEmpty(args[i + 1])) Int32.TryParse(args[i + 1], out _compressionLevel);
else if (strippedArg == "overwrite" || strippedArg == "overwriteduplicates" || strippedArg == "o") _overwriteDuplicates = true;
else if (strippedArg == "preserveoriginal" || strippedArg == "original" || strippedArg == "po") _deleteOriginalFile = false;
else if (strippedArg == "genFullInstallConfig") _genFullInstallConfig = true;
else if (strippedArg == "installBranch" && !string.IsNullOrEmpty(args[i + 1])) _installBranch = args[i + 1];

_strippedArgs.Add(strippedArg);
}
Expand Down Expand Up @@ -257,6 +261,11 @@ static void Main(string[] args)
HandleException(e);
}
}
else if (_genFullInstallConfig)
{
programManager = new ProgramManager(ProgramManager.InstallType.FullInstall);
programManager.SetBranch(_installBranch);
}
else
{
programManager = new ProgramManager();
Expand Down Expand Up @@ -340,12 +349,12 @@ public static bool IsStableBuild()

public static bool IsBetaBuild()
{
return (!String.IsNullOrEmpty(devAppendTag) && String.IsNullOrEmpty(betaAppendTag));
return !String.IsNullOrWhiteSpace(betaAppendTag);
}

public static bool IsDevBuild()
{
return !String.IsNullOrEmpty(devAppendTag);
return !String.IsNullOrWhiteSpace(devAppendTag);
}

public static string GetBuild()
Expand Down
Loading

0 comments on commit 2fd1967

Please sign in to comment.