summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <atimar@suse.com>2012-07-12 15:03:51 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-12 16:28:49 +0200
commit446cffa2443064dce416ce39ae2547e35bfae208 (patch)
treec66d691ad824fb94fa3a0fdc4a508f9e4c560a4e
parent34314ec5eaf7d7ac42f902b91e334fae22300c8b (diff)
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 <vmiklos@suse.cz>
-rw-r--r--cui/source/dialogs/about.cxx39
1 files changed, 34 insertions, 5 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index daa662836ef9..8ba491c73eb8 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 );