diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2019-09-18 23:07:09 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-13 11:50:27 +0100 |
commit | d064ea3659198fcd914b6939ec1f31880ebe9809 (patch) | |
tree | 8798b5b8ca6f344875f3f11e26a8f3728f291c4e /sfx2 | |
parent | 4157921a0741b292e322d4306e6a520ef4dd528e (diff) |
[cp] add EULA button to Help - License Information... dialog
Forward port of acd8acfa89d9 from distro/collabora/cp-6.0
Rewritten for weld API
Change-Id: I62b9293c68059389a63e523ea5747fdb267b1a99
28a21f5831e0b2e99eb11f1c1ac2b8845c462669
Reviewed-on: https://gerrit.libreoffice.org/79110
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 26 | ||||
-rw-r--r-- | sfx2/uiconfig/ui/licensedialog.ui | 49 |
2 files changed, 66 insertions, 9 deletions
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 107b8c1f749a..ccb93bfc4c6b 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -254,21 +254,43 @@ namespace class LicenseDialog : public weld::GenericDialogController { + private: + std::unique_ptr<weld::Button> m_xBtnLicense; + std::unique_ptr<weld::Button> m_xBtnEula; + + DECL_LINK(EulaHdl, weld::Button&, void); + DECL_LINK(LicenseHdl, weld::Button&, void); + public: LicenseDialog(weld::Window* pParent) : GenericDialogController(pParent, "sfx/ui/licensedialog.ui", "LicenseDialog") + , m_xBtnLicense(m_xBuilder->weld_button("license")) + , m_xBtnEula(m_xBuilder->weld_button("eula")) { + m_xBtnLicense->connect_clicked( LINK(this, LicenseDialog, LicenseHdl) ); + m_xBtnEula->connect_clicked( LINK(this, LicenseDialog, EulaHdl) ); } virtual short run() override { short nRet = GenericDialogController::run(); - if (nRet == RET_OK) - showDocument("LICENSE"); return nRet; } }; + IMPL_LINK_NOARG(LicenseDialog, EulaHdl, weld::Button&, void) + { + response(RET_OK); + showDocument("EULA.odt"); + } + + IMPL_LINK_NOARG(LicenseDialog, LicenseHdl, weld::Button&, void) + { + response(RET_OK); + showDocument("LICENSE"); + } + + class SafeModeQueryDialog : public weld::MessageDialogController { public: diff --git a/sfx2/uiconfig/ui/licensedialog.ui b/sfx2/uiconfig/ui/licensedialog.ui index 71d504f9300d..a1d42e05dc7a 100644 --- a/sfx2/uiconfig/ui/licensedialog.ui +++ b/sfx2/uiconfig/ui/licensedialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.2 --> +<!-- Generated with glade 3.22.1 --> <interface domain="sfx"> <requires lib="gtk+" version="3.20"/> <object class="GtkDialog" id="LicenseDialog"> @@ -11,6 +11,9 @@ <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> @@ -21,7 +24,7 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <object class="GtkButton" id="ok"> + <object class="GtkButton" id="license"> <property name="label" translatable="yes" context="licensedialog|show">_Show License</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -37,6 +40,23 @@ </packing> </child> <child> + <object class="GtkButton" id="eula"> + <property name="label" translatable="yes" context="licensedialog|eula">_EULA</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + <property name="secondary">True</property> + </packing> + </child> + <child> <object class="GtkButton" id="close"> <property name="label" translatable="yes" context="stock">_Close</property> <property name="visible">True</property> @@ -50,7 +70,7 @@ <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">2</property> </packing> </child> </object> @@ -62,6 +82,24 @@ </packing> </child> <child> + <object class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="licensedialog|label2">%PRODUCTNAME binary package is made available subject to the terms of the End User License and Subscription Agreement; choose EULA to see exact details in English.</property> + <property name="use_underline">True</property> + <property name="wrap">True</property> + <property name="mnemonic_widget">eula</property> + <property name="max_width_chars">80</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> <object class="GtkLabel" id="label"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -88,11 +126,8 @@ This product was created by %OOOVENDOR, based on OpenOffice.org, which is Copyri </object> </child> <action-widgets> - <action-widget response="-5">ok</action-widget> + <action-widget response="-5">license</action-widget> <action-widget response="-7">close</action-widget> </action-widgets> - <child> - <placeholder/> - </child> </object> </interface> |