[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/source sfx2/uiconfig

Gülşah Köse (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 19 09:51:49 UTC 2019


 sfx2/source/appl/appserv.cxx      |   26 ++++++++++++++++++--
 sfx2/uiconfig/ui/licensedialog.ui |   49 ++++++++++++++++++++++++++++++++------
 2 files changed, 66 insertions(+), 9 deletions(-)

New commits:
commit 43d8d224cf2774c040a7de653c35275b585b2dfe
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Wed Sep 18 23:07:09 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Thu Sep 19 11:51:14 2019 +0200

    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
    Change-Id: I28a21f5831e0b2e99eb11f1c1ac2b8845c462669
    Reviewed-on: https://gerrit.libreoffice.org/79110
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 1d0c7d0d4476..e6fd447cae64 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -313,21 +313,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 cd83b98edfad..695996b2b5cb 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.18"/>
   <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">gtk-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>


More information about the Libreoffice-commits mailing list