diff options
-rw-r--r-- | desktop/source/app/app.cxx | 29 | ||||
-rw-r--r-- | framework/inc/services/desktop.hxx | 5 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 59 |
3 files changed, 70 insertions, 23 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 71acf329ef49..4fb663f1d5fa 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2,9 +2,9 @@ * * $RCSfile: app.cxx,v $ * - * $Revision: 1.67 $ + * $Revision: 1.68 $ * - * last change: $Author: cd $ $Date: 2001-12-11 14:39:35 $ + * last change: $Author: cd $ $Date: 2001-12-13 09:01:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -149,6 +149,9 @@ #ifndef _COM_SUN_STAR_TASK_XJOBEXECUTOR_HPP_ #include <com/sun/star/task/XJobExecutor.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#include <com/sun/star/beans/XPropertySet.hpp> +#endif #include <com/sun/star/beans/XMaterialHolder.hpp> @@ -631,11 +634,31 @@ void Desktop::DeInit() BOOL Desktop::QueryExit() { + const sal_Char SUSPEND_QUICKSTARTVETO[] = "SuspendQuickstartVeto"; + DBG_ERROR("QueryExit!"); Reference< ::com::sun::star::frame::XDesktop > xDesktop( ::comphelper::getProcessServiceFactory()->createInstance( OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), UNO_QUERY ); - return !xDesktop.is() || xDesktop->terminate(); + + Reference < ::com::sun::star::beans::XPropertySet > xPropertySet( xDesktop, UNO_QUERY ); + if ( xPropertySet.is() ) + { + Any a; + a <<= (sal_Bool)sal_True; + xPropertySet->setPropertyValue( OUSTRING(RTL_CONSTASCII_USTRINGPARAM( SUSPEND_QUICKSTARTVETO )), a ); + } + + BOOL bExit = ( !xDesktop.is() || xDesktop->terminate() ); + + if ( !bExit && xPropertySet.is() ) + { + Any a; + a <<= (sal_Bool)sal_False; + xPropertySet->setPropertyValue( OUSTRING(RTL_CONSTASCII_USTRINGPARAM( SUSPEND_QUICKSTARTVETO )), a ); + } + + return bExit; } void Desktop::StartSetup( const OUString& aParameters ) diff --git a/framework/inc/services/desktop.hxx b/framework/inc/services/desktop.hxx index ddde40ae1e20..be95ebe646fc 100644 --- a/framework/inc/services/desktop.hxx +++ b/framework/inc/services/desktop.hxx @@ -2,9 +2,9 @@ * * $RCSfile: desktop.hxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: mba $ $Date: 2001-11-21 14:56:43 $ + * last change: $Author: cd $ $Date: 2001-12-13 09:03:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -434,6 +434,7 @@ class Desktop : // interfaces css::uno::Reference< css::frame::XTerminateListener > m_xPipeTerminator ; /// special terminate listener to close pipe and block external requests during/after terminate css::uno::Reference< css::frame::XTerminateListener > m_xQuickLauncher ; /// special terminate listener to block terminate if tray-icon is active css::uno::Any m_aInteractionRequest ; + sal_Bool m_bSuspendQuickstartVeto ; /// don't ask quickstart for a veto }; // class Desktop diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index c20d52691052..e99e31093c25 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -2,9 +2,9 @@ * * $RCSfile: desktop.cxx,v $ * - * $Revision: 1.32 $ + * $Revision: 1.33 $ * - * last change: $Author: as $ $Date: 2001-12-12 14:32:26 $ + * last change: $Author: cd $ $Date: 2001-12-13 09:04:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -176,6 +176,11 @@ #ifndef _COM_SUN_STAR_FRAME_DISPATCHRESULTSTATE_HPP_ #include <com/sun/star/frame/DispatchResultState.hpp> #endif + +#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_ +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#endif + //_________________________________________________________________________________________________________________ // includes of other projects //_________________________________________________________________________________________________________________ @@ -208,6 +213,10 @@ #include <vcl/svapp.hxx> #endif +#ifndef _COMPHELPER_EXTRACT_HXX_ +#include <comphelper/extract.hxx> +#endif + //_________________________________________________________________________________________________________________ // namespace //_________________________________________________________________________________________________________________ @@ -219,17 +228,19 @@ namespace framework{ //_________________________________________________________________________________________________________________ // names of properties -#define PROPERTYNAME_ACTIVECOMPONENT DECLARE_ASCII("ActiveComponent" ) -#define PROPERTYNAME_ACTIVEFRAME DECLARE_ASCII("ActiveFrame" ) -#define PROPERTYNAME_ISPLUGGED DECLARE_ASCII("IsPlugged" ) +#define PROPERTYNAME_ACTIVECOMPONENT DECLARE_ASCII("ActiveComponent" ) +#define PROPERTYNAME_ACTIVEFRAME DECLARE_ASCII("ActiveFrame" ) +#define PROPERTYNAME_ISPLUGGED DECLARE_ASCII("IsPlugged" ) +#define PROPERTYNAME_SUSPENDQUICKSTARTVETO DECLARE_ASCII("SuspendQuickstartVeto" ) // handle of properties #define PROPERTYHANDLE_ACTIVECOMPONENT 1 #define PROPERTYHANDLE_ACTIVEFRAME 2 #define PROPERTYHANDLE_ISPLUGGED 3 +#define PROPERTYHANDLE_SUSPENDQUICKSTARTVETO 4 // count of ALL properties -#define PROPERTYCOUNT 3 +#define PROPERTYCOUNT 4 //_________________________________________________________________________________________________________________ // non exported definitions @@ -242,7 +253,7 @@ namespace framework{ //***************************************************************************************************************** // XInterface, XTypeProvider, XServiceInfo //***************************************************************************************************************** -DEFINE_XINTERFACE_12 ( Desktop , +DEFINE_XINTERFACE_13 ( Desktop , OWeakObject , DIRECT_INTERFACE( css::lang::XTypeProvider ), DIRECT_INTERFACE( css::lang::XServiceInfo ), @@ -253,9 +264,10 @@ DEFINE_XINTERFACE_12 ( Desktop DIRECT_INTERFACE( css::frame::XFramesSupplier ), DIRECT_INTERFACE( css::frame::XFrame ), DIRECT_INTERFACE( css::lang::XComponent ), - DIRECT_INTERFACE( css::frame::XDispatchResultListener ), + DIRECT_INTERFACE( css::frame::XDispatchResultListener ), DIRECT_INTERFACE( css::lang::XEventListener ), - DIRECT_INTERFACE( css::task::XInteractionHandler ) + DIRECT_INTERFACE( css::task::XInteractionHandler ), + DIRECT_INTERFACE( css::beans::XPropertySet ) ) DEFINE_XTYPEPROVIDER_12 ( Desktop , @@ -268,7 +280,7 @@ DEFINE_XTYPEPROVIDER_12 ( Desktop css::frame::XFramesSupplier , css::frame::XFrame , css::lang::XComponent , - css::frame::XDispatchResultListener , + css::frame::XDispatchResultListener , css::lang::XEventListener , css::task::XInteractionHandler ) @@ -356,6 +368,7 @@ Desktop::Desktop( const css::uno::Reference< css::lang::XMultiServiceFactory >& , m_aListenerContainer ( m_aLock.getShareableOslMutex() ) , m_eLoadState ( E_NOTSET ) , m_aInteractionRequest ( ) + , m_bSuspendQuickstartVeto( sal_False ) #ifdef ENABLE_ASSERTIONS , m_bIsTerminated ( sal_False ) // see dispose() for further informations! #endif @@ -412,9 +425,10 @@ sal_Bool SAL_CALL Desktop::terminate() throw( css::uno::RuntimeException ) // That's why it's agood idea to hold use self alive. css::uno::Reference< css::frame::XDesktop > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); // Get other neccessary references. - css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator = m_xPipeTerminator ; - css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher = m_xQuickLauncher ; - css::lang::EventObject aEvent ( static_cast< ::cppu::OWeakObject* >(this) ); + css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator = m_xPipeTerminator ; + css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher = m_xQuickLauncher ; + css::lang::EventObject aEvent ( static_cast< ::cppu::OWeakObject* >(this) ); + sal_Bool bAskQuickStart = !m_bSuspendQuickstartVeto ; aReadLock.unlock(); /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ @@ -445,9 +459,11 @@ sal_Bool SAL_CALL Desktop::terminate() throw( css::uno::RuntimeException ) //------------------------------------------------------------------------------------------------------------- // If no veto comes we should ask our quicklauncher. // He stop termination of whole office .. but not closing of open tasks!!! + // We shouldn't ask quicklauncher if property "SuspendQuickstartVeto" is set to FALSE!! if( - ( bNormalListenerVeto == sal_False ) && - ( xQuickLauncher.is() == sal_True ) + ( bNormalListenerVeto == sal_False ) && + ( bAskQuickStart == sal_True ) && + ( xQuickLauncher.is() == sal_True ) ) { try @@ -1635,6 +1651,8 @@ sal_Bool SAL_CALL Desktop::convertFastPropertyValue( css::uno::Any& aCon case PROPERTYHANDLE_ACTIVEFRAME : case PROPERTYHANDLE_ISPLUGGED : bReturn = sal_False; // These variables are readonly(!) and can't be changed. break; + case PROPERTYHANDLE_SUSPENDQUICKSTARTVETO: bReturn = impl_tryToChangeProperty( m_bSuspendQuickstartVeto, aValue, aOldValue, aConvertedValue ); + break; } // Return state of operation. @@ -1670,6 +1688,8 @@ void SAL_CALL Desktop::setFastPropertyValue_NoBroadcast( sal_Int32 case PROPERTYHANDLE_ACTIVEFRAME : case PROPERTYHANDLE_ISPLUGGED : LOG_ERROR( "Desktop::setFastPropertyValue_NoBroadcast()", "Set of readonly property not allowed." ) break; + case PROPERTYHANDLE_SUSPENDQUICKSTARTVETO: aValue >>= m_bSuspendQuickstartVeto; + break; } } @@ -1705,6 +1725,8 @@ void SAL_CALL Desktop::getFastPropertyValue( css::uno::Any& aValue , break; case PROPERTYHANDLE_ISPLUGGED : aValue <<= impl_checkPlugInState(); break; + case PROPERTYHANDLE_SUSPENDQUICKSTARTVETO: aValue <<= m_bSuspendQuickstartVeto; + break; } } @@ -1936,9 +1958,10 @@ const css::uno::Sequence< css::beans::Property > Desktop::impl_getStaticProperty static const css::beans::Property pProperties[] = { - css::beans::Property( PROPERTYNAME_ACTIVECOMPONENT, PROPERTYHANDLE_ACTIVECOMPONENT, ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL), css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), - css::beans::Property( PROPERTYNAME_ACTIVEFRAME , PROPERTYHANDLE_ACTIVEFRAME , ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL), css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), - css::beans::Property( PROPERTYNAME_ISPLUGGED , PROPERTYHANDLE_ISPLUGGED , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), + css::beans::Property( PROPERTYNAME_ACTIVECOMPONENT , PROPERTYHANDLE_ACTIVECOMPONENT , ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL), css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), + css::beans::Property( PROPERTYNAME_ACTIVEFRAME , PROPERTYHANDLE_ACTIVEFRAME , ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL), css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), + css::beans::Property( PROPERTYNAME_ISPLUGGED , PROPERTYHANDLE_ISPLUGGED , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ), + css::beans::Property( PROPERTYNAME_SUSPENDQUICKSTARTVETO, PROPERTYHANDLE_SUSPENDQUICKSTARTVETO , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT ), }; // Use it to initialize sequence! static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor( pProperties, PROPERTYCOUNT ); |