diff options
author | Kurt Zenker <kz@openoffice.org> | 2006-10-06 09:37:03 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2006-10-06 09:37:03 +0000 |
commit | dc2075d878549c6f5c28fa7ec780a1898553b8cf (patch) | |
tree | deef7e5b99b2bfe99a0170f742b0e1b56ec6dc52 /extensions/source/update/check/updatecheck.cxx | |
parent | 7feb68f630e969d20f45a8e9fd5194b0241969d5 (diff) |
INTEGRATION: CWS onlineupdate4 (1.2.6); FILE MERGED
2006/10/04 08:40:35 dv 1.2.6.4: RESYNC: (1.2-1.5); FILE MERGED
2006/09/26 13:05:27 obr 1.2.6.3: #i69837# default bubble text moved to ui library
2006/09/25 13:00:16 dv 1.2.6.2: #i69837# Get default bubble text from ui component
2006/09/01 13:32:36 dv 1.2.6.1: UI component removed XInitialization interface, use XPropertySet instead
Diffstat (limited to 'extensions/source/update/check/updatecheck.cxx')
-rw-r--r-- | extensions/source/update/check/updatecheck.cxx | 68 |
1 files changed, 28 insertions, 40 deletions
diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index e357b857e..99ad93bf8 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -4,9 +4,9 @@ * * $RCSfile: updatecheck.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: vg $ $Date: 2006-09-25 09:33:36 $ + * last change: $Author: kz $ $Date: 2006-10-06 10:37:03 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -50,6 +50,9 @@ #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif #ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ #include <com/sun/star/frame/XFrame.hpp> @@ -102,6 +105,13 @@ extern "C" void SAL_CALL myThreadFunc(void*); #define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) +#define PROPERTY_TITLE UNISTRING("BubbleHeading") +#define PROPERTY_TEXT UNISTRING("BubbleText") +#define PROPERTY_IMAGE UNISTRING("BubbleImageURL") +#define PROPERTY_SHOW_BUBBLE UNISTRING("BubbleVisible") +#define PROPERTY_CLICK_HDL UNISTRING("MenuClickHDL") +#define PROPERTY_DEFAULT_TITLE UNISTRING("DefaultHeading") +#define PROPERTY_DEFAULT_TEXT UNISTRING("DefaultText") //------------------------------------------------------------------------------ @@ -192,9 +202,6 @@ class UpdateCheckJob : public ::cppu::WeakImplHelper3< task::XJob, lang::XServic uno::Reference< uno::XInterface > m_xUIService; - rtl::OUString m_aBubbleHeading; - rtl::OUString m_aBubbleText; - sal_Bool (* m_pHasInternetConnection) (); protected: @@ -365,8 +372,9 @@ UpdateCheckJob::getUpdateAccess( uno::Reference< uno::XInterface > UpdateCheckJob::getUIService(sal_Bool bShowBubble) const { - uno::Reference<uno::XComponentContext> xContext(m_xContext); - + uno::Reference< uno::XComponentContext > xContext(m_xContext); + uno::Reference< uno::XInterface > xUpdateCheckUI; + if( !xContext.is() ) throw uno::RuntimeException( UNISTRING( "UpdateCheckJob: empty component context" ), *this ); @@ -380,18 +388,19 @@ UpdateCheckJob::getUIService(sal_Bool bShowBubble) const rtl::OUString aPlaceholder( RTL_CONSTASCII_USTRINGPARAM("%PRODUCTNAME") ); rtl::OUString aProductName = getProductName(); - uno::Sequence< uno::Any > aArgumentList(4); - // FIXME this should be another object .. - aArgumentList[0] = uno::makeAny( uno::Reference< task::XJob >(const_cast <UpdateCheckJob *> (this) ) ); - aArgumentList[1] = uno::makeAny( - m_aBubbleHeading.replaceAt( m_aBubbleHeading.indexOf( aPlaceholder ), - aPlaceholder.getLength(), aProductName) ); - aArgumentList[2] = uno::makeAny( m_aBubbleText ); - aArgumentList[3] = uno::makeAny( bShowBubble ); - - return xServiceManager->createInstanceWithArgumentsAndContext( - UNISTRING( "com.sun.star.setup.UpdateCheckUI" ), - aArgumentList, xContext ); + xUpdateCheckUI = xServiceManager->createInstanceWithContext( + UNISTRING( "com.sun.star.setup.UpdateCheckUI" ), xContext ); + + uno::Reference< beans::XPropertySet > xSetProperties(xUpdateCheckUI, uno::UNO_QUERY_THROW); + xSetProperties->setPropertyValue( PROPERTY_TITLE, + xSetProperties->getPropertyValue( PROPERTY_DEFAULT_TITLE ) ); + xSetProperties->setPropertyValue( PROPERTY_TEXT, + xSetProperties->getPropertyValue( PROPERTY_DEFAULT_TEXT ) ); + xSetProperties->setPropertyValue( PROPERTY_CLICK_HDL, + uno::makeAny( uno::Reference< task::XJob >(const_cast <UpdateCheckJob *> (this) ) ) ); + xSetProperties->setPropertyValue( PROPERTY_SHOW_BUBBLE, uno::makeAny( bShowBubble ) ); + + return xUpdateCheckUI; } //------------------------------------------------------------------------------ @@ -691,27 +700,6 @@ UpdateCheckJob::execute(const uno::Sequence<beans::NamedValue>& namedValues) uno::Sequence<beans::NamedValue> aConfig = getValue< uno::Sequence<beans::NamedValue> > (namedValues, "JobConfig"); - // Localization in extendable sets not yet supported - rtl::OString aLocale = OUStringToOString(getLocale(), RTL_TEXTENCODING_ASCII_US); - try - { - rtl::OString aKey = "BubbleHeading_"; - aKey += aLocale; - m_aBubbleHeading = getValue< rtl::OUString > (aConfig, aKey.getStr()); - aKey = "BubbleText_"; - aKey += aLocale; - m_aBubbleText = getValue< rtl::OUString > (aConfig, aKey.getStr()); - } - catch( uno::RuntimeException& ) - { - // fallback to en-US - m_aBubbleHeading = getValue< rtl::OUString > (aConfig, "BubbleHeading_en-US"); - m_aBubbleText = getValue< rtl::OUString > (aConfig, "BubbleText_en-US"); - } - -// m_aBubbleHeading = getValue< rtl::OUString > (aConfig, "BubbleHeading"); -// m_aBubbleText = getValue< rtl::OUString > (aConfig, "BubbleText"); - /* Determine the way we got invoked here - * see Developers Guide Chapter "4.7.2 Jobs" to understand the magic */ |