[aseprite] 64/134: Add NewFrameCommand::onGetFriendlyName() to differentiate "New Empty Frame" from "New Frame"

Tobias Hansen thansen at moszumanska.debian.org
Sat Mar 14 17:10:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit bee4e64e38ed6262018fabbb5fcbd0ea0c40c1b4
Author: David Capello <davidcapello at gmail.com>
Date:   Sat Nov 15 15:47:21 2014 -0300

    Add NewFrameCommand::onGetFriendlyName() to differentiate "New Empty Frame" from "New Frame"
---
 src/app/commands/cmd_new_frame.cpp | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/app/commands/cmd_new_frame.cpp b/src/app/commands/cmd_new_frame.cpp
index 4e9f5ae..a7f4e9d 100644
--- a/src/app/commands/cmd_new_frame.cpp
+++ b/src/app/commands/cmd_new_frame.cpp
@@ -49,9 +49,10 @@ public:
   Command* clone() const override { return new NewFrameCommand(*this); }
 
 protected:
-  void onLoadParams(Params* params);
-  bool onEnabled(Context* context);
-  void onExecute(Context* context);
+  void onLoadParams(Params* params) override;
+  bool onEnabled(Context* context) override;
+  void onExecute(Context* context) override;
+  std::string onGetFriendlyName() const override;
 
 private:
   Content m_content;
@@ -106,6 +107,22 @@ void NewFrameCommand::onExecute(Context* context)
   App::instance()->getMainWindow()->popTimeline();
 }
 
+std::string NewFrameCommand::onGetFriendlyName() const
+{
+  std::string text = "New Frame";
+
+  switch (m_content) {
+    case Content::CurrentFrame:
+      text = "New Frame (duplicated)";
+      break;
+    case Content::EmptyFrame:
+      text = "New Frame (empty)";
+      break;
+  }
+
+  return text;
+}
+
 Command* CommandFactory::createNewFrameCommand()
 {
   return new NewFrameCommand;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list