diff --git a/Text-Grab/Pages/GeneralSettings.xaml b/Text-Grab/Pages/GeneralSettings.xaml
index 9370bbcc..40009e6c 100644
--- a/Text-Grab/Pages/GeneralSettings.xaml
+++ b/Text-Grab/Pages/GeneralSettings.xaml
@@ -48,6 +48,32 @@
Click="AboutBTN_Click" />
+
+
+
+
+ Thank you for using Text Grab!
+ Building this application is very much a labor of love. I am always happy to hear from users to better understand how you use the app and what you would like to see in the future.
+ Feel free to open an issue on GitHub if you have a bug or feature request. Email me directly for questions or just to say hi.
+ Happy Text Grabbing!
+
+
+ 🌐 https://github.com/TheJoeFin/Text-Grab/issues
+
+
+ 📧 joe@JoeFinApps.com
+
+
+
+
-
+
Show Notification when text is copied.
@@ -140,7 +169,6 @@
-
+
+
+
+ Auto start Text Grab when you login
+
+
+
+
+
+
+ Try to Insert text in text fields after Fullscreen Grab after:
+
+
+
+
+
+
+
+
+
public partial class GeneralSettings : Page
{
- private Settings DefaultSettings = Settings.Default;
+ #region Fields
+
+ private readonly Settings DefaultSettings = Settings.Default;
+ private readonly Brush BadBrush = new SolidColorBrush(Colors.Red);
+ private readonly Brush GoodBrush = new SolidColorBrush(Colors.Transparent);
+ private double InsertDelaySeconds = 1.5;
+
+ #endregion Fields
+
public GeneralSettings()
{
@@ -41,7 +51,7 @@ private void AboutBTN_Click(object sender, RoutedEventArgs e)
WindowUtilities.OpenOrActivateWindow();
}
- private void Page_Loaded(object sender, RoutedEventArgs e)
+ private async void Page_Loaded(object sender, RoutedEventArgs e)
{
AppTheme appTheme = Enum.Parse(DefaultSettings.AppTheme, true);
switch (appTheme)
@@ -80,6 +90,33 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
break;
}
+ if (ImplementAppOptions.IsPackaged())
+ {
+ StartupTask startupTask = await StartupTask.GetAsync("StartTextGrab");
+
+ switch (startupTask.State)
+ {
+ case StartupTaskState.Disabled:
+ // Task is disabled but can be enabled.
+ StartupOnLoginCheckBox.IsChecked = false;
+ break;
+ case StartupTaskState.DisabledByUser:
+ // Task is disabled and user must enable it manually.
+ StartupOnLoginCheckBox.IsChecked = false;
+ StartupOnLoginCheckBox.IsEnabled = false;
+
+ StartupTextBlock.Text += "\nDisabled in Task Manager";
+ break;
+ case StartupTaskState.Enabled:
+ StartupOnLoginCheckBox.IsChecked = true;
+ break;
+ }
+ }
+ else
+ {
+ StartupOnLoginCheckBox.IsChecked = Settings.Default.StartupOnLogin;
+ }
+
ShowToastCheckBox.IsChecked = DefaultSettings.ShowToast;
RunInBackgroundChkBx.IsChecked = DefaultSettings.RunInTheBackground;
ReadBarcodesBarcode.IsChecked = DefaultSettings.TryToReadBarcodes;
@@ -87,6 +124,33 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
ErrorCorrectBox.IsChecked = DefaultSettings.CorrectErrors;
CorrectToLatin.IsChecked = DefaultSettings.CorrectToLatin;
NeverUseClipboardChkBx.IsChecked = DefaultSettings.NeverAutoUseClipboard;
+ TryInsertCheckbox.IsChecked = DefaultSettings.TryInsert;
+ InsertDelaySeconds = DefaultSettings.InsertDelay;
+ SecondsTextBox.Text = InsertDelaySeconds.ToString("##.#", System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ private void ValidateTextIsNumber(object sender, TextChangedEventArgs e)
+ {
+ if (!IsLoaded)
+ return;
+
+ if (sender is System.Windows.Controls.TextBox numberInputBox)
+ {
+ bool wasAbleToConvert = double.TryParse(numberInputBox.Text, out double parsedText);
+ if (wasAbleToConvert && parsedText > 0 && parsedText < 10)
+ {
+ InsertDelaySeconds = parsedText;
+ DefaultSettings.InsertDelay = InsertDelaySeconds;
+ DelayTimeErrorSeconds.Visibility = Visibility.Collapsed;
+ numberInputBox.BorderBrush = GoodBrush;
+ }
+ else
+ {
+ InsertDelaySeconds = 3;
+ DelayTimeErrorSeconds.Visibility = Visibility.Visible;
+ numberInputBox.BorderBrush = BadBrush;
+ }
+ }
}
private void FullScreenRDBTN_Checked(object sender, RoutedEventArgs e)
@@ -185,4 +249,36 @@ private void NeverUseClipboardChkBx_Unchecked(object sender, RoutedEventArgs e)
{
DefaultSettings.NeverAutoUseClipboard = false;
}
+
+ private async void StartupOnLoginCheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.StartupOnLogin = true;
+ await ImplementAppOptions.ImplementStartupOption(true);
+ }
+
+ private async void StartupOnLoginCheckBox_Unchecked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.StartupOnLogin = false;
+ await ImplementAppOptions.ImplementStartupOption(false);
+ }
+
+ private void TryInsertCheckbox_Checked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.TryInsert = true;
+ }
+
+ private void TryInsertCheckbox_Unchecked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.TryInsert = false;
+ }
+
+ private void ShowToastCheckBox_Checked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.ShowToast = true;
+ }
+
+ private void ShowToastCheckBox_Unchecked(object sender, RoutedEventArgs e)
+ {
+ DefaultSettings.ShowToast = false;
+ }
}
diff --git a/Text-Grab/Pages/TesseractSettings.xaml.cs b/Text-Grab/Pages/TesseractSettings.xaml.cs
index abe78d5d..636e2c4d 100644
--- a/Text-Grab/Pages/TesseractSettings.xaml.cs
+++ b/Text-Grab/Pages/TesseractSettings.xaml.cs
@@ -15,7 +15,7 @@ namespace Text_Grab.Pages;
///
public partial class TesseractSettings : Page
{
- private Settings DefaultSettings = Settings.Default;
+ private readonly Settings DefaultSettings = Settings.Default;
public TesseractSettings()
{
diff --git a/Text-Grab/Views/SettingsWindow.xaml b/Text-Grab/Views/SettingsWindow.xaml
index a8028121..890bad01 100644
--- a/Text-Grab/Views/SettingsWindow.xaml
+++ b/Text-Grab/Views/SettingsWindow.xaml
@@ -10,7 +10,7 @@
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="Text Grab Settings"
Width="660"
- Height="600"
+ Height="800"
MinWidth="200"
MinHeight="300"
d:Background="Black"
@@ -33,7 +33,7 @@
-
+
@@ -47,7 +47,6 @@
@@ -93,314 +92,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Correct common confusions between numbers and letters
-
-
-
-
-
- Correct misidentifications between Greek and Cyrillic to Latin letters
-
-
-
-
-
- Never automatically add text to the clipboard
-
-
-
-
-
-
- Run Text Grab in the background and enable hotkeys
-
-
-
- For this setting to take effect close all instances of Text Grab.
-
-
-
- Global hotkeys (clear text to disable hotkey):
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Auto start Text Grab when you login
-
-
-
-
-
-
- Try to Insert text in text fields after Fullscreen Grab after:
-
-
-
-
-
-
-
-
-
-
-
- Try to read barcodes (Disabling may speed up results)
-
-
-
-
-
- Keep recent history of Grabs and Edit Text Windows
-
-
-
-
-
-
-
- Use Tesseract, when possible.
-
-
-
- More information
-
-
-
-
-
-
- Tesseract is an optical character recognition engine for various operating systems. It is free software, released under the Apache License. Originally developed by Hewlett-Packard as proprietary software in the 1980s, it was released as open source in 2005 and development has been sponsored by Google since 2006.
- More: https://en.wikipedia.org/wiki/Tesseract_(software)
-
-
-
-
- Text Grab will capture the image then pass it to the Tesseract EXE. Then Tesseract returns the result of the OCR to Text Grab and error occurs according to user settings.
- Does not use Tesseract: Table Recogintion and the Grab Frame.
-
-
- The source repository is on GitHub:
- https://github.com/tesseract-ocr/tesseract
-
- UB Mannheim maintains an installer for Windows:
- https://github.com/UB-Mannheim/tesseract/wiki/
-
-
-
-
-
- winget install -e --id UB-Mannheim.TesseractOCR
-
-
-
-
-
-
- Tesseract is known for having the best OCR capabilities. While the Windows OCR is convenient and fast, it has not been updated in years and Microsoft has no plans to update it.
- Feel free to try Tesseract and hopefully it will work well for you. Ideally Text Grab can bring together the convenience with the power of Tesseract.
-
-
-
- The default OCR Models installed by UB Mannheim are the 'fast' models which are not as accurate. Other more accurate models can be downloaded from the tessdata GitHub repository here:
- https://github.com/tesseract-ocr/tessdata
-
- After downloading language files, place them in the "tessdata" folder in the installed location of Tesseract:
-
-
-
-
-
- Enter path to tesseract.exe here. ex: c:/tess/tesseract.exe
-
-
-
-
- Done
-
-
-
-
-
- Reset All settings to default settings.
-
-
-
-
-
-
-
-
- What do you want to see here? Submit an issue on GitHub
-
- https://github.com/TheJoeFin/Text-Grab/issues
-
-
-
-
-
diff --git a/Text-Grab/Views/SettingsWindow.xaml.cs b/Text-Grab/Views/SettingsWindow.xaml.cs
index ac3219d9..a2c05f7a 100644
--- a/Text-Grab/Views/SettingsWindow.xaml.cs
+++ b/Text-Grab/Views/SettingsWindow.xaml.cs
@@ -1,18 +1,8 @@
using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using Text_Grab.Controls;
-using Text_Grab.Models;
using Text_Grab.Pages;
using Text_Grab.Properties;
-using Text_Grab.Services;
using Text_Grab.Utilities;
-using Windows.ApplicationModel;
-using WpfScreenHelper;
namespace Text_Grab;
@@ -21,13 +11,6 @@ namespace Text_Grab;
///
public partial class SettingsWindow : Wpf.Ui.Controls.FluentWindow
{
- #region Fields
-
- private readonly Brush BadBrush = new SolidColorBrush(Colors.Red);
- private readonly Brush GoodBrush = new SolidColorBrush(Colors.Transparent);
-
- #endregion Fields
-
#region Constructors
public SettingsWindow()
@@ -39,286 +22,8 @@ public SettingsWindow()
#endregion Constructors
- #region Properties
-
- public double InsertDelaySeconds { get; set; } = 3;
-
- #endregion Properties
-
#region Methods
- private void AboutBTN_Click(object sender, RoutedEventArgs e)
- {
- //ShowToastCheckBox.IsChecked = Settings.Default.ShowToast;
- ErrorCorrectBox.IsChecked = Settings.Default.CorrectErrors;
- NeverUseClipboardChkBx.IsChecked = Settings.Default.NeverAutoUseClipboard;
- RunInBackgroundChkBx.IsChecked = Settings.Default.RunInTheBackground;
- TryInsertCheckbox.IsChecked = Settings.Default.TryInsert;
- ReadBarcodesBarcode.IsChecked = Settings.Default.TryToReadBarcodes;
- //CorrectToLatin.IsChecked = Settings.Default.CorrectToLatin;
- // GlobalHotkeysCheckbox.IsChecked = Settings.Default.GlobalHotkeysEnabled;
-
- WindowUtilities.OpenOrActivateWindow();
- }
-
- private void ClearHistoryButton_Click(object sender, RoutedEventArgs e)
- {
- MessageBoxResult areYouSure = MessageBox.Show("Are you sure you want to delete all history?", "Reset Settings to Default", MessageBoxButton.YesNo);
-
- if (areYouSure != MessageBoxResult.Yes)
- return;
-
- Singleton.Instance.DeleteHistory();
- }
-
- private void CloseBTN_Click(object sender, RoutedEventArgs e)
- {
- Close();
- }
-
- private bool HotKeysAllDifferent()
- {
- bool anyMatchingKeys = false;
-
- HashSet shortcuts = new();
-
- foreach (UIElement child in ShortcutsStackPanel.Children)
- if (child is ShortcutControl shortcutControl)
- shortcuts.Add(shortcutControl);
-
- if (shortcuts.Count == 0)
- return false;
-
- foreach (ShortcutControl shortcut in shortcuts)
- {
- ShortcutKeySet keySet = shortcut.KeySet;
- bool isThisShortcutGood = true;
-
- foreach (ShortcutControl shortcut2 in shortcuts)
- {
- if (shortcut == shortcut2)
- continue;
-
- if (keySet.AreKeysEqual(shortcut2.KeySet) && (shortcut.KeySet.IsEnabled && keySet.IsEnabled))
- {
- shortcut.HasConflictingError = true;
- shortcut2.HasConflictingError = true;
- shortcut2.GoIntoErrorMode("Cannot have two shortcuts that are the same");
- anyMatchingKeys = true;
- isThisShortcutGood = false;
- }
- }
-
- if (isThisShortcutGood)
- shortcut.HasConflictingError = false;
-
- shortcut.CheckForErrors();
- }
-
- if (anyMatchingKeys)
- return false;
-
- return true;
- }
-
- private void Hyperlink_RequestNavigate(object sender, System.Windows.Navigation.RequestNavigateEventArgs e)
- {
- Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
- e.Handled = true;
- }
-
- private void MoreInfoHyperlink_Click(object sender, RoutedEventArgs e)
- {
- if (TessMoreInfoBorder.Visibility == Visibility.Visible)
- TessMoreInfoBorder.Visibility = Visibility.Collapsed;
- else
- TessMoreInfoBorder.Visibility = Visibility.Visible;
- }
-
- private void OpenExeFolderButton_Click(object sender, RoutedEventArgs ev)
- {
- if (Path.GetDirectoryName(System.AppContext.BaseDirectory) is not string exePath)
- return;
-
- Uri source = new(exePath, UriKind.Absolute);
- System.Windows.Navigation.RequestNavigateEventArgs e = new(source, exePath);
- Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
- e.Handled = true;
- }
-
- private void OpenPathButton_Click(object sender, RoutedEventArgs ev)
- {
- if (TesseractPathTextBox.Text is not string pathTextBox || !File.Exists(TesseractPathTextBox.Text))
- return;
-
- string? tesseractExePath = Path.GetDirectoryName(pathTextBox);
-
- if (tesseractExePath is null)
- return;
-
- Uri source = new(tesseractExePath, UriKind.Absolute);
- System.Windows.Navigation.RequestNavigateEventArgs e = new(source, tesseractExePath);
- Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) { UseShellExecute = true });
- e.Handled = true;
- }
-
- private void ResetSettingsButton_Click(object sender, RoutedEventArgs e)
- {
- MessageBoxResult areYouSure = MessageBox.Show("Are you sure you want to reset all settings to default?", "Reset Settings to Default", MessageBoxButton.YesNo);
-
- if (areYouSure != MessageBoxResult.Yes)
- return;
-
- Settings.Default.Reset();
- Singleton.Instance.DeleteHistory();
- this.Close();
- }
-
- private async void SaveBTN_Click(object sender, RoutedEventArgs e)
- {
- //if (ShowToastCheckBox.IsChecked is bool showToast)
- // Settings.Default.ShowToast = showToast;
- //if (SystemThemeRdBtn.IsChecked is true)
- // Settings.Default.AppTheme = AppTheme.System.ToString();
- //else if (LightThemeRdBtn.IsChecked is true)
- // Settings.Default.AppTheme = AppTheme.Light.ToString();
- //else if (DarkThemeRdBtn.IsChecked is true)
- // Settings.Default.AppTheme = AppTheme.Dark.ToString();
-
- //if (ShowToastCheckBox.IsChecked != null)
- // Settings.Default.ShowToast = (bool)ShowToastCheckBox.IsChecked;
-
- //if (FullScreenRDBTN.IsChecked is true)
- // Settings.Default.DefaultLaunch = TextGrabMode.Fullscreen.ToString();
- //else if (GrabFrameRDBTN.IsChecked is true)
- // Settings.Default.DefaultLaunch = TextGrabMode.GrabFrame.ToString();
- //else if (EditTextRDBTN.IsChecked is true)
- // Settings.Default.DefaultLaunch = TextGrabMode.EditText.ToString();
- //else if (QuickLookupRDBTN.IsChecked is true)
- // Settings.Default.DefaultLaunch = TextGrabMode.QuickLookup.ToString();
-
- //if (ErrorCorrectBox.IsChecked is bool errorCorrect)
- // Settings.Default.CorrectErrors = errorCorrect;
-
- //if (NeverUseClipboardChkBx.IsChecked is bool neverClipboard)
- // Settings.Default.NeverAutoUseClipboard = neverClipboard;
-
- //if (RunInBackgroundChkBx.IsChecked is bool runInBackground)
- //{
- // Settings.Default.RunInTheBackground = runInBackground;
- // ImplementAppOptions.ImplementBackgroundOption(Settings.Default.RunInTheBackground);
- //}
-
- if (TryInsertCheckbox.IsChecked is bool tryInsert)
- Settings.Default.TryInsert = tryInsert;
-
- //if (StartupOnLoginCheckBox.IsChecked is bool startupOnLogin)
- //{
- // Settings.Default.StartupOnLogin = startupOnLogin;
- // await ImplementAppOptions.ImplementStartupOption(Settings.Default.StartupOnLogin);
- //}
-
- if (GlobalHotkeysCheckbox.IsChecked is bool globalHotKeys)
- Settings.Default.GlobalHotkeysEnabled = globalHotKeys;
-
- if (ReadBarcodesBarcode.IsChecked is bool readBarcodes)
- Settings.Default.TryToReadBarcodes = readBarcodes;
-
- if (UseTesseractCheckBox.IsChecked is bool useTesseract)
- Settings.Default.UseTesseract = useTesseract;
-
- if (ReadBarcodesBarcode.IsChecked is not null)
- Settings.Default.TryToReadBarcodes = (bool)ReadBarcodesBarcode.IsChecked;
-
- //if (CorrectToLatin.IsChecked is not null)
- // Settings.Default.CorrectToLatin = (bool)CorrectToLatin.IsChecked;
-
- if (HistorySwitch.IsChecked is not null)
- Settings.Default.UseHistory = (bool)HistorySwitch.IsChecked;
-
- if (HotKeysAllDifferent())
- {
- List shortcutKeys = [];
-
- foreach (UIElement child in ShortcutsStackPanel.Children)
- if (child is ShortcutControl control)
- shortcutKeys.Add(control.KeySet);
-
- ShortcutKeysUtilities.SaveShortcutKeySetSettings(shortcutKeys);
- }
-
- if (!string.IsNullOrEmpty(SecondsTextBox.Text))
- Settings.Default.InsertDelay = InsertDelaySeconds;
-
- if (File.Exists(TesseractPathTextBox.Text))
- Settings.Default.TesseractPath = TesseractPathTextBox.Text;
-
- Settings.Default.Save();
-
- App app = (App)App.Current;
- if (app.TextGrabIcon != null)
- {
- NotifyIconUtilities.UnregisterHotkeys(app);
- NotifyIconUtilities.RegisterHotKeys(app);
- }
- App.SetTheme();
-
- Close();
- }
-
- private void ShortcutControl_Recording(object sender, EventArgs e)
- {
- foreach (UIElement child in ShortcutsStackPanel.Children)
- if (child is ShortcutControl shortcutControl
- && sender is ShortcutControl senderShortcut
- && shortcutControl != senderShortcut)
- shortcutControl.StopRecording(sender);
- }
-
- private void ShortcutControl_KeySetChanged(object sender, EventArgs e)
- {
- HotKeysAllDifferent();
- }
-
- private void TesseractPathTextBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- if (sender is not TextBox pathTextbox || pathTextbox.Text is not string pathText)
- return;
-
- if (File.Exists(pathText))
- UseTesseractCheckBox.IsEnabled = true;
- else
- UseTesseractCheckBox.IsEnabled = false;
- }
-
- private void TessInfoCloseHypBtn_Click(object sender, RoutedEventArgs e)
- {
- TessMoreInfoBorder.Visibility = Visibility.Collapsed;
- }
-
- private void ValidateTextIsNumber(object sender, TextChangedEventArgs e)
- {
- if (!IsLoaded)
- return;
-
- if (sender is TextBox numberInputBox)
- {
- bool wasAbleToConvert = double.TryParse(numberInputBox.Text, out double parsedText);
- if (wasAbleToConvert && parsedText > 0 && parsedText < 10)
- {
- InsertDelaySeconds = parsedText;
- DelayTimeErrorSeconds.Visibility = Visibility.Collapsed;
- numberInputBox.BorderBrush = GoodBrush;
- }
- else
- {
- InsertDelaySeconds = 3;
- DelayTimeErrorSeconds.Visibility = Visibility.Visible;
- numberInputBox.BorderBrush = BadBrush;
- }
- }
- }
-
private void Window_Closed(object? sender, EventArgs e)
{
Settings.Default.Save();
@@ -329,128 +34,12 @@ private void Window_Closed(object? sender, EventArgs e)
WindowUtilities.ShouldShutDown();
}
- private async void Window_Loaded(object sender, RoutedEventArgs e)
+ private void Window_Loaded(object sender, RoutedEventArgs e)
{
SettingsNavView.Navigate(typeof(GeneralSettings));
- RunInBackgroundChkBx.IsChecked = Settings.Default.RunInTheBackground;
- GlobalHotkeysCheckbox.IsChecked = Settings.Default.GlobalHotkeysEnabled;
-
- TryInsertCheckbox.IsChecked = Settings.Default.TryInsert;
- // ShowToastCheckBox.IsChecked = Settings.Default.ShowToast;
- ErrorCorrectBox.IsChecked = Settings.Default.CorrectErrors;
- NeverUseClipboardChkBx.IsChecked = Settings.Default.NeverAutoUseClipboard;
- ReadBarcodesBarcode.IsChecked = Settings.Default.TryToReadBarcodes;
- //CorrectToLatin.IsChecked = Settings.Default.CorrectToLatin;
- HistorySwitch.IsChecked = Settings.Default.UseHistory;
-
- InsertDelaySeconds = Settings.Default.InsertDelay;
- SecondsTextBox.Text = InsertDelaySeconds.ToString("##.#", System.Globalization.CultureInfo.InvariantCulture);
-
-
- if (ImplementAppOptions.IsPackaged())
- {
- StartupTask startupTask = await StartupTask.GetAsync("StartTextGrab");
-
- switch (startupTask.State)
- {
- case StartupTaskState.Disabled:
- // Task is disabled but can be enabled.
- StartupOnLoginCheckBox.IsChecked = false;
- break;
- case StartupTaskState.DisabledByUser:
- // Task is disabled and user must enable it manually.
- StartupOnLoginCheckBox.IsChecked = false;
- StartupOnLoginCheckBox.IsEnabled = false;
-
- StartupTextBlock.Text += "\nDisabled in Task Manager";
- break;
- case StartupTaskState.Enabled:
- StartupOnLoginCheckBox.IsChecked = true;
- break;
- }
- }
- else
- {
- StartupOnLoginCheckBox.IsChecked = Settings.Default.StartupOnLogin;
- }
-
- //TextGrabMode defaultLaunchSetting = Enum.Parse(Settings.Default.DefaultLaunch, true);
- //switch (defaultLaunchSetting)
- //{
- // case TextGrabMode.Fullscreen:
- // FullScreenRDBTN.IsChecked = true;
- // break;
- // case TextGrabMode.GrabFrame:
- // GrabFrameRDBTN.IsChecked = true;
- // break;
- // case TextGrabMode.EditText:
- // EditTextRDBTN.IsChecked = true;
- // break;
- // case TextGrabMode.QuickLookup:
- // QuickLookupRDBTN.IsChecked = true;
- // break;
- // default:
- // FullScreenRDBTN.IsChecked = true;
- // break;
- //}
-
- IEnumerable shortcutKeySets = ShortcutKeysUtilities.GetShortcutKeySetsFromSettings();
-
- foreach (ShortcutKeySet keySet in shortcutKeySets)
- {
- switch (keySet.Action)
- {
- case ShortcutKeyActions.None:
- break;
- case ShortcutKeyActions.Settings:
- break;
- case ShortcutKeyActions.Fullscreen:
- FsgShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.GrabFrame:
- GfShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.Lookup:
- QslShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.EditWindow:
- EtwShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.PreviousRegionGrab:
- GlrShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.PreviousEditWindow:
- LetwShortcutControl.KeySet = keySet;
- break;
- case ShortcutKeyActions.PreviousGrabFrame:
- LgfShortcutControl.KeySet = keySet;
- break;
- default:
- break;
- }
- }
-
if (App.Current is App app)
NotifyIconUtilities.UnregisterHotkeys(app);
-
- if (TesseractHelper.CanLocateTesseractExe())
- {
- UseTesseractCheckBox.IsChecked = Settings.Default.UseTesseract;
- TesseractPathTextBox.Text = Settings.Default.TesseractPath;
- }
- else
- {
- UseTesseractCheckBox.IsChecked = false;
- UseTesseractCheckBox.IsEnabled = false;
- Settings.Default.UseTesseract = false;
- Settings.Default.Save();
- //CouldNotFindTessTxtBlk.Visibility = Visibility.Visible;
- }
- }
- private void WinGetCodeCopyButton_Click(object sender, RoutedEventArgs e)
- {
- Clipboard.SetText(WinGetInstallTextBox.Text);
}
#endregion Methods
}