logic: headless license check

* added license check when running coati in headless more.
This commit is contained in:
malte_langkabel
2016-04-22 13:45:56 +02:00
parent 3e90b62c82
commit 73973cb4a3
3 changed files with 49 additions and 41 deletions
+11 -4
View File
@@ -56,7 +56,10 @@ int main(int argc, char *argv[])
setupApp(argc, argv);
init();
std::shared_ptr<Application> app = Application::create( version );
std::shared_ptr<Application> app = Application::create(version);
std::shared_ptr<LicenseChecker> checker = LicenseChecker::getInstance();
checker->setApp(app.get());
if (commandLineParser.startedWithLicense())
{
@@ -64,8 +67,13 @@ int main(int argc, char *argv[])
return 0;
}
if (!checker->isCurrentLicenseValid()) // this works because the user cannot enter a license string while running the app in headless more.
{
LOG_WARNING("Your current Coati license seems to be invalid. Please update your license info.");
return 0;
}
commandLineParser.projectLoad();
// todo: set app of license checker.
return qtApp.exec();
}
else
@@ -82,11 +90,10 @@ int main(int argc, char *argv[])
QtViewFactory viewFactory;
QtNetworkFactory networkFactory;
std::shared_ptr<LicenseChecker> checker = LicenseChecker::getInstance();
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
std::shared_ptr<Application> app = Application::create(version, &viewFactory, &networkFactory);
std::shared_ptr<LicenseChecker> checker = LicenseChecker::getInstance();
checker->setApp(app.get());
commandLineParser.projectLoad();