diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 13:28:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-27 09:52:32 +0000 |
commit | 0fad8d308122a862aa49dece498d56a418df2afe (patch) | |
tree | e67e7df1f9d315648535f436b424c9941dea589e /sfx2 | |
parent | f3a4129ed5946e2b8661dc8df23e00c4b6c6ecc8 (diff) |
convert remaining WarningBox to weld::MessageDialog
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/dialog/securitypage.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 4 |
4 files changed, 24 insertions, 13 deletions
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 6d190e45fce2..6698c1b70d99 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -39,7 +39,8 @@ #include <unotools/ucbstreamhelper.hxx> #include <svtools/transfer.hxx> #include <sot/formats.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <sfx2/filedlghelper.hxx> #include <sfx2/docfile.hxx> #include <unotools/pathoptions.hxx> @@ -157,8 +158,12 @@ ErrCode SvxOpenGraphicDialog::Execute() // could not load? if ( nFound == USHRT_MAX ) { - ScopedVclPtrInstance< WarningBox > aWarningBox(nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, SfxResId( SvxOpenGrfErr2ResId(nImpRet) )); - bQuitLoop = aWarningBox->Execute() != RET_RETRY; + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, + VclMessageType::Warning, VclButtonsType::NONE, + SfxResId(SvxOpenGrfErr2ResId(nImpRet)))); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Retry), RET_RETRY); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + bQuitLoop = xWarn->run() != RET_RETRY; } else { diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index eb45d935591d..8d9ef33a9293 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -31,7 +31,7 @@ #include <vcl/button.hxx> #include <vcl/edit.hxx> #include <vcl/fixed.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <svl/eitem.hxx> #include <svl/poolitem.hxx> @@ -332,9 +332,12 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl, CheckBox&, void) bool bAlreadyDone = false; if (!m_bEndRedliningWarningDone) { - ScopedVclPtrInstance<WarningBox> aBox(m_rMyTabPage.GetParent(), MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, - m_aEndRedliningWarning ); - if (aBox->Execute() != RET_YES) + vcl::Window* pWin = m_rMyTabPage.GetParent(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::YesNo, + m_aEndRedliningWarning)); + xWarn->set_default_response(RET_NO); + if (xWarn->run() != RET_YES) bAlreadyDone = true; else m_bEndRedliningWarningDone = true; diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index fc290b791fd6..5de8041192d4 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -23,7 +23,6 @@ #include <cassert> -#include <vcl/msgbox.hxx> #include <svl/eitem.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> @@ -97,6 +96,8 @@ #include <comphelper/documentconstants.hxx> #include <comphelper/string.hxx> #include <vcl/bitmapex.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <svtools/embedhlp.hxx> #include <basic/modsizeexceeded.hxx> #include <officecfg/Office/Common.hxx> @@ -2868,7 +2869,7 @@ HiddenInformation SfxObjectShell::GetHiddenInformationState( HiddenInformation n return nState; } -sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::Window* pParent ) +sal_Int16 SfxObjectShell::QueryHiddenInformation(HiddenWarningFact eFact, weld::Window* pParent) { sal_Int16 nRet = RET_YES; const char* pResId = nullptr; @@ -2936,8 +2937,10 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl:: { sMessage += "\n"; sMessage += SfxResId(pResId); - ScopedVclPtrInstance< WarningBox > aWBox(pParent, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, sMessage); - nRet = aWBox->Execute(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pParent, + VclMessageType::Warning, VclButtonsType::YesNo, sMessage)); + xWarn->set_default_response(RET_NO); + nRet = xWarn->run(); } } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index f5b0f7399318..cdb960c9bed9 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -450,7 +450,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) { SfxObjectShell* pDoc = GetObjectShell(); if ( pDoc && pDoc->QueryHiddenInformation( - HiddenWarningFact::WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES ) + HiddenWarningFact::WhenSaving, GetViewFrame()->GetWindow().GetFrameWeld() ) != RET_YES ) break; @@ -514,7 +514,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) SfxBluetoothModel aModel; SfxObjectShell* pDoc = GetObjectShell(); if ( pDoc && pDoc->QueryHiddenInformation( - HiddenWarningFact::WhenSaving, &GetViewFrame()->GetWindow() ) != RET_YES ) + HiddenWarningFact::WhenSaving, GetViewFrame()->GetWindow().GetFrameWeld() ) != RET_YES ) break; uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame ); |