diff options
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/dinfdlg.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/mgetempl.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/dialog/newstyle.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/dialog/passwd.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 12 |
7 files changed, 44 insertions, 37 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 91e21b80360a..d7703f62a73e 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -21,9 +21,9 @@ #include <svl/urihelper.hxx> #include <tools/datetime.hxx> #include <tools/urlobj.hxx> -#include <vcl/layout.hxx> #include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <unotools/localedatawrapper.hxx> #include <unotools/cmdoptions.hxx> #include <comphelper/processfactory.hxx> @@ -1658,7 +1658,9 @@ void CustomPropertiesWindow::ValidateLine( CustomPropertyLine* pLine, bool bIsFr if ( bIsFromTypeBox ) // LoseFocus of TypeBox pLine->m_bTypeLostFocus = true; vcl::Window* pParent = GetParent()->GetParent(); - if (ScopedVclPtrInstance<MessageDialog>(pParent, SfxResId(STR_SFX_QUERY_WRONG_TYPE), VclMessageType::Question, VclButtonsType::OkCancel)->Execute() == RET_OK) + std::unique_ptr<weld::MessageDialog> xMessageBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, + VclMessageType::Question, VclButtonsType::OkCancel, SfxResId(STR_SFX_QUERY_WRONG_TYPE))); + if (xMessageBox->run() == RET_OK) pLine->m_aTypeBox->SelectEntryPos(pLine->m_aTypeBox->GetEntryPos(reinterpret_cast<void*>(CUSTOM_TYPE_TEXT))); else pLine->m_aValueEdit->GrabFocus(); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 3d20a6a3333d..32249bd1db6b 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -51,6 +51,7 @@ #include <comphelper/types.hxx> #include <tools/urlobj.hxx> #include <vcl/help.hxx> +#include <vcl/weld.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbhelper.hxx> #include <osl/file.hxx> @@ -1540,10 +1541,10 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList, } catch( const IllegalArgumentException& ) { - ScopedVclPtrInstance< MessageDialog > aBox( - mpPreferredParentWindow, - SfxResId(RID_SVXSTR_GPG_ENCRYPT_FAILURE)); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(mpPreferredParentWindow ? mpPreferredParentWindow->GetFrameWeld() : nullptr, + VclMessageType::Warning, VclButtonsType::Ok, + SfxResId(RID_SVXSTR_GPG_ENCRYPT_FAILURE))); + xBox->run(); } } diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index 00fdcb0a2264..aa712142cf6b 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -52,7 +52,7 @@ #include <rtl/uri.h> #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <sfx2/mailmodelapi.hxx> #include <sfxtypes.hxx> @@ -784,8 +784,9 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: SolarMutexGuard aGuard; VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow( xParentWindow ); - ScopedVclPtrInstance< MessageDialog > aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui"); - aBox->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pParentWindow ? pParentWindow->GetFrameWeld() : nullptr, "sfx/ui/errorfindemaildialog.ui")); + std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("ErrorFindEmailDialog")); + xBox->run(); eResult = SEND_MAIL_CANCELLED; } else diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx index 1dc87a2c537d..6268c5d61ace 100644 --- a/sfx2/source/dialog/mgetempl.cxx +++ b/sfx2/source/dialog/mgetempl.cxx @@ -18,7 +18,7 @@ */ #include <comphelper/string.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/msgbox.hxx> #include <vcl/field.hxx> #include <svl/eitem.hxx> @@ -602,8 +602,10 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' '))) { - ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VclMessageType::Info); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_TABPAGE_INVALIDNAME))); + xBox->run(); m_pNameRw->GrabFocus(); m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); return DeactivateRC::KeepPage; @@ -619,8 +621,10 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) { if ( !pStyle->SetFollow( aFollowEntry ) ) { - ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VclMessageType::Info); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_TABPAGE_INVALIDSTYLE))); + xBox->run(); m_pFollowLb->GrabFocus(); return DeactivateRC::KeepPage; } @@ -639,8 +643,10 @@ DeactivateRC SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet ) { if ( !pStyle->SetParent( aParentEntry ) ) { - ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VclMessageType::Info); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_TABPAGE_INVALIDPARENT))); + xBox->run(); m_pBaseLb->GrabFocus(); return DeactivateRC::KeepPage; } diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 76dd62b0539d..e72f454a0795 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -25,6 +25,7 @@ #include <sfx2/strings.hrc> #include <sfx2/sfxresid.hxx> #include <vcl/layout.hxx> +#include <vcl/weld.hxx> // Private methods ------------------------------------------------------ @@ -40,11 +41,14 @@ IMPL_LINK_NOARG( SfxNewStyleDlg, OKHdl, ComboBox&, void ) { if ( !pStyle->IsUserDefined() ) { - ScopedVclPtrInstance<MessageDialog>( this, SfxResId( STR_POOL_STYLE_NAME ), VclMessageType::Info )->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SfxResId(STR_POOL_STYLE_NAME))); + xBox->run(); return; } - if ( RET_YES == aQueryOverwriteBox->Execute() ) + if (RET_YES == xQueryOverwriteBox->run()) EndDialog( RET_OK ); } else @@ -58,8 +62,8 @@ IMPL_LINK( SfxNewStyleDlg, ModifyHdl, Edit&, rBox, void ) SfxNewStyleDlg::SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& rInPool ) : ModalDialog(pParent, "CreateStyleDialog", "sfx/ui/newstyle.ui") - , aQueryOverwriteBox(VclPtr<MessageDialog>::Create(this, SfxResId(STR_QUERY_OVERWRITE), - VclMessageType::Question, VclButtonsType::YesNo)) + , xQueryOverwriteBox(Application::CreateMessageDialog(GetFrameWeld(), VclMessageType::Question, VclButtonsType::YesNo, + SfxResId(STR_QUERY_OVERWRITE))) , rPool(rInPool) { get(m_pColBox, "stylename"); @@ -86,7 +90,7 @@ SfxNewStyleDlg::~SfxNewStyleDlg() void SfxNewStyleDlg::dispose() { - aQueryOverwriteBox.disposeAndClear(); + xQueryOverwriteBox.reset(); m_pColBox.clear(); m_pOKBtn.clear(); ModalDialog::dispose(); diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx index 347629fc7615..8c0f2378329c 100644 --- a/sfx2/source/dialog/passwd.cxx +++ b/sfx2/source/dialog/passwd.cxx @@ -17,16 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - -// Include --------------------------------------------------------------- -#include <vcl/layout.hxx> - #include <sfx2/passwd.hxx> #include <sfxtypes.hxx> #include <sfx2/sfxresid.hxx> - #include <sfx2/strings.hrc> - +#include <vcl/weld.hxx> IMPL_LINK( SfxPasswordDialog, EditModifyHdl, Edit&, rEdit, void ) { @@ -71,8 +66,10 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, Button*, void) bConfirmFailed = true; if ( bConfirmFailed ) { - ScopedVclPtrInstance< MessageDialog > aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM)); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, + SfxResId(STR_ERROR_WRONG_CONFIRM))); + xBox->run(); mpConfirm1ED->SetText( OUString() ); mpConfirm1ED->GrabFocus(); } diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 38d9fd8b4cc4..412b02f35110 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -1885,14 +1885,10 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl() // we only want to show the dialog once and if we want to delete a style in use (UX-advice) if ( bUsedStyle ) { - #if defined UNX - ScopedVclPtrInstance<MessageDialog> aBox(SfxGetpApp()->GetTopWindow(), aMsg, - VclMessageType::Question, VclButtonsType::YesNo); - #else - ScopedVclPtrInstance<MessageDialog> aBox(GetWindow(), aMsg, - VclMessageType::Question, VclButtonsType::YesNo); - #endif - aApproved = aBox->Execute() == RET_YES; + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + aMsg)); + aApproved = xBox->run() == RET_YES; } // if there are no used styles selected or the user approved the changes |