Skip to content

Commit

Permalink
#2 : Add support for global recursive copy option in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Jul 27, 2020
1 parent 65337e3 commit a9306cb
Show file tree
Hide file tree
Showing 7 changed files with 1,653 additions and 1,456 deletions.
19 changes: 19 additions & 0 deletions PathCopyCopySettings/Core/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public enum StringEncodeParam
/// Name of registry value specifying the separator to use between multiple copied paths.
private const string PathsSeparatorValueName = "PathsSeparator";

/// Name of registry value determining whether to copy paths recursively.
private const string CopyPathsRecursivelyValueName = "CopyPathsRecursively";

/// Name of registry value specifying whether to copy paths to the .lnk files themselves.
private const string TrueLnkPathsValueName = "TrueLnkPaths";

Expand Down Expand Up @@ -239,6 +242,9 @@ public enum StringEncodeParam
/// Default value of the "paths separator" setting.
private const string PathsSeparatorDefaultValue = "";

/// Default value of the "copy paths recursively" setting.
private const int CopyPathsRecursivelyDefaultValue = 0;

/// Default value of the "true .lnk paths" setting.
private const int TrueLnkPathsDefaultValue = 0;

Expand Down Expand Up @@ -481,6 +487,19 @@ public string PathsSeparator
}
}

/// <summary>
/// Whether paths should be copied recursively or not.
/// </summary>
public bool CopyPathsRecursively
{
get {
return ((int) GetUserOrGlobalValue(CopyPathsRecursivelyValueName, CopyPathsRecursivelyDefaultValue)) != 0;
}
set {
userKey.SetValue(CopyPathsRecursivelyValueName, value ? 1 : 0);
}
}

/// <summary>
/// Whether to copy the paths of .lnk files themselves.
/// </summary>
Expand Down
38 changes: 34 additions & 4 deletions PathCopyCopySettings/UI/Forms/MainForm.Designer.cs

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

4 changes: 4 additions & 0 deletions PathCopyCopySettings/UI/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ private void LoadUserSettings()
UsePreviewModeInMainMenuChk.Checked = Settings.UsePreviewModeInMainMenu;
}
DropRedundantWordsChk.Checked = Settings.DropRedundantWords;
RecursiveCopyChk.Checked = Settings.CopyPathsRecursively;
TrueLnkPathsChk.Checked = Settings.TrueLnkPaths;
EnableSoftwareUpdateChk.Checked = !Settings.DisableSoftwareUpdate;

Expand Down Expand Up @@ -459,6 +460,9 @@ private void SaveUserSettings()
if (DropRedundantWordsChk.Checked != Settings.DropRedundantWords) {
Settings.DropRedundantWords = DropRedundantWordsChk.Checked;
}
if (RecursiveCopyChk.Checked != Settings.CopyPathsRecursively) {
Settings.CopyPathsRecursively = RecursiveCopyChk.Checked;
}
if (TrueLnkPathsChk.Checked != Settings.TrueLnkPaths) {
Settings.TrueLnkPaths = TrueLnkPathsChk.Checked;
}
Expand Down
Loading

0 comments on commit a9306cb

Please sign in to comment.