bool UIEulaAgreement::OnEvent(const TBWidgetEvent &ev) { if (ev.type == EVENT_TYPE_CLICK) { if (ev.target->GetID() == TBIDC("quit")) { SendEvent(E_EXITREQUESTED); return true; } else if (ev.target->GetID() == TBIDC("ok")) { Editor* editor = GetSubsystem<Editor>(); if (!eulaCheck_->GetValue()) { editor->PostModalInfo("License Agreement", "Please agree to licensing terms and conditions to continue"); return true; } SharedPtr<UIEulaAgreement> keepAlive(this); GetSubsystem<UIModalOps>()->Hide(); LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>(); licenseSystem->LicenseAgreementConfirmed(); return true; } } return false; }
void AtomicTool::DoActivation() { LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>(); if (!licenseSystem->ValidateKey(activationKey_)) { ErrorExit(ToString("\nProduct key \"%s\" is invalid, keys are in the form ATOMIC-XXXX-XXXX-XXXX-XXXX\n", activationKey_.CString())); return; } licenseSystem->LicenseAgreementConfirmed(); SubscribeToEvent(E_LICENSE_ACTIVATIONERROR, HANDLER(AtomicTool, HandleLicenseActivationError)); SubscribeToEvent(E_LICENSE_ACTIVATIONSUCCESS, HANDLER(AtomicTool, HandleLicenseActivationSuccess)); licenseSystem->RequestServerActivation(activationKey_); }