cui/source/dialogs/about.cxx | 40 ++++++++++++++++++++++++++++++++++------ cui/source/dialogs/about.hrc | 1 - cui/source/dialogs/about.src | 4 ---- cui/source/inc/about.hxx | 1 - 4 files changed, 34 insertions(+), 12 deletions(-)
New commits: commit e10695d407cd882a4e95fd64a6848606017607b4 Author: Andras Timar <ati...@suse.com> Date: Thu Jul 12 15:22:20 2012 +0200 cleanup of m_aWebsiteLinkStr in About box code (fdo#52000) Change-Id: Ie4b7325eb238064540681d5e19e5d2e7666f094d Signed-off-by: Miklos Vajna <vmik...@suse.cz> diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 8ba491c..21e4592 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -82,7 +82,6 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) : m_aCopyrightTextStr(ResId(ABOUT_STR_COPYRIGHT, *rId.GetResMgr())), m_aBasedTextStr(ResId(ABOUT_STR_BASED, *rId.GetResMgr())), m_aBasedDerivedTextStr(ResId(ABOUT_STR_BASED_DERIVED, *rId.GetResMgr())), - m_aWebsiteLinkStr(ResId( ABOUT_STR_LINK_WEBSITE, *rId.GetResMgr())), m_aCreditsLinkStr(ResId( ABOUT_STR_LINK_CREDITS, *rId.GetResMgr())), m_sBuildStr(ResId(ABOUT_STR_BUILD, *rId.GetResMgr())), m_aDescriptionTextStr(ResId(ABOUT_STR_DESCRIPTION, *rId.GetResMgr())) diff --git a/cui/source/dialogs/about.hrc b/cui/source/dialogs/about.hrc index 7842dc9..045595b 100644 --- a/cui/source/dialogs/about.hrc +++ b/cui/source/dialogs/about.hrc @@ -33,7 +33,6 @@ #define ABOUT_STR_COPYRIGHT 4 #define ABOUT_STR_BASED 5 #define ABOUT_STR_BASED_DERIVED 6 -#define ABOUT_STR_LINK_WEBSITE 7 #define ABOUT_STR_LINK_CREDITS 8 #define ABOUT_BTN_CREDITS 10 #define ABOUT_DESCRIPTION_TEXT 11 diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src index 63c5f2c..ab853c6 100644 --- a/cui/source/dialogs/about.src +++ b/cui/source/dialogs/about.src @@ -97,10 +97,6 @@ ModalDialog RID_DEFAULTABOUT { Text[ en-US ] = "(Build ID: $BUILDID)"; }; - String ABOUT_STR_LINK_WEBSITE - { - Text[ en-US ] = "http://www.libreoffice.org"; - }; String ABOUT_STR_LINK_CREDITS { Text[ en-US ] = "http://www.libreoffice.org/about-us/credits/"; diff --git a/cui/source/inc/about.hxx b/cui/source/inc/about.hxx index 6394908..783a261 100644 --- a/cui/source/inc/about.hxx +++ b/cui/source/inc/about.hxx @@ -61,7 +61,6 @@ private: String m_aCopyrightTextStr; String m_aBasedTextStr; String m_aBasedDerivedTextStr; - String m_aWebsiteLinkStr; String m_aCreditsLinkStr; rtl::OUString m_sBuildStr; String m_aDescriptionTextStr; commit 446cffa2443064dce416ce39ae2547e35bfae208 Author: Andras Timar <ati...@suse.com> Date: Thu Jul 12 15:03:51 2012 +0200 fdo#52000 take website url from configuration instead of taking it from a localized resource. This way we have more control over localizations, no need to ping each l10n team. Change-Id: I4f8904b4601cd623399146ce060b9697d7b52671 Signed-off-by: Miklos Vajna <vmik...@suse.cz> diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index daa6628..8ba491c 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/uno/Any.h> #include <vcl/graph.hxx> #include <svtools/filter.hxx> +#include <svtools/langhelp.hxx> #include "com/sun/star/system/SystemShellExecuteFlags.hpp" #include "com/sun/star/system/XSystemShellExecute.hpp" @@ -56,6 +57,8 @@ #include <vcl/bitmap.hxx> #include <vcl/rendergraphicrasterizer.hxx> +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; using namespace ::com::sun::star; enum AboutDialogButton @@ -121,22 +124,48 @@ IMPL_LINK( AboutDialog, HandleClick, PushButton*, pButton ) if ( pDialogButton == (AboutDialogButton*)CREDITS_BUTTON ) sURL = m_aCreditsLinkStr; else if ( pDialogButton == (AboutDialogButton*)WEBSITE_BUTTON ) - sURL = m_aWebsiteLinkStr; + { + try + { + Reference<lang::XMultiServiceFactory> xConfig( comphelper::getProcessServiceFactory()->createInstance(rtl::OUString( "com.sun.star.configuration.ConfigurationProvider" )),UNO_QUERY); + if( xConfig.is() ) + { + Sequence<Any> args(1); + PropertyValue val( + rtl::OUString( "nodepath" ), + 0, + Any(rtl::OUString( "/org.openoffice.Office.Common/Help/StartCenter" )), + PropertyState_DIRECT_VALUE); + args.getArray()[0] <<= val; + Reference<container::XNameAccess> xNameAccess(xConfig->createInstanceWithArguments(rtl::OUString( "com.sun.star.configuration.ConfigurationAccess" ),args), UNO_QUERY); + if( xNameAccess.is() ) + { + //throws css::container::NoSuchElementException, css::lang::WrappedTargetException + Any value( xNameAccess->getByName(rtl::OUString( "InfoURL" )) ); + sURL = value.get<rtl::OUString> (); + localizeWebserviceURI(sURL); + } + } + } + catch (const Exception&) + { + } + } // If the URL is empty, don't do anything if ( sURL.isEmpty() ) return 1; try { - uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( + Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance( - DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), uno::UNO_QUERY_THROW ); + DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute") ), UNO_QUERY_THROW ); xSystemShellExecute->execute( sURL, rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY ); } - catch (const uno::Exception&) + catch (const Exception&) { - uno::Any exc( ::cppu::getCaughtException() ); + Any exc( ::cppu::getCaughtException() ); rtl::OUString msg( ::comphelper::anyToString( exc ) ); const SolarMutexGuard guard; ErrorBox aErrorBox( NULL, WB_OK, msg ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits