mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Conditionally compile the license activation code when the ENABLE_DRM flag is defined
This commit is contained in:
parent
122769c836
commit
588d8027f4
@ -177,6 +177,13 @@ Export Warning
|
||||
<<{0}
|
||||
||&Yes||&No
|
||||
END
|
||||
enter_license_disabled = <<<END
|
||||
Information
|
||||
<<This copy of Aseprite does not support entering a license key.
|
||||
<<Consider getting one from https://aseprite.org/download.
|
||||
<<Activating Aseprite will give you access to automatic updates.
|
||||
||&OK
|
||||
END
|
||||
|
||||
[brush_slot_params]
|
||||
brush = Brush:
|
||||
|
@ -7,6 +7,14 @@
|
||||
#include "app/app.h"
|
||||
#include "app/commands/command.h"
|
||||
#include "app/context.h"
|
||||
#include "ver/info.h"
|
||||
|
||||
#ifdef ENABLE_DRM
|
||||
#include "drm/license_manager.h"
|
||||
#else
|
||||
#include "app/i18n/strings.h"
|
||||
#include "ui/alert.h"
|
||||
#endif
|
||||
|
||||
#include "enter_license.xml.h"
|
||||
|
||||
@ -26,16 +34,26 @@ EnterLicenseCommand::EnterLicenseCommand()
|
||||
|
||||
void EnterLicenseCommand::onExecute(Context* context)
|
||||
{
|
||||
#ifdef ENABLE_DRM
|
||||
// Load the window widget
|
||||
app::gen::EnterLicense window;
|
||||
|
||||
window.setSizeable(false);
|
||||
window.licenseKey()->Change.connect([&window]() {
|
||||
window.licenseKey()->setText(base::string_to_upper(window.licenseKey()->text()));
|
||||
window.okButton()->setEnabled(window.licenseKey()->text().size() > 0);
|
||||
});
|
||||
window.okButton()->setEnabled(false);
|
||||
window.okButton()->Click.connect([&window](ui::Event&) {
|
||||
drm::LicenseManager::instance()->activate(window.licenseKey()->text(), get_app_name(), get_app_version());
|
||||
window.closeWindow(nullptr);
|
||||
});
|
||||
|
||||
// Open the window
|
||||
window.openWindowInForeground();
|
||||
#else
|
||||
ui::Alert::show(Strings::alerts_enter_license_disabled());
|
||||
#endif
|
||||
}
|
||||
|
||||
Command* CommandFactory::createRegisterCommand()
|
||||
|
Loading…
x
Reference in New Issue
Block a user