[TD]make Arrow enums translatable
This commit is contained in:
@@ -30,14 +30,14 @@
|
||||
namespace TechDraw {
|
||||
|
||||
const int ArrowPropEnum::ArrowCount = 8;
|
||||
const char* ArrowPropEnum::ArrowTypeEnums[]= { "NONE",
|
||||
"FILLED_ARROW",
|
||||
"OPEN_ARROW",
|
||||
"TICK",
|
||||
"DOT",
|
||||
"OPEN_CIRCLE",
|
||||
"FORK",
|
||||
"FILLED_TRIANGLE",
|
||||
const char* ArrowPropEnum::ArrowTypeEnums[]= { "None",
|
||||
"Filled_Arrow",
|
||||
"Open_Arrow",
|
||||
"Tick",
|
||||
"Dot",
|
||||
"Open_Circle",
|
||||
"Fork",
|
||||
"Filled_Triangle",
|
||||
NULL};
|
||||
|
||||
const std::vector<std::string> ArrowPropEnum::ArrowTypeIcons = { ":icons/arrownone.svg",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <QCoreApplication>
|
||||
|
||||
namespace TechDraw
|
||||
{
|
||||
@@ -42,8 +42,9 @@ enum ArrowType { NONE = 0,
|
||||
FILLED_TRIANGLE };
|
||||
|
||||
class TechDrawExport ArrowPropEnum {
|
||||
Q_DECLARE_TR_FUNCTIONS(TechDraw::ArrowPropEnum)
|
||||
|
||||
public:
|
||||
|
||||
static const char* ArrowTypeEnums[];
|
||||
static const int ArrowCount;
|
||||
static const std::vector<std::string> ArrowTypeIcons;
|
||||
|
||||
@@ -88,7 +88,7 @@ void DrawGuiUtil::loadArrowBox(QComboBox* qcb)
|
||||
qcb->clear();
|
||||
int i = 0;
|
||||
for (; i < ArrowPropEnum::ArrowCount; i++) {
|
||||
qcb->addItem(QString::fromUtf8(ArrowPropEnum::ArrowTypeEnums[i]));
|
||||
qcb->addItem(tr(ArrowPropEnum::ArrowTypeEnums[i]));
|
||||
QIcon itemIcon(QString::fromUtf8(ArrowPropEnum::ArrowTypeIcons[i].c_str()));
|
||||
qcb->setItemIcon(i, itemIcon);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#define _DrawGuiUtil_h_
|
||||
|
||||
#include <string>
|
||||
#include <QCoreApplication>
|
||||
#include <QRectF>
|
||||
#include <QPointF>
|
||||
#include <QComboBox>
|
||||
@@ -47,6 +48,7 @@ namespace TechDrawGui
|
||||
|
||||
/// Convenient utility functions for TechDraw Gui Module
|
||||
class TechDrawGuiExport DrawGuiUtil {
|
||||
Q_DECLARE_TR_FUNCTIONS(TechDrawGui::DrawGuiUtil)
|
||||
public:
|
||||
static TechDraw::DrawPage* findPage(Gui::Command* cmd);
|
||||
static bool needPage(Gui::Command* cmd);
|
||||
|
||||
Reference in New Issue
Block a user