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 /sd | |
parent | f3a4129ed5946e2b8661dc8df23e00c4b6c6ecc8 (diff) |
convert remaining WarningBox to weld::MessageDialog
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 11 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/animations/SlideTransitionPane.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/dlg/LayerTabBar.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/dlg/PhotoAlbumDialog.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/dlg/animobjs.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/dlg/custsdlg.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/func/fucopy.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/func/fulinend.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/func/fumorph.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/func/fuscale.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 21 |
14 files changed, 78 insertions, 52 deletions
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 55cfc04e9266..1e8c666f68bb 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -37,13 +37,14 @@ #include <sfx2/fcontnr.hxx> #include <sfx2/frmhtmlw.hxx> #include <sfx2/progress.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <vcl/wrkwin.hxx> #include <svl/aeitem.hxx> #include <svx/svditer.hxx> #include <svtools/imaprect.hxx> #include <svtools/imapcirc.hxx> #include <svtools/imappoly.hxx> -#include <vcl/msgbox.hxx> #include <editeng/outlobj.hxx> #include <editeng/editobj.hxx> #include <svx/svdopath.hxx> @@ -3097,8 +3098,12 @@ bool HtmlExport::checkForExistingFiles() osl::FileBase::getSystemPathFromFileURL( maExportPath, aSystemPath ); OUString aMsg(SdResId(STR_OVERWRITE_WARNING)); aMsg = aMsg.replaceFirst( "%FILENAME", aSystemPath ); - ScopedVclPtrInstance< WarningBox > aWarning( nullptr, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aMsg ); - bFound = ( RET_NO == aWarning->Execute() ); + + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, + VclMessageType::Warning, VclButtonsType::YesNo, + aMsg)); + xWarn->set_default_response(RET_YES); + bFound = (RET_NO == xWarn->run()); } } catch( Exception& ) diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index dad89d8f8ffe..7012cb278b36 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -45,7 +45,8 @@ #include <vcl/field.hxx> #include <vcl/lstbox.hxx> #include <vcl/layout.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <vcl/decoview.hxx> #include <vcl/combobox.hxx> #include <vcl/menu.hxx> @@ -1527,9 +1528,12 @@ void CustomAnimationEffectTabPage::openSoundFileDialog() { OUString aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); aStrWarning = aStrWarning.replaceFirst("%", aFile); - ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, aStrWarning ); - aWarningBox->SetModalInputMode (true); - bQuitLoop = aWarningBox->Execute() != RET_RETRY; + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, + VclMessageType::Warning, VclButtonsType::NONE, + aStrWarning)); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Retry), RET_RETRY); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + bQuitLoop = xWarn->run() != RET_RETRY; bValidSoundFile=false; } diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 5204d0f3a8ff..0fe9d7292996 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -36,7 +36,8 @@ #include <svtools/controldims.hxx> #include <svx/gallery.hxx> #include <unotools/pathoptions.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <tools/urlobj.hxx> #include <DrawViewShell.hxx> #include <slideshow.hxx> @@ -768,9 +769,12 @@ void SlideTransitionPane::openSoundFileDialog() { OUString aStrWarning(SdResId(STR_WARNING_NOSOUNDFILE)); aStrWarning = aStrWarning.replaceFirst("%", aFile); - ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, MessBoxStyle::RetryCancel, WB_3DLOOK, aStrWarning ); - aWarningBox->SetModalInputMode (true); - bQuitLoop = (aWarningBox->Execute() != RET_RETRY); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr, + VclMessageType::Warning, VclButtonsType::NONE, + aStrWarning)); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Retry), RET_RETRY); + xWarn->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + bQuitLoop = (xWarn->run() != RET_RETRY); bValidSoundFile = false; } diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index 38238db341b7..bdfc7855897f 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -20,7 +20,8 @@ #include <LayerTabBar.hxx> #include <svx/svdlayer.hxx> #include <svx/svdpagv.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <sfx2/dispatch.hxx> #include <sdattr.hxx> @@ -274,9 +275,10 @@ TabBarAllowRenamingReturnCode LayerTabBar::AllowRenaming() (rLayerAdmin.GetLayer( aNewName ) && aLayerName != aNewName) ) { // Name already exists - ScopedVclPtrInstance<WarningBox> aWarningBox( &pDrViewSh->GetViewFrame()->GetWindow(), MessBoxStyle::Ok, - SdResId( STR_WARN_NAME_DUPLICATE ) ); - aWarningBox->Execute(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pDrViewSh->GetViewFrame()->GetWindow().GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_WARN_NAME_DUPLICATE))); + xWarn->run(); bOK = false; } diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index adf5a386ee9f..c7d0c8243a27 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -25,7 +25,7 @@ #include <unotools/ucbstreamhelper.hxx> #include <officecfg/Office/Impress.hxx> #include <svx/svdview.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <svx/unoshape.hxx> #include <svx/xfltrit.hxx> @@ -110,8 +110,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, CreateHdl, Button*, void) { if (pImagesLst->GetEntryCount() == 0) { - ScopedVclPtrInstance< WarningBox > aWarning(this, MessBoxStyle::Ok, SdResId(STR_PHOTO_ALBUM_EMPTY_WARNING)); - aWarning->Execute(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_PHOTO_ALBUM_EMPTY_WARNING))); + xWarn->run(); } else { diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index b2786b38c451..9f0c5f3ed820 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -25,7 +25,8 @@ #include <sfx2/basedlgs.hxx> #include <sfx2/dispatch.hxx> #include <sfx2/progress.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <anminfo.hxx> #include <animobjs.hxx> @@ -439,8 +440,10 @@ IMPL_LINK( AnimationWindow, ClickRemoveBitmapHdl, Button*, pBtn, void ) } else // delete everything { - ScopedVclPtrInstance< WarningBox > aWarnBox( this, MessBoxStyle::YesNo, SdResId( STR_ASK_DELETE_ALL_PICTURES ) ); - short nReturn = aWarnBox->Execute(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::YesNo, + SdResId(STR_ASK_DELETE_ALL_PICTURES))); + short nReturn = xWarn->run(); if( nReturn == RET_YES ) { diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index 9e6bab218aa2..66fe0686076c 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -27,7 +27,8 @@ #include <cusshow.hxx> #include <sdmod.hxx> #include <customshowlist.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <svtools/treelistentry.hxx> // SdCustomShowDlg @@ -531,9 +532,10 @@ IMPL_LINK_NOARG(SdDefineCustomShowDlg, OKHdl, Button*, void) } else { - ScopedVclPtrInstance<WarningBox>( this, MessBoxStyle::Ok, - SdResId( STR_WARN_NAME_DUPLICATE ) )->Execute(); - + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_WARN_NAME_DUPLICATE))); + xWarn->run(); m_pEdtName->GrabFocus(); } } diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 944d1c1c06bf..a7381b2abd38 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -31,7 +31,8 @@ #include <svx/dialogs.hrc> #include <svx/strarray.hxx> #include <svx/dlgutil.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <sdattr.hxx> #include <sdresid.hxx> @@ -367,9 +368,12 @@ DeactivateRC SdTpOptionsMisc::DeactivatePage( SfxItemSet* pActiveSet ) FillItemSet( pActiveSet ); return DeactivateRC::LeavePage; } - ScopedVclPtrInstance< WarningBox > aWarnBox( GetParent(), MessBoxStyle::YesNo, SdResId( STR_WARN_SCALE_FAIL ) ); - if( aWarnBox->Execute() == RET_YES ) + vcl::Window* pWin = GetParent(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::YesNo, + SdResId(STR_WARN_SCALE_FAIL))); + if (xWarn->run() == RET_YES) return DeactivateRC::KeepPage; if( pActiveSet ) diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx index f3389e861b30..a8cde2135f49 100644 --- a/sd/source/ui/func/fucopy.cxx +++ b/sd/source/ui/func/fucopy.cxx @@ -31,7 +31,6 @@ #include <DrawDocShell.hxx> #include <vcl/wrkwin.hxx> #include <svx/svdobj.hxx> -#include <vcl/msgbox.hxx> #include <sfx2/app.hxx> #include <svx/xcolit.hxx> #include <svx/xflclit.hxx> diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx index 354d4b55e806..36aedff0551d 100644 --- a/sd/source/ui/func/fulinend.cxx +++ b/sd/source/ui/func/fulinend.cxx @@ -23,7 +23,8 @@ #include <svx/dialogs.hrc> #include <svx/svdobj.hxx> #include <svx/svdopath.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <strings.hrc> #include <ViewShell.hxx> @@ -137,9 +138,10 @@ void FuLineEnd::DoExecute( SfxRequest& ) } else { - ScopedVclPtrInstance<WarningBox> aWarningBox( mpWindow, MessBoxStyle::Ok, - SdResId( STR_WARN_NAME_DUPLICATE ) ); - aWarningBox->Execute(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(mpWindow ? mpWindow->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_WARN_NAME_DUPLICATE))); + xWarn->run(); } } } diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 16565daf57ad..b78c018747ed 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -20,7 +20,6 @@ #include <fumorph.hxx> #include <svx/xfillit.hxx> #include <svx/xlineit.hxx> -#include <vcl/msgbox.hxx> #include <svx/svdpool.hxx> #include <tools/poly.hxx> #include <svx/svdopath.hxx> diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx index 33749b20c71e..7cb45019018d 100644 --- a/sd/source/ui/func/fuscale.cxx +++ b/sd/source/ui/func/fuscale.cxx @@ -31,7 +31,6 @@ #include <ViewShell.hxx> #include <fuzoom.hxx> -#include <vcl/msgbox.hxx> #include <svx/svdpagv.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 91377f2b69f2..2e55d56edfe0 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -49,7 +49,8 @@ #include <svx/xlnclit.hxx> #include <toolkit/awt/vclxdevice.hxx> #include <unotools/localedatawrapper.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <unotools/moduleoptions.hxx> #include <xmloff/autolayout.hxx> @@ -1281,11 +1282,12 @@ public: // Show warning that the orientation could not be set. if (pViewShell) { - ScopedVclPtrInstance<WarningBox> aWarnBox( - pViewShell->GetActiveWindow(), - MessBoxStyle::OkCancel | MessBoxStyle::DefaultCancel, - SdResId(STR_WARN_PRINTFORMAT_FAILURE)); - if (aWarnBox->Execute() != RET_OK) + vcl::Window* pWin = pViewShell->GetActiveWindow(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::OkCancel, + SdResId(STR_WARN_PRINTFORMAT_FAILURE))); + xWarn->set_default_response(RET_CANCEL); + if (xWarn->run() != RET_OK) return; } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 6d6dcad9e855..df48f77d5642 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -93,7 +93,6 @@ #include <unotools/useroptions.hxx> #include <vcl/graph.hxx> -#include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <vcl/waitobj.hxx> #include <vcl/weld.hxx> @@ -1813,11 +1812,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) || aLayerName.isEmpty() ) { // name already exists - ScopedVclPtrInstance<WarningBox> aWarningBox ( - GetParentWindow(), - MessBoxStyle::Ok, - SdResId(STR_WARN_NAME_DUPLICATE)); - aWarningBox->Execute(); + vcl::Window* pWin = GetParentWindow(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_WARN_NAME_DUPLICATE))); + xWarn->run(); } else bLoop = false; @@ -1982,11 +1981,11 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) aLayerName != aOldLayerName) || aLayerName.isEmpty() ) { // name already exists - ScopedVclPtrInstance<WarningBox> aWarningBox ( - GetParentWindow(), - MessBoxStyle::Ok, - SdResId(STR_WARN_NAME_DUPLICATE)); - aWarningBox->Execute(); + vcl::Window* pWin = GetParentWindow(); + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::Ok, + SdResId(STR_WARN_NAME_DUPLICATE))); + xWarn->run(); } else bLoop = false; |