From 308ef7e345de3d3e6442644d0b4157e5099247f9 Mon Sep 17 00:00:00 2001 From: Jonathan Westhues Date: Tue, 29 Sep 2009 04:47:48 -0800 Subject: [PATCH] Add an additional nag screen: open the website whenever they start the program, if it's unregistered and the trial period has expired. [git-p4: depot-paths = "//depot/solvespace/": change = 2039] --- solvespace.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/solvespace.cpp b/solvespace.cpp index 6ebd9c3..ed54e3e 100644 --- a/solvespace.cpp +++ b/solvespace.cpp @@ -29,6 +29,13 @@ void SolveSpace::CheckLicenseFromRegistry(void) { const int SECONDS_IN_DAY = 60*60*24; license.trialDaysRemaining = 30 - (int)(((now - license.firstUse))/SECONDS_IN_DAY); + + if((!license.licensed) && (license.trialDaysRemaining < 0)) { + Message("The 30-day demo has expired. All exported content will " + "contain a message noting that it was generated by an " + "unregistered version of SolveSpace."); + OpenWebsite("http://solvespace.com/buyunreg"); + } } void SolveSpace::Init(char *cmdLine) {