Skip to content

Commit d1bdacd

Browse files
2.3.3.5 - Application Focus now has Delay Before and Delay After options.
1 parent 18ac44f commit d1bdacd

File tree

11 files changed

+148
-18
lines changed

11 files changed

+148
-18
lines changed

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.3.3.4")]
36-
[assembly: AssemblyFileVersion("2.3.3.4")]
35+
[assembly: AssemblyVersion("2.3.3.5")]
36+
[assembly: AssemblyFileVersion("2.3.3.5")]
3737
[assembly: NeutralResourcesLanguageAttribute("en-CA")]

app.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<assemblyIdentity
44
type="win32"
55
name="GavinKendall.AutoScreenCapture"
6-
version="2.3.3.4"/>
6+
version="2.3.3.5"/>
77
<asmv3:application>
88
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
99
<dpiAware>True/PM</dpiAware>

command/CommandLineRegex.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,15 @@ public static class CommandLineRegex
150150
/// Regex for parsing the -label command.
151151
/// </summary>
152152
public const string REGEX_COMMAND_LINE_LABEL = "^-label=(?<Label>.+)$";
153+
154+
/// <summary>
155+
/// Regex for parsing the -applicationFocusDelayBefore command.
156+
/// </summary>
157+
public const string REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE = @"^-applicationFocusDelayBefore=(?<ApplicationFocusDelayBefore>\d{1,5})$";
158+
159+
/// <summary>
160+
/// Regex for parsing the -applicationFocusDelayAfter command.
161+
/// </summary>
162+
public const string REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER = @"^-applicationFocusDelayAfter=(?<ApplicationFocusDelayAfter>\d{1,5})$";
153163
}
154164
}

interface/FormAbout.resx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<data name="richTextBoxDeveloper.Text" xml:space="preserve">
121-
<value>Auto Screen Capture 2.3.3.4 ("Boombayah")
121+
<value>Auto Screen Capture 2.3.3.5 ("Boombayah")
122122
Developed by Gavin Kendall (2008 - 2020)
123123

124124
SourceForge Project Site
@@ -322,7 +322,8 @@ END OF TERMS AND CONDITIONS</value>
322322
</data>
323323
<data name="richTextBoxChangelog.Text" xml:space="preserve">
324324
<value>Codename "Boombayah"
325-
2.3.3.4 Bug fix to saving of file when adding screenshot to collection.
325+
2.3.3.5 Application Focus now has Delay Before and Delay After options.
326+
2.3.3.4 A bug fix for saving of file when adding screenshot to collection.
326327
2.3.3.3 An internal list of image hash values are stored when emailing screenshots so we do not email duplicate images.
327328
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.
328329
2.3.3.1 New command line arguments -activeWindowTitle, -applicationFocus, and -label.

interface/main/FormMain-CommandLine.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ private void ParseCommandLineArguments(string[] args)
439439
}
440440

441441
RefreshApplicationFocusList();
442+
443+
DoApplicationFocus();
442444
}
443445
}
444446

@@ -468,6 +470,36 @@ private void ParseCommandLineArguments(string[] args)
468470
comboBoxScreenshotLabel.Text = label;
469471
}
470472
}
473+
474+
// -applicationFocusDelayBefore=x
475+
if (Regex.IsMatch(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE))
476+
{
477+
int delayBefore = Convert.ToInt32(Regex.Match(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE).Groups["ApplicationFocusDelayBefore"].Value);
478+
479+
Settings.User.SetValueByKey("ApplicationFocusDelayBefore", delayBefore);
480+
481+
if (!Settings.User.Save())
482+
{
483+
_screenCapture.ApplicationError = true;
484+
}
485+
486+
numericUpDownApplicationFocusDelayBefore.Value = delayBefore;
487+
}
488+
489+
// -applicationFocusDelayAfter=x
490+
if (Regex.IsMatch(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER))
491+
{
492+
int delayAfter = Convert.ToInt32(Regex.Match(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER).Groups["ApplicationFocusDelayAfter"].Value);
493+
494+
Settings.User.SetValueByKey("ApplicationFocusDelayAfter", delayAfter);
495+
496+
if (!Settings.User.Save())
497+
{
498+
_screenCapture.ApplicationError = true;
499+
}
500+
501+
numericUpDownApplicationFocusDelayAfter.Value = delayAfter;
502+
}
471503
}
472504

473505
if (ScreenCapture.AutoStartFromCommandLine)

interface/main/FormMain-ScreenCapture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private void TakeScreenshot(bool captureNow)
180180
_screenCapture.DateTimePreviousCycle = dtNow;
181181
}
182182

183-
ScreenCapture.SetApplicationFocus(comboBoxProcessList.Text);
183+
DoApplicationFocus();
184184

185185
_screenCapture.ActiveWindowTitle = _screenCapture.GetActiveWindowTitle();
186186

interface/main/FormMain-Settings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ private void SaveSettings()
241241

242242
// Application Focus
243243
Settings.User.GetByKey("ApplicationFocus", DefaultSettings.ApplicationFocus).Value = comboBoxProcessList.Text;
244+
Settings.User.GetByKey("ApplicationFocusDelayBefore", DefaultSettings.ApplicationFocusDelayBefore).Value = (int)numericUpDownApplicationFocusDelayBefore.Value;
245+
Settings.User.GetByKey("ApplicationFocusDelayAfter", DefaultSettings.ApplicationFocusDelayAfter).Value = (int)numericUpDownApplicationFocusDelayAfter.Value;
244246

245247
// Region Select / Auto Save.
246248
Settings.User.GetByKey("AutoSaveFolder", DefaultSettings.AutoSaveFolder).Value = textBoxAutoSaveFolder.Text.Trim();
@@ -297,7 +299,10 @@ private void RefreshApplicationFocusList()
297299
comboBoxProcessList.Items.Add(applicationFocus);
298300
}
299301

300-
comboBoxProcessList.SelectedIndex = comboBoxProcessList.Items.IndexOf(applicationFocus);
302+
comboBoxProcessList.SelectedIndex = comboBoxProcessList.Items.IndexOf(applicationFocus);
303+
304+
numericUpDownApplicationFocusDelayBefore.Value = Convert.ToInt32(Settings.User.GetByKey("ApplicationFocusDelayBefore", DefaultSettings.ApplicationFocusDelayBefore).Value);
305+
numericUpDownApplicationFocusDelayAfter.Value = Convert.ToInt32(Settings.User.GetByKey("ApplicationFocusDelayAfter", DefaultSettings.ApplicationFocusDelayAfter).Value);
301306
}
302307
}
303308
}

interface/main/FormMain.Designer.cs

Lines changed: 71 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)