Skip to content

Commit

Permalink
#7 : Edit option to copy true .lnk paths in Settings app
Browse files Browse the repository at this point in the history
  • Loading branch information
clechasseur committed Jan 1, 2020
1 parent b3e5f7e commit 0655ecb
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 6 deletions.
19 changes: 19 additions & 0 deletions PathCopyCopySettings/Core/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,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 specifying whether to copy paths to the .lnk files themselves.
private const string TrueLnkPathsValueName = "TrueLnkPaths";

/// Name of registry value containing the ID of the plugin to activate when Ctrl key is held down.
private const string CtrlKeyPluginValueName = "CtrlKeyPlugin";

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

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

/// Default value of the "disable software update" setting.
private const int DisableSoftwareUpdateDefaultValue = 0;

Expand Down Expand Up @@ -463,6 +469,19 @@ public string PathsSeparator
}
}

/// <summary>
/// Whether to copy the paths of .lnk files themselves.
/// </summary>
public bool TrueLnkPaths
{
get {
return ((int) GetUserOrGlobalValue(TrueLnkPathsValueName, TrueLnkPathsDefaultValue)) != 0;
}
set {
userKey.SetValue(TrueLnkPathsValueName, value ? 1 : 0);
}
}

/// <summary>
/// Whether software updates are disabled.
/// </summary>
Expand Down
27 changes: 21 additions & 6 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 @@ -269,6 +269,7 @@ private void LoadUserSettings()
UsePreviewModeInMainMenuChk.Checked = settings.UsePreviewModeInMainMenu;
}
DropRedundantWordsChk.Checked = settings.DropRedundantWords;
TrueLnkPathsChk.Checked = settings.TrueLnkPaths;
EnableSoftwareUpdateChk.Checked = !settings.DisableSoftwareUpdate;

// Set binding list as data source for the combo box used to pick ctrl key plugin.
Expand Down Expand Up @@ -427,6 +428,9 @@ private void SaveUserSettings()
if (DropRedundantWordsChk.Checked != settings.DropRedundantWords) {
settings.DropRedundantWords = DropRedundantWordsChk.Checked;
}
if (TrueLnkPathsChk.Checked != settings.TrueLnkPaths) {
settings.TrueLnkPaths = TrueLnkPathsChk.Checked;
}
if (EnableSoftwareUpdateChk.Checked != (!settings.DisableSoftwareUpdate)) {
settings.DisableSoftwareUpdate = !EnableSoftwareUpdateChk.Checked;
}
Expand Down
21 changes: 21 additions & 0 deletions PathCopyCopySettings/UI/Forms/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,27 @@
<metadata name="MainToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>769, 18</value>
</metadata>
<metadata name="MainToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>769, 18</value>
</metadata>
<metadata name="CtrlKeyPluginComboBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>209, 40</value>
</metadata>
<metadata name="IconCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PluginCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="InMainMenuCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="InSubmenuCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="PluginsDataGridBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>15, 39</value>
</metadata>
<metadata name="IconCol.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down

0 comments on commit 0655ecb

Please sign in to comment.