diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-31 11:57:38 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-31 22:08:07 +0100 |
commit | 9d1c68ae17ef566b9034478c7b29411c62684289 (patch) | |
tree | 265f9e7decdbe9dc77ff7a108d878b68ed9887a6 /cui/source/dialogs/cuigaldlg.cxx | |
parent | 97be9270868990d3d45b29724c8fdc3598d2a64c (diff) |
replace StartExecuteModal with StartExecuteAsync
Change-Id: I2c0e0266f6bb468ebb5285f95d1824cf12100812
Reviewed-on: https://gerrit.libreoffice.org/62690
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/dialogs/cuigaldlg.cxx')
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index a04340bbc80e..3bb5d6154677 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -236,7 +236,6 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl, void*, void) disposeOnce(); } - short SearchProgress::Execute() { OSL_FAIL( "SearchProgress cannot be executed via Dialog::Execute!\n" @@ -245,17 +244,15 @@ short SearchProgress::Execute() return RET_CANCEL; } - -void SearchProgress::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) +bool SearchProgress::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) { assert(!maSearchThread.is()); maSearchThread = new SearchThread( this, static_cast< TPGalleryThemeProperties * >(parent_.get()), startUrl_); maSearchThread->launch(); - ModalDialog::StartExecuteModal( rEndDialogHdl ); + return ModalDialog::StartExecuteAsync(rCtx); } - TakeThread::TakeThread( TakeProgress* pProgress, TPGalleryThemeProperties* pBrowser, @@ -400,7 +397,6 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl, void*, void) disposeOnce(); } - short TakeProgress::Execute() { OSL_FAIL( "TakeProgress cannot be executed via Dialog::Execute!\n" @@ -409,17 +405,15 @@ short TakeProgress::Execute() return RET_CANCEL; } - -void TakeProgress::StartExecuteModal( const Link<Dialog&,void>& rEndDialogHdl ) +bool TakeProgress::StartExecuteAsync(VclAbstractDialog::AsyncContext &rCtx) { assert(!maTakeThread.is()); maTakeThread = new TakeThread( this, static_cast< TPGalleryThemeProperties * >(window_.get()), maTakenList); maTakeThread->launch(); - ModalDialog::StartExecuteModal( rEndDialogHdl ); + return ModalDialog::StartExecuteAsync(rCtx); } - ActualizeProgress::ActualizeProgress(vcl::Window* pWindow, GalleryTheme* pThm) : ModalDialog(pWindow, "GalleryUpdateProgress", "cui/ui/galleryupdateprogress.ui") @@ -923,7 +917,9 @@ void TPGalleryThemeProperties::SearchFiles() pProgress->SetDirectory( INetURLObject() ); pProgress->Update(); - pProgress->StartExecuteModal( LINK( this, TPGalleryThemeProperties, EndSearchProgressHdl ) ); + pProgress->StartExecuteAsync([=](sal_Int32 nResult){ + EndSearchProgressHdl(nResult); + }); } @@ -962,7 +958,6 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, ClickSearchHdl, Button*, void) } } - void TPGalleryThemeProperties::TakeFiles() { if( m_pLbxFound->GetSelectedEntryCount() || ( bTakeAll && bEntriesFound ) ) @@ -970,9 +965,10 @@ void TPGalleryThemeProperties::TakeFiles() VclPtrInstance<TakeProgress> pTakeProgress( this ); pTakeProgress->Update(); - pTakeProgress->StartExecuteModal( - Link<Dialog&,void>() /* no postprocessing needed, pTakeProgress - will be disposed in TakeProgress::CleanupHdl */ ); + pTakeProgress->StartExecuteAsync([=](sal_Int32 /*nResult*/){ + /* no postprocessing needed, pTakeProgress + will be disposed in TakeProgress::CleanupHdl */ + }); } } @@ -1107,8 +1103,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, PreviewTimerHdl, Timer *, void) DoPreview(); } - -IMPL_LINK_NOARG(TPGalleryThemeProperties, EndSearchProgressHdl, Dialog&, void) +void TPGalleryThemeProperties::EndSearchProgressHdl(sal_Int32 /*nResult*/) { if( !aFoundList.empty() ) { @@ -1126,7 +1121,6 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, EndSearchProgressHdl, Dialog&, void) } } - IMPL_LINK( TPGalleryThemeProperties, DialogClosedHdl, css::ui::dialogs::DialogClosedEvent*, pEvt, void ) { DBG_ASSERT( xFolderPicker.is(), "TPGalleryThemeProperties::DialogClosedHdl(): no folder picker" ); |