diff --git a/limereport/lrbanddesignintf.cpp b/limereport/lrbanddesignintf.cpp index 11eae6c..2402d67 100644 --- a/limereport/lrbanddesignintf.cpp +++ b/limereport/lrbanddesignintf.cpp @@ -160,6 +160,16 @@ BandDesignIntf::~BandDesignIntf() delete m_bandNameLabel; } +int extractItemIndex(const BaseDesignIntf* item){ + QString objectName = extractClassName(item->metaObject()->className()); + QString value = item->objectName().right(item->objectName().size() - objectName.size()); + return value.toInt(); +} + +QString BandDesignIntf::translateBandName(const BaseDesignIntf* item) const{ + return tr(extractClassName(item->metaObject()->className()).toLatin1())+QString::number(extractItemIndex(item)); +} + void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { @@ -171,8 +181,7 @@ void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *op if (itemMode() & DesignMode){ painter->save(); - QString bandText = objectName(); - if (parentBand()) bandText+=tr(" connected to ")+parentBand()->objectName(); + QString bandText = bandTitle(); QFont font("Arial", 7 * Const::fontFACTOR, -1, true); QFontMetrics fontMetrics(font); @@ -203,6 +212,23 @@ void BandDesignIntf::paint(QPainter *painter, const QStyleOptionGraphicsItem *op BaseDesignIntf::paint(painter,option,widget); } +void BandDesignIntf::translateBandsName() +{ + tr("DataBand"); + tr("DataHeaderBand"); + tr("DataFooterBand"); + tr("ReportHeader"); + tr("ReportFooter"); + tr("PageHeader"); + tr("PageFooter"); + tr("SubDetailBand"); + tr("SubDetailHeaderBand"); + tr("SubDetailFooterBand"); + tr("GroupBandHeader"); + tr("GroupBandFooter"); + tr("TearOffBand"); +} + BandDesignIntf::BandsType BandDesignIntf::bandType() const { return m_bandType; @@ -210,8 +236,8 @@ BandDesignIntf::BandsType BandDesignIntf::bandType() const QString BandDesignIntf::bandTitle() const { - QString result = objectName(); - if (parentBand()) result +=tr(" connected to ")+parentBand()->objectName(); + QString result = translateBandName(this); + if (parentBand()) result +=tr(" connected to ") + translateBandName(parentBand()); return result; } diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 3b1a48b..b138468 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -121,6 +121,7 @@ public: ~BandDesignIntf(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + void translateBandsName(); virtual BandsType bandType() const; virtual QString bandTitle() const; virtual QIcon bandIcon() const; @@ -245,7 +246,7 @@ protected: void moveItemsDown(qreal startPos, qreal offset); void preparePopUpMenu(QMenu &menu); void processPopUpAction(QAction *action); - + QString translateBandName(const BaseDesignIntf *item) const; private slots: void childBandDeleted(QObject* band); private: diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index 2e55526..0bdae75 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -1182,8 +1182,10 @@ void ReportDesignWindow::slotBandAdded(PageDesignIntf *, BandDesignIntf * band) break; case BandDesignIntf::ReportFooter: m_newReportFooter->setDisabled(true); + break; case BandDesignIntf::TearOffBand: m_newTearOffBand->setDisabled(true); + break; default: break; } diff --git a/translations/limereport_ru.ts b/translations/limereport_ru.ts index 6add569..987aad9 100644 --- a/translations/limereport_ru.ts +++ b/translations/limereport_ru.ts @@ -262,6 +262,74 @@ p, li { white-space: pre-wrap; } Splittable Разбивать содержимое на части + + DataBand + Данные + + + ReportHeader + Заголовок отчета + + + ReportFooter + Завершение отчета + + + PageHeader + Верхний колонтитул + + + PageFooter + Нижний колонтитул + + + Subdetail + Подчиненный + + + DataHeaderBand + Заголовок данных + + + DataFooterBand + Завершение данных + + + SubdetailBand + Подчиненные данные + + + SubdetailHeaderBand + Заголовок подчиненных данных + + + SubdetailFooterBand + Завершение подчиненных данных + + + GroupBandHeader + Заголовок группы + + + GroupBandFooter + Завершение группы + + + TearOffBand + Полоса для отрывания + + + SubDetailBand + Подчиненные данные + + + SubDetailHeaderBand + Заголовок подчиненных данных + + + SubDetailFooterBand + Завершение подчиненных данных + LimeReport::BaseDesignIntf