2015-02-12 23:16:25 +08:00
|
|
|
// Aseprite
|
2018-06-15 03:16:50 +08:00
|
|
|
// Copyright (C) 2001-2018 David Capello
|
2015-02-12 23:16:25 +08:00
|
|
|
//
|
2016-08-27 04:02:58 +08:00
|
|
|
// This program is distributed under the terms of
|
|
|
|
// the End-User License Agreement for Aseprite.
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2012-01-06 06:45:03 +08:00
|
|
|
#include "config.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#endif
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2016-12-07 03:03:51 +08:00
|
|
|
#include "app/app.h"
|
2013-08-06 08:20:19 +08:00
|
|
|
#include "app/commands/command.h"
|
|
|
|
#include "app/modules/gui.h"
|
2016-12-07 03:03:51 +08:00
|
|
|
#include "app/ui/main_window.h"
|
2012-01-06 06:45:03 +08:00
|
|
|
#include "base/bind.h"
|
2018-06-15 03:16:50 +08:00
|
|
|
|
|
|
|
#include "about.xml.h"
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
namespace app {
|
2012-01-06 06:45:03 +08:00
|
|
|
|
2012-06-18 09:02:54 +08:00
|
|
|
using namespace ui;
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
class AboutCommand : public Command {
|
2012-01-06 06:45:03 +08:00
|
|
|
public:
|
|
|
|
AboutCommand();
|
|
|
|
|
|
|
|
protected:
|
2015-10-01 03:34:43 +08:00
|
|
|
void onExecute(Context* context) override;
|
2012-01-06 06:45:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
AboutCommand::AboutCommand()
|
2017-12-02 02:10:21 +08:00
|
|
|
: Command(CommandId::About(), CmdUIOnlyFlag)
|
2012-01-06 06:45:03 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void AboutCommand::onExecute(Context* context)
|
|
|
|
{
|
2018-06-15 03:16:50 +08:00
|
|
|
gen::About window;
|
|
|
|
window.title()->setText(PACKAGE " v" VERSION);
|
|
|
|
window.licenses()->Click.connect(
|
2016-12-07 03:03:51 +08:00
|
|
|
[&window]{
|
2018-06-15 03:16:50 +08:00
|
|
|
window.closeWindow(nullptr);
|
2016-12-07 12:12:54 +08:00
|
|
|
App::instance()->mainWindow()->showBrowser("docs/LICENSES.md");
|
2016-12-07 03:03:51 +08:00
|
|
|
});
|
2018-06-15 03:16:50 +08:00
|
|
|
window.openWindowInForeground();
|
2012-01-06 06:45:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
Command* CommandFactory::createAboutCommand()
|
|
|
|
{
|
|
|
|
return new AboutCommand;
|
|
|
|
}
|
2013-08-06 08:20:19 +08:00
|
|
|
|
|
|
|
} // namespace app
|