Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
HovKlan-DH committed Feb 2, 2024
1 parent ac2bf49 commit bc63583
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 106 deletions.
1 change: 0 additions & 1 deletion HovText/HandleClipboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ in a thread.
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using System.Reflection;

namespace HovText
{
Expand Down
2 changes: 1 addition & 1 deletion HovText/HandleFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class HandleFiles
private static List<int> entriesOrderLoad = new List<int>();
public static bool saveIndexAndFavoriteFiles = false;

// Below 3 booleans will be set to "true", if we are not loading any files
// Below booleans will be set to "true", if we are not loading any files
public static bool loadingDataFile = false; // "true" = currently loading the data file
public static bool onLoadAllEntriesInClipboardQueue = false; // "true" = all entries have been loaded from data file and to the clipboard queue - no content yet in the clipboard list, as the queue has not been processed yet
public static bool onLoadAllEntriesProcessedInClipboardQueue = false; // "true" = all cliopboard entries have been processed and the clipboard list nbow shows everything - nothing has been saved yet
Expand Down
76 changes: 10 additions & 66 deletions HovText/History.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion HovText/HovText.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ REM ---

REM Sign EXE
REM ---
rem signtool.exe sign /fd sha256 /tr http://ts.ssl.com /td sha256 /n "Dennis Helligsø" "$(TargetPath)"
signtool.exe sign /fd sha256 /tr http://ts.ssl.com /td sha256 /n "Dennis Helligsø" "$(TargetPath)"
</PostBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
4 changes: 2 additions & 2 deletions HovText/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("03fbad69-cd44-4a0c-b4bf-90406561f14f")]
//[assembly: AssemblyVersion("2021.01.23.1")]
[assembly: AssemblyFileVersion("2024.01.26.1")]
[assembly: AssemblyFileVersion("2024.02.02.1")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: NeutralResourcesLanguage("en")]
[assembly: AssemblyVersion("2024.01.26.1")]
[assembly: AssemblyVersion("2024.02.02.1")]
Binary file modified HovText/Resources/HovText Auto-Install.exe
Binary file not shown.
36 changes: 1 addition & 35 deletions HovText/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ public sealed partial class Settings : Form
public static SortedDictionary<int, Image> entriesApplicationIcon = new SortedDictionary<int, Image>();
public static SortedDictionary<int, string> entriesText = new SortedDictionary<int, string>();
public static SortedDictionary<int, string> entriesTextTrimmed = new SortedDictionary<int, string>();
//public static SortedDictionary<int, bool> entriesShow = new SortedDictionary<int, bool>();
public static SortedDictionary<int, bool> entriesIsFavorite = new SortedDictionary<int, bool>();
public static SortedDictionary<int, bool> entriesIsUrl = new SortedDictionary<int, bool>();
public static SortedDictionary<int, bool> entriesIsEmail = new SortedDictionary<int, bool>();
Expand Down Expand Up @@ -266,7 +265,6 @@ public sealed partial class Settings : Form
bool activatedHotkeys = false; // the hotkeys should not be enabled until we have loaded everything into the clipboard list
private DateTime lastClipboardEvent = DateTime.MinValue;
private int minMsBetween = 100;
//public static bool isProcessingRawClipboard = false;


// ###########################################################################################
Expand Down Expand Up @@ -467,7 +465,6 @@ protected override void WndProc(ref Message m)
whoUpdatedClipboardName = HandleClipboard.GetActiveApplicationName();
}

//Logging.Log("Received clipboard [UPDATE] event");
Logging.Log("Received clipboard [UPDATE] event from application ["+ whoUpdatedClipboardName +"]");

// Set an overall boolean that will depict if we should continue processing clipboard
Expand Down Expand Up @@ -524,8 +521,8 @@ protected override void WndProc(ref Message m)

isProcessingClipboard = false;
}

break;

default:
base.WndProc(ref m);
break;
Expand Down Expand Up @@ -924,7 +921,6 @@ public static void ClearHistory()
entriesIsTransparent.Clear();
entriesIsUrl.Clear();
entriesOriginal.Clear();
//entriesShow.Clear();
entriesText.Clear();
entriesTextTrimmed.Clear();
entriesOrder.Clear();
Expand All @@ -944,7 +940,6 @@ public void SelectHistoryEntry(int index)
int entriesInList = History.entriesInList;
if (entriesInList > 0)
{
//MoveEntryToTop(entryIndex);
MoveEntryToTop(index);

// Restore the original clipboard, if we are within the "Paste on hotkey only" mode
Expand Down Expand Up @@ -1062,7 +1057,6 @@ public void ToggleEnabled()
UiGeneralToggleEnableClipboard.Enabled = true;
UiGeneralLabelEnableClipboard.Enabled = true;
UiGeneralLabelEnableClipboardShortcut.Enabled = true;
//UiHotkeysButtonToggleApplication.Enabled = true;

SetFieldsBasedOnHistoryEnabled();

Expand Down Expand Up @@ -1119,7 +1113,6 @@ public void ToggleEnabled()
UiGeneralLabelPasteToApplication.Enabled = false;
UiGeneralToggleAlwaysPasteOriginal.Enabled = false;
UiGeneralLabelAlwaysPasteOriginal.Enabled = false;
//UiHotkeysButtonToggleApplication.Enabled = false;
UiHotkeysButtonPasteHotkey.Enabled = false;
UiHotkeysRadioUseStandardWindowsMethod.Enabled = false;
UiHotkeysRadioPasteOnHotkey.Enabled = false;
Expand Down Expand Up @@ -1264,19 +1257,6 @@ private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
}


// ###########################################################################################
// When pressing one of the history hotkeys then change focus to this application to prevent the keypresses go in to the active application
// ###########################################################################################

/*
private void ChangeFocusToHovText()
{
NativeMethods.SetForegroundWindow(Handle);
Logging.Log("Set focus to HovText");
}
*/


// ###########################################################################################
// When an entry has been submitted to the clipboard then pass back focus to the originating application
// ###########################################################################################
Expand Down Expand Up @@ -1371,7 +1351,6 @@ private static void ConvertLegacyRegistry()
else
{
firstTimeLaunch = false;
//Logging.Log("Registry [" + registryPath + "] exists, so this is an [already initialized] launch");
}
}

Expand Down Expand Up @@ -1475,8 +1454,6 @@ private static void InitializeRegistry()
Logging.Log(" \"HistorySearch\" = [" + regVal + "]");
regVal = GetRegistryKey(registryPath, "FavoritesEnable");
Logging.Log(" \"FavoritesEnable\" = [" + regVal + "]");
//regVal = GetRegistryKey(registryPath, "FavoritesKeep");
//Logging.Log(" \"FavoritesKeep\" = [" + regVal + "]");
regVal = GetRegistryKey(registryPath, "CopyImages");
Logging.Log(" \"CopyImages\" = [" + regVal + "]");
regVal = GetRegistryKey(registryPath, "PasteOnSelection");
Expand Down Expand Up @@ -2807,7 +2784,6 @@ private void TrayIconAbout_Click(object sender, EventArgs e)
var tabToSelect = UiFormTabControl.TabPages.Cast<TabPage>().FirstOrDefault(tab => tab.Name == tabName);
if (tabToSelect != null)
{
//UiFormTabControl.SelectedIndex = 9; // About
UiFormTabControl.SelectedTab = tabToSelect;
}
}
Expand All @@ -2825,7 +2801,6 @@ private void TrayIconSettings_Click(object sender, EventArgs e)
var tabToSelect = UiFormTabControl.TabPages.Cast<TabPage>().FirstOrDefault(tab => tab.Name == tabName);
if (tabToSelect != null)
{
//UiFormTabControl.SelectedIndex = 0; // General
UiFormTabControl.SelectedTab = tabToSelect;
}
}
Expand Down Expand Up @@ -2887,7 +2862,6 @@ private void NotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
var tabToSelect = UiFormTabControl.TabPages.Cast<TabPage>().FirstOrDefault(tab => tab.Name == tabName);
if (tabToSelect != null)
{
//UiFormTabControl.SelectedIndex = 0; // General
UiFormTabControl.SelectedTab = tabToSelect;
}
}
Expand Down Expand Up @@ -2940,7 +2914,6 @@ private void GuiHotkeyBehaviourPaste_CheckedChanged(object sender, EventArgs e)
UiGeneralLabelRestoreOriginal.Enabled = false;
UiHotkeysLabelPasteHotkey.Enabled = true;
isEnabledPasteOnHotkey = true;
// HandleClipboard.SetClipboard(HandleClipboard.threadSafeIndex - 1);
SetNotifyIcon();
}

Expand Down Expand Up @@ -3013,7 +2986,6 @@ private void HotkeySearch(object sender, NHotkey.HotkeyEventArgs e)
GetEntryCounter();

// Check if application is enabled
//if (isApplicationEnabled && entryCounter > 0)
if (isApplicationEnabled)
{
// Hide the history list again, if it already is visible and I pressed the hotkey again
Expand All @@ -3034,9 +3006,6 @@ private void HotkeySearch(object sender, NHotkey.HotkeyEventArgs e)
originatingApplicationName = HandleClipboard.GetActiveApplicationName();
history.SetupForm();

// Always change focus to HovText to ensure we can catch the key-up event
//ChangeFocusToHovText();

// Only proceed if the entry counter is equal to or more than 0
if (entryCounter > 0)
{
Expand All @@ -3061,7 +3030,6 @@ private void HotkeyPasteOnHotkey(object sender, NHotkey.HotkeyEventArgs e)
{
// Get active application and change focus to HovText
originatingApplicationName = HandleClipboard.GetActiveApplicationName();
//ChangeFocusToHovText();

// Show the invisible form, so we can catch the key-up event
pasteOnHotkey.Show();
Expand Down Expand Up @@ -4780,7 +4748,6 @@ public void UpdateMemoryConsumed()

public void UpdateClipboardEntriesCounters()
{
//if (HandleClipboard.clipboardQueue.Count == 0 && clipboardSaveQueue.Count == 0)
if (!isProcessingClipboardQueue && !isClipboardSaveQueueBeingProcessed)
{
try
Expand Down Expand Up @@ -5337,7 +5304,6 @@ public static void AutoInstall(string argument)

// Terminate the main application
settings.Close();
//Environment.Exit(0);
}


Expand Down

0 comments on commit bc63583

Please sign in to comment.