diff --git a/limereport/lrreportengine.cpp b/limereport/lrreportengine.cpp index 3bd6af9..a128d46 100644 --- a/limereport/lrreportengine.cpp +++ b/limereport/lrreportengine.cpp @@ -908,6 +908,7 @@ bool ReportEnginePrivate::isNeedToSave() QString ReportEnginePrivate::renderToString() { LimeReport::ReportRender render; + updateTranslations(); dataManager()->connectAllDatabases(); dataManager()->setDesignTime(false); if (m_pages.count()){ @@ -1120,6 +1121,7 @@ ReportPages ReportEnginePrivate::renderToPages() { if (m_reportRendering) return ReportPages(); m_reportRender = ReportRender::Ptr(new ReportRender); + updateTranslations(); dataManager()->clearErrors(); dataManager()->connectAllDatabases(); @@ -1160,7 +1162,6 @@ ReportPages ReportEnginePrivate::renderToPages() } } - for (int i=0; iisTOC()){ diff --git a/limereport/lrreporttranslation.cpp b/limereport/lrreporttranslation.cpp index 81fd2c4..db54b37 100644 --- a/limereport/lrreporttranslation.cpp +++ b/limereport/lrreporttranslation.cpp @@ -82,8 +82,14 @@ void ReportTranslation::updatePageTranslation(PageDesignIntf* page) if (itemTranslation){ foreach(QString propertyName, stringsForTranslation.keys()){ PropertyTranslation* propertyTranslation = itemTranslation->findProperty(propertyName); + if (propertyTranslation->checked) + propertyTranslation->sourceHasBeenChanged = propertyTranslation->sourceValue != stringsForTranslation.value(propertyName); + if (propertyTranslation->sourceHasBeenChanged) + propertyTranslation->checked = false; propertyTranslation->sourceValue = stringsForTranslation.value(propertyName); - propertyTranslation->sourceHasBeenChanged = propertyTranslation->value != propertyTranslation->sourceValue; + + if ( language() == QLocale::AnyLanguage ) + propertyTranslation->value = propertyTranslation->sourceValue; } } else { createItemTranslation(item, pageTranslation); diff --git a/limereport/translationeditor/images/question.png b/limereport/translationeditor/images/question.png index badcba0..1b358c8 100644 Binary files a/limereport/translationeditor/images/question.png and b/limereport/translationeditor/images/question.png differ diff --git a/limereport/translationeditor/translationeditor.cpp b/limereport/translationeditor/translationeditor.cpp index f4f4ce6..d792d67 100644 --- a/limereport/translationeditor/translationeditor.cpp +++ b/limereport/translationeditor/translationeditor.cpp @@ -19,7 +19,7 @@ TranslationEditor::TranslationEditor(QWidget *parent) : ui->splitter_2->setStretchFactor(1,2); ui->splitter->setStretchFactor(0,2); QTableWidgetItem* item = new QTableWidgetItem(); - item->setIcon(QIcon(":/translationeditor/images/checked.png")); + item->setIcon(QIcon(":/translationeditor/checked")); ui->tbStrings->setColumnCount(4); ui->tbStrings->setColumnWidth(0,30); ui->tbStrings->setColumnWidth(1,100); @@ -132,8 +132,14 @@ void TranslationEditor::activatePage(PageTranslation* pageTranslation) ui->tbStrings->setRowCount(rowIndex+1); foreach(PropertyTranslation* propertyTranslation, itemTranslation->propertyesTranslation){ QTableWidgetItem* checkItem = new QTableWidgetItem(); - if (propertyTranslation->checked) - checkItem->setIcon(QIcon(":/translationeditor/images/checked.png")); + + if (propertyTranslation->sourceHasBeenChanged){ + checkItem->setIcon(QIcon(":/translationeditor/question")); + } + if (propertyTranslation->checked){ + checkItem->setIcon(QIcon(":/translationeditor/checked")); + } + ui->tbStrings->setItem(rowIndex,0,checkItem); ui->tbStrings->setItem(rowIndex,1,new QTableWidgetItem(itemTranslation->itemName)); ui->tbStrings->setItem(rowIndex,2,new QTableWidgetItem(propertyTranslation->propertyName)); @@ -179,7 +185,7 @@ void TranslationEditor::on_cbChecked_toggled(bool checked) { if (m_currentPropertyTranslation){ m_currentPropertyTranslation->checked = checked; - ui->tbStrings->item(ui->tbStrings->currentRow(),0)->setIcon(checked ? QIcon(":/translationeditor/images/checked.png"):QIcon()); + ui->tbStrings->item(ui->tbStrings->currentRow(),0)->setIcon(checked ? QIcon(":/translationeditor/checked"):QIcon()); } } diff --git a/limereport/translationeditor/translationeditor.qrc b/limereport/translationeditor/translationeditor.qrc index 706f7af..af0f804 100644 --- a/limereport/translationeditor/translationeditor.qrc +++ b/limereport/translationeditor/translationeditor.qrc @@ -1,8 +1,9 @@ - images/add.png - images/remove.png + images/add.png + images/remove.png images/checked.png - images/question.png + images/question.png + images/green_check.png diff --git a/limereport/translationeditor/translationeditor.ui b/limereport/translationeditor/translationeditor.ui index 86f7a2f..944fec4 100644 --- a/limereport/translationeditor/translationeditor.ui +++ b/limereport/translationeditor/translationeditor.ui @@ -62,7 +62,7 @@ - :/translationeditor/images/add.png:/translationeditor/images/add.png + :/translationeditor/add:/translationeditor/add true @@ -76,7 +76,7 @@ - :/translationeditor/images/remove.png:/translationeditor/images/remove.png + :/translationeditor/remove:/translationeditor/remove true @@ -158,6 +158,10 @@ + + + :/translationeditor/checked:/translationeditor/checked + @@ -215,6 +219,7 @@ +