diff options
author | homeboy445 <akshitsan13@gmail.com> | 2021-06-26 20:46:25 +0530 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-07-27 14:19:06 +0200 |
commit | 6cb3c79b84e396959a982070f6fc4d439a9c396d (patch) | |
tree | e76414396b63922a1b12b52193d30be2f2da1808 /svx | |
parent | a66dc788d92d9ef0ab6a5a0339f02df0c39b97fb (diff) |
Added the feature to store VCL test results as a zip file
The results can now be downloaded as a zip file, which would
consist of the test log and all the resultant bitmap images produced
by the tests compressed as png stored in the user directory folder.
Change-Id: I8a6098a7454a621bbb9cafa7b6f2cafaa5503522
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117937
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/Library_svx.mk | 1 | ||||
-rw-r--r-- | svx/UIConfig_svx.mk | 2 | ||||
-rw-r--r-- | svx/source/dialog/FileExportedDialog.cxx | 42 | ||||
-rw-r--r-- | svx/source/dialog/SafeModeDialog.cxx | 35 | ||||
-rw-r--r-- | svx/uiconfig/ui/fileexporteddialog.ui (renamed from svx/uiconfig/ui/profileexporteddialog.ui) | 10 |
5 files changed, 51 insertions, 39 deletions
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index b6b97a76e0e6..578e7776ce8e 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -145,6 +145,7 @@ $(eval $(call gb_Library_add_exception_objects,svx,\ svx/source/dialog/rubydialog \ svx/source/dialog/rulritem \ svx/source/dialog/SafeModeDialog \ + svx/source/dialog/FileExportedDialog \ svx/source/dialog/SafeModeUI \ svx/source/dialog/SpellDialogChildWindow \ svx/source/dialog/srchctrl \ diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk index d7343541b2fe..2186185f10c2 100644 --- a/svx/UIConfig_svx.mk +++ b/svx/UIConfig_svx.mk @@ -101,7 +101,7 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\ svx/uiconfig/ui/paraulspacing \ svx/uiconfig/ui/passwd \ svx/uiconfig/ui/presetmenu \ - svx/uiconfig/ui/profileexporteddialog \ + svx/uiconfig/ui/fileexporteddialog \ svx/uiconfig/ui/querydeletecontourdialog \ svx/uiconfig/ui/querydeleteobjectdialog \ svx/uiconfig/ui/querydeletethemedialog \ diff --git a/svx/source/dialog/FileExportedDialog.cxx b/svx/source/dialog/FileExportedDialog.cxx new file mode 100644 index 000000000000..e352a0621f50 --- /dev/null +++ b/svx/source/dialog/FileExportedDialog.cxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <svx/FileExportedDialog.hxx> + +#include <tools/diagnose_ex.h> +#include <comphelper/backupfilehelper.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/system/XSystemShellExecute.hpp> +#include <com/sun/star/system/SystemShellExecuteFlags.hpp> +#include <com/sun/star/system/SystemShellExecute.hpp> + +FileExportedDialog::FileExportedDialog(weld::Window* pParent, OUString atitle) + : GenericDialogController(pParent, "svx/ui/fileexporteddialog.ui", "FileExportedDialog") + , m_xFileLabel(m_xBuilder->weld_label("Filelabel")) + , m_xButton(m_xBuilder->weld_button("ok")) +{ + m_xFileLabel->set_label(atitle); + m_xButton->connect_clicked(LINK(this, FileExportedDialog, OpenHdl)); +} + +IMPL_LINK_NOARG(FileExportedDialog, OpenHdl, weld::Button&, void) +{ + const OUString uri(comphelper::BackupFileHelper::getUserProfileURL()); + css::uno::Reference<css::system::XSystemShellExecute> exec( + css::system::SystemShellExecute::create(comphelper::getProcessComponentContext())); + try + { + exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); + } + catch (const css::uno::Exception&) + { + TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:"); + } + m_xDialog->response(RET_OK); +}
\ No newline at end of file diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index 9ebb269d0b7e..e9c99500a50a 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -19,6 +19,7 @@ #include <unotools/configmgr.hxx> #include <svx/dialmgr.hxx> #include <svx/strings.hrc> +#include <svx/FileExportedDialog.hxx> #include <com/sun/star/task/OfficeRestartManager.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> @@ -269,38 +270,6 @@ IMPL_LINK(SafeModeDialog, DialogBtnHdl, weld::Button&, rBtn, void) } } -namespace { - class ProfileExportedDialog : public weld::GenericDialogController - { - private: - std::unique_ptr<weld::Button> m_xButton; - - DECL_LINK(OpenHdl, weld::Button&, void); - public: - explicit ProfileExportedDialog(weld::Window* pParent); - }; - - ProfileExportedDialog::ProfileExportedDialog(weld::Window* pParent) - : GenericDialogController(pParent, "svx/ui/profileexporteddialog.ui", "ProfileExportedDialog") - , m_xButton(m_xBuilder->weld_button("ok")) - { - m_xButton->connect_clicked(LINK(this, ProfileExportedDialog, OpenHdl)); - } - - IMPL_LINK_NOARG(ProfileExportedDialog, OpenHdl, weld::Button&, void) - { - const OUString uri(comphelper::BackupFileHelper::getUserProfileURL()); - css::uno::Reference< css::system::XSystemShellExecute > exec( - css::system::SystemShellExecute::create(comphelper::getProcessComponentContext())); - try { - exec->execute(uri, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY); - } catch (const css::uno::Exception &) { - TOOLS_WARN_EXCEPTION("svx.dialog", "opening <" << uri << "> failed:"); - } - m_xDialog->response(RET_OK); - } -} - IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, /*rBtn*/, void) { const OUString zipFileURL(comphelper::BackupFileHelper::getUserProfileURL() + "/libreoffice-profile.zip"); @@ -320,7 +289,7 @@ IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, /*rBtn*/, void) return; } - ProfileExportedDialog aDialog(m_xDialog.get()); + FileExportedDialog aDialog(m_xDialog.get(),"Your user profile has been exported as 'libreoffice-profile.zip'."); aDialog.run(); } diff --git a/svx/uiconfig/ui/profileexporteddialog.ui b/svx/uiconfig/ui/fileexporteddialog.ui index fe73848d5014..aa1f3d4ae50f 100644 --- a/svx/uiconfig/ui/profileexporteddialog.ui +++ b/svx/uiconfig/ui/fileexporteddialog.ui @@ -2,10 +2,10 @@ <!-- Generated with glade 3.22.1 --> <interface domain="svx"> <requires lib="gtk+" version="3.20"/> - <object class="GtkDialog" id="ProfileExportedDialog"> + <object class="GtkDialog" id="FileExportedDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> - <property name="title" translatable="yes" context="profileexporteddialog|ProfileExportedDialog">Profile exported</property> + <property name="title" translatable="yes" context="fileexporteddialog|FileExportedDialog">File Exported</property> <property name="resizable">False</property> <property name="modal">True</property> <property name="default_width">0</property> @@ -42,7 +42,7 @@ </child> <child> <object class="GtkButton" id="ok"> - <property name="label" translatable="yes" context="profileexporteddialog|openfolder">Open Containing _Folder</property> + <property name="label" translatable="yes" context="fileexporteddialog|openfolder">Open Containing _Folder</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -63,10 +63,10 @@ </packing> </child> <child> - <object class="GtkLabel" id="label"> + <object class="GtkLabel" id="Filelabel"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes" context="profileexporteddialog|label">Your user profile has been exported as “libreoffice-profile.zip”.</property> + <property name="label" translatable="yes" context="fileexporteddialog|Filelabel">File Name</property> <property name="wrap">True</property> <property name="max_width_chars">80</property> <property name="lines">2</property> |