From 28885e0764df296aeafbda21ba24341f06f16eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 22 Feb 2019 21:25:41 +0000 Subject: [PATCH] weld ShowLicenseDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia7e158a4f5a4bc629c4ad4aafc71d7c10d453099 Reviewed-on: https://gerrit.libreoffice.org/68234 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../source/deployment/gui/dp_gui_dialog2.cxx | 28 ++++++------------- .../source/deployment/gui/dp_gui_dialog2.hxx | 8 ++---- desktop/uiconfig/ui/showlicensedialog.ui | 9 +++++- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 46649607e212..f38b261882e3 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -299,8 +299,8 @@ void ExtBoxWithBtns_Impl::MouseButtonDown( const MouseEvent& rMEvt ) break; case CMD_SHOW_LICENSE: { - ScopedVclPtrInstance< ShowLicenseDialog > aLicenseDlg( m_pParent, GetEntryData( nPos )->m_xPackage ); - aLicenseDlg->Execute(); + ShowLicenseDialog aLicenseDlg(m_pParent->GetFrameWeld(), GetEntryData(nPos)->m_xPackage); + aLicenseDlg.run(); break; } } @@ -1448,29 +1448,19 @@ void UpdateRequiredDialog::disableAllEntries() m_pCloseBtn->SetText( m_sCloseText ); } - // ShowLicenseDialog - -ShowLicenseDialog::ShowLicenseDialog( vcl::Window * pParent, - const uno::Reference< deployment::XPackage > &xPackage ) - : ModalDialog(pParent, "ShowLicenseDialog", "desktop/ui/showlicensedialog.ui") +ShowLicenseDialog::ShowLicenseDialog(weld::Window* pParent, + const uno::Reference< deployment::XPackage> &xPackage) + : GenericDialogController(pParent, "desktop/ui/showlicensedialog.ui", "ShowLicenseDialog") + , m_xLicenseText(m_xBuilder->weld_text_view("textview")) { - get(m_pLicenseText, "textview"); - Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MapMode(MapUnit::MapAppFont))); - m_pLicenseText->set_width_request(aSize.Width()); - m_pLicenseText->set_height_request(aSize.Height()); - m_pLicenseText->SetText(xPackage->getLicenseText()); + m_xLicenseText->set_size_request(m_xLicenseText->get_approximate_digit_width() * 72, + m_xLicenseText->get_height_rows(21)); + m_xLicenseText->set_text(xPackage->getLicenseText()); } ShowLicenseDialog::~ShowLicenseDialog() { - disposeOnce(); -} - -void ShowLicenseDialog::dispose() -{ - m_pLicenseText.clear(); - ModalDialog::dispose(); } // UpdateRequiredDialogService diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index a2d88c0f458e..90a28f71f87c 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -252,16 +252,14 @@ public: }; -class ShowLicenseDialog : public ModalDialog +class ShowLicenseDialog : public weld::GenericDialogController { - VclPtr m_pLicenseText; + std::unique_ptr m_xLicenseText; public: - ShowLicenseDialog(vcl::Window * pParent, const css::uno::Reference< css::deployment::XPackage > &xPackage); + ShowLicenseDialog(weld::Window * pParent, const css::uno::Reference< css::deployment::XPackage > &xPackage); virtual ~ShowLicenseDialog() override; - virtual void dispose() override; }; - class UpdateRequiredDialogService : public ::cppu::WeakImplHelper< css::ui::dialogs::XExecutableDialog > { css::uno::Reference< css::uno::XComponentContext > const m_xComponentContext; diff --git a/desktop/uiconfig/ui/showlicensedialog.ui b/desktop/uiconfig/ui/showlicensedialog.ui index 296aaf377e55..6039c59fb827 100644 --- a/desktop/uiconfig/ui/showlicensedialog.ui +++ b/desktop/uiconfig/ui/showlicensedialog.ui @@ -1,11 +1,18 @@ + False 6 Extension Software License Agreement + True + 0 + 0 dialog + + + False @@ -47,7 +54,7 @@ True in - + True True True