[Libreoffice-commits] .: Branch 'libreoffice-3-3' - 4 commits - desktop/source sfx2/source sysui/desktop
Michael Meeks
mmeeks at kemper.freedesktop.org
Thu Jan 6 08:25:16 PST 2011
desktop/source/pkgchk/unopkg/unopkg_app.cxx | 5 -
desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 21 +++-
desktop/source/pkgchk/unopkg/unopkg_shared.h | 3
sfx2/source/appl/app.hrc | 10 ++
sfx2/source/appl/app.src | 54 ++++++++++
sfx2/source/appl/appserv.cxx | 124 +++++++++++++++----------
sysui/desktop/menus/base.desktop | 1
sysui/desktop/menus/calc.desktop | 1
sysui/desktop/menus/draw.desktop | 1
sysui/desktop/menus/impress.desktop | 1
sysui/desktop/menus/javafilter.desktop | 1
sysui/desktop/menus/math.desktop | 1
sysui/desktop/menus/printeradmin.desktop | 2
sysui/desktop/menus/qstart.desktop | 1
sysui/desktop/menus/startcenter.desktop | 1
sysui/desktop/menus/writer.desktop | 1
16 files changed, 172 insertions(+), 56 deletions(-)
New commits:
commit d4028665b8d04a812f45718608e9111c0891ce19
Author: Michael Meeks <michael.meeks at novell.com>
Date: Thu Jan 6 16:25:20 2011 +0000
add BrOffice translations for pt-BR to .desktop files, from Rene.
Signed-off-by: Michael Meeks <michael.meeks at novell.com>
diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index dea43ca..a195c89 100644
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-MoreApplicat
Exec=${UNIXBASISROOTNAME} -base %U
MimeType=application/vnd.oasis.opendocument.database;application/vnd.sun.xml.base;
Name=%PRODUCTNAME Base
+Name[pt-BR]=%PRODUCTNAME_BR Base
GenericName=Database Development
Comment=Manage databases, create queries and reports to track and manage your information by using Base.
InitialPreference=5
diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop
index 659f60a..522c179 100644
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Sprea
Exec=${UNIXBASISROOTNAME} -calc %U
MimeType=application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/vnd.stardivision.calc;application/vnd.stardivision.chart;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroenabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroenabled.12;application/vnd.ms-excel.sheet.binary.macroenabled.12;text/csv;application/x-dbf;
Name=%PRODUCTNAME Calc
+Name[pt-BR]=%PRODUCTNAME_BR Calc
GenericName=Spreadsheet
Comment=Perform calculation, analyze information and manage lists in spreadsheets by using Calc.
InitialPreference=5
diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop
index f90dc6e..3ea1741 100644
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Drawi
Exec=${UNIXBASISROOTNAME} -draw %U
MimeType=application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.graphics-template;application/vnd.sun.xml.draw;application/vnd.sun.xml.draw.template;application/vnd.stardivision.draw;
Name=%PRODUCTNAME Draw
+Name[pt-BR]=%PRODUCTNAME_BR Draw
GenericName=Drawing Program
Comment=Create and edit drawings, flow charts, and logos by using Draw.
InitialPreference=5
diff --git a/sysui/desktop/menus/impress.desktop b/sysui/desktop/menus/impress.desktop
index c35d46c..dc08e25 100644
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Prese
Exec=${UNIXBASISROOTNAME} -impress %U
MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/vnd.stardivision.impress;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.ms-powerpoint.presentation.macroenabled.12;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.ms-powerpoint.template.macroenabled.12;
Name=%PRODUCTNAME Impress
+Name[pt-BR]=%PRODUCTNAME_BR Impress
GenericName=Presentation
Comment=Create and edit presentations for slideshows, meeting and Web pages by using Impress.
InitialPreference=5
diff --git a/sysui/desktop/menus/javafilter.desktop b/sysui/desktop/menus/javafilter.desktop
index 9d230f9..f7f1f4f 100644
--- a/sysui/desktop/menus/javafilter.desktop
+++ b/sysui/desktop/menus/javafilter.desktop
@@ -5,5 +5,6 @@ Type=Application
Exec=openoffice -writer %U
MimeType=application/x-aportisdoc;application/x-pocket-word;application/x-pocket-excel;
Name=%PRODUCTNAME Small Device Format Importer
+Name[pt-BR]=%PRODUCTNAME_BR Small Device Format Importer
GenericName=Small Device Format Importer
NoDisplay=true
diff --git a/sysui/desktop/menus/math.desktop b/sysui/desktop/menus/math.desktop
index 514a6ec..c10e548 100644
--- a/sysui/desktop/menus/math.desktop
+++ b/sysui/desktop/menus/math.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other
Exec=${UNIXBASISROOTNAME} -math %U
MimeType=application/vnd.oasis.opendocument.formula;application/vnd.sun.xml.math;application/vnd.stardivision.math;
Name=%PRODUCTNAME Math
+Name[pt-BR]=%PRODUCTNAME_BR Math
GenericName=Formula Editor
Comment=Create and edit scientific formulas and equations by using Math.
InitialPreference=5
diff --git a/sysui/desktop/menus/printeradmin.desktop b/sysui/desktop/menus/printeradmin.desktop
index 17b5831..c845dd9 100644
--- a/sysui/desktop/menus/printeradmin.desktop
+++ b/sysui/desktop/menus/printeradmin.desktop
@@ -6,3 +6,5 @@ Type=Application
Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;
Exec=${UNIXBASISROOTNAME}-printeradmin
Name=%PRODUCTNAME Printer Administration
+Name[pt-BR]=%PRODUCTNAME_BR Printer Administration
+
diff --git a/sysui/desktop/menus/qstart.desktop b/sysui/desktop/menus/qstart.desktop
index 1cded62..c6f63d3 100644
--- a/sysui/desktop/menus/qstart.desktop
+++ b/sysui/desktop/menus/qstart.desktop
@@ -6,4 +6,5 @@ Categories=Office;
Exec=${UNIXBASISROOTNAME} -quickstart -nologo -nodefault
NoDisplay=true
Name=%PRODUCTNAME Quickstarter
+Name[pt-BR]=%PRODUCTNAME_BR Quickstarter
Comment=Hook for quickstarter startup
diff --git a/sysui/desktop/menus/startcenter.desktop b/sysui/desktop/menus/startcenter.desktop
index 224f0e6..2a03e56 100644
--- a/sysui/desktop/menus/startcenter.desktop
+++ b/sysui/desktop/menus/startcenter.desktop
@@ -7,5 +7,6 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Other
Exec=${UNIXBASISROOTNAME} %U
MimeType=application/vnd.openofficeorg.extension;
Name=%PRODUCTNAME
+Name[pt-BR]=%PRODUCTNAME_BR
GenericName=Office
Comment=The office productivity suite compatible to the open and standardized ODF document format. Supported by Sun Microsystems.
diff --git a/sysui/desktop/menus/writer.desktop b/sysui/desktop/menus/writer.desktop
index 12307d4..75d26a7 100644
--- a/sysui/desktop/menus/writer.desktop
+++ b/sysui/desktop/menus/writer.desktop
@@ -7,6 +7,7 @@ Categories=Office;X-Red-Hat-Base;X-SuSE-Core-Office;X-MandrivaLinux-Office-Wordp
Exec=${UNIXBASISROOTNAME} -writer %U
MimeType=application/vnd.oasis.opendocument.text;application/vnd.oasis.opendocument.text-template;application/vnd.oasis.opendocument.text-web;application/vnd.oasis.opendocument.text-master;application/vnd.sun.xml.writer;application/vnd.sun.xml.writer.template;application/vnd.sun.xml.writer.global;application/vnd.stardivision.writer;application/msword;application/vnd.ms-word;application/x-doc;application/rtf;text/rtf;application/vnd.wordperfect;application/wordperfect;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.template.macroenabled.12;
Name=%PRODUCTNAME Writer
+Name[pt-BR]=%PRODUCTNAME_BR Writer
GenericName=Word Processor
Comment=Create and edit text and graphics in letters, reports, documents and Web pages by using Writer.
InitialPreference=5
commit e607b710a65e723466c3c37780a4b4f6e0258a87
Author: David Tardon <dtardon at redhat.com>
Date: Thu Jan 6 09:28:40 2011 +0100
Related: fdo#32840 update help line for unopkg --supress-license
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index 8143f03..de8c13b 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -103,8 +103,7 @@ const char s_usingText [] =
" -V, --version version information\n"
" -v, --verbose verbose output to stdout\n"
" -f, --force force overwriting existing extensions\n"
-" -s, --suppress-license prevents showing the license provided that\n"
-" the extension allows it\n"
+" -s, --suppress-license prevents showing the license\n"
" --log-file <file> custom log file; default: <cache-dir>/log.txt\n"
" --shared expert feature: operate on shared installation\n"
" deployment context;\n"
commit 6acbb75aeb55f288675f86abc5790e8f52123fd3
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date: Wed Jan 5 10:52:49 2011 +0100
fdo#32840: make unopkg --suppress-license skip license in all cases
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index e08b427..8143f03 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -412,7 +412,7 @@ extern "C" int unopkg_main()
Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv(
createCmdEnv( xComponentContext, logFile,
- option_force, option_verbose) );
+ option_force, option_verbose, option_suppressLicense) );
//synchronize bundled/shared extensions
//Do not synchronize when command is "reinstall". This could add types and services to UNO and
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 73c9de6..c6d26b1 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -86,6 +86,7 @@ class CommandEnvironmentImpl
sal_Int32 m_logLevel;
bool m_option_force_overwrite;
bool m_option_verbose;
+ bool m_option_suppress_license;
Reference< XComponentContext > m_xComponentContext;
Reference< XProgressHandler > m_xLogFile;
@@ -99,7 +100,8 @@ public:
Reference<XComponentContext> const & xComponentContext,
OUString const & log_file,
bool option_force_overwrite,
- bool option_verbose);
+ bool option_verbose,
+ bool option_suppress_license);
// XCommandEnvironment
virtual Reference< task::XInteractionHandler > SAL_CALL
@@ -124,10 +126,12 @@ CommandEnvironmentImpl::CommandEnvironmentImpl(
Reference<XComponentContext> const & xComponentContext,
OUString const & log_file,
bool option_force_overwrite,
- bool option_verbose)
+ bool option_verbose,
+ bool option_suppressLicense)
: m_logLevel(0),
m_option_force_overwrite( option_force_overwrite ),
m_option_verbose( option_verbose ),
+ m_option_suppress_license( option_suppressLicense ),
m_xComponentContext(xComponentContext)
{
if (log_file.getLength() > 0) {
@@ -280,7 +284,13 @@ void CommandEnvironmentImpl::handle(
}
else if (request >>= licExc)
{
- printLicense(licExc.ExtensionName, licExc.Text, approve, abort);
+ if ( !m_option_suppress_license )
+ printLicense(licExc.ExtensionName, licExc.Text, approve, abort);
+ else
+ {
+ approve = true;
+ abort = false;
+ }
}
else if (request >>= instExc)
{
@@ -425,10 +435,11 @@ Reference< XCommandEnvironment > createCmdEnv(
Reference< XComponentContext > const & xContext,
OUString const & logFile,
bool option_force_overwrite,
- bool option_verbose)
+ bool option_verbose,
+ bool option_suppress_license)
{
return new CommandEnvironmentImpl(
- xContext, logFile, option_force_overwrite, option_verbose);
+ xContext, logFile, option_force_overwrite, option_verbose, option_suppress_license);
}
} // unopkg
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 58c9619..232fbf8 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -169,7 +169,8 @@ css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv(
css::uno::Reference<css::uno::XComponentContext> const & xContext,
::rtl::OUString const & logFile,
bool option_force_overwrite,
- bool option_verbose);
+ bool option_verbose,
+ bool option_suppressLicense);
//==============================================================================
void printf_packages(
::std::vector<
commit a2b5536328c2723a8145689b4cb3b36df9c4abc2
Author: Jan Holesovsky <kendy at suse.cz>
Date: Wed Dec 29 01:48:57 2010 +0100
Show the license information in a separate, localizable dialog; fdo#32563.
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
index 1f9c125..8229ec6 100644
--- a/sfx2/source/appl/app.hrc
+++ b/sfx2/source/appl/app.hrc
@@ -267,6 +267,16 @@
#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 MD_DDE_LINKEDIT (RID_SFX_APP_START + 1)
#endif // #ifndef _SFX_APP_HRC
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index e1c43c0..3e76c0b 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -1092,3 +1092,57 @@ String RID_SVXSTR_GRFILTER_TOOBIG
Text [ en-US ] = "Not enough memory to insert graphic" ;
};
+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 THIRDPARTYLICENSEREADME.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, 2010 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, 2010 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" ;
+ };
+};
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 3f1b44e..1aa8970 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -157,20 +157,42 @@ long QuitAgain_Impl( void* pObj, void* pArg )
return 0;
}
-namespace {
- sal_Bool checkURL( const char *pName, rtl::OUString &rURL )
- {
- using namespace osl;
- DirectoryItem aDirItem;
-
- rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") );
- rURL += rtl::OUString::createFromAscii( pName );
- rtl::Bootstrap::expandMacros( rURL );
+/// Find the correct location of the document (LICENSE.odt, etc.), and return
+/// it in rURL if found.
+static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rURL )
+{
+ using namespace osl;
+ DirectoryItem aDirItem;
+
+ rURL = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("$BRAND_BASE_DIR/") );
+ rURL += rtl::OUString::createFromAscii( pName );
+ rURL += rtl::OUString::createFromAscii( pExt );
+ rtl::Bootstrap::expandMacros( rURL );
+
+ if (rURL.getLength() != 0)
+ return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None;
+ else
+ return sal_False;
+}
- if (rURL.getLength() != 0)
- return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None;
- else
- return sal_False;
+/// Displays CREDITS or LICENSE in any of the available version
+static void showDocument( const char* pBaseName )
+{
+ try {
+ Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
+ Sequence < com::sun::star::beans::PropertyValue > args(2);
+ args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
+ args[0].Value <<= sal_True;
+ args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
+ args[1].Value <<= sal_True;
+
+ rtl::OUString aURL;
+ if ( checkURL ( pBaseName, ".odt", aURL ) ||
+ checkURL ( pBaseName, ".html", aURL ) ||
+ checkURL ( pBaseName, "", aURL ) ) {
+ xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args );
+ }
+ } catch (const ::com::sun::star::uno::Exception &) {
}
}
@@ -356,43 +378,51 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
break;
}
- case SID_SHOW_CREDITS:
case SID_SHOW_LICENSE:
{
- try {
- Reference < XComponentLoader > xLoader( ::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY );
- Sequence < com::sun::star::beans::PropertyValue > args(2);
- args[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ViewOnly"));
- args[0].Value <<= sal_True;
- args[1].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly"));
- args[1].Value <<= sal_True;
-
- rtl::OUString aURL;
- char const** pNames;
- if( rReq.GetSlot() == SID_SHOW_LICENSE )
- {
- static char const* pLicenseStrings[] =
- {
- "LICENSE.odt", "LICENSE.html", "LICENSE"
- };
- pNames = pLicenseStrings;
- }
- else
- {
- static char const* pCreditsStrings[] =
- {
- "CREDITS.odt", "CREDITS.html", "CREDITS"
- };
- pNames = pCreditsStrings;
- }
-
- if ( checkURL ( pNames[0], aURL ) ||
- checkURL ( pNames[1], aURL ) ||
- checkURL ( pNames[2], aURL ) ) {
- xLoader->loadComponentFromURL( aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_blank")), 0, args );
- }
- } catch (const ::com::sun::star::uno::Exception &) {
+ ModalDialog aDialog( NULL, SfxResId( DLG_HELP_LICENSING ) );
+
+ 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 += String( SfxResId( i ) );
}
+
+ FixedText aText( &aDialog );
+ aText.SetText( aLicensing );
+ OKButton aShow( &aDialog, SfxResId( PB_LICENSING_SHOW ) );
+ CancelButton aClose( &aDialog, SfxResId( PB_LICENSING_CLOSE ) );
+
+ // positions and sizes are computed to always fit the language
+ Size aTextSize( aText.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aShowSize( aShow.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+ Size aCloseSize( aClose.GetOptimalSize( WINDOWSIZE_PREFERRED ) );
+
+ 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() ) );
+
+ aDialog.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();
+
+ if ( aDialog.Execute() == RET_OK )
+ showDocument( "LICENSE" );
+
+ break;
+ }
+
+ case SID_SHOW_CREDITS:
+ {
+ showDocument( "CREDITS" );
break;
}
More information about the Libreoffice-commits
mailing list