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