Use correct object
[LibreOffice.git] / cui / source / options / optupdt.cxx
blob21fd59d7f712ce9373f6f068f3a86010b039376b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <config_features.h>
21 #include <vcl/svapp.hxx>
22 #include <vcl/settings.hxx>
23 #include <svl/numformat.hxx>
24 #include <svl/zforlist.hxx>
25 #include "optupdt.hxx"
26 #include <comphelper/processfactory.hxx>
27 #include <com/sun/star/configuration/theDefaultProvider.hpp>
28 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 #include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
30 #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
31 #include <com/sun/star/deployment/UpdateInformationProvider.hpp>
32 #include <com/sun/star/ucb/XWebDAVCommandEnvironment.hpp>
33 #include <com/sun/star/frame/Desktop.hpp>
34 #include <com/sun/star/frame/XDispatchProvider.hpp>
35 #include <com/sun/star/util/XChangesBatch.hpp>
36 #include <com/sun/star/util/URLTransformer.hpp>
37 #include <com/sun/star/util/XURLTransformer.hpp>
38 #include <com/sun/star/setup/UpdateCheck.hpp>
39 #include <com/sun/star/setup/UpdateCheckConfig.hpp>
40 #include <com/sun/star/configuration/ReadWriteAccess.hpp>
41 #include <com/sun/star/beans/PropertyAttribute.hpp>
42 #include <com/sun/star/beans/NamedValue.hpp>
43 #include <sfx2/filedlghelper.hxx>
44 #include <officecfg/Office/Common.hxx>
45 #include <officecfg/Office/Update.hxx>
46 #include <osl/file.hxx>
47 #include <osl/security.hxx>
48 #include <comphelper/diagnose_ex.hxx>
49 #include <unotools/configmgr.hxx>
51 using namespace ::css;
53 SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
54 : SfxTabPage(pPage, pController, u"cui/ui/optonlineupdatepage.ui"_ustr, u"OptOnlineUpdatePage"_ustr, &rSet)
55 , m_showTraditionalOnlineUpdate(isTraditionalOnlineUpdateAvailable())
56 , m_showMarOnlineUpdate(isMarOnlineUpdateAvailable())
57 , m_xNeverChecked(m_xBuilder->weld_label(u"neverchecked"_ustr))
58 , m_xAutoCheckCheckBox(m_xBuilder->weld_check_button(u"autocheck"_ustr))
59 , m_xAutoCheckImg(m_xBuilder->weld_widget(u"lockautocheck"_ustr))
60 , m_xEveryDayButton(m_xBuilder->weld_radio_button(u"everyday"_ustr))
61 , m_xEveryWeekButton(m_xBuilder->weld_radio_button(u"everyweek"_ustr))
62 , m_xEveryMonthButton(m_xBuilder->weld_radio_button(u"everymonth"_ustr))
63 , m_xCheckIntervalImg(m_xBuilder->weld_widget(u"lockcheckinterval"_ustr))
64 , m_xCheckNowButton(m_xBuilder->weld_button(u"checknow"_ustr))
65 , m_xAutoDownloadCheckBox(m_xBuilder->weld_check_button(u"autodownload"_ustr))
66 , m_xAutoDownloadImg(m_xBuilder->weld_widget(u"lockautodownload"_ustr))
67 , m_xDestPathLabel(m_xBuilder->weld_label(u"destpathlabel"_ustr))
68 , m_xDestPath(m_xBuilder->weld_label(u"destpath"_ustr))
69 , m_xChangePathButton(m_xBuilder->weld_button(u"changepath"_ustr))
70 , m_xLastChecked(m_xBuilder->weld_label(u"lastchecked"_ustr))
71 , m_xExtrasCheckBox(m_xBuilder->weld_check_button(u"extrabits"_ustr))
72 , m_xExtrasImg(m_xBuilder->weld_widget(u"lockextrabits"_ustr))
73 , m_xUserAgentLabel(m_xBuilder->weld_label(u"useragent"_ustr))
74 , m_xPrivacyPolicyButton(m_xBuilder->weld_link_button(u"btnPrivacyPolicy"_ustr))
75 , m_xBox2(m_xBuilder->weld_box(u"box2"_ustr))
76 , m_xFrameDest(m_xBuilder->weld_frame(u"frameDest"_ustr))
77 , m_xFrameAgent(m_xBuilder->weld_frame(u"frameAgent"_ustr))
78 , m_xMar(m_xBuilder->weld_frame(u"frameMar"_ustr))
79 , m_xEnableMar(m_xBuilder->weld_check_button(u"enableMar"_ustr))
81 if (m_showTraditionalOnlineUpdate) {
82 m_aNeverChecked = m_xNeverChecked->get_label();
84 m_xAutoCheckCheckBox->connect_toggled( LINK( this, SvxOnlineUpdateTabPage, AutoCheckHdl_Impl ) );
85 m_xExtrasCheckBox->connect_toggled( LINK( this, SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl ) );
86 m_xCheckNowButton->connect_clicked( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
87 m_xChangePathButton->connect_clicked( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
88 m_xPrivacyPolicyButton->set_uri(
89 officecfg::Office::Common::Menus::PrivacyPolicyURL::get()
90 + "?type=updatecheck&LOvers=" + utl::ConfigManager::getProductVersion()
91 + "&LOlocale=" + LanguageTag(utl::ConfigManager::getUILocale()).getBcp47());
94 const uno::Reference < uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
96 m_xUpdateAccess = setup::UpdateCheckConfig::create( xContext );
97 m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, u"*"_ustr);
99 bool bDownloadSupported = false;
100 m_xUpdateAccess->getByName( u"DownloadSupported"_ustr ) >>= bDownloadSupported;
102 m_xAutoDownloadCheckBox->set_visible(bDownloadSupported);
103 m_xDestPathLabel->set_visible(bDownloadSupported);
104 m_xDestPath->set_visible(bDownloadSupported);
105 m_xChangePathButton->set_visible(bDownloadSupported);
107 m_aLastCheckedTemplate = m_xLastChecked->get_label();
109 UpdateLastCheckedText();
110 UpdateUserAgent();
111 } else {
112 m_xAutoCheckCheckBox->hide();
113 m_xEveryDayButton->hide();
114 m_xEveryWeekButton->hide();
115 m_xEveryMonthButton->hide();
116 m_xCheckNowButton->hide();
117 m_xBox2->hide();
118 m_xAutoCheckImg->hide();
119 m_xCheckIntervalImg->hide();
120 m_xFrameDest->hide();
121 m_xFrameAgent->hide();
122 m_xPrivacyPolicyButton->hide();
125 if (m_showMarOnlineUpdate) {
126 m_xMar->show();
127 m_xEnableMar->set_sensitive(!officecfg::Office::Update::Update::Enabled::isReadOnly());
128 } else {
129 m_xMar->hide();
133 SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
137 void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
139 OUString aText;
140 sal_Int64 lastChecked = 0;
142 m_xUpdateAccess->getByName(u"LastCheck"_ustr) >>= lastChecked;
144 if( lastChecked == 0 ) // never checked
146 aText = m_aNeverChecked;
148 else
150 TimeValue lastCheckedTV;
151 oslDateTime lastCheckedDT;
153 Date aDate( Date::EMPTY );
154 tools::Time aTime( tools::Time::EMPTY );
156 lastCheckedTV.Seconds = static_cast<sal_uInt32>(lastChecked);
157 osl_getLocalTimeFromSystemTime( &lastCheckedTV, &lastCheckedTV );
159 if ( osl_getDateTimeFromTimeValue( &lastCheckedTV, &lastCheckedDT ) )
161 aDate = Date( lastCheckedDT.Day, lastCheckedDT.Month, lastCheckedDT.Year );
162 aTime = ::tools::Time( lastCheckedDT.Hours, lastCheckedDT.Minutes );
165 LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType();
166 std::optional<SvNumberFormatter> pNumberFormatter( std::in_place, ::comphelper::getProcessComponentContext(), eUILang );
167 const Color* pColor = nullptr;
168 const Date& rNullDate = pNumberFormatter->GetNullDate();
169 sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( SvNumFormatType::DATE, eUILang );
171 OUString aDateStr;
172 pNumberFormatter->GetOutputString( aDate - rNullDate, nFormat, aDateStr, &pColor );
174 nFormat = pNumberFormatter->GetStandardFormat( SvNumFormatType::TIME, eUILang );
175 OUString aTimeStr;
176 pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTimeStr, &pColor );
178 pNumberFormatter.reset();
180 aText = m_aLastCheckedTemplate;
181 sal_Int32 nIndex = aText.indexOf( "%DATE%" );
182 if ( nIndex != -1 )
183 aText = aText.replaceAt( nIndex, 6, aDateStr );
185 nIndex = aText.indexOf( "%TIME%" );
186 if ( nIndex != -1 )
187 aText = aText.replaceAt( nIndex, 6, aTimeStr );
190 m_xLastChecked->set_label(aText);
193 static inline OUString WrapString(const OUString& aStr)
195 OUString sResult;
196 OUString sPos;
197 int nPos = 0;
198 for (int i = 0; i < aStr.getLength(); i++)
200 sPos = aStr.subView(i, 1);
201 sResult += sPos;
202 if ((nPos > 50) && (sPos == ";"))
204 sResult += "\n";
205 nPos = 0;
207 nPos++;
209 return sResult;
212 void SvxOnlineUpdateTabPage::UpdateUserAgent()
214 try {
215 uno::Reference< ucb::XWebDAVCommandEnvironment > xDav(
216 css::deployment::UpdateInformationProvider::create(
217 ::comphelper::getProcessComponentContext() ),
218 css::uno::UNO_QUERY_THROW );
220 OUString aPseudoURL = u"useragent:normal"_ustr;
221 if( m_xExtrasCheckBox->get_active() )
222 aPseudoURL = "useragent:extended";
223 const uno::Sequence< beans::StringPair > aHeaders
224 = xDav->getUserRequestHeaders( aPseudoURL, ucb::WebDAVHTTPMethod(0) );
226 for (const css::beans::StringPair & aHeader : aHeaders)
228 if ( aHeader.First == "User-Agent" )
230 OUString aText = aHeader.Second;
231 m_xUserAgentLabel->set_label(WrapString(aText));
232 break;
235 } catch (const uno::Exception &) {
236 TOOLS_WARN_EXCEPTION( "cui.options", "Unexpected exception fetching User Agent" );
240 std::unique_ptr<SfxTabPage> SvxOnlineUpdateTabPage::Create( weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrSet )
242 return std::make_unique<SvxOnlineUpdateTabPage>( pPage, pController, *rAttrSet );
245 OUString SvxOnlineUpdateTabPage::GetAllStrings()
247 OUString sAllStrings;
248 OUString labels[] = { u"label1"_ustr, u"lastchecked"_ustr, u"neverchecked"_ustr, u"labeldest"_ustr,
249 u"destpathlabel"_ustr, u"labelagent"_ustr, u"useragent_label"_ustr, u"useragent_changed"_ustr };
251 for (const auto& label : labels)
253 if (const auto pString = m_xBuilder->weld_label(label))
254 sAllStrings += pString->get_label() + " ";
257 OUString checkButton[] = { u"autocheck"_ustr, u"autodownload"_ustr, u"extrabits"_ustr };
259 for (const auto& check : checkButton)
261 if (const auto pString = m_xBuilder->weld_check_button(check))
262 sAllStrings += pString->get_label() + " ";
265 OUString radioButton[] = { u"everyday"_ustr, u"everyweek"_ustr, u"everymonth"_ustr };
267 for (const auto& radio : radioButton)
269 if (const auto pString = m_xBuilder->weld_radio_button(radio))
270 sAllStrings += pString->get_label() + " ";
273 // some buttons are not included
274 sAllStrings += m_xPrivacyPolicyButton->get_label() + " ";
276 return sAllStrings.replaceAll("_", "");
279 bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
281 bool bModified = false;
283 if (m_showTraditionalOnlineUpdate) {
284 bool bValue;
285 sal_Int64 nValue;
287 if( m_xAutoCheckCheckBox->get_state_changed_from_saved() )
289 bValue = m_xAutoCheckCheckBox->get_active();
290 m_xUpdateAccess->replaceByName( u"AutoCheckEnabled"_ustr, uno::Any( bValue ) );
291 bModified = true;
294 nValue = 0;
295 if( m_xEveryDayButton->get_active() )
297 if( !m_xEveryDayButton->get_saved_state() )
298 nValue = 86400;
300 else if( m_xEveryWeekButton->get_active() )
302 if( !m_xEveryWeekButton->get_saved_state() )
303 nValue = 604800;
305 else if( m_xEveryMonthButton->get_active() )
307 if( !m_xEveryMonthButton->get_saved_state() )
308 nValue = 2592000;
311 if( nValue > 0 )
313 m_xUpdateAccess->replaceByName( u"CheckInterval"_ustr, uno::Any( nValue ) );
314 bModified = true;
317 if( m_xAutoDownloadCheckBox->get_state_changed_from_saved() )
319 bValue = m_xAutoDownloadCheckBox->get_active();
320 m_xUpdateAccess->replaceByName( u"AutoDownloadEnabled"_ustr, uno::Any( bValue ) );
321 bModified = true;
324 OUString sValue, aURL;
325 m_xUpdateAccess->getByName( u"DownloadDestination"_ustr ) >>= sValue;
327 if( ( osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(m_xDestPath->get_label(), aURL) ) &&
328 ( aURL != sValue ) )
330 m_xUpdateAccess->replaceByName( u"DownloadDestination"_ustr, uno::Any( aURL ) );
331 bModified = true;
334 if( m_xExtrasCheckBox->get_state_changed_from_saved() )
336 bValue = m_xExtrasCheckBox->get_active();
337 m_xUpdateAccess->replaceByName( u"ExtendedUserAgent"_ustr, uno::Any( bValue ) );
338 bModified = true;
341 uno::Reference< util::XChangesBatch > xChangesBatch(m_xUpdateAccess, uno::UNO_QUERY);
342 if( xChangesBatch.is() && xChangesBatch->hasPendingChanges() )
343 xChangesBatch->commitChanges();
346 if (m_showMarOnlineUpdate && m_xEnableMar->get_state_changed_from_saved()) {
347 auto batch(comphelper::ConfigurationChanges::create());
348 officecfg::Office::Update::Update::Enabled::set(m_xEnableMar->get_active(), batch);
349 batch->commit();
350 bModified = true;
353 return bModified;
356 void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
358 if (m_showTraditionalOnlineUpdate) {
359 bool bValue = false;
360 m_xUpdateAccess->getByName( u"AutoCheckEnabled"_ustr ) >>= bValue;
361 beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled"_ustr);
362 bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
364 m_xAutoCheckCheckBox->set_active(bValue);
365 m_xAutoCheckCheckBox->set_sensitive(!bReadOnly);
366 m_xAutoCheckImg->set_visible(bReadOnly);
368 sal_Int64 nValue = 0;
369 m_xUpdateAccess->getByName( u"CheckInterval"_ustr ) >>= nValue;
370 aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval"_ustr);
371 bool bReadOnly2 = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
372 m_xEveryDayButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
373 m_xEveryWeekButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
374 m_xEveryMonthButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
375 m_xCheckIntervalImg->set_visible(bReadOnly2);
377 if( nValue == 86400 )
378 m_xEveryDayButton->set_active(true);
379 else if( nValue == 604800 )
380 m_xEveryWeekButton->set_active(true);
381 else
382 m_xEveryMonthButton->set_active(true);
384 m_xAutoCheckCheckBox->save_state();
385 m_xEveryDayButton->save_state();
386 m_xEveryWeekButton->save_state();
387 m_xEveryMonthButton->save_state();
389 m_xUpdateAccess->getByName( u"AutoDownloadEnabled"_ustr ) >>= bValue;
390 aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoDownloadEnabled"_ustr);
391 bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
392 m_xAutoDownloadCheckBox->set_active(bValue);
393 m_xAutoDownloadCheckBox->set_sensitive(!bReadOnly);
394 m_xAutoDownloadImg->set_visible(bReadOnly);
395 m_xDestPathLabel->set_sensitive(true);
396 m_xDestPath->set_sensitive(true);
398 OUString sValue, aPath;
399 m_xUpdateAccess->getByName( u"DownloadDestination"_ustr ) >>= sValue;
400 aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/DownloadDestination"_ustr);
401 bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
402 m_xChangePathButton->set_sensitive(!bReadOnly);
404 if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(sValue, aPath) )
405 m_xDestPath->set_label(aPath);
407 m_xUpdateAccess->getByName( u"ExtendedUserAgent"_ustr ) >>= bValue;
408 aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/ExtendedUserAgent"_ustr);
409 bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
410 m_xExtrasCheckBox->set_active(bValue);
411 m_xExtrasCheckBox->set_sensitive(!bReadOnly);
412 m_xExtrasImg->set_visible(bReadOnly);
413 m_xExtrasCheckBox->save_state();
414 UpdateUserAgent();
416 m_xAutoDownloadCheckBox->save_state();
419 if (m_showMarOnlineUpdate) {
420 m_xEnableMar->set_active(officecfg::Office::Update::Update::Enabled::get());
421 m_xEnableMar->save_state();
425 void SvxOnlineUpdateTabPage::FillUserData()
429 IMPL_LINK(SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, weld::Toggleable&, rBox, void)
431 bool bEnabled = rBox.get_active();
432 beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(u"/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval"_ustr);
433 bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
434 m_xEveryDayButton->set_sensitive(bEnabled && !bReadOnly);
435 m_xEveryWeekButton->set_sensitive(bEnabled && !bReadOnly);
436 m_xEveryMonthButton->set_sensitive(bEnabled && !bReadOnly);
437 m_xCheckIntervalImg->set_visible(bReadOnly);
440 IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl, weld::Toggleable&, void)
442 UpdateUserAgent();
445 IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, weld::Button&, void)
447 const uno::Reference < uno::XComponentContext >& xContext( ::comphelper::getProcessComponentContext() );
448 uno::Reference < ui::dialogs::XFolderPicker2 > xFolderPicker = sfx2::createFolderPicker(xContext, GetFrameWeld());
450 OUString aURL;
451 if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_xDestPath->get_label(), aURL) )
452 osl::Security().getHomeDir(aURL);
454 xFolderPicker->setDisplayDirectory( aURL );
455 sal_Int16 nRet = xFolderPicker->execute();
457 if ( ui::dialogs::ExecutableDialogResults::OK == nRet )
459 OUString aFolder;
460 if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(xFolderPicker->getDirectory(), aFolder))
461 m_xDestPath->set_label(aFolder);
465 IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, weld::Button&, void)
467 const uno::Reference < uno::XComponentContext>& xContext( ::comphelper::getProcessComponentContext() );
471 uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
472 css::configuration::theDefaultProvider::get( xContext ) );
474 beans::NamedValue aProperty;
475 aProperty.Name = "nodepath";
476 aProperty.Value <<= u"org.openoffice.Office.Addons/AddonUI/OfficeHelp/UpdateCheckJob"_ustr;
478 uno::Sequence< uno::Any > aArgumentList{ uno::Any(aProperty) };
480 uno::Reference< container::XNameAccess > xNameAccess(
481 xConfigProvider->createInstanceWithArguments(
482 u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArgumentList ),
483 uno::UNO_QUERY_THROW );
485 util::URL aURL;
486 xNameAccess->getByName(u"URL"_ustr) >>= aURL.Complete;
488 uno::Reference < util::XURLTransformer > xTransformer( util::URLTransformer::create( xContext ) );
490 xTransformer->parseStrict(aURL);
492 uno::Reference < frame::XDesktop2 > xDesktop = frame::Desktop::create( xContext );
494 uno::Reference< frame::XDispatchProvider > xDispatchProvider(
495 xDesktop->getCurrentFrame(), uno::UNO_QUERY );
497 uno::Reference< frame::XDispatch > xDispatch;
498 if( xDispatchProvider.is() )
499 xDispatch = xDispatchProvider->queryDispatch(aURL, OUString(), 0);
501 if( xDispatch.is() )
502 xDispatch->dispatch(aURL, uno::Sequence< beans::PropertyValue > ());
504 UpdateLastCheckedText();
506 catch( const uno::Exception& )
508 TOOLS_WARN_EXCEPTION("cui.options", "Caught exception, thread terminated");
512 bool SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateAvailable() {
515 css::uno::Reference < css::uno::XInterface > xService( setup::UpdateCheck::create( ::comphelper::getProcessComponentContext() ) );
516 if( xService.is() )
517 return true;
519 catch ( css::uno::DeploymentException& )
522 return false;
525 bool SvxOnlineUpdateTabPage::isMarOnlineUpdateAvailable() {
526 #if HAVE_FEATURE_UPDATE_MAR
527 return true;
528 #else
529 return false;
530 #endif
533 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */