diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/inc/strings.hrc | 3 | ||||
-rw-r--r-- | cui/source/dialogs/GraphicTestsDialog.cxx | 28 |
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(); } |