weld ShowLicenseDialog

Change-Id: Ia7e158a4f5a4bc629c4ad4aafc71d7c10d453099
Reviewed-on: https://gerrit.libreoffice.org/68234
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2019-02-23 16:05:55 +01:00
parent 10edac7ecc
commit 28885e0764
3 changed files with 20 additions and 25 deletions
@@ -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
@@ -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;
+8 -1
View File
@@ -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>