Commit 27080254 authored by twanvl's avatar twanvl

Names of add/remove card/keyword actions

parent 02325c19
......@@ -91,7 +91,7 @@ GenericAddAction<T>::GenericAddAction(AddingOrRemoving ar, const vector<T>& item
template <typename T>
String GenericAddAction<T>::getName() const {
String type = type_name(steps.front().item) + (steps.size() == 1 ? _("") : _("s"));
return adding ? _ACTION_1_("add object", type) : _ACTION_1_("remove object", type);
return adding ? _ACTION_1_("add item", type) : _ACTION_1_("remove item", type);
}
template <typename T>
......
......@@ -357,7 +357,7 @@ AddSymbolPartAction::AddSymbolPartAction(Symbol& symbol, const SymbolPartP& part
{}
String AddSymbolPartAction::getName(bool to_undo) const {
return _ACTION_1_("add part", part->name);
return _ACTION_1_("add item", part->name);
}
void AddSymbolPartAction::perform(bool to_undo) {
......@@ -396,7 +396,7 @@ void RemoveSymbolPartsAction::check(SymbolGroup& group, const set<SymbolPartP>&
}
String RemoveSymbolPartsAction::getName(bool to_undo) const {
return _ACTION_1_("remove parts", removals.size() == 1 ? _TYPE_("shape") : _TYPE_("shapes"));
return _ACTION_1_("remove item", removals.size() == 1 ? _TYPE_("shape") : _TYPE_("shapes"));
}
void RemoveSymbolPartsAction::perform(bool to_undo) {
......
......@@ -86,6 +86,9 @@ class Card : public IntrusivePtrVirtualBase {
inline String type_name(const Card&) {
return _TYPE_("card");
}
inline String type_name(const vector<CardP>&) {
return _TYPE_("cards"); // not actually used, only for locale.pl script
}
void mark_dependency_member(const Card& value, const String& name, const Dependency& dep);
......
......@@ -114,6 +114,12 @@ class Keyword : public IntrusivePtrVirtualBase {
DECLARE_REFLECTION();
};
inline String type_name(const Keyword&) {
return _TYPE_("keyword");
}
inline String type_name(const vector<KeywordP>&) {
return _TYPE_("keywords"); // not actually used, only for locale.pl script
}
// ----------------------------------------------------------------------------- : Using keywords
......
This diff is collapsed.
......@@ -35,6 +35,9 @@ void mark_dependency_member(const T& value, const String& name, const Dependency
template <typename T> inline String type_name(const T&) {
return _TYPE_("object");
}
template <typename T> inline String type_name(const intrusive_ptr<T>& p) {
return type_name(*p.get());
}
template <typename K, typename V> inline String type_name(const pair<K,V>& p) {
return type_name(p.second); // for maps
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment