Skip to content

Commit

Permalink
Allow to exclude forms from Softlock
Browse files Browse the repository at this point in the history
Fixes #14
  • Loading branch information
Rookiestyle committed Oct 14, 2023
1 parent 9450a50 commit 4704b78
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
34 changes: 31 additions & 3 deletions src/Config/LockAssistConfig_SL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,48 @@ public static bool SL_OnMinimize
set { _config.SetBool(LockAssistSoftlockOnMinimize, value); }
}

private static List<string> m_SL_DefaultExcludeForms = new List<string>() {"AboutForm","AutoTypeCtxForm","CharPickerForm","ColumnsForm",
"HelpSourceForm","KeyPromptForm","LanguageForm","PluginsForm","PwGeneratorForm","UpdateCheckForm", "OtpKeyProv.Forms.OtpKeyPromptForm" };
private const string mc_ExcludeFormsText = "Enter form names to exclude from Softlock";
public static List<string> SL_ExcludeForms
{
get
{
string sForms = _config.GetString(LockAssistSoftlockExcludeForms, "AboutForm,AutoTypeCtxForm,CharPickerForm,ColumnsForm," +
"HelpSourceForm,KeyPromptForm,LanguageForm,PluginsForm,PwGeneratorForm,UpdateCheckForm");
var aForms = sForms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
//Set defaults
List<string> lForms = new List<string>();
lForms.AddRange(m_SL_DefaultExcludeForms);

string sForms = _config.GetString(LockAssistSoftlockExcludeForms, string.Empty);
if (string.IsNullOrEmpty(sForms))
{
sForms = string.Empty;
SL_ExcludeForms = new List<string>() { mc_ExcludeFormsText };
}
var aForms = sForms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (var sForm in aForms)
{
if (sForm == mc_ExcludeFormsText) continue;
if (sForm.Trim().StartsWith("-")) continue;
if (!lForms.Contains(sForm.Trim())) lForms.Add(sForm.Trim());
}
foreach (var sForm in aForms)
{
if (sForm == mc_ExcludeFormsText) continue;
if (!sForm.Trim().StartsWith("-")) continue;
lForms.Remove(sForm.Trim().Substring(1));
}
return lForms;
}
set
{
string sForms = string.Empty;
foreach (var s in value)
{
if (!string.IsNullOrEmpty(sForms)) sForms += ",";
sForms += s;
}
_config.SetString(LockAssistSoftlockExcludeForms, sForms);
}
}
}
}
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.3.1")]
[assembly: AssemblyFileVersion("3.3.1")]
[assembly: AssemblyVersion("3.4")]
[assembly: AssemblyFileVersion("3.4")]
2 changes: 1 addition & 1 deletion version.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:
LockAssist:3.3.1
LockAssist:3.4
LockAssist!de:5
LockAssist!pt:4
:

0 comments on commit 4704b78

Please sign in to comment.