[Libreoffice-commits] core.git: sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk

Caolán McNamara caolanm at redhat.com
Thu Apr 4 00:43:09 PDT 2013


 sfx2/UI_sfx.mk                    |    1 
 sfx2/source/appl/app.hrc          |   10 ----
 sfx2/source/appl/app.src          |   55 ------------------------
 sfx2/source/appl/appserv.cxx      |   52 ----------------------
 sfx2/uiconfig/ui/licensedialog.ui |   87 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 90 insertions(+), 115 deletions(-)

New commits:
commit 26f33b9c61d5b050b398a69a83d4f99fe9c228f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Apr 3 20:33:10 2013 +0100

    convert license dialog to .ui format
    
    Change-Id: Icbcb2a86369c95f9acff05d677a4f5eaa1d9dfb9

diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
index da23f43..0b59c7f 100644
--- a/sfx2/UI_sfx.mk
+++ b/sfx2/UI_sfx.mk
@@ -15,6 +15,7 @@ $(eval $(call gb_UI_add_uifiles,sfx,\
 	sfx2/uiconfig/ui/descriptioninfopage \
 	sfx2/uiconfig/ui/documentinfopage \
 	sfx2/uiconfig/ui/documentpropertiesdialog \
+	sfx2/uiconfig/ui/licensedialog \
 	sfx2/uiconfig/ui/managestylepage \
 	sfx2/uiconfig/ui/optprintpage \
 	sfx2/uiconfig/ui/password \
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index 899324f..6a5a97c 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -132,16 +132,6 @@
 #define RID_SVXSTR_GRFILTER_FILTERERROR         (RID_SFX_APP_START + 202)
 #define RID_SVXSTR_GRFILTER_TOOBIG              (RID_SFX_APP_START + 203)
 
-// For the License Information dialog box
-#define DLG_HELP_LICENSING                      (RID_SFX_APP_START + 204)
-#define STR_LICENSING_INFORMATION_1             (RID_SFX_APP_START + 205)
-#define STR_LICENSING_INFORMATION_2             (RID_SFX_APP_START + 206)
-#define STR_LICENSING_INFORMATION_3             (RID_SFX_APP_START + 207)
-#define STR_LICENSING_INFORMATION_4             (RID_SFX_APP_START + 208)
-#define STR_LICENSING_INFORMATION_5             (RID_SFX_APP_START + 209)
-#define PB_LICENSING_SHOW                       (RID_SFX_APP_START + 210)
-#define PB_LICENSING_CLOSE                      (RID_SFX_APP_START + 211)
-
 #define RID_SVXSTR_END_REDLINING_WARNING        (RID_SFX_APP_START + 212)
 #define RID_SVXSTR_INCORRECT_PASSWORD           (RID_SFX_APP_START + 213)
 #define RID_SVXSTR_FORWARD_ERRMSSG              (RID_SFX_APP_START + 214)
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index c05081e..d105a70 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -508,59 +508,4 @@ String RID_SVXSTR_FORWARD_ERRMSSG
     Text [ en-US ] = "If you select the option \"%PLACEHOLDER%\", you must enter a URL." ;
 };
 
-ModalDialog DLG_HELP_LICENSING
-{
-    // Size is computed
-    Text [ en-US ] = "Licensing and Legal information";
-    MOVEABLE = TRUE ;
-    CLOSEABLE = TRUE ;
-    OUTPUTSIZE = TRUE ;
-    SVLOOK = TRUE ;
-    String STR_LICENSING_INFORMATION_1
-    {
-        Text [ en-US ] =
-            "%PRODUCTNAME is made available subject to the terms of GNU Lesser General Public\n"
-            "License Version 3. A copy of the LGPL license can be found at\n"
-            "http://www.gnu.org/licenses/lgpl-3.0.html" ;
-    };
-    String STR_LICENSING_INFORMATION_2
-    {
-        Text [ en-US ] =
-            "Third Party Code Additional copyright notices and license terms applicable to\n"
-            "portions of the Software are set forth in the LICENSE.html\n"
-            "file; choose Show License to see exact details in English." ;
-    };
-    String STR_LICENSING_INFORMATION_3
-    {
-        Text [ en-US ] =
-            "All trademarks and registered trademarks mentioned herein are the property of\n"
-            "their respective owners." ;
-    };
-    String STR_LICENSING_INFORMATION_4
-    {
-        Text [ en-US ] =
-            "Copyright © 2000, 2013 LibreOffice contributors and/or their affiliates. All rights\n"
-            "reserved." ;
-    };
-    String STR_LICENSING_INFORMATION_5
-    {
-        Text [ en-US ] =
-            "This product was created by %OOOVENDOR, based on OpenOffice.org,\n"
-            "which is Copyright 2000, 2011 Oracle and/or its affiliates.\n"
-            "%OOOVENDOR acknowledges all community members, please see\n"
-            "http://www.libreoffice.org/ for more details." ;
-    };
-    OKButton PB_LICENSING_SHOW
-    {
-        // Position and size is computed
-        Text [ en-US ] = "~Show License" ;
-        DefButton = TRUE ;
-    };
-    CancelButton PB_LICENSING_CLOSE
-    {
-        // Position and size is computed
-        Text [ en-US ] = "~Close" ;
-    };
-};
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index f845a05..d631b7b 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -229,61 +229,15 @@ namespace
     class LicenseDialog : public ModalDialog
     {
     private:
-        FixedText aText;
-        OKButton aShow;
-        CancelButton aClose;
-
-        DECL_LINK(CancelHdl, void *);
         DECL_LINK(ShowHdl, void *);
     public:
         LicenseDialog(Window *pParent=NULL);
     };
 
     LicenseDialog::LicenseDialog(Window *pParent)
-        : ModalDialog(pParent, SfxResId(DLG_HELP_LICENSING))
-        , aText( this )
-        , aShow( this, SfxResId( PB_LICENSING_SHOW ) )
-        , aClose( this, SfxResId( PB_LICENSING_CLOSE ) )
-    {
-        aClose.SetClickHdl( LINK( this, LicenseDialog, CancelHdl ) );
-        aShow.SetClickHdl( LINK( this, LicenseDialog, ShowHdl ) );
-
-        String aLicensing;
-        for ( int i = STR_LICENSING_INFORMATION_1; i <= STR_LICENSING_INFORMATION_5; ++i )
-        {
-            if ( i != STR_LICENSING_INFORMATION_1 )
-                aLicensing += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n" ) );
-            aLicensing += SfxResId( i ).toString();
-        }
-
-        aText.SetText( aLicensing );
-
-        // positions and sizes are computed to always fit the language
-        Size aTextSize(aText.GetOptimalSize());
-        Size aShowSize(aShow.GetOptimalSize());
-        Size aCloseSize(aClose.GetOptimalSize());
-
-        long nDelimX = 12;
-        long nDelimY = 12;
-        long nWidth = aTextSize.Width() + 2*nDelimX;
-        long nButtonY = aTextSize.Height() + 2*nDelimY;
-        Size aButtonSize( std::max( aShowSize.Width(), aCloseSize.Width() ) + nDelimX,
-                std::max( aShowSize.Height(), aCloseSize.Height() ) );
-
-        SetSizePixel( Size( nWidth, aTextSize.Height() + 3*nDelimY + aButtonSize.Height() ) );
-        aText.SetPosSizePixel( Point( nDelimX, nDelimY ), aTextSize );
-        aShow.SetPosSizePixel( Point( ( nWidth - nDelimX ) / 2 - aButtonSize.Width(), nButtonY ), aButtonSize );
-        aClose.SetPosSizePixel( Point( aShow.GetPosPixel().X() + aButtonSize.Width() + nDelimX, nButtonY ), aButtonSize );
-
-        aText.Show();
-
-        FreeResource();
-    }
-
-    IMPL_LINK_NOARG(LicenseDialog, CancelHdl)
+        : ModalDialog(pParent, "LicenseDialog", "sfx/ui/licensedialog.ui")
     {
-        Close();
-        return 0;
+        get<PushButton>("show")->SetClickHdl(LINK(this, LicenseDialog, ShowHdl));
     }
 
     IMPL_LINK_NOARG(LicenseDialog, ShowHdl)
@@ -292,10 +246,8 @@ namespace
         showDocument("LICENSE");
         return 0;
     }
-
 }
 
-
 void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 {
     bool bDone = false;
diff --git a/sfx2/uiconfig/ui/licensedialog.ui b/sfx2/uiconfig/ui/licensedialog.ui
new file mode 100644
index 0000000..aa14f0e
--- /dev/null
+++ b/sfx2/uiconfig/ui/licensedialog.ui
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="LicenseDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Licensing and Legal information</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="show">
+                <property name="label" translatable="yes">_Show License</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">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="close">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</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>
+            <property name="xalign">0</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">%PRODUCTNAME is made available subject to the terms of GNU Lesser General Public License Version 3. A copy of the LGPL license can be found at http://www.gnu.org/licenses/lgpl-3.0.html
+
+Third Party Code Additional copyright notices and license terms applicable to portions of the Software are set forth in the LICENSE.html file; choose Show License to see exact details in English.
+
+All trademarks and registered trademarks mentioned herein are the property of their respective owners.
+
+Copyright © 2000, 2013 LibreOffice contributors and/or their affiliates. All rights reserved.
+
+This product was created by %OOOVENDOR, based on OpenOffice.org, which is Copyright 2000, 2011 Oracle and/or its affiliates. %OOOVENDOR acknowledges all community members, please see http://www.libreoffice.org/ for more details.</property>
+            <property name="wrap">True</property>
+            <property name="max_width_chars">80</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">show</action-widget>
+      <action-widget response="0">close</action-widget>
+    </action-widgets>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list