xref: /haiku/src/apps/icon-o-matic/shape/commands/AddShapesCommand.cpp (revision c6c2c0428420c1a7a9b16a843b41ab26903bc5fb)
1 /*
2  * Copyright 2006, 2023, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  *		Zardshard
8  */
9 
10 #include "AddShapesCommand.h"
11 
12 #include <Catalog.h>
13 #include <Locale.h>
14 #include <StringFormat.h>
15 
16 #include "Shape.h"
17 
18 
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "Icon-O-Matic-AddShapesCmd"
21 
22 
23 AddShapesCommand::AddShapesCommand(Container<Shape>* container,
24 		const Shape* const* shapes, int32 count, int32 index)
25 	: AddCommand<Shape>(container, shapes, count, true, index)
26 {
27 }
28 
29 
30 AddShapesCommand::~AddShapesCommand()
31 {
32 }
33 
34 
35 void
36 AddShapesCommand::GetName(BString& name)
37 {
38 	static BStringFormat format(B_TRANSLATE("Add {0, plural, "
39 		"one{shape} other{shapes}}"));
40 	format.Format(name, fCount);
41 }
42