* Added non-commercial use option to enter license window * Show enter license window on first start and force license selection * Added ApplicationSettings migration that removed private/academic license and switches user to non-commercial mode * Added commandline option to choose non-commercial use and provide better hints to license selection * Removed trial mode fortune cookie message = A secret admirer will soon send you a sign of affection.
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
#ifndef LICENSE_CHECKER_H
|
|
#define LICENSE_CHECKER_H
|
|
|
|
#include "utility/messaging/type/MessageEnteredLicense.h"
|
|
|
|
class License;
|
|
|
|
class LicenseChecker
|
|
{
|
|
public:
|
|
enum LicenseState
|
|
{
|
|
LICENSE_EMPTY,
|
|
LICENSE_MOVED,
|
|
LICENSE_MALFORMED,
|
|
LICENSE_INVALID,
|
|
LICENSE_EXPIRED,
|
|
LICENSE_VALID
|
|
};
|
|
|
|
static void createInstance();
|
|
static std::shared_ptr<LicenseChecker> getInstance();
|
|
|
|
~LicenseChecker();
|
|
|
|
std::string getCurrentLicenseString() const;
|
|
void saveCurrentLicenseString(const std::string& licenseString) const;
|
|
|
|
bool isCurrentLicenseValid();
|
|
LicenseState checkCurrentLicense() const;
|
|
LicenseState checkLicenseString(const std::string& licenseString) const;
|
|
|
|
MessageEnteredLicense::LicenseType getCurrentLicenseType() const;
|
|
MessageEnteredLicense::LicenseType getLicenseType(const std::string& licenseString) const;
|
|
|
|
private:
|
|
LicenseChecker();
|
|
LicenseChecker(const LicenseChecker&) = delete;
|
|
void operator=(const LicenseChecker&) = delete;
|
|
|
|
LicenseState checkLicense(License& license) const;
|
|
|
|
static std::shared_ptr<LicenseChecker> s_instance;
|
|
};
|
|
|
|
#endif // LICENSE_CHECKER_H
|