desktop/source/deployment/gui/dp_gui_dialog2.cxx | 28 +++++++---------------- desktop/source/deployment/gui/dp_gui_dialog2.hxx | 8 ++---- desktop/uiconfig/ui/showlicensedialog.ui | 9 ++++++- 3 files changed, 20 insertions(+), 25 deletions(-)
New commits: commit 28885e0764df296aeafbda21ba24341f06f16eb9 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Feb 22 21:25:41 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat Feb 23 16:05:55 2019 +0100 weld ShowLicenseDialog Change-Id: Ia7e158a4f5a4bc629c4ad4aafc71d7c10d453099 Reviewed-on: https://gerrit.libreoffice.org/68234 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> 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<VclMultiLineEdit> m_pLicenseText; + std::unique_ptr<weld::TextView> 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 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- Generated with glade 3.22.1 --> <interface domain="dkt"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="ShowLicenseDialog"> <property name="can_focus">False</property> <property name="border_width">6</property> <property name="title" translatable="yes" context="showlicensedialog|ShowLicenseDialog">Extension Software License Agreement</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -47,7 +54,7 @@ <property name="vexpand">True</property> <property name="shadow_type">in</property> <child> - <object class="GtkTextView" id="textview:border"> + <object class="GtkTextView" id="textview"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="hexpand">True</property> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits