aseprite/src/app/commands/cmd_enter_license.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
965 B
C++
Raw Normal View History

// Aseprite
// Copyright (C) 2021 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#include "app/commands/command.h"
#include "app/context.h"
#ifdef ENABLE_DRM
2021-09-08 03:33:27 +08:00
#include "app/ui/enter_license.h"
#else
#include "app/i18n/strings.h"
#include "ui/alert.h"
#endif
namespace app {
class EnterLicenseCommand : public Command {
public:
EnterLicenseCommand();
2024-12-17 01:52:19 +08:00
protected:
void onExecute(Context* context) override;
};
EnterLicenseCommand::EnterLicenseCommand() : Command(CommandId::EnterLicense(), CmdUIOnlyFlag)
{
}
void EnterLicenseCommand::onExecute(Context* context)
{
#ifdef ENABLE_DRM
// Load the window widget
2021-09-08 03:33:27 +08:00
app::EnterLicense window;
// Open the window
window.openWindowInForeground();
#else
ui::Alert::show(Strings::alerts_enter_license_disabled());
#endif
}
Command* CommandFactory::createRegisterCommand()
{
return new EnterLicenseCommand;
}
} // namespace app