summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2022-01-06 12:38:13 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-01-11 09:22:52 +0100
commitcf3840931454553ff25e488dc1ede2af65e0016b (patch)
treeba03aba6df6f0b6895e7f5502e9f3e123755886d /cui
parent98538ea2155274b4cdb66a5d4e46d221aec564d3 (diff)
tdf#145919 Localize strings in Graphics Test dialog
but not in the saved log file Change-Id: I65c580e7b8762b654f1812c96bc53841b882a960 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128087 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/inc/strings.hrc3
-rw-r--r--cui/source/dialogs/GraphicTestsDialog.cxx28
2 files changed, 19 insertions, 12 deletions
diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc
index fd91ae802b42..92e9cb7ed7ae 100644
--- a/cui/inc/strings.hrc
+++ b/cui/inc/strings.hrc
@@ -396,4 +396,7 @@
#define RID_CUISTR_OLE_INSERT NC_("RID_SVXSTR_OLE_INSERT", "Inserting OLE object...")
+#define RID_CUISTR_CLICK_RESULT NC_("RID_CUISTR_CLICK_RESULT", "(Click on any test to view its resultant bitmap image)")
+#define RID_CUISTR_ZIPFAIL NC_("RID_CUISTR_ZIPFAIL", "Creation of Zip file failed!")
+#define RID_CUISTR_SAVED NC_("RID_CUISTR_SAVED", "The results have been successfully saved in the file 'GraphicTestResults.zip'!")
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/dialogs/GraphicTestsDialog.cxx b/cui/source/dialogs/GraphicTestsDialog.cxx
index 555ef3bd888c..c6232c2e8868 100644
--- a/cui/source/dialogs/GraphicTestsDialog.cxx
+++ b/cui/source/dialogs/GraphicTestsDialog.cxx
@@ -14,6 +14,11 @@
#include <unotools/ZipPackageHelper.hxx>
#include <GraphicsTestsDialog.hxx>
#include <vcl/test/GraphicsRenderTests.hxx>
+#include <svl/svlresid.hxx>
+#include <svl/svl.hrc>
+
+#include <dialmgr.hxx>
+#include <strings.hrc>
GraphicTestEntry::GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDialog,
OUString aTestName, OUString aTestStatus, Bitmap aTestBitmap)
@@ -28,17 +33,18 @@ GraphicTestEntry::GraphicTestEntry(weld::Container* pParent, weld::Dialog* pDial
m_xTestButton->set_label(aTestStatus);
m_xTestButton->set_tooltip_text(aTestName);
m_xTestButton->set_background(
- aTestStatus == "PASSED"
+ aTestStatus == SvlResId(GRTSTR_PASSED)
? COL_LIGHTGREEN
- : aTestStatus == "QUIRKY" ? COL_YELLOW
- : aTestStatus == "FAILED" ? COL_LIGHTRED : COL_LIGHTGRAY);
+ : aTestStatus == SvlResId(GRTSTR_QUIRKY)
+ ? COL_YELLOW
+ : aTestStatus == SvlResId(GRTSTR_FAILED) ? COL_LIGHTRED : COL_LIGHTGRAY);
m_xTestButton->connect_clicked(LINK(this, GraphicTestEntry, HandleResultViewRequest));
m_xContainer->show();
}
IMPL_LINK(GraphicTestEntry, HandleResultViewRequest, weld::Button&, rButton, void)
{
- if (rButton.get_label() == "SKIPPED")
+ if (rButton.get_label() == SvlResId(GRTSTR_SKIPPED))
{
return;
}
@@ -64,14 +70,14 @@ short GraphicsTestsDialog::run()
{
GraphicsRenderTests aTestObject;
aTestObject.run(true);
- OUString aResultLog = aTestObject.getResultString()
- + "\n(Click on any test to view its resultant bitmap image)";
+ OUString aResultLog
+ = aTestObject.getResultString(true) + "\n" + CuiResId(RID_CUISTR_CLICK_RESULT);
m_xResultLog->set_text(aResultLog);
sal_Int32 nTestNumber = 0;
- for (const VclTestResult& test : aTestObject.getTestResults())
+ for (VclTestResult& test : aTestObject.getTestResults())
{
auto xGpTest = std::make_unique<GraphicTestEntry>(m_xContainerBox.get(), m_xDialog.get(),
- test.getTestName(), test.getStatus(),
+ test.getTestName(), test.getStatus(true),
test.getBitmap());
m_xContainerBox->reorder_child(xGpTest->get_widget(), nTestNumber++);
m_xGraphicTestEntries.push_back(std::move(xGpTest));
@@ -92,13 +98,11 @@ IMPL_LINK_NOARG(GraphicsTestsDialog, HandleDownloadRequest, weld::Button&, void)
{
std::unique_ptr<weld::MessageDialog> xBox(
Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning,
- VclButtonsType::Ok, "Creation of Zip file failed!"));
+ VclButtonsType::Ok, CuiResId(RID_CUISTR_ZIPFAIL)));
xBox->run();
return;
}
- FileExportedDialog aDialog(
- m_xDialog.get(),
- "The results have been successfully saved in the file 'GraphicTestResults.zip' !");
+ FileExportedDialog aDialog(m_xDialog.get(), CuiResId(RID_CUISTR_SAVED));
aDialog.run();
}