diff options
Diffstat (limited to 'uui/source')
-rw-r--r-- | uui/source/iahndl.cxx | 83 | ||||
-rw-r--r-- | uui/source/iahndl.hxx | 10 | ||||
-rw-r--r-- | uui/source/ids.hrc | 3 | ||||
-rw-r--r-- | uui/source/newerverwarn.cxx | 175 | ||||
-rw-r--r-- | uui/source/newerverwarn.hrc | 50 | ||||
-rw-r--r-- | uui/source/newerverwarn.hxx | 54 | ||||
-rw-r--r-- | uui/source/newerverwarn.src | 76 |
7 files changed, 1 insertions, 450 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index d80904b33da6..1ec234443ade 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -33,7 +33,6 @@ #include <com/sun/star/script/ModuleSizeExceededRequest.hpp> #include <com/sun/star/task/ErrorCodeIOException.hpp> #include <com/sun/star/task/ErrorCodeRequest.hpp> -#include <com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp> #include <com/sun/star/task/InteractionHandler.hpp> #include <com/sun/star/task/XInteractionAbort.hpp> #include <com/sun/star/task/XInteractionApprove.hpp> @@ -82,7 +81,6 @@ #include "getcontinuations.hxx" #include "secmacrowarnings.hxx" -#include "newerverwarn.hxx" #include "iahndl.hxx" #include "nameclashdlg.hxx" @@ -96,7 +94,6 @@ using ::com::sun::star::task::XInteractionContinuation; using ::com::sun::star::task::XInteractionAbort; using ::com::sun::star::task::XInteractionApprove; using ::com::sun::star::task::XInteractionAskLater; -using ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest; using ::com::sun::star::uno::XInterface; using ::com::sun::star::lang::XInitialization; using ::com::sun::star::uno::UNO_QUERY_THROW; @@ -876,17 +873,6 @@ UUIInteractionHelper::handleRequest_impl( return true; } - task::FutureDocumentVersionProductUpdateRequest - aProductUpdateRequest; - if (aAnyRequest >>= aProductUpdateRequest) - { - handleFutureDocumentVersionUpdateRequest( - aProductUpdateRequest, - rRequest->getContinuations()); - return true; - } - - // Last chance: interaction handlers registered in the configuration @@ -1258,75 +1244,6 @@ UUIInteractionHelper::handleMacroConfirmRequest( } void -UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest( - const task::FutureDocumentVersionProductUpdateRequest& _rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations ) -{ - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionAskLater > xAskLater; - getContinuations( rContinuations, &xApprove, &xAbort, &xAskLater ); - - short nResult = RET_CANCEL; - - static bool s_bDeferredToNextSession = false; - // TODO: this static variable is somewhat hacky. Formerly (before the dialog was moved from SFX2 to the - // interaction handler implementation), this was stored in SfxGetpApp()'s impl structure, in member - // bODFVersionWarningLater. Of course, we do not have access to it here. - - // A proper solution which I would envision would be: - // - There's a central implementation (this one here) of css.task.InteractionHandler - // - There's a configuration which maps UNO names to service names - // - If the handler is confronted with a request, it tries to find the name of the UNO structure describing - // the request in the said configuration. - // - If an entry is found, then - // - the respective service is instantiated - // - the component is queried for css.task.XInteractionHandler, and the request is delegated - // - if no entry is found, then the request is silenced (with calling the AbortContinuation, if possible) - // This way, the FutureDocumentVersionProductUpdateRequest could be handled in SFX (or any other - // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession - // flag. - - // Note: The above pattern has been implemented in CWS autorecovery. Now the remaining task is to move the - // handling of this interaction to SFX, again. - - if ( !s_bDeferredToNextSession ) - { - boost::scoped_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( "uui" ) ); - if ( pResMgr.get() ) - { - ::uui::NewerVersionWarningDialog aDialog( - getParentProperty(), - _rRequest.DocumentODFVersion, - *pResMgr.get() ); - nResult = aDialog.Execute(); - } - } - - switch ( nResult ) - { - case RET_OK: - if ( xApprove.is() ) - xApprove->select(); - break; - case RET_CANCEL: - if ( xAbort.is() ) - xAbort->select(); - break; - case RET_ASK_LATER: - if ( xAskLater.is() ) - xAskLater->select(); - s_bDeferredToNextSession = true; - break; - default: - OSL_FAIL( "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: " - "unexpected dialog return value!" ); - break; - } -} - -void UUIInteractionHelper::handleBrokenPackageRequest( std::vector< OUString > const & rArguments, uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index efbee64016d7..688a35854777 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -50,7 +50,6 @@ namespace com { namespace sun { namespace star { struct DocumentSignatureInformation; } namespace task { - class FutureDocumentVersionProductUpdateRequest; class XInteractionContinuation; class XInteractionHandler2; class XInteractionRequest; @@ -260,15 +259,6 @@ private: rContinuations); void - handleFutureDocumentVersionUpdateRequest( - const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& - _rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations); - - void handleBrokenPackageRequest( std::vector< OUString > const & rArguments, ::com::sun::star::uno::Sequence< diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index f73056ec268c..2050beee583b 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -57,7 +57,7 @@ #define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50) #define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51) #define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) -#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53) + #define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54) #define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 55) #define STR_ENTER_PASSWORD_TO_OPEN (RID_UUI_START + 56) @@ -153,7 +153,6 @@ #define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3) #define HID_DLG_FILTER_SELECT "UUI_HID_DLG_FILTER_SELECT" -#define HID_DLG_NEWERVERSIONWARNING "UUI_HID_DLG_NEWERVERSIONWARNING" #define HID_DLG_SIMPLE_NAME_CLASH "UUI_HID_DLG_SIMPLE_NAME_CLASH" diff --git a/uui/source/newerverwarn.cxx b/uui/source/newerverwarn.cxx deleted file mode 100644 index 2688f117c39b..000000000000 --- a/uui/source/newerverwarn.cxx +++ /dev/null @@ -1,175 +0,0 @@ -/* -*- 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 . - */ - -#include <config_features.h> -#include <config_folders.h> - -#include "newerverwarn.hxx" -#include "newerverwarn.hrc" -#include "ids.hrc" - -#include <com/sun/star/frame/Desktop.hpp> -#include <com/sun/star/frame/XDispatchProvider.hpp> -#include <com/sun/star/system/SystemShellExecute.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/util/URLTransformer.hpp> -#include <com/sun/star/util/XURLTransformer.hpp> -#include <com/sun/star/container/XHierarchicalNameAccess.hpp> - -#include <comphelper/processfactory.hxx> -#include <rtl/bootstrap.hxx> -#include <tools/diagnose_ex.h> -#include <vcl/msgbox.hxx> -#include <osl/process.h> -#include <officecfg/Office/Addons.hxx> - -using namespace com::sun::star; - -namespace uui -{ - -NewerVersionWarningDialog::NewerVersionWarningDialog( - Window* pParent, const OUString& rVersion, ResMgr& rResMgr ) : - - ModalDialog( pParent, ResId( RID_DLG_NEWER_VERSION_WARNING, rResMgr ) ), - - m_aImage ( this, ResId( FI_IMAGE, rResMgr ) ), - m_aInfoText ( this, ResId( FT_INFO, rResMgr ) ), - m_aButtonLine ( this, ResId( FL_BUTTON, rResMgr ) ), - m_aUpdateBtn ( this, ResId( PB_UPDATE, rResMgr ) ), - m_aLaterBtn ( this, ResId( PB_LATER, rResMgr ) ), - m_sVersion ( rVersion ) -{ - FreeResource(); - - m_aUpdateBtn.SetClickHdl( LINK( this, NewerVersionWarningDialog, UpdateHdl ) ); - m_aLaterBtn.SetClickHdl( LINK( this, NewerVersionWarningDialog, LaterHdl ) ); - - InitButtonWidth(); -} - -NewerVersionWarningDialog::~NewerVersionWarningDialog() -{ -} - -IMPL_LINK_NOARG(NewerVersionWarningDialog, UpdateHdl) -{ - // detect execute path - OUString sProgramPath; - osl_getExecutableFile( &sProgramPath.pData ); - sal_uInt32 nLastIndex = sProgramPath.lastIndexOf( '/' ); - if ( nLastIndex > 0 ) - sProgramPath = sProgramPath.copy( 0, nLastIndex + 1 ); - - // read keys from soffice.ini (sofficerc) - OUString sIniFileName = sProgramPath; -#if HAVE_FEATURE_MACOSX_MACLIKE_APP_STRUCTURE - sIniFileName += "../" LIBO_ETC_FOLDER "/"; -#endif - sIniFileName += SAL_CONFIGFILE( "version" ); - ::rtl::Bootstrap aIniFile( sIniFileName ); - OUString sNotifyURL; - aIniFile.getFrom( OUString( "ODFNotifyURL" ), sNotifyURL ); - - try - { - uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - if ( !sNotifyURL.isEmpty() && !m_sVersion.isEmpty() ) - { - uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( com::sun::star::system::SystemShellExecute::create(xContext) ); - sNotifyURL += m_sVersion; - if ( !sNotifyURL.isEmpty() ) - { - xSystemShell->execute( - sNotifyURL, OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY ); - } - } - else - { - // TODO: do we need to respect the /org.openoffice.Office.Jobs/Jobs/ - // UpdateCheck/Arguments/AutoCheckEnabled configuration flag? - // Finally, its meaning is "are automatic updates enabled", but this - // here is not an automatic update, but one triggered explicitly by - // the user. - css::uno::Reference< css::container::XHierarchicalNameAccess > xOfficeHelp(officecfg::Office::Addons::AddonUI::OfficeHelp::get(xContext), css::uno::UNO_QUERY_THROW); - - util::URL aURL; - if ( xOfficeHelp->getByHierarchicalName("['UpdateCheckJob']/URL") >>= aURL.Complete ) - { - uno::Reference< util::XURLTransformer > xTransformer( util::URLTransformer::create(xContext) ); - xTransformer->parseStrict( aURL ); - - uno::Reference < frame::XDesktop2 > xDesktop = frame::Desktop::create(xContext); - - uno::Reference< frame::XDispatchProvider > xDispatchProvider( - xDesktop->getCurrentFrame(), uno::UNO_QUERY ); - if ( !xDispatchProvider.is() ) - xDispatchProvider = uno::Reference < frame::XDispatchProvider > ( xDesktop, uno::UNO_QUERY ); - - uno::Reference< frame::XDispatch > xDispatch = - xDispatchProvider->queryDispatch( aURL, OUString(), 0 ); - if ( xDispatch.is() ) - xDispatch->dispatch( aURL, uno::Sequence< beans::PropertyValue >() ); - } - } - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - - EndDialog( RET_OK ); - return 0; -} - -IMPL_LINK_NOARG(NewerVersionWarningDialog, LaterHdl) -{ - EndDialog( RET_ASK_LATER ); - return 0; -} - -void NewerVersionWarningDialog::InitButtonWidth() -{ - // one button too small for its text? - long nBtnTextWidth = m_aUpdateBtn.GetCtrlTextWidth( m_aUpdateBtn.GetText() ); - long nTemp = m_aLaterBtn.GetCtrlTextWidth( m_aLaterBtn.GetText() ); - if ( nTemp > nBtnTextWidth ) - nBtnTextWidth = nTemp; - nBtnTextWidth = nBtnTextWidth * 115 / 100; // a little offset - long nMaxBtnWidth = LogicToPixel( Size( MAX_BUTTON_WIDTH, 0 ), MAP_APPFONT ).Width(); - nBtnTextWidth = std::min( nBtnTextWidth, nMaxBtnWidth ); - long nButtonWidth = m_aUpdateBtn .GetSizePixel().Width(); - - if ( nBtnTextWidth > nButtonWidth ) - { - long nDelta = nBtnTextWidth - nButtonWidth; - Point aNewPos = m_aUpdateBtn.GetPosPixel(); - aNewPos.X() -= 2*nDelta; - Size aNewSize = m_aUpdateBtn.GetSizePixel(); - aNewSize.Width() += nDelta; - m_aUpdateBtn.SetPosSizePixel( aNewPos, aNewSize ); - aNewPos = m_aLaterBtn.GetPosPixel(); - aNewPos.X() -= nDelta; - m_aLaterBtn.SetPosSizePixel( aNewPos, aNewSize ); - } -} - -} // end of namespace uui - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/newerverwarn.hrc b/uui/source/newerverwarn.hrc deleted file mode 100644 index 6a1181615e77..000000000000 --- a/uui/source/newerverwarn.hrc +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- 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 _NEWERVERSIONWARNING_HRC -#define _NEWERVERSIONWARNING_HRC - -#include <svtools/controldims.hrc> - -#define FI_IMAGE 10 -#define FT_INFO 11 -#define FL_BUTTON 12 -#define PB_UPDATE 13 -#define PB_LATER 14 - -#define IMAGE_WIDTH 20 -#define IMAGE_HEIGHT IMAGE_WIDTH -#define INFO_WIDTH 180 -#define INFO_LINES 7 -#define DLG_WIDTH (RSC_SP_DLG_INNERBORDER_LEFT + IMAGE_WIDTH + RSC_SP_CTRL_X + INFO_WIDTH + RSC_SP_DLG_INNERBORDER_RIGHT) - -#define COL_1 RSC_SP_DLG_INNERBORDER_LEFT -#define COL_2 (COL_1 + IMAGE_WIDTH + RSC_SP_CTRL_X) -#define COL_4 (DLG_WIDTH - RSC_SP_DLG_INNERBORDER_LEFT - RSC_CD_PUSHBUTTON_WIDTH) -#define COL_3 (COL_4 - RSC_SP_CTRL_GROUP_X - RSC_CD_PUSHBUTTON_WIDTH) - -#define ROW_1 RSC_SP_DLG_INNERBORDER_TOP -#define ROW_2 (ROW_1 + INFO_LINES * RSC_CD_FIXEDTEXT_HEIGHT + RSC_SP_CTRL_GROUP_Y) -#define ROW_3 (ROW_2 + RSC_CD_FIXEDLINE_HEIGHT + RSC_SP_CTRL_GROUP_Y) - -#define DLG_HEIGHT (ROW_3 + RSC_CD_PUSHBUTTON_HEIGHT + RSC_SP_DLG_INNERBORDER_BOTTOM) -#define MAX_BUTTON_WIDTH (DLG_WIDTH - RSC_SP_DLG_INNERBORDER_LEFT - RSC_SP_DLG_INNERBORDER_RIGHT - RSC_SP_CTRL_GROUP_X) / 2 - -#endif // #ifndef _NEWERVERSIONWARNING_HRC - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/newerverwarn.hxx b/uui/source/newerverwarn.hxx deleted file mode 100644 index e24e531c579f..000000000000 --- a/uui/source/newerverwarn.hxx +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- 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 INCLUDED_UUI_SOURCE_NEWERVERWARN_HXX -#define INCLUDED_UUI_SOURCE_NEWERVERWARN_HXX - -#include <vcl/button.hxx> -#include <vcl/fixed.hxx> -#include <vcl/dialog.hxx> - -#define RET_ASK_LATER short( 100 ) - -namespace uui -{ - class NewerVersionWarningDialog : public ModalDialog - { - private: - FixedImage m_aImage; - FixedText m_aInfoText; - FixedLine m_aButtonLine; - PushButton m_aUpdateBtn; - CancelButton m_aLaterBtn; - - OUString m_sVersion; - - DECL_LINK(UpdateHdl, void *); - DECL_LINK(LaterHdl, void *); - - void InitButtonWidth(); - - public: - NewerVersionWarningDialog( Window* pParent, const OUString& rVersion, ResMgr& rResMgr ); - virtual ~NewerVersionWarningDialog(); - }; -} // namespace uui - -#endif // INCLUDED_UUI_SOURCE_NEWERVERWARN_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/newerverwarn.src b/uui/source/newerverwarn.src deleted file mode 100644 index 7a9476c61739..000000000000 --- a/uui/source/newerverwarn.src +++ /dev/null @@ -1,76 +0,0 @@ -/* -*- 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 . - */ - -#define __RSC - -#include "newerverwarn.hrc" -#include "ids.hrc" - -#define STD_MASKCOLOR Color { Red=0xffff; Green=0x0000; Blue=0xffff; } - -ModalDialog RID_DLG_NEWER_VERSION_WARNING -{ - HelpId = HID_DLG_NEWERVERSIONWARNING; - OutputSize = TRUE ; - Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ; - SvLook = TRUE ; - Moveable = TRUE ; - Closeable = TRUE ; - Text [ en-US ] = "%PRODUCTNAME Update Available" ; - FixedImage FI_IMAGE - { - Pos = MAP_APPFONT ( COL_1 , ROW_1 ); - Size = MAP_APPFONT ( IMAGE_WIDTH , IMAGE_HEIGHT ); - Hide = FALSE; - Fixed = Image - { - ImageBitmap = Bitmap { File = "versionwarning.png"; }; - MaskColor = STD_MASKCOLOR; - }; - }; - FixedText FT_INFO - { - Pos = MAP_APPFONT( COL_2, ROW_1 ); - Size = MAP_APPFONT( INFO_WIDTH, INFO_LINES * RSC_CD_FIXEDTEXT_HEIGHT ); - Wordbreak = TRUE; - Text [ en-US ] = "This document was created by a newer version of %PRODUCTNAME. It may contain features not supported by your current version.\n\nClick 'Update Now...' to run online update and get the latest version of %PRODUCTNAME."; - }; - FixedLine FL_BUTTON - { - Pos = MAP_APPFONT ( 0 , ROW_2 ) ; - Size = MAP_APPFONT ( DLG_WIDTH , RSC_CD_FIXEDLINE_HEIGHT ) ; - }; - PushButton PB_UPDATE - { - HelpID = "uui:PushButton:RID_DLG_NEWER_VERSION_WARNING:PB_UPDATE"; - Pos = MAP_APPFONT ( COL_3 , ROW_3 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Update Now..." ; - }; - CancelButton PB_LATER - { - Pos = MAP_APPFONT ( COL_4 , ROW_3 ) ; - Size = MAP_APPFONT ( RSC_CD_PUSHBUTTON_WIDTH , RSC_CD_PUSHBUTTON_HEIGHT ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Later" ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |