fdo#46808, Adapt setup::UpdateCheckConfig UNO services to new style
The services already existed, it just did not have an IDL file. Change-Id: Iae319545e5bf2384ede0992715a4879554605a22
This commit is contained in:
@@ -35,16 +35,11 @@
|
|||||||
#include <com/sun/star/util/XChangesBatch.hpp>
|
#include <com/sun/star/util/XChangesBatch.hpp>
|
||||||
#include <com/sun/star/util/URLTransformer.hpp>
|
#include <com/sun/star/util/URLTransformer.hpp>
|
||||||
#include <com/sun/star/util/XURLTransformer.hpp>
|
#include <com/sun/star/util/XURLTransformer.hpp>
|
||||||
|
#include <com/sun/star/setup/UpdateCheckConfig.hpp>
|
||||||
#include <osl/file.hxx>
|
#include <osl/file.hxx>
|
||||||
#include <osl/security.hxx>
|
#include <osl/security.hxx>
|
||||||
|
|
||||||
namespace beans = ::com::sun::star::beans;
|
using namespace ::com::sun::star;
|
||||||
namespace container = ::com::sun::star::container;
|
|
||||||
namespace dialogs = ::com::sun::star::ui::dialogs;
|
|
||||||
namespace frame = ::com::sun::star::frame;
|
|
||||||
namespace lang = ::com::sun::star::lang;
|
|
||||||
namespace uno = ::com::sun::star::uno;
|
|
||||||
namespace util = ::com::sun::star::util;
|
|
||||||
|
|
||||||
// class SvxOnlineUpdateTabPage --------------------------------------------------
|
// class SvxOnlineUpdateTabPage --------------------------------------------------
|
||||||
|
|
||||||
@@ -70,11 +65,9 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage( Window* pParent, const SfxItemSe
|
|||||||
m_aCheckNowButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
|
m_aCheckNowButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
|
||||||
m_aChangePathButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
|
m_aChangePathButton.SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
|
||||||
|
|
||||||
uno::Reference < lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
|
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
||||||
|
|
||||||
m_xUpdateAccess = uno::Reference < container::XNameReplace >(
|
m_xUpdateAccess = setup::UpdateCheckConfig::create( xContext );
|
||||||
xFactory->createInstance( "com.sun.star.setup.UpdateCheckConfig" ),
|
|
||||||
uno::UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
sal_Bool bDownloadSupported = sal_False;
|
sal_Bool bDownloadSupported = sal_False;
|
||||||
m_xUpdateAccess->getByName( "DownloadSupported" ) >>= bDownloadSupported;
|
m_xUpdateAccess->getByName( "DownloadSupported" ) >>= bDownloadSupported;
|
||||||
@@ -301,7 +294,7 @@ IMPL_LINK( SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, CheckBox *, pBox )
|
|||||||
IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl)
|
IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl)
|
||||||
{
|
{
|
||||||
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
|
||||||
uno::Reference < dialogs::XFolderPicker2 > xFolderPicker = dialogs::FolderPicker::create(xContext);
|
uno::Reference < ui::dialogs::XFolderPicker2 > xFolderPicker = ui::dialogs::FolderPicker::create(xContext);
|
||||||
|
|
||||||
rtl::OUString aURL;
|
rtl::OUString aURL;
|
||||||
if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) )
|
if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_aDestPath.GetText(), aURL) )
|
||||||
@@ -310,7 +303,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl)
|
|||||||
xFolderPicker->setDisplayDirectory( aURL );
|
xFolderPicker->setDisplayDirectory( aURL );
|
||||||
sal_Int16 nRet = xFolderPicker->execute();
|
sal_Int16 nRet = xFolderPicker->execute();
|
||||||
|
|
||||||
if ( dialogs::ExecutableDialogResults::OK == nRet )
|
if ( ui::dialogs::ExecutableDialogResults::OK == nRet )
|
||||||
{
|
{
|
||||||
rtl::OUString aFolder;
|
rtl::OUString aFolder;
|
||||||
if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(xFolderPicker->getDirectory(), aFolder))
|
if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(xFolderPicker->getDirectory(), aFolder))
|
||||||
|
@@ -275,6 +275,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
|
|||||||
DocumentDigitalSignatures \
|
DocumentDigitalSignatures \
|
||||||
SerialNumberAdapter \
|
SerialNumberAdapter \
|
||||||
))
|
))
|
||||||
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/setup,\
|
||||||
|
UpdateCheckConfig \
|
||||||
|
))
|
||||||
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sheet,\
|
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sheet,\
|
||||||
ExternalDocLink \
|
ExternalDocLink \
|
||||||
ExternalDocLinks \
|
ExternalDocLinks \
|
||||||
|
41
offapi/com/sun/star/setup/UpdateCheckConfig.idl
Normal file
41
offapi/com/sun/star/setup/UpdateCheckConfig.idl
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* 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 .
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __com_sun_star_setup_UpdateCheckConfig_idl__
|
||||||
|
#define __com_sun_star_setup_UpdateCheckConfig_idl__
|
||||||
|
|
||||||
|
#include <com/sun/star/container/XNameReplace.idl>
|
||||||
|
|
||||||
|
|
||||||
|
module com { module sun { module star { module setup {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
This was created from it's places of use, so it may be incomplete.
|
||||||
|
|
||||||
|
@since LibreOffice 4.1
|
||||||
|
*/
|
||||||
|
service UpdateCheckConfig : com::sun::star::container::XNameReplace;
|
||||||
|
|
||||||
|
|
||||||
|
}; }; }; };
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@@ -25,6 +25,7 @@
|
|||||||
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
#include <com/sun/star/frame/XDispatchProvider.hpp>
|
||||||
#include <com/sun/star/system/SystemShellExecute.hpp>
|
#include <com/sun/star/system/SystemShellExecute.hpp>
|
||||||
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
|
#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
|
||||||
|
#include <com/sun/star/setup/UpdateCheckConfig.hpp>
|
||||||
#include <com/sun/star/util/URLTransformer.hpp>
|
#include <com/sun/star/util/URLTransformer.hpp>
|
||||||
#include <com/sun/star/util/XURLTransformer.hpp>
|
#include <com/sun/star/util/XURLTransformer.hpp>
|
||||||
#include <com/sun/star/container/XNameReplace.hpp>
|
#include <com/sun/star/container/XNameReplace.hpp>
|
||||||
@@ -37,14 +38,7 @@
|
|||||||
#include <vcl/msgbox.hxx>
|
#include <vcl/msgbox.hxx>
|
||||||
#include <osl/process.h>
|
#include <osl/process.h>
|
||||||
|
|
||||||
namespace beans = ::com::sun::star::beans;
|
using namespace com::sun::star;
|
||||||
namespace frame = ::com::sun::star::frame;
|
|
||||||
namespace lang = ::com::sun::star::lang;
|
|
||||||
namespace uno = ::com::sun::star::uno;
|
|
||||||
namespace util = ::com::sun::star::util;
|
|
||||||
namespace container = ::com::sun::star::container;
|
|
||||||
|
|
||||||
using namespace com::sun::star::system;
|
|
||||||
|
|
||||||
namespace uui
|
namespace uui
|
||||||
{
|
{
|
||||||
@@ -91,23 +85,21 @@ IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
|
||||||
if ( !sNotifyURL.isEmpty() && !m_sVersion.isEmpty() )
|
if ( !sNotifyURL.isEmpty() && !m_sVersion.isEmpty() )
|
||||||
{
|
{
|
||||||
uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
|
uno::Reference< system::XSystemShellExecute > xSystemShell( system::SystemShellExecute::create(xContext) );
|
||||||
uno::Reference< XSystemShellExecute > xSystemShell( SystemShellExecute::create(xContext) );
|
|
||||||
sNotifyURL += m_sVersion;
|
sNotifyURL += m_sVersion;
|
||||||
if ( !sNotifyURL.isEmpty() )
|
if ( !sNotifyURL.isEmpty() )
|
||||||
{
|
{
|
||||||
xSystemShell->execute(
|
xSystemShell->execute(
|
||||||
sNotifyURL, ::rtl::OUString(), SystemShellExecuteFlags::URIS_ONLY );
|
sNotifyURL, ::rtl::OUString(), system::SystemShellExecuteFlags::URIS_ONLY );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
|
uno::Reference < container::XNameReplace > xUpdateConfig =
|
||||||
|
setup::UpdateCheckConfig::create(xContext);
|
||||||
uno::Reference < container::XNameReplace > xUpdateConfig(
|
|
||||||
aContext.createComponent( "com.sun.star.setup.UpdateCheckConfig" ), uno::UNO_QUERY_THROW );
|
|
||||||
|
|
||||||
sal_Bool bUpdateCheckEnabled = sal_False;
|
sal_Bool bUpdateCheckEnabled = sal_False;
|
||||||
OSL_VERIFY( xUpdateConfig->getByName( OUString( "AutoCheckEnabled" ) ) >>= bUpdateCheckEnabled );
|
OSL_VERIFY( xUpdateConfig->getByName( OUString( "AutoCheckEnabled" ) ) >>= bUpdateCheckEnabled );
|
||||||
@@ -116,7 +108,7 @@ IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl)
|
|||||||
// updates enabled", but this here is not an automatic update, but one triggered explicitly by the user.
|
// updates enabled", but this here is not an automatic update, but one triggered explicitly by the user.
|
||||||
|
|
||||||
uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
|
uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey(
|
||||||
aContext.getUNOContext(),
|
xContext,
|
||||||
"org.openoffice.Office.Addons/",
|
"org.openoffice.Office.Addons/",
|
||||||
"AddonUI/OfficeHelp/UpdateCheckJob",
|
"AddonUI/OfficeHelp/UpdateCheckJob",
|
||||||
"URL",
|
"URL",
|
||||||
@@ -124,10 +116,10 @@ IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl)
|
|||||||
util::URL aURL;
|
util::URL aURL;
|
||||||
if ( aVal >>= aURL.Complete )
|
if ( aVal >>= aURL.Complete )
|
||||||
{
|
{
|
||||||
uno::Reference< util::XURLTransformer > xTransformer( util::URLTransformer::create(aContext.getUNOContext()) );
|
uno::Reference< util::XURLTransformer > xTransformer( util::URLTransformer::create(xContext) );
|
||||||
xTransformer->parseStrict( aURL );
|
xTransformer->parseStrict( aURL );
|
||||||
|
|
||||||
uno::Reference < frame::XDesktop2 > xDesktop = frame::Desktop::create(aContext.getUNOContext());
|
uno::Reference < frame::XDesktop2 > xDesktop = frame::Desktop::create(xContext);
|
||||||
|
|
||||||
uno::Reference< frame::XDispatchProvider > xDispatchProvider(
|
uno::Reference< frame::XDispatchProvider > xDispatchProvider(
|
||||||
xDesktop->getCurrentFrame(), uno::UNO_QUERY );
|
xDesktop->getCurrentFrame(), uno::UNO_QUERY );
|
||||||
|
Reference in New Issue
Block a user