Skip to content

Commit

Permalink
2.3.3.5 - Application Focus now has Delay Before and Delay After opti…
Browse files Browse the repository at this point in the history
…ons.
  • Loading branch information
igloo-gkendall committed Dec 7, 2020
1 parent 18ac44f commit d1bdacd
Show file tree
Hide file tree
Showing 11 changed files with 148 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.4")]
[assembly: AssemblyFileVersion("2.3.3.4")]
[assembly: AssemblyVersion("2.3.3.5")]
[assembly: AssemblyFileVersion("2.3.3.5")]
[assembly: NeutralResourcesLanguageAttribute("en-CA")]
2 changes: 1 addition & 1 deletion app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<assemblyIdentity
type="win32"
name="GavinKendall.AutoScreenCapture"
version="2.3.3.4"/>
version="2.3.3.5"/>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>True/PM</dpiAware>
Expand Down
10 changes: 10 additions & 0 deletions command/CommandLineRegex.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,15 @@ public static class CommandLineRegex
/// Regex for parsing the -label command.
/// </summary>
public const string REGEX_COMMAND_LINE_LABEL = "^-label=(?<Label>.+)$";

/// <summary>
/// Regex for parsing the -applicationFocusDelayBefore command.
/// </summary>
public const string REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE = @"^-applicationFocusDelayBefore=(?<ApplicationFocusDelayBefore>\d{1,5})$";

/// <summary>
/// Regex for parsing the -applicationFocusDelayAfter command.
/// </summary>
public const string REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER = @"^-applicationFocusDelayAfter=(?<ApplicationFocusDelayAfter>\d{1,5})$";
}
}
5 changes: 3 additions & 2 deletions interface/FormAbout.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="richTextBoxDeveloper.Text" xml:space="preserve">
<value>Auto Screen Capture 2.3.3.4 ("Boombayah")
<value>Auto Screen Capture 2.3.3.5 ("Boombayah")
Developed by Gavin Kendall (2008 - 2020)

SourceForge Project Site
Expand Down Expand Up @@ -322,7 +322,8 @@ END OF TERMS AND CONDITIONS</value>
</data>
<data name="richTextBoxChangelog.Text" xml:space="preserve">
<value>Codename "Boombayah"
2.3.3.4 Bug fix to saving of file when adding screenshot to collection.
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.
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.
2.3.3.1 New command line arguments -activeWindowTitle, -applicationFocus, and -label.
Expand Down
32 changes: 32 additions & 0 deletions interface/main/FormMain-CommandLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ private void ParseCommandLineArguments(string[] args)
}

RefreshApplicationFocusList();

DoApplicationFocus();
}
}

Expand Down Expand Up @@ -468,6 +470,36 @@ private void ParseCommandLineArguments(string[] args)
comboBoxScreenshotLabel.Text = label;
}
}

// -applicationFocusDelayBefore=x
if (Regex.IsMatch(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE))
{
int delayBefore = Convert.ToInt32(Regex.Match(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_BEFORE).Groups["ApplicationFocusDelayBefore"].Value);

Settings.User.SetValueByKey("ApplicationFocusDelayBefore", delayBefore);

if (!Settings.User.Save())
{
_screenCapture.ApplicationError = true;
}

numericUpDownApplicationFocusDelayBefore.Value = delayBefore;
}

// -applicationFocusDelayAfter=x
if (Regex.IsMatch(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER))
{
int delayAfter = Convert.ToInt32(Regex.Match(arg, CommandLineRegex.REGEX_COMMAND_LINE_APPLICATION_FOCUS_DELAY_AFTER).Groups["ApplicationFocusDelayAfter"].Value);

Settings.User.SetValueByKey("ApplicationFocusDelayAfter", delayAfter);

if (!Settings.User.Save())
{
_screenCapture.ApplicationError = true;
}

numericUpDownApplicationFocusDelayAfter.Value = delayAfter;
}
}

if (ScreenCapture.AutoStartFromCommandLine)
Expand Down
2 changes: 1 addition & 1 deletion interface/main/FormMain-ScreenCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private void TakeScreenshot(bool captureNow)
_screenCapture.DateTimePreviousCycle = dtNow;
}

ScreenCapture.SetApplicationFocus(comboBoxProcessList.Text);
DoApplicationFocus();

_screenCapture.ActiveWindowTitle = _screenCapture.GetActiveWindowTitle();

Expand Down
7 changes: 6 additions & 1 deletion interface/main/FormMain-Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ private void SaveSettings()

// Application Focus
Settings.User.GetByKey("ApplicationFocus", DefaultSettings.ApplicationFocus).Value = comboBoxProcessList.Text;
Settings.User.GetByKey("ApplicationFocusDelayBefore", DefaultSettings.ApplicationFocusDelayBefore).Value = (int)numericUpDownApplicationFocusDelayBefore.Value;
Settings.User.GetByKey("ApplicationFocusDelayAfter", DefaultSettings.ApplicationFocusDelayAfter).Value = (int)numericUpDownApplicationFocusDelayAfter.Value;

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

comboBoxProcessList.SelectedIndex = comboBoxProcessList.Items.IndexOf(applicationFocus);
comboBoxProcessList.SelectedIndex = comboBoxProcessList.Items.IndexOf(applicationFocus);

numericUpDownApplicationFocusDelayBefore.Value = Convert.ToInt32(Settings.User.GetByKey("ApplicationFocusDelayBefore", DefaultSettings.ApplicationFocusDelayBefore).Value);
numericUpDownApplicationFocusDelayAfter.Value = Convert.ToInt32(Settings.User.GetByKey("ApplicationFocusDelayAfter", DefaultSettings.ApplicationFocusDelayAfter).Value);
}
}
}
81 changes: 71 additions & 10 deletions interface/main/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d1bdacd

Please sign in to comment.