mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix RunScript command description when a filename is specified
This commit is contained in:
parent
798d6df5ff
commit
bc247395ca
@ -19,6 +19,7 @@
|
||||
#include "app/resource_finder.h"
|
||||
#include "app/script/engine.h"
|
||||
#include "base/fs.h"
|
||||
#include "fmt/format.h"
|
||||
#include "ui/manager.h"
|
||||
|
||||
#include <cstdio>
|
||||
@ -43,6 +44,7 @@ public:
|
||||
protected:
|
||||
void onLoadParams(const Params& params) override;
|
||||
void onExecute(Context* context) override;
|
||||
std::string onGetFriendlyName() const override;
|
||||
|
||||
private:
|
||||
std::string m_filename;
|
||||
@ -76,6 +78,16 @@ void RunScriptCommand::onExecute(Context* context)
|
||||
ui::Manager::getDefault()->invalidate();
|
||||
}
|
||||
|
||||
std::string RunScriptCommand::onGetFriendlyName() const
|
||||
{
|
||||
if (m_filename.empty())
|
||||
return getBaseFriendlyName();
|
||||
else
|
||||
return fmt::format("{0}: {1}",
|
||||
getBaseFriendlyName(),
|
||||
base::get_file_name(m_filename));
|
||||
}
|
||||
|
||||
Command* CommandFactory::createRunScriptCommand()
|
||||
{
|
||||
return new RunScriptCommand;
|
||||
|
Loading…
x
Reference in New Issue
Block a user