diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index dbdf68b8..86dc2863 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.3.5")] -[assembly: AssemblyFileVersion("2.3.3.5")] +[assembly: AssemblyVersion("2.3.3.6")] +[assembly: AssemblyFileVersion("2.3.3.6")] [assembly: NeutralResourcesLanguageAttribute("en-CA")] \ No newline at end of file diff --git a/app.manifest b/app.manifest index 2d934144..a88c4246 100644 --- a/app.manifest +++ b/app.manifest @@ -3,7 +3,7 @@ + version="2.3.3.6"/> True/PM diff --git a/autoscreen.csproj b/autoscreen.csproj index 64669515..5e794aae 100644 --- a/autoscreen.csproj +++ b/autoscreen.csproj @@ -71,10 +71,11 @@ app.manifest - true + false - autoscreen.pfx + + @@ -325,7 +326,6 @@ - diff --git a/autoscreen.pfx b/autoscreen.pfx deleted file mode 100644 index 0ffd0072..00000000 Binary files a/autoscreen.pfx and /dev/null differ diff --git a/interface/FormAbout.resx b/interface/FormAbout.resx index 53fb53bb..74d1db7a 100644 --- a/interface/FormAbout.resx +++ b/interface/FormAbout.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Auto Screen Capture 2.3.3.5 ("Boombayah") + Auto Screen Capture 2.3.3.6 ("Boombayah") Developed by Gavin Kendall (2008 - 2020) SourceForge Project Site @@ -322,6 +322,7 @@ END OF TERMS AND CONDITIONS Codename "Boombayah" +2.3.3.6 Active Window Title text comparison includes type of match to use during text comparison. 2.3.3.5 Application Focus now has Delay Before and Delay After options. 2.3.3.4 A bug fix for saving of file when adding screenshot to collection. 2.3.3.3 An internal list of image hash values are stored when emailing screenshots so we do not email duplicate images. diff --git a/interface/main/FormMain-ScreenCapture.cs b/interface/main/FormMain-ScreenCapture.cs index 2314565a..cbb4ab12 100644 --- a/interface/main/FormMain-ScreenCapture.cs +++ b/interface/main/FormMain-ScreenCapture.cs @@ -21,6 +21,7 @@ using System; using System.Drawing; using System.Windows.Forms; +using System.Text.RegularExpressions; namespace AutoScreenCapture { @@ -70,7 +71,15 @@ private void EnableStartCapture() groupBoxActiveWindowTitle.Enabled = true; checkBoxActiveWindowTitle.Enabled = true; - textBoxActiveWindowTitle.Enabled = true; + + groupBoxApplicationFocus.Enabled = true; + comboBoxProcessList.Enabled = true; + labelApplicationFocusDelayBefore.Enabled = true; + labelApplicationFocusDelayAfter.Enabled = true; + numericUpDownApplicationFocusDelayBefore.Enabled = true; + numericUpDownApplicationFocusDelayAfter.Enabled = true; + buttonApplicationFocusTest.Enabled = true; + buttonApplicationFocusRefresh.Enabled = true; } else { @@ -107,7 +116,15 @@ private void EnableStopScreenCapture() groupBoxActiveWindowTitle.Enabled = false; checkBoxActiveWindowTitle.Enabled = false; - textBoxActiveWindowTitle.Enabled = false; + + groupBoxApplicationFocus.Enabled = false; + comboBoxProcessList.Enabled = false; + labelApplicationFocusDelayBefore.Enabled = false; + labelApplicationFocusDelayAfter.Enabled = false; + numericUpDownApplicationFocusDelayBefore.Enabled = false; + numericUpDownApplicationFocusDelayAfter.Enabled = false; + buttonApplicationFocusTest.Enabled = false; + buttonApplicationFocusRefresh.Enabled = false; } /// @@ -186,15 +203,10 @@ private void TakeScreenshot(bool captureNow) _screenCapture.ActiveWindowProcessName = _screenCapture.GetActiveWindowProcessName(); - if (!string.IsNullOrEmpty(_screenCapture.ActiveWindowTitle)) + // Do not continue if the active window title needs to be checked and the active window title does not contain the defined text or regex pattern. + if (checkBoxActiveWindowTitle.Checked && !ActiveWindowTitleMatchesText()) { - // Do not continue if the active window title needs to be checked and the active window title - // does not contain the text defined in "Active Window Title Capture Text". - if (checkBoxActiveWindowTitle.Checked && !string.IsNullOrEmpty(textBoxActiveWindowTitle.Text) && - !_screenCapture.ActiveWindowTitle.ToLower().Contains(textBoxActiveWindowTitle.Text.ToLower())) - { - return; - } + return; } RunRegionCaptures(); @@ -642,5 +654,35 @@ private void timerScreenCapture_Tick(object sender, EventArgs e) StopScreenCapture(); } } + + private bool ActiveWindowTitleMatchesText() + { + try + { + if (!string.IsNullOrEmpty(_screenCapture.ActiveWindowTitle) && !string.IsNullOrEmpty(textBoxActiveWindowTitle.Text)) + { + if (radioButtonCaseSensitiveMatch.Checked) + { + return _screenCapture.ActiveWindowTitle.Contains(textBoxActiveWindowTitle.Text); + } + else if (radioButtonCaseInsensitiveMatch.Checked) + { + return _screenCapture.ActiveWindowTitle.ToLower().Contains(textBoxActiveWindowTitle.Text.ToLower()); + } + else if (radioButtonRegularExpressionMatch.Checked) + { + return Regex.IsMatch(_screenCapture.ActiveWindowTitle, textBoxActiveWindowTitle.Text); + } + } + + return false; + } + catch (Exception ex) + { + Log.WriteExceptionMessage("FormMain-ScreenCapture::ActiveWindowTitleMatchesText", ex); + + return false; + } + } } } \ No newline at end of file diff --git a/interface/main/FormMain-Settings.cs b/interface/main/FormMain-Settings.cs index 87ccd53d..be77ed11 100644 --- a/interface/main/FormMain-Settings.cs +++ b/interface/main/FormMain-Settings.cs @@ -194,10 +194,47 @@ private void LoadSettings() checkBoxScreenshotLabel.Checked = Convert.ToBoolean(Settings.User.GetByKey("ApplyScreenshotLabel", DefaultSettings.ApplyScreenshotLabel).Value); - // The user can compare the current Active Window Title text to compare against what the text they've defined. + // Active Window Title checkBoxActiveWindowTitle.Checked = Convert.ToBoolean(Settings.User.GetByKey("ActiveWindowTitleCaptureCheck", DefaultSettings.ActiveWindowTitleCaptureCheck).Value); textBoxActiveWindowTitle.Text = Settings.User.GetByKey("ActiveWindowTitleCaptureText", DefaultSettings.ActiveWindowTitleCaptureText).Value.ToString(); + if (checkBoxActiveWindowTitle.Checked) + { + textBoxActiveWindowTitle.Enabled = true; + radioButtonCaseSensitiveMatch.Enabled = true; + radioButtonCaseInsensitiveMatch.Enabled = true; + radioButtonRegularExpressionMatch.Enabled = true; + } + else + { + textBoxActiveWindowTitle.Enabled = false; + radioButtonCaseSensitiveMatch.Enabled = false; + radioButtonCaseInsensitiveMatch.Enabled = false; + radioButtonRegularExpressionMatch.Enabled = false; + } + + radioButtonCaseSensitiveMatch.Checked = false; + radioButtonCaseInsensitiveMatch.Checked = false; + radioButtonRegularExpressionMatch.Checked = false; + + int activeWindowTitleMatchType = Convert.ToInt32(Settings.User.GetByKey("ActiveWindowTitleMatchType", DefaultSettings.ActiveWindowTitleMatchType).Value); + + switch (activeWindowTitleMatchType) + { + case 1: + radioButtonCaseSensitiveMatch.Checked = true; + break; + + case 2: + radioButtonCaseInsensitiveMatch.Checked = true; + break; + + case 3: + radioButtonRegularExpressionMatch.Checked = true; + break; + } + + // Application Focus RefreshApplicationFocusList(); @@ -235,10 +272,23 @@ private void SaveSettings() Settings.User.GetByKey("ScreenshotLabel", DefaultSettings.ScreenshotLabel).Value = comboBoxScreenshotLabel.Text.Trim(); Settings.User.GetByKey("ApplyScreenshotLabel", DefaultSettings.ApplyScreenshotLabel).Value = checkBoxScreenshotLabel.Checked; - // Active Window Title text comparison check. + // Active Window Title Settings.User.GetByKey("ActiveWindowTitleCaptureCheck", DefaultSettings.ActiveWindowTitleCaptureCheck).Value = checkBoxActiveWindowTitle.Checked; Settings.User.GetByKey("ActiveWindowTitleCaptureText", DefaultSettings.ActiveWindowTitleCaptureText).Value = textBoxActiveWindowTitle.Text.Trim(); + if (radioButtonCaseSensitiveMatch.Checked) + { + Settings.User.GetByKey("ActiveWindowTitleMatchType", DefaultSettings.ActiveWindowTitleMatchType).Value = 1; + } + else if (radioButtonCaseInsensitiveMatch.Checked) + { + Settings.User.GetByKey("ActiveWindowTitleMatchType", DefaultSettings.ActiveWindowTitleMatchType).Value = 2; + } + else if (radioButtonRegularExpressionMatch.Checked) + { + Settings.User.GetByKey("ActiveWindowTitleMatchType", DefaultSettings.ActiveWindowTitleMatchType).Value = 3; + } + // Application Focus Settings.User.GetByKey("ApplicationFocus", DefaultSettings.ApplicationFocus).Value = comboBoxProcessList.Text; Settings.User.GetByKey("ApplicationFocusDelayBefore", DefaultSettings.ApplicationFocusDelayBefore).Value = (int)numericUpDownApplicationFocusDelayBefore.Value; diff --git a/interface/main/FormMain.Designer.cs b/interface/main/FormMain.Designer.cs index 3d263db2..c905f27b 100644 --- a/interface/main/FormMain.Designer.cs +++ b/interface/main/FormMain.Designer.cs @@ -67,6 +67,8 @@ private void InitializeComponent() this.tabControlModules = new System.Windows.Forms.TabControl(); this.tabPageSetup = new System.Windows.Forms.TabPage(); this.groupBoxApplicationFocus = new System.Windows.Forms.GroupBox(); + this.numericUpDownApplicationFocusDelayAfter = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownApplicationFocusDelayBefore = new System.Windows.Forms.NumericUpDown(); this.labelApplicationFocusDelayAfter = new System.Windows.Forms.Label(); this.labelApplicationFocusDelayBefore = new System.Windows.Forms.Label(); this.buttonApplicationFocusTest = new System.Windows.Forms.Button(); @@ -79,6 +81,9 @@ private void InitializeComponent() this.textBoxAutoSaveMacro = new System.Windows.Forms.TextBox(); this.textBoxAutoSaveFolder = new System.Windows.Forms.TextBox(); this.groupBoxActiveWindowTitle = new System.Windows.Forms.GroupBox(); + this.radioButtonRegularExpressionMatch = new System.Windows.Forms.RadioButton(); + this.radioButtonCaseSensitiveMatch = new System.Windows.Forms.RadioButton(); + this.radioButtonCaseInsensitiveMatch = new System.Windows.Forms.RadioButton(); this.textBoxActiveWindowTitle = new System.Windows.Forms.TextBox(); this.checkBoxActiveWindowTitle = new System.Windows.Forms.CheckBox(); this.groupBoxSecurity = new System.Windows.Forms.GroupBox(); @@ -133,13 +138,13 @@ private void InitializeComponent() this.labelLabel = new System.Windows.Forms.Label(); this.labelHelp = new System.Windows.Forms.Label(); this.timerShowNextHelpTip = new System.Windows.Forms.Timer(this.components); - this.numericUpDownApplicationFocusDelayBefore = new System.Windows.Forms.NumericUpDown(); - this.numericUpDownApplicationFocusDelayAfter = new System.Windows.Forms.NumericUpDown(); this.statusStrip.SuspendLayout(); this.contextMenuStripSystemTrayIcon.SuspendLayout(); this.tabControlModules.SuspendLayout(); this.tabPageSetup.SuspendLayout(); this.groupBoxApplicationFocus.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayAfter)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayBefore)).BeginInit(); this.groupBoxRegionSelectAutoSave.SuspendLayout(); this.groupBoxActiveWindowTitle.SuspendLayout(); this.groupBoxSecurity.SuspendLayout(); @@ -151,8 +156,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.numericUpDownHoursInterval)).BeginInit(); this.tabPageScreenshots.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeepScreenshotsForDays)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayBefore)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayAfter)).BeginInit(); this.SuspendLayout(); // // monthCalendar @@ -491,13 +494,39 @@ private void InitializeComponent() this.groupBoxApplicationFocus.Controls.Add(this.buttonApplicationFocusTest); this.groupBoxApplicationFocus.Controls.Add(this.buttonApplicationFocusRefresh); this.groupBoxApplicationFocus.Controls.Add(this.comboBoxProcessList); - this.groupBoxApplicationFocus.Location = new System.Drawing.Point(6, 256); + this.groupBoxApplicationFocus.Location = new System.Drawing.Point(6, 323); this.groupBoxApplicationFocus.Name = "groupBoxApplicationFocus"; this.groupBoxApplicationFocus.Size = new System.Drawing.Size(205, 128); this.groupBoxApplicationFocus.TabIndex = 0; this.groupBoxApplicationFocus.TabStop = false; this.groupBoxApplicationFocus.Text = "Application Focus"; // + // numericUpDownApplicationFocusDelayAfter + // + this.numericUpDownApplicationFocusDelayAfter.Location = new System.Drawing.Point(147, 71); + this.numericUpDownApplicationFocusDelayAfter.Maximum = new decimal(new int[] { + 60000, + 0, + 0, + 0}); + this.numericUpDownApplicationFocusDelayAfter.Name = "numericUpDownApplicationFocusDelayAfter"; + this.numericUpDownApplicationFocusDelayAfter.Size = new System.Drawing.Size(51, 20); + this.numericUpDownApplicationFocusDelayAfter.TabIndex = 3; + this.numericUpDownApplicationFocusDelayAfter.TabStop = false; + // + // numericUpDownApplicationFocusDelayBefore + // + this.numericUpDownApplicationFocusDelayBefore.Location = new System.Drawing.Point(148, 47); + this.numericUpDownApplicationFocusDelayBefore.Maximum = new decimal(new int[] { + 60000, + 0, + 0, + 0}); + this.numericUpDownApplicationFocusDelayBefore.Name = "numericUpDownApplicationFocusDelayBefore"; + this.numericUpDownApplicationFocusDelayBefore.Size = new System.Drawing.Size(51, 20); + this.numericUpDownApplicationFocusDelayBefore.TabIndex = 0; + this.numericUpDownApplicationFocusDelayBefore.TabStop = false; + // // labelApplicationFocusDelayAfter // this.labelApplicationFocusDelayAfter.AutoSize = true; @@ -555,7 +584,7 @@ private void InitializeComponent() this.groupBoxRegionSelectAutoSave.Controls.Add(this.labelAutoSaveFolder); this.groupBoxRegionSelectAutoSave.Controls.Add(this.textBoxAutoSaveMacro); this.groupBoxRegionSelectAutoSave.Controls.Add(this.textBoxAutoSaveFolder); - this.groupBoxRegionSelectAutoSave.Location = new System.Drawing.Point(6, 390); + this.groupBoxRegionSelectAutoSave.Location = new System.Drawing.Point(6, 457); this.groupBoxRegionSelectAutoSave.Name = "groupBoxRegionSelectAutoSave"; this.groupBoxRegionSelectAutoSave.Size = new System.Drawing.Size(205, 78); this.groupBoxRegionSelectAutoSave.TabIndex = 0; @@ -610,15 +639,48 @@ private void InitializeComponent() // // groupBoxActiveWindowTitle // + this.groupBoxActiveWindowTitle.Controls.Add(this.radioButtonRegularExpressionMatch); + this.groupBoxActiveWindowTitle.Controls.Add(this.radioButtonCaseSensitiveMatch); + this.groupBoxActiveWindowTitle.Controls.Add(this.radioButtonCaseInsensitiveMatch); this.groupBoxActiveWindowTitle.Controls.Add(this.textBoxActiveWindowTitle); this.groupBoxActiveWindowTitle.Controls.Add(this.checkBoxActiveWindowTitle); this.groupBoxActiveWindowTitle.Location = new System.Drawing.Point(6, 178); this.groupBoxActiveWindowTitle.Name = "groupBoxActiveWindowTitle"; - this.groupBoxActiveWindowTitle.Size = new System.Drawing.Size(205, 72); + this.groupBoxActiveWindowTitle.Size = new System.Drawing.Size(205, 139); this.groupBoxActiveWindowTitle.TabIndex = 0; this.groupBoxActiveWindowTitle.TabStop = false; this.groupBoxActiveWindowTitle.Text = "Active Window Title"; // + // radioButtonRegularExpressionMatch + // + this.radioButtonRegularExpressionMatch.AutoSize = true; + this.radioButtonRegularExpressionMatch.Location = new System.Drawing.Point(6, 114); + this.radioButtonRegularExpressionMatch.Name = "radioButtonRegularExpressionMatch"; + this.radioButtonRegularExpressionMatch.Size = new System.Drawing.Size(149, 17); + this.radioButtonRegularExpressionMatch.TabIndex = 0; + this.radioButtonRegularExpressionMatch.Text = "Regular Expression Match"; + this.radioButtonRegularExpressionMatch.UseVisualStyleBackColor = true; + // + // radioButtonCaseSensitiveMatch + // + this.radioButtonCaseSensitiveMatch.AutoSize = true; + this.radioButtonCaseSensitiveMatch.Location = new System.Drawing.Point(6, 68); + this.radioButtonCaseSensitiveMatch.Name = "radioButtonCaseSensitiveMatch"; + this.radioButtonCaseSensitiveMatch.Size = new System.Drawing.Size(128, 17); + this.radioButtonCaseSensitiveMatch.TabIndex = 0; + this.radioButtonCaseSensitiveMatch.Text = "Case Sensitive Match"; + this.radioButtonCaseSensitiveMatch.UseVisualStyleBackColor = true; + // + // radioButtonCaseInsensitiveMatch + // + this.radioButtonCaseInsensitiveMatch.AutoSize = true; + this.radioButtonCaseInsensitiveMatch.Location = new System.Drawing.Point(6, 91); + this.radioButtonCaseInsensitiveMatch.Name = "radioButtonCaseInsensitiveMatch"; + this.radioButtonCaseInsensitiveMatch.Size = new System.Drawing.Size(135, 17); + this.radioButtonCaseInsensitiveMatch.TabIndex = 0; + this.radioButtonCaseInsensitiveMatch.Text = "Case Insensitive Match"; + this.radioButtonCaseInsensitiveMatch.UseVisualStyleBackColor = true; + // // textBoxActiveWindowTitle // this.textBoxActiveWindowTitle.Enabled = false; @@ -646,7 +708,7 @@ private void InitializeComponent() this.groupBoxSecurity.Controls.Add(this.labelPasswordDescription); this.groupBoxSecurity.Controls.Add(this.buttonSetPassphrase); this.groupBoxSecurity.Controls.Add(this.textBoxPassphrase); - this.groupBoxSecurity.Location = new System.Drawing.Point(6, 474); + this.groupBoxSecurity.Location = new System.Drawing.Point(6, 541); this.groupBoxSecurity.Name = "groupBoxSecurity"; this.groupBoxSecurity.Size = new System.Drawing.Size(205, 110); this.groupBoxSecurity.TabIndex = 0; @@ -985,7 +1047,6 @@ private void InitializeComponent() // // timerScheduledCapture // - this.timerScheduledCapture.Enabled = false; this.timerScheduledCapture.Interval = 1000; this.timerScheduledCapture.Tick += new System.EventHandler(this.timerScheduledCapture_Tick); // @@ -1228,32 +1289,6 @@ private void InitializeComponent() this.timerShowNextHelpTip.Interval = 20000; this.timerShowNextHelpTip.Tick += new System.EventHandler(this.timerShowNextHelpTip_Tick); // - // numericUpDownApplicationFocusDelayBefore - // - this.numericUpDownApplicationFocusDelayBefore.Location = new System.Drawing.Point(148, 47); - this.numericUpDownApplicationFocusDelayBefore.Maximum = new decimal(new int[] { - 60000, - 0, - 0, - 0}); - this.numericUpDownApplicationFocusDelayBefore.Name = "numericUpDownApplicationFocusDelayBefore"; - this.numericUpDownApplicationFocusDelayBefore.Size = new System.Drawing.Size(51, 20); - this.numericUpDownApplicationFocusDelayBefore.TabIndex = 0; - this.numericUpDownApplicationFocusDelayBefore.TabStop = false; - // - // numericUpDownApplicationFocusDelayAfter - // - this.numericUpDownApplicationFocusDelayAfter.Location = new System.Drawing.Point(147, 71); - this.numericUpDownApplicationFocusDelayAfter.Maximum = new decimal(new int[] { - 60000, - 0, - 0, - 0}); - this.numericUpDownApplicationFocusDelayAfter.Name = "numericUpDownApplicationFocusDelayAfter"; - this.numericUpDownApplicationFocusDelayAfter.Size = new System.Drawing.Size(51, 20); - this.numericUpDownApplicationFocusDelayAfter.TabIndex = 3; - this.numericUpDownApplicationFocusDelayAfter.TabStop = false; - // // FormMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1298,6 +1333,8 @@ private void InitializeComponent() this.tabPageSetup.PerformLayout(); this.groupBoxApplicationFocus.ResumeLayout(false); this.groupBoxApplicationFocus.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayAfter)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayBefore)).EndInit(); this.groupBoxRegionSelectAutoSave.ResumeLayout(false); this.groupBoxRegionSelectAutoSave.PerformLayout(); this.groupBoxActiveWindowTitle.ResumeLayout(false); @@ -1314,8 +1351,6 @@ private void InitializeComponent() this.tabPageScreenshots.ResumeLayout(false); this.tabPageScreenshots.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeepScreenshotsForDays)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayBefore)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownApplicationFocusDelayAfter)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -1426,5 +1461,8 @@ private void InitializeComponent() private Label labelApplicationFocusDelayBefore; private NumericUpDown numericUpDownApplicationFocusDelayAfter; private NumericUpDown numericUpDownApplicationFocusDelayBefore; + private RadioButton radioButtonRegularExpressionMatch; + private RadioButton radioButtonCaseSensitiveMatch; + private RadioButton radioButtonCaseInsensitiveMatch; } } \ No newline at end of file diff --git a/interface/main/FormMain.cs b/interface/main/FormMain.cs index ef72cea3..31b4ce08 100644 --- a/interface/main/FormMain.cs +++ b/interface/main/FormMain.cs @@ -438,10 +438,16 @@ private void checkBoxActiveWindowTitle_CheckedChanged(object sender, EventArgs e if (checkBoxActiveWindowTitle.Checked) { textBoxActiveWindowTitle.Enabled = true; + radioButtonCaseSensitiveMatch.Enabled = true; + radioButtonCaseInsensitiveMatch.Enabled = true; + radioButtonRegularExpressionMatch.Enabled = true; } else { textBoxActiveWindowTitle.Enabled = false; + radioButtonCaseSensitiveMatch.Enabled = false; + radioButtonCaseInsensitiveMatch.Enabled = false; + radioButtonRegularExpressionMatch.Enabled = false; } } diff --git a/log/Log.cs b/log/Log.cs index f80e7f42..0c69bf88 100644 --- a/log/Log.cs +++ b/log/Log.cs @@ -97,7 +97,7 @@ private static void Write(string message, bool writeError, Exception ex) { _mutexWriteFile.WaitOne(); - string appVersion = "[(v" + Settings.Application.GetByKey("Version", DefaultSettings.ApplicationVersion).Value + ") "; + string appVersion = "[(v" + DefaultSettings.ApplicationVersion + ") "; if (string.IsNullOrEmpty(FileSystem.DebugFolder)) { @@ -135,7 +135,7 @@ private static void Write(string message, bool writeError, Exception ex) // If we encounter an exception error it's probably better to just error out on exit // but we'll let the user decide if that's what they really want to do. - if (Convert.ToBoolean(Settings.Application.GetByKey("ExitOnError", DefaultSettings.ExitOnError).Value)) + if (Settings.Application == null || Convert.ToBoolean(Settings.Application.GetByKey("ExitOnError", DefaultSettings.ExitOnError).Value)) { Environment.Exit(1); } diff --git a/settings/DefaultSettings.cs b/settings/DefaultSettings.cs index 6c6fe80a..7b9c9f7b 100644 --- a/settings/DefaultSettings.cs +++ b/settings/DefaultSettings.cs @@ -83,6 +83,7 @@ public static class DefaultSettings internal static readonly string AutoSaveMacro = MacroParser.DefaultAutoSaveMacro; internal static readonly int ApplicationFocusDelayBefore = 0; internal static readonly int ApplicationFocusDelayAfter = 0; + internal static readonly int ActiveWindowTitleMatchType = 2; // Keyboard Shortcuts. internal static readonly bool UseKeyboardShortcuts = false; diff --git a/settings/Settings.cs b/settings/Settings.cs index c826234b..bd3cc3a1 100644 --- a/settings/Settings.cs +++ b/settings/Settings.cs @@ -176,6 +176,7 @@ public static void Initialize() _versionCollection.Add(new Version(CODENAME_BOOMBAYAH, "2.3.3.2")); // Can now run an Editor without arguments or without %filepath% tag when using Run Editor trigger action. Includes changes to version collection, change to how Application Focus behaves when application not found (so now adds the application to the process list regardless), and bug fix applied to threads. _versionCollection.Add(new Version(CODENAME_BOOMBAYAH, "2.3.3.3")); // An internal list of image hash values are stored when emailing screenshots so we do not email duplicate images. _versionCollection.Add(new Version(CODENAME_BOOMBAYAH, "2.3.3.4")); // A bug fix for saving of file when adding screenshot to collection. + _versionCollection.Add(new Version(CODENAME_BOOMBAYAH, "2.3.3.5")); // Application Focus now has Delay Before and Delay After options. Application = new SettingCollection { @@ -400,6 +401,7 @@ public static void Initialize() User.Add(new Setting("KeyboardShortcutRegionSelectEditModifier1", DefaultSettings.KeyboardShortcutRegionSelectEditModifier1)); User.Add(new Setting("KeyboardShortcutRegionSelectEditModifier2", DefaultSettings.KeyboardShortcutRegionSelectEditModifier2)); User.Add(new Setting("KeyboardShortcutRegionSelectEditKey", DefaultSettings.KeyboardShortcutRegionSelectEditKey)); + User.Add(new Setting("ActiveWindowTitleMatchType", DefaultSettings.ActiveWindowTitleMatchType)); User.Save(); }