diff --git a/src/app/commands/cmd_run_script.cpp b/src/app/commands/cmd_run_script.cpp index 5446a7bfd..23eb5ed2c 100644 --- a/src/app/commands/cmd_run_script.cpp +++ b/src/app/commands/cmd_run_script.cpp @@ -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 @@ -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;