Skip to content

Commit

Permalink
2.3.4.0 - Welcome message for FirstRun and bringing back Active Windo…
Browse files Browse the repository at this point in the history
…w to be created by default if screens.xml initially created
  • Loading branch information
gavinkendall committed Feb 26, 2021
1 parent af53e8c commit c2740c7
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
16 changes: 13 additions & 3 deletions interface/main/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,19 @@ public FormMain(Config config)
/// <param name="e"></param>
private void FormMain_Load(object sender, EventArgs e)
{
HelpMessage("Welcome to " +
_config.Settings.Application.GetByKey("Name", _config.Settings.ApplicationName).Value + " " +
_config.Settings.Application.GetByKey("Version", _config.Settings.ApplicationVersion).Value);
string name = _config.Settings.Application.GetByKey("Name", _config.Settings.ApplicationName).Value.ToString();
string version = _config.Settings.Application.GetByKey("Version", _config.Settings.ApplicationVersion).Value.ToString();

bool firstRun = Convert.ToBoolean(_config.Settings.User.GetByKey("FirstRun", _config.Settings.DefaultSettings.FirstRun).Value);

string welcome = "Welcome to " + name + " (" + version + ")";

if (firstRun)
{
welcome += " - Please click the Help button to learn how to use the application";
}

HelpMessage(welcome);

// Start the scheduled capture timer.
timerScheduledCapture.Interval = 1000;
Expand Down
28 changes: 28 additions & 0 deletions modules/screens/ScreenCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,34 @@ public bool LoadXmlFileAndAddScreens(ImageFormatCollection imageFormatCollection
{
log.WriteDebugMessage("WARNING: Unable to load screens");

if (config.Settings.VersionManager.IsOldAppVersion(config.Settings, AppCodename, AppVersion))
{
Version v2182 = config.Settings.VersionManager.Versions.Get(Settings.CODENAME_CLARA, Settings.CODEVERSION_CLARA);
Version configVersion = config.Settings.VersionManager.Versions.Get(AppCodename, AppVersion);

if (v2182 != null && configVersion != null && v2182.VersionNumber == configVersion.VersionNumber)
{
Add(new Screen()
{
ViewId = Guid.NewGuid(),
Name = "Active Window",
Folder = fileSystem.ScreenshotsFolder,
Macro = macroParser.DefaultMacro,
Component = 0,
Format = _imageFormatCollection.GetByName(ScreenCapture.DefaultImageFormat),
JpegQuality = 100,
Mouse = true,
Active = true,
X = 0,
Y = 0,
Width = 0,
Height = 0,
Source = 0,
DeviceName = string.Empty
});
}
}

AddDefaultScreens(screenCapture, macroParser, fileSystem, log);

SaveToXmlFile(config, fileSystem, log);
Expand Down

0 comments on commit c2740c7

Please sign in to comment.