2011-04-04 18:02:18 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-04 11:25:41 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2011-01-12 11:56:09 +01:00
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
#include <vcl/layout.hxx>
|
2011-01-12 11:56:09 +01:00
|
|
|
#include <vcl/svapp.hxx>
|
2014-01-02 23:52:37 +01:00
|
|
|
#include <vcl/settings.hxx>
|
2011-04-04 18:02:18 +01:00
|
|
|
|
2011-01-12 11:56:09 +01:00
|
|
|
#include <tools/stream.hxx>
|
|
|
|
#include <rtl/bootstrap.hxx>
|
|
|
|
#include <unotools/configmgr.hxx>
|
|
|
|
#include <unotools/bootstrap.hxx>
|
|
|
|
#include <com/sun/star/uno/Any.h>
|
|
|
|
#include <vcl/graph.hxx>
|
2013-01-02 22:07:41 +01:00
|
|
|
#include <vcl/graphicfilter.hxx>
|
2012-07-12 15:03:51 +02:00
|
|
|
#include <svtools/langhelp.hxx>
|
2011-04-04 18:02:18 +01:00
|
|
|
|
|
|
|
#include "com/sun/star/system/SystemShellExecuteFlags.hpp"
|
2012-08-29 07:45:05 +02:00
|
|
|
#include "com/sun/star/system/SystemShellExecute.hpp"
|
2011-04-04 18:02:18 +01:00
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#include "comphelper/anytostring.hxx"
|
|
|
|
#include "cppuhelper/exc_hlp.hxx"
|
|
|
|
#include "cppuhelper/bootstrap.hxx"
|
2013-01-31 23:59:10 +01:00
|
|
|
#include <basegfx/numeric/ftools.hxx>
|
|
|
|
#include <com/sun/star/geometry/RealRectangle2D.hpp>
|
2013-11-08 22:24:25 +01:00
|
|
|
#include <svtools/optionsdrawinglayer.hxx>
|
2011-04-04 18:02:18 +01:00
|
|
|
|
2011-01-12 11:56:09 +01:00
|
|
|
#include <sfx2/sfxuno.hxx>
|
2011-04-04 18:02:18 +01:00
|
|
|
#include <sfx2/sfxcommands.h>
|
2011-01-12 11:56:09 +01:00
|
|
|
#include "about.hxx"
|
2013-08-29 13:14:29 +02:00
|
|
|
#include <config_buildid.h>
|
2011-01-12 11:56:09 +01:00
|
|
|
#include <sfx2/app.hxx>
|
2011-08-01 21:57:42 +01:00
|
|
|
#include <rtl/ustrbuf.hxx>
|
2012-04-10 12:43:48 +01:00
|
|
|
#include <vcl/bitmap.hxx>
|
2017-01-28 18:00:57 +01:00
|
|
|
#include <cctype>
|
2016-07-01 20:49:19 +01:00
|
|
|
|
2016-07-28 10:33:53 +02:00
|
|
|
#if HAVE_FEATURE_OPENCL
|
2016-07-01 20:49:19 +01:00
|
|
|
#include <opencl/openclwrapper.hxx>
|
2016-07-28 10:33:53 +02:00
|
|
|
#endif
|
2012-07-12 16:19:37 +02:00
|
|
|
#include <officecfg/Office/Common.hxx>
|
2011-04-04 18:02:18 +01:00
|
|
|
|
2012-07-12 15:03:51 +02:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
2011-04-04 18:02:18 +01:00
|
|
|
using namespace ::com::sun::star;
|
2011-01-12 11:56:09 +01:00
|
|
|
|
2014-09-23 11:20:40 +02:00
|
|
|
AboutDialog::AboutDialog(vcl::Window* pParent)
|
2013-04-04 11:55:47 +01:00
|
|
|
: SfxModalDialog(pParent, "AboutDialog", "cui/ui/aboutdialog.ui")
|
2011-01-12 11:56:09 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
get(m_pLogoReplacement, "logoreplacement");
|
|
|
|
get(m_pLogoImage, "logo");
|
|
|
|
get(m_pVersion, "version");
|
|
|
|
get(m_pDescriptionText, "description");
|
|
|
|
get(m_pCopyrightText, "copyright");
|
2017-01-28 18:00:57 +01:00
|
|
|
get(m_pBuildIdLink, "buildIdLink");
|
2013-04-04 11:55:47 +01:00
|
|
|
m_aCopyrightTextStr = m_pCopyrightText->GetText();
|
|
|
|
get(m_pWebsiteButton, "website");
|
|
|
|
get(m_pCreditsButton, "credits");
|
|
|
|
m_aCreditsLinkStr = get<FixedText>("link")->GetText();
|
|
|
|
m_sBuildStr = get<FixedText>("buildid")->GetText();
|
|
|
|
m_aVendorTextStr = get<FixedText>("vendor")->GetText();
|
|
|
|
m_aVersionTextStr = m_pVersion->GetText();
|
|
|
|
m_aBasedTextStr = get<FixedText>("libreoffice")->GetText();
|
|
|
|
m_aBasedDerivedTextStr = get<FixedText>("derived")->GetText();
|
2016-01-09 22:55:28 +01:00
|
|
|
m_aLocaleStr = get<FixedText>("locale")->GetText();
|
2017-01-28 18:00:57 +01:00
|
|
|
m_buildIdLinkString = m_pBuildIdLink->GetText();
|
2013-04-04 11:55:47 +01:00
|
|
|
|
|
|
|
m_pVersion->SetText(GetVersionString());
|
|
|
|
|
|
|
|
OUString aCopyrightString = GetCopyrightString();
|
|
|
|
m_pCopyrightText->SetText( aCopyrightString );
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2017-01-28 18:00:57 +01:00
|
|
|
SetBuildIdLink();
|
|
|
|
|
2012-04-10 12:43:48 +01:00
|
|
|
StyleControls();
|
2013-04-04 11:55:47 +01:00
|
|
|
|
|
|
|
SetLogo();
|
2012-04-10 12:43:48 +01:00
|
|
|
|
|
|
|
// Connect all handlers
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pCreditsButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
|
|
|
|
m_pWebsiteButton->SetClickHdl( LINK( this, AboutDialog, HandleClick ) );
|
2011-01-12 11:56:09 +01:00
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
get<PushButton>("close")->GrabFocus();
|
2011-01-12 11:56:09 +01:00
|
|
|
}
|
|
|
|
|
2015-03-09 14:29:30 +02:00
|
|
|
AboutDialog::~AboutDialog()
|
|
|
|
{
|
2015-03-10 09:07:06 +02:00
|
|
|
disposeOnce();
|
2015-03-09 14:29:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void AboutDialog::dispose()
|
|
|
|
{
|
|
|
|
m_pVersion.clear();
|
|
|
|
m_pDescriptionText.clear();
|
|
|
|
m_pCopyrightText.clear();
|
|
|
|
m_pLogoImage.clear();
|
|
|
|
m_pLogoReplacement.clear();
|
|
|
|
m_pCreditsButton.clear();
|
|
|
|
m_pWebsiteButton.clear();
|
2017-01-28 18:00:57 +01:00
|
|
|
m_pBuildIdLink.clear();
|
2015-03-09 14:29:30 +02:00
|
|
|
SfxModalDialog::dispose();
|
|
|
|
}
|
|
|
|
|
2016-10-05 07:56:12 +02:00
|
|
|
IMPL_LINK( AboutDialog, HandleClick, Button*, pButton, void )
|
2012-03-09 09:16:47 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sURL = "";
|
2012-04-10 12:43:48 +01:00
|
|
|
|
|
|
|
// Find which button was pressed and from this, get the URL to be opened
|
2016-05-25 14:42:05 +01:00
|
|
|
if (pButton == m_pCreditsButton)
|
2012-04-10 12:43:48 +01:00
|
|
|
sURL = m_aCreditsLinkStr;
|
2016-05-25 14:42:05 +01:00
|
|
|
else if (pButton == m_pWebsiteButton)
|
2012-07-12 15:03:51 +02:00
|
|
|
{
|
2012-07-12 16:19:37 +02:00
|
|
|
sURL = officecfg::Office::Common::Help::StartCenter::InfoURL::get();
|
|
|
|
localizeWebserviceURI(sURL);
|
2012-07-12 15:03:51 +02:00
|
|
|
}
|
2012-04-10 12:43:48 +01:00
|
|
|
|
|
|
|
// If the URL is empty, don't do anything
|
|
|
|
if ( sURL.isEmpty() )
|
2015-08-19 09:11:34 +02:00
|
|
|
return;
|
2011-04-04 18:02:18 +01:00
|
|
|
try
|
|
|
|
{
|
2015-07-28 14:18:40 +02:00
|
|
|
Reference< css::system::XSystemShellExecute > xSystemShellExecute(
|
|
|
|
css::system::SystemShellExecute::create(::comphelper::getProcessComponentContext() ) );
|
|
|
|
xSystemShellExecute->execute( sURL, OUString(), css::system::SystemShellExecuteFlags::URIS_ONLY );
|
2011-04-04 18:02:18 +01:00
|
|
|
}
|
2012-07-12 15:03:51 +02:00
|
|
|
catch (const Exception&)
|
2011-04-04 18:02:18 +01:00
|
|
|
{
|
2012-07-12 15:03:51 +02:00
|
|
|
Any exc( ::cppu::getCaughtException() );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString msg( ::comphelper::anyToString( exc ) );
|
2011-04-04 18:02:18 +01:00
|
|
|
const SolarMutexGuard guard;
|
2015-03-31 23:04:14 +01:00
|
|
|
ScopedVclPtrInstance< MessageDialog > aErrorBox(nullptr, msg);
|
2015-02-11 14:42:23 +02:00
|
|
|
aErrorBox->SetText( GetText() );
|
|
|
|
aErrorBox->Execute();
|
2011-04-04 18:02:18 +01:00
|
|
|
}
|
|
|
|
}
|
2011-01-12 11:56:09 +01:00
|
|
|
|
2017-01-28 18:00:57 +01:00
|
|
|
void AboutDialog::SetBuildIdLink()
|
|
|
|
{
|
|
|
|
const OUString buildId = GetBuildId();
|
|
|
|
|
|
|
|
if (IsStringValidGitHash(buildId))
|
|
|
|
{
|
|
|
|
if (m_buildIdLinkString.indexOf("$GITHASH") == -1)
|
|
|
|
{
|
|
|
|
SAL_WARN( "cui.dialogs", "translated git hash string in translations doesn't contain $GITHASH placeholder" );
|
|
|
|
m_buildIdLinkString += " $GITHASH";
|
|
|
|
}
|
|
|
|
|
|
|
|
m_pBuildIdLink->SetText(m_buildIdLinkString.replaceAll("$GITHASH", buildId));
|
|
|
|
m_pBuildIdLink->SetURL("https://gerrit.libreoffice.org/gitweb?p=core.git;a=log;h=" + buildId);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_pBuildIdLink->Hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-10 12:43:48 +01:00
|
|
|
void AboutDialog::StyleControls()
|
|
|
|
{
|
|
|
|
// Make all the controls have a transparent background
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pLogoImage->SetBackground();
|
|
|
|
m_pLogoReplacement->SetPaintTransparent(true);
|
|
|
|
m_pVersion->SetPaintTransparent(true);
|
|
|
|
m_pDescriptionText->SetPaintTransparent(true);
|
|
|
|
m_pCopyrightText->SetPaintTransparent(true);
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2015-05-14 09:24:01 +09:00
|
|
|
const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
|
|
|
|
|
2016-04-12 16:39:03 +02:00
|
|
|
const vcl::Font& aLabelFont = rStyleSettings.GetLabelFont();
|
2014-09-16 10:09:58 +02:00
|
|
|
vcl::Font aLargeFont = aLabelFont;
|
2016-02-03 10:13:00 +11:00
|
|
|
aLargeFont.SetFontSize(Size( 0, aLabelFont.GetFontSize().Height() * 3));
|
2012-07-20 12:22:04 +02:00
|
|
|
|
|
|
|
// Logo Replacement Text
|
2015-05-14 09:24:01 +09:00
|
|
|
m_pLogoReplacement->SetControlFont(aLargeFont);
|
2012-04-10 12:43:48 +01:00
|
|
|
|
|
|
|
// Description Text
|
2016-02-03 10:13:00 +11:00
|
|
|
aLargeFont.SetFontSize(Size(0, aLabelFont.GetFontSize().Height() * 1.3));
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pDescriptionText->SetControlFont(aLargeFont);
|
2012-04-10 12:43:48 +01:00
|
|
|
|
|
|
|
// Version Text
|
2016-02-03 10:13:00 +11:00
|
|
|
aLargeFont.SetFontSize(Size(0, aLabelFont.GetFontSize().Height() * 1.2));
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pVersion->SetControlFont(aLargeFont);
|
2012-07-20 12:22:04 +02:00
|
|
|
|
|
|
|
// If not in high-contrast mode, hard-code colors
|
2015-05-14 09:24:01 +09:00
|
|
|
if (!rStyleSettings.GetHighContrastMode())
|
2012-07-20 12:22:04 +02:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pLogoReplacement->SetControlForeground(Color(51, 51, 51));
|
|
|
|
m_pVersion->SetControlForeground(Color(102, 102, 102));
|
|
|
|
m_pDescriptionText->SetControlForeground(Color(51, 51, 51));
|
|
|
|
m_pCopyrightText->SetControlForeground(Color(102, 102, 102));
|
2012-07-20 12:22:04 +02:00
|
|
|
}
|
2012-04-10 12:43:48 +01:00
|
|
|
}
|
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
void AboutDialog::SetLogo()
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
long nWidth = get_content_area()->get_preferred_size().Width();
|
2012-07-13 15:36:28 +02:00
|
|
|
|
2013-11-08 22:24:25 +01:00
|
|
|
// fdo#67401 set AntiAliasing for SVG logo
|
|
|
|
SvtOptionsDrawinglayer aDrawOpt;
|
2014-04-16 11:39:08 +02:00
|
|
|
bool bOldAntiAliasSetting = aDrawOpt.IsAntiAliasing();
|
2014-03-20 17:16:37 +02:00
|
|
|
aDrawOpt.SetAntiAliasing(true);
|
2013-11-08 22:24:25 +01:00
|
|
|
|
2013-01-31 23:59:10 +01:00
|
|
|
// load svg logo, specify desired width, scale height isotrophically
|
2015-05-14 09:24:01 +09:00
|
|
|
if (SfxApplication::loadBrandSvg("flat_logo", aLogoBitmap, nWidth) &&
|
|
|
|
!aLogoBitmap.IsEmpty())
|
2012-07-13 15:36:28 +02:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pLogoImage->SetImage(Image(aLogoBitmap));
|
|
|
|
m_pLogoReplacement->Hide();
|
|
|
|
m_pLogoImage->Show();
|
2012-07-13 15:36:28 +02:00
|
|
|
}
|
2012-07-20 12:22:04 +02:00
|
|
|
else
|
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
m_pLogoImage->Hide();
|
|
|
|
m_pLogoReplacement->Show();
|
2012-07-20 12:22:04 +02:00
|
|
|
}
|
2013-11-08 22:24:25 +01:00
|
|
|
aDrawOpt.SetAntiAliasing(bOldAntiAliasSetting);
|
2012-04-10 12:43:48 +01:00
|
|
|
}
|
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
void AboutDialog::Resize()
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
SfxModalDialog::Resize();
|
2015-05-14 09:24:01 +09:00
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
// Load background image
|
|
|
|
if (isInitialLayout(this) && !(Application::GetSettings().GetStyleSettings().GetHighContrastMode()))
|
2012-06-07 23:50:37 +02:00
|
|
|
{
|
2015-05-14 09:24:01 +09:00
|
|
|
SfxApplication::loadBrandSvg("shell/about", aBackgroundBitmap, GetSizePixel().Width());
|
2012-06-07 23:50:37 +02:00
|
|
|
}
|
2012-04-10 12:43:48 +01:00
|
|
|
}
|
|
|
|
|
2015-05-14 09:24:01 +09:00
|
|
|
void AboutDialog::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
|
2011-01-12 11:56:09 +01:00
|
|
|
{
|
2015-05-14 09:24:01 +09:00
|
|
|
rRenderContext.SetClipRegion(vcl::Region(rRect));
|
2013-04-04 11:55:47 +01:00
|
|
|
|
2015-06-23 10:29:48 +02:00
|
|
|
Size aSize(GetOutputSizePixel());
|
2013-04-04 11:55:47 +01:00
|
|
|
Point aPos(aSize.Width() - aBackgroundBitmap.GetSizePixel().Width(),
|
2015-05-14 09:24:01 +09:00
|
|
|
aSize.Height() - aBackgroundBitmap.GetSizePixel().Height());
|
|
|
|
|
|
|
|
rRenderContext.DrawBitmapEx(aPos, aBackgroundBitmap);
|
2012-04-10 12:43:48 +01:00
|
|
|
}
|
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
OUString AboutDialog::GetBuildId()
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
OUString sDefault;
|
|
|
|
OUString sBuildId(utl::Bootstrap::getBuildVersion(sDefault));
|
2012-04-10 12:43:48 +01:00
|
|
|
if (!sBuildId.isEmpty())
|
|
|
|
return sBuildId;
|
|
|
|
|
|
|
|
sBuildId = utl::Bootstrap::getBuildIdData(sDefault);
|
|
|
|
|
|
|
|
if (!sBuildId.isEmpty())
|
|
|
|
{
|
|
|
|
sal_Int32 nIndex = 0;
|
|
|
|
return sBuildId.getToken( 0, '-', nIndex );
|
|
|
|
}
|
|
|
|
|
|
|
|
OSL_ENSURE( !sBuildId.isEmpty(), "No BUILDID in bootstrap file" );
|
|
|
|
return sBuildId;
|
|
|
|
}
|
|
|
|
|
2014-11-16 01:58:54 +05:30
|
|
|
OUString AboutDialog::GetLocaleString()
|
|
|
|
{
|
2015-04-28 13:24:36 +02:00
|
|
|
OUString aLocaleStr;
|
2014-11-16 01:58:54 +05:30
|
|
|
rtl_Locale * pLocale;
|
|
|
|
|
|
|
|
osl_getProcessLocale( &pLocale );
|
|
|
|
|
2015-04-28 13:18:50 +02:00
|
|
|
if ( pLocale && pLocale->Language )
|
2014-11-16 01:58:54 +05:30
|
|
|
{
|
2015-04-28 13:18:50 +02:00
|
|
|
if (pLocale->Country && rtl_uString_getLength( pLocale->Country) > 0)
|
2015-04-28 13:24:36 +02:00
|
|
|
aLocaleStr = OUString(pLocale->Language) + "_" + OUString(pLocale->Country);
|
2015-04-28 13:18:50 +02:00
|
|
|
else
|
2015-04-28 13:24:36 +02:00
|
|
|
aLocaleStr = OUString(pLocale->Language);
|
2015-04-28 13:18:50 +02:00
|
|
|
if (pLocale->Variant && rtl_uString_getLength( pLocale->Variant) > 0)
|
2015-04-28 13:24:36 +02:00
|
|
|
aLocaleStr += OUString(pLocale->Variant);
|
2014-11-16 01:58:54 +05:30
|
|
|
}
|
|
|
|
|
2015-04-28 13:24:36 +02:00
|
|
|
return aLocaleStr;
|
2014-11-16 01:58:54 +05:30
|
|
|
}
|
|
|
|
|
2017-01-28 18:00:57 +01:00
|
|
|
bool AboutDialog::IsStringValidGitHash(const OUString& hash)
|
|
|
|
{
|
|
|
|
for (int i = 0; i < hash.getLength(); i++)
|
|
|
|
{
|
|
|
|
if (!std::isxdigit(hash[i]))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
OUString AboutDialog::GetVersionString()
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
OUString sVersion = m_aVersionTextStr;
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2015-01-10 17:07:42 +01:00
|
|
|
#ifdef _WIN64
|
|
|
|
sVersion += " (x64)";
|
|
|
|
#endif
|
|
|
|
|
2013-04-04 11:55:47 +01:00
|
|
|
OUString sBuildId = GetBuildId();
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2015-05-01 00:14:07 +02:00
|
|
|
OUString aLocaleStr = Application::GetSettings().GetLanguageTag().getBcp47() + " (" + GetLocaleString() + ")";
|
2014-11-16 01:58:54 +05:30
|
|
|
|
2012-04-25 16:06:16 +01:00
|
|
|
if (!sBuildId.trim().isEmpty())
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2013-04-04 11:55:47 +01:00
|
|
|
sVersion += "\n";
|
2012-04-25 16:06:16 +01:00
|
|
|
if (m_sBuildStr.indexOf("$BUILDID") == -1)
|
|
|
|
{
|
|
|
|
SAL_WARN( "cui.dialogs", "translated Build Id string in translations doesn't contain $BUILDID placeholder" );
|
|
|
|
m_sBuildStr += " $BUILDID";
|
|
|
|
}
|
2012-04-16 16:33:41 +01:00
|
|
|
sVersion += m_sBuildStr.replaceAll("$BUILDID", sBuildId);
|
2015-08-26 12:25:14 +02:00
|
|
|
}
|
|
|
|
|
2016-08-01 14:51:58 +05:30
|
|
|
sVersion += "\n" + Application::GetHWOSConfInfo();
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2015-03-02 11:07:39 +00:00
|
|
|
if (EXTRA_BUILDID[0] != '\0')
|
2013-08-29 14:50:10 +03:00
|
|
|
{
|
2014-12-18 13:21:49 +01:00
|
|
|
sVersion += "\n" EXTRA_BUILDID;
|
2013-08-29 14:50:10 +03:00
|
|
|
}
|
2012-11-29 18:21:30 +01:00
|
|
|
|
2015-04-28 13:24:36 +02:00
|
|
|
if (!aLocaleStr.trim().isEmpty())
|
2014-11-16 01:58:54 +05:30
|
|
|
{
|
|
|
|
sVersion += "\n";
|
2015-04-28 13:24:36 +02:00
|
|
|
if (m_aLocaleStr.indexOf("$LOCALE") == -1)
|
2014-11-16 01:58:54 +05:30
|
|
|
{
|
|
|
|
SAL_WARN( "cui.dialogs", "translated locale string in translations doesn't contain $LOCALE placeholder" );
|
2015-04-28 13:24:36 +02:00
|
|
|
m_aLocaleStr += " $LOCALE";
|
2014-11-16 01:58:54 +05:30
|
|
|
}
|
2015-04-28 13:24:36 +02:00
|
|
|
sVersion += m_aLocaleStr.replaceAll("$LOCALE", aLocaleStr);
|
2014-11-16 01:58:54 +05:30
|
|
|
}
|
|
|
|
|
2016-07-28 10:33:53 +02:00
|
|
|
#if HAVE_FEATURE_OPENCL
|
2016-07-01 20:49:19 +01:00
|
|
|
OUString aCalcMode = "Calc: "; // Calc calculation mode
|
|
|
|
bool bSWInterp = officecfg::Office::Common::Misc::UseSwInterpreter::get();
|
|
|
|
bool bOpenCL = opencl::GPUEnv::isOpenCLEnabled();
|
|
|
|
if (bOpenCL)
|
|
|
|
aCalcMode += "CL";
|
|
|
|
else if (bSWInterp)
|
|
|
|
aCalcMode += "group";
|
|
|
|
else
|
|
|
|
aCalcMode += "single";
|
|
|
|
sVersion += "; " + aCalcMode;
|
2016-07-28 10:33:53 +02:00
|
|
|
#endif
|
2016-07-01 20:49:19 +01:00
|
|
|
|
2012-04-10 12:43:48 +01:00
|
|
|
return sVersion;
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString AboutDialog::GetCopyrightString()
|
2012-04-10 12:43:48 +01:00
|
|
|
{
|
2016-08-01 14:51:58 +05:30
|
|
|
OUString aCopyrightString = m_aVendorTextStr + "\n"
|
|
|
|
+ m_aCopyrightTextStr + "\n";
|
2012-04-10 12:43:48 +01:00
|
|
|
|
2014-12-18 13:21:49 +01:00
|
|
|
if (utl::ConfigManager::getProductName() == "LibreOffice")
|
2012-04-10 12:43:48 +01:00
|
|
|
aCopyrightString += m_aBasedTextStr;
|
|
|
|
else
|
|
|
|
aCopyrightString += m_aBasedDerivedTextStr;
|
|
|
|
|
|
|
|
return aCopyrightString;
|
|
|
|
}
|
|
|
|
|
2014-02-21 12:53:51 +01:00
|
|
|
bool AboutDialog::Close()
|
2011-04-04 18:02:18 +01:00
|
|
|
{
|
|
|
|
EndDialog( RET_OK );
|
2014-02-21 12:53:51 +01:00
|
|
|
return false;
|
2011-01-12 11:56:09 +01:00
|
|
|
}
|
2011-04-04 18:02:18 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|