summaryrefslogtreecommitdiff
path: root/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-11-18 07:24:15 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-11-18 07:24:15 +0000
commit8fc3fe99c8f98853bee4795db7db28b697b69d69 (patch)
tree906f1163e99689d81d8869de6ec8cd66aec9c341 /desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
parent0746817c7bb5687dd6513ba31637df9cdff832d0 (diff)
CWS-TOOLING: integrate CWS extmgrui06
2008-10-30 15:46:52 +0100 hr r262831 : CWS-TOOLING: rebase CWS extmgrui06 to trunk@262620 (milestone: DEV300:m34) 2008-10-22 11:19:35 +0200 dv r262586 : #i80640# mirgate CWS extmgrui06 to SVN 2008-10-22 11:19:03 +0200 dv r262585 : #i80640# mirgate CWS extmgrui06 to SVN
Diffstat (limited to 'desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx')
-rw-r--r--desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx50
1 files changed, 28 insertions, 22 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
index 67719dc75805..6e8e214a6d12 100644
--- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx
@@ -8,7 +8,7 @@
*
* $RCSfile: dp_gui_extensioncmdqueue.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.7.4.3 $
*
* This file is part of OpenOffice.org.
*
@@ -98,20 +98,6 @@
#include <queue>
#include <boost/shared_ptr.hpp>
-#if 0
-#include "dp_gui.hrc"
-#include "dp_gui.h"
-#include "dp_gui_cmdenv.h"
-#include "comphelper/anytostring.hxx"
-#include "com/sun/star/lang/WrappedTargetException.hpp"
-#include "tools/resid.hxx"
-#include "tools/rcid.h"
-#include "vcl/msgbox.hxx"
-#include "vcl/threadex.hxx"
-#include "boost/bind.hpp"
-
-#endif
-
#if (defined(_MSC_VER) && (_MSC_VER < 1400))
#define _WIN32_WINNT 0x0400
#endif
@@ -140,9 +126,6 @@ OUString getVersion( const uno::Reference< deployment::XPackage > &rPackage )
namespace dp_gui {
//==============================================================================
-//Only if the class is consructed with the DialogImpl then the ProgressDialog can be
-//displayed. Otherwise this class can still be used to forward an interaction. This
-//is done by the interaction handler of the "Download and Installation" dialog.
class ProgressCmdEnv
: public ::cppu::WeakImplHelper3< ucb::XCommandEnvironment,
@@ -185,6 +168,7 @@ public:
Dialog * activeDialog() { return m_pDialog; }
+ void setTitle( const OUString& rNewTitle ) { m_sTitle = rNewTitle; }
void startProgress();
void stopProgress();
void progressSection( const OUString &rText,
@@ -312,6 +296,7 @@ private:
const OUString m_sDisablingPackages;
const OUString m_sAddingPackages;
const OUString m_sRemovingPackages;
+ const OUString m_sDefaultCmd;
osl::Condition m_wakeup;
osl::Mutex m_mutex;
Input m_eInput;
@@ -659,6 +644,7 @@ ExtensionCmdQueue::Thread::Thread( ExtMgrDialog *pDialog,
m_sDisablingPackages( ExtMgrDialog::getResourceString( RID_STR_DISABLING_PACKAGES ) ),
m_sAddingPackages( ExtMgrDialog::getResourceString( RID_STR_ADDING_PACKAGES ) ),
m_sRemovingPackages( ExtMgrDialog::getResourceString( RID_STR_REMOVING_PACKAGES ) ),
+ m_sDefaultCmd( ExtMgrDialog::getResourceString( RID_STR_ADD_PACKAGES ) ),
m_eInput( NONE ),
m_bTerminated( false ),
m_bStopped( false ),
@@ -830,7 +816,7 @@ void ExtensionCmdQueue::Thread::execute()
if ( eInput == STOP )
break;
- ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialog, m_sAddingPackages ) );
+ ::rtl::Reference< ProgressCmdEnv > currentCmdEnv( new ProgressCmdEnv( m_xContext, m_pDialog, m_sDefaultCmd ) );
// Do not lock the following part with addExtension. addExtension may be called in the main thread.
// If the message box "Do you want to install the extension (or similar)" is shown and then
@@ -935,6 +921,12 @@ void ExtensionCmdQueue::Thread::execute()
}
}
+ {
+ // when leaving the while loop with break, we should set working to false, too
+ osl::MutexGuard aGuard( m_mutex );
+ m_bWorking = false;
+ }
+
if ( !bStartProgress )
currentCmdEnv->stopProgress();
}
@@ -955,7 +947,16 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
{
//check if we have a string in anyTitle. For example "unopkg gui \" caused anyTitle to be void
//and anyTitle.get<OUString> throws as RuntimeException.
- uno::Any anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv.get() ).getPropertyValue( OUSTR("Title") );
+ uno::Any anyTitle;
+ try
+ {
+ anyTitle = ::ucbhelper::Content( rPackageURL, rCmdEnv.get() ).getPropertyValue( OUSTR("Title") );
+ }
+ catch ( uno::Exception & )
+ {
+ return;
+ }
+
OUString sName;
if ( ! (anyTitle >>= sName) )
{
@@ -974,8 +975,6 @@ void ExtensionCmdQueue::Thread::_addExtension( ::rtl::Reference< ProgressCmdEnv
rPackageURL, OUString() /* detect media-type */,
xAbortChannel, rCmdEnv.get() ) );
OSL_ASSERT( xPackage.is() );
-// long nPos = m_pDialog->addPackageToList( xPackage, xPackageManager );
-// m_pDialog->selectEntry( nPos );
}
catch ( ucb::CommandFailedException & )
{
@@ -1206,5 +1205,12 @@ bool ExtensionCmdQueue::isBusy()
return m_thread->isBusy();
}
+void handleInteractionRequest( const uno::Reference< uno::XComponentContext > & xContext,
+ const uno::Reference< task::XInteractionRequest > & xRequest )
+{
+ ::rtl::Reference< ProgressCmdEnv > xCmdEnv( new ProgressCmdEnv( xContext, NULL, OUSTR("Extension Manager") ) );
+ xCmdEnv->handle( xRequest );
+}
+
} //namespace dp_gui