Skip to content

Commit 2fd1967

Browse files
committed
Full-Install support and other minor changes
- Full-Install support - Error messages are easier to read
1 parent 58c772f commit 2fd1967

8 files changed

Lines changed: 123 additions & 47 deletions

File tree

FileAES/MenuPanels/DecryptPanel.Designer.cs

Lines changed: 8 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileAES/MenuPanels/DecryptPanel.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,22 +91,29 @@ public bool SetFileToDecrypt(FAES_File faesFile)
9191
private void SetNote(string note, int severity)
9292
{
9393
Logging.Log(String.Format("FAES_GUI(SetNote({1})): '{0}'", note, severity), Severity.DEBUG);
94+
string message;
9495

9596
switch (severity)
9697
{
9798
case 1:
98-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Warning: " + note; }));
99+
message = "Warning: " + note;
99100
break;
100101
case 2:
101-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Important: " + note; }));
102+
message = "Important: " + note;
102103
break;
103104
case 3:
104-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Error: " + note; }));
105+
message = "Error: " + note;
105106
break;
106107
default:
107-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Note: " + note; }));
108+
message = "Note: " + note;
108109
break;
109110
}
111+
112+
statusInformation.Invoke(new MethodInvoker(delegate
113+
{
114+
this.statusInformation.Text = message;
115+
this.toolTip.SetToolTip(statusInformation, message);
116+
}));
110117
}
111118

112119
private void SetMetaData()
@@ -157,6 +164,7 @@ private void Decrypt()
157164
FileAES_Decrypt decrypt = new FileAES_Decrypt(_fileToDecrypt, passTextbox.Text);
158165
decrypt.SetDeleteAfterDecrypt(deleteOriginal.Checked);
159166
decrypt.SetOverwriteDuplicate(overwriteDuplicate.Checked);
167+
decrypt.DebugMode = FileAES_Utilities.GetVerboseLogging();
160168

161169
Thread dThread = new Thread(() =>
162170
{

FileAES/MenuPanels/DecryptPanel.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,7 @@
123123
<metadata name="decryptionTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124124
<value>592, 27</value>
125125
</metadata>
126+
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127+
<value>733, 27</value>
128+
</metadata>
126129
</root>

FileAES/MenuPanels/EncryptPanel.Designer.cs

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FileAES/MenuPanels/EncryptPanel.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,29 @@ public bool SetFileToEncrypt(FAES_File faesFile)
9494
private void SetNote(string note, int severity)
9595
{
9696
Logging.Log(String.Format("FAES_GUI(SetNote({1})): '{0}'", note, severity), Severity.DEBUG);
97+
string message;
9798

9899
switch (severity)
99100
{
100101
case 1:
101-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Warning: " + note; }));
102+
message = "Warning: " + note;
102103
break;
103104
case 2:
104-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Important: " + note; }));
105+
message = "Important: " + note;
105106
break;
106107
case 3:
107-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Error: " + note; }));
108+
message = "Error: " + note;
108109
break;
109110
default:
110-
statusInformation.Invoke(new MethodInvoker(delegate { this.statusInformation.Text = "Note: " + note; }));
111+
message = "Note: " + note;
111112
break;
112113
}
114+
115+
statusInformation.Invoke(new MethodInvoker(delegate
116+
{
117+
this.statusInformation.Text = message;
118+
this.toolTip.SetToolTip(statusInformation, message);
119+
}));
113120
}
114121

115122
private void Locked(bool lockChanges)
@@ -150,10 +157,12 @@ private void Encrypt()
150157
{
151158
try
152159
{
160+
153161
FileAES_Encrypt encrypt = new FileAES_Encrypt(_fileToEncrypt, passTextbox.Text, passHintTextbox.Text);
154162
encrypt.SetCompressionMode(FAES.Packaging.CompressionUtils.GetAllOptimiseModes()[compressMode.SelectedIndex]);
155163
encrypt.SetDeleteAfterEncrypt(deleteOriginal.Checked);
156164
encrypt.SetOverwriteDuplicate(overwriteDuplicate.Checked);
165+
encrypt.DebugMode = FileAES_Utilities.GetVerboseLogging();
157166

158167
Thread eThread = new Thread(() =>
159168
{

FileAES/MenuPanels/EncryptPanel.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,7 @@
123123
<metadata name="encryptionTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124124
<value>451, 27</value>
125125
</metadata>
126+
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127+
<value>592, 27</value>
128+
</metadata>
126129
</root>

FileAES/Program.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ namespace FAES_GUI
1313
{
1414
static class Program
1515
{
16-
private const string devAppendTag = "BETA 4";
17-
private const string betaAppendTag = "";
16+
private const string devAppendTag = "";
17+
private const string betaAppendTag = "BETA 5";
1818

1919
private static bool _verbose = false;
2020
private static bool _purgeTemp = false;
@@ -24,6 +24,8 @@ static class Program
2424
private static bool _showProgress = false;
2525
private static bool _overwriteDuplicates = false;
2626
private static bool _deleteOriginalFile = true;
27+
private static bool _genFullInstallConfig = false;
28+
private static string _installBranch;
2729
private static string _directory = null;
2830
private static string _password;
2931
private static string _passwordHint = null;
@@ -74,6 +76,8 @@ static void Main(string[] args)
7476
else if ((strippedArg == "level" || strippedArg == "compressionlevel" || strippedArg == "l") && !string.IsNullOrEmpty(args[i + 1])) Int32.TryParse(args[i + 1], out _compressionLevel);
7577
else if (strippedArg == "overwrite" || strippedArg == "overwriteduplicates" || strippedArg == "o") _overwriteDuplicates = true;
7678
else if (strippedArg == "preserveoriginal" || strippedArg == "original" || strippedArg == "po") _deleteOriginalFile = false;
79+
else if (strippedArg == "genFullInstallConfig") _genFullInstallConfig = true;
80+
else if (strippedArg == "installBranch" && !string.IsNullOrEmpty(args[i + 1])) _installBranch = args[i + 1];
7781

7882
_strippedArgs.Add(strippedArg);
7983
}
@@ -257,6 +261,11 @@ static void Main(string[] args)
257261
HandleException(e);
258262
}
259263
}
264+
else if (_genFullInstallConfig)
265+
{
266+
programManager = new ProgramManager(ProgramManager.InstallType.FullInstall);
267+
programManager.SetBranch(_installBranch);
268+
}
260269
else
261270
{
262271
programManager = new ProgramManager();
@@ -340,12 +349,12 @@ public static bool IsStableBuild()
340349

341350
public static bool IsBetaBuild()
342351
{
343-
return (!String.IsNullOrEmpty(devAppendTag) && String.IsNullOrEmpty(betaAppendTag));
352+
return !String.IsNullOrWhiteSpace(betaAppendTag);
344353
}
345354

346355
public static bool IsDevBuild()
347356
{
348-
return !String.IsNullOrEmpty(devAppendTag);
357+
return !String.IsNullOrWhiteSpace(devAppendTag);
349358
}
350359

351360
public static string GetBuild()

0 commit comments

Comments
 (0)