Kaydet (Commit) 99cecd1f authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

use StartExecuteAsync in basctl

Change-Id: Id24d03631ff60305525835144ad543d5dcb2064f
Reviewed-on: https://gerrit.libreoffice.org/65709
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6aaed7c5
...@@ -739,9 +739,12 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) ...@@ -739,9 +739,12 @@ void Shell::ExecuteGlobal( SfxRequest& rReq )
case SID_BASICIDE_MANAGE_LANG: case SID_BASICIDE_MANAGE_LANG:
{ {
ScopedVclPtrInstance< ManageLanguageDialog > aDlg(pCurWin, m_pCurLocalizationMgr); std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
aDlg->Execute(); rReq.Ignore(); // the 'old' request is not relevant any more
rReq.Done(); auto pDlg = VclPtr<ManageLanguageDialog>::Create(pCurWin, m_pCurLocalizationMgr);
pDlg->StartExecuteAsync([=](sal_Int32 /*nResult*/){
pRequest->Done();
});
} }
break; break;
......
...@@ -72,7 +72,7 @@ void Organize( sal_Int16 tabId ) ...@@ -72,7 +72,7 @@ void Organize( sal_Int16 tabId )
aDesc = pCurWin->CreateEntryDescriptor(); aDesc = pCurWin->CreateEntryDescriptor();
vcl::Window* pParent = Application::GetDefDialogParent(); vcl::Window* pParent = Application::GetDefDialogParent();
ScopedVclPtrInstance<OrganizeDialog>(pParent, tabId, aDesc)->Execute(); VclPtr<OrganizeDialog>::Create(pParent, tabId, aDesc)->StartExecuteAsync(nullptr);
} }
bool IsValidSbxName( const OUString& rName ) bool IsValidSbxName( const OUString& rName )
......
...@@ -742,20 +742,19 @@ IMPL_LINK(MacroChooser, ButtonHdl, weld::Button&, rButton, void) ...@@ -742,20 +742,19 @@ IMPL_LINK(MacroChooser, ButtonHdl, weld::Button&, rButton, void)
m_xBasicBox->get_selected(m_xBasicBoxIter.get()); m_xBasicBox->get_selected(m_xBasicBoxIter.get());
EntryDescriptor aDesc = m_xBasicBox->GetEntryDescriptor(m_xBasicBoxIter.get()); EntryDescriptor aDesc = m_xBasicBox->GetEntryDescriptor(m_xBasicBoxIter.get());
VclPtrInstance< OrganizeDialog > pDlg( nullptr, 0, aDesc ); //TODO VclPtrInstance< OrganizeDialog > pDlg( nullptr, 0, aDesc ); //TODO
sal_uInt16 nRet = pDlg->Execute(); pDlg->StartExecuteAsync([=](sal_Int32 nRet){
pDlg.reset(); if ( nRet ) // not only closed
{
if ( nRet ) // not only closed m_xDialog->response(Macro_Edit);
{ return;
m_xDialog->response(Macro_Edit); }
return;
}
Shell* pShell = GetShell(); Shell* pShell = GetShell();
if ( pShell && pShell->IsAppBasicModified() ) if ( pShell && pShell->IsAppBasicModified() )
bForceStoreBasic = true; bForceStoreBasic = true;
m_xBasicBox->UpdateEntries(); m_xBasicBox->UpdateEntries();
});
} }
} }
......
...@@ -145,19 +145,21 @@ void ManageLanguageDialog::ClearLanguageBox() ...@@ -145,19 +145,21 @@ void ManageLanguageDialog::ClearLanguageBox()
IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, Button*, void) IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, Button*, void)
{ {
ScopedVclPtrInstance< SetDefaultLanguageDialog > aDlg( this, m_xLocalizationMgr ); VclPtr< SetDefaultLanguageDialog > pDlg = VclPtr<SetDefaultLanguageDialog>::Create(this, m_xLocalizationMgr);
if ( aDlg->Execute() == RET_OK ) pDlg->StartExecuteAsync([pDlg,this](sal_Int32 nResult)
{ {
// add new locales if (!nResult )
Sequence< Locale > aLocaleSeq = aDlg->GetLocales(); return;
m_xLocalizationMgr->handleAddLocales( aLocaleSeq ); // add new locales
// update listbox Sequence< Locale > aLocaleSeq = pDlg->GetLocales();
ClearLanguageBox(); m_xLocalizationMgr->handleAddLocales( aLocaleSeq );
FillLanguageBox(); // update listbox
ClearLanguageBox();
if (SfxBindings* pBindings = GetBindingsPtr()) FillLanguageBox();
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
} if (SfxBindings* pBindings = GetBindingsPtr())
pBindings->Invalidate( SID_BASICIDE_CURRENT_LANG );
});
} }
IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl, Button*, void) IMPL_LINK_NOARG(ManageLanguageDialog, DeleteHdl, Button*, void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment