diff options
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 1 | ||||
-rw-r--r-- | sw/source/ui/dialog/swmessdialog.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 33 | ||||
-rw-r--r-- | sw/source/ui/envelp/labfmt.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/misc/glossary.cxx | 30 | ||||
-rw-r--r-- | sw/source/ui/misc/srtdlg.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/table/tabledlg.cxx | 7 |
10 files changed, 83 insertions, 38 deletions
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 688125e3202a..c02c74ce3851 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -28,7 +28,7 @@ #include <globals.hrc> #include <unotools/configmgr.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> #include <sfx2/fcontnr.hxx> @@ -260,9 +260,9 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, SelectHdl, ListBox&, void) IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, Button*, void) { - ScopedVclPtrInstance<MessageDialog> aQuery(this, "QueryDefaultCompatDialog", - "modules/swriter/ui/querydefaultcompatdialog.ui"); - if (aQuery->Execute() == RET_YES) + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/querydefaultcompatdialog.ui")); + std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryDefaultCompatDialog")); + if (xQueryBox->run() == RET_YES) { for ( vector< SvtCompatibilityEntry >::iterator pItem = m_pImpl->m_aList.begin(); pItem != m_pImpl->m_aList.end(); ++pItem ) diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index ded560e5bdb0..853574e67eb2 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -21,7 +21,7 @@ #include <mailmergewizard.hxx> #include <swtypes.hxx> #include "addresslistdialog.hxx" -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/txtattr.hxx> #include <vcl/xtextedt.hxx> #include <vcl/builderfactory.hxx> @@ -183,7 +183,9 @@ IMPL_LINK_NOARG(SwMailMergeAddressBlockPage, AddressListHdl_Impl, Button*, void) catch (const uno::Exception& e) { SAL_WARN("sw", e); - ScopedVclPtrInstance<MessageDialog>(this, e.Message)->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Warning, VclButtonsType::Ok, e.Message)); + xBox->run(); } } diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 3adfa2970897..6212ae20cf5c 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -21,6 +21,7 @@ #include <mailmergewizard.hxx> #include <mmconfigitem.hxx> #include <vcl/msgbox.hxx> +#include <vcl/messagedialog.hxx> #include <dbui.hrc> #include <strings.hrc> #include <bitmaps.hlst> diff --git a/sw/source/ui/dialog/swmessdialog.cxx b/sw/source/ui/dialog/swmessdialog.cxx index 79aba4459af6..c57f23534eb8 100644 --- a/sw/source/ui/dialog/swmessdialog.cxx +++ b/sw/source/ui/dialog/swmessdialog.cxx @@ -11,7 +11,7 @@ #include <vcl/button.hxx> #include <vcl/edit.hxx> #include <vcl/fixed.hxx> -#include <vcl/layout.hxx> +#include <vcl/messagedialog.hxx> #include <vcl/msgbox.hxx> #include <vcl/vclmedit.hxx> diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index aac5e2c1dfd1..1096103092da 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -22,7 +22,7 @@ #include <svl/urihelper.hxx> #include <svl/PasswordHelper.hxx> #include <vcl/svapp.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <svl/stritem.hxx> #include <svl/eitem.hxx> #include <sfx2/passwd.hxx> @@ -422,7 +422,10 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) } else { - ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_WRONG_PASSWORD), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_WRONG_PASSWORD))); + xInfoBox->run(); } } } @@ -989,7 +992,10 @@ IMPL_LINK( SwEditRegionDlg, UseFileHdl, Button *, pButton, void ) bool bContent = pSectRepr->IsContent(); if( pBox->IsChecked() && bContent && rSh.HasSelection() ) { - if (RET_NO == ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_QUERY_CONNECT), VclMessageType::Question, VclButtonsType::YesNo)->Execute()) + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + SwResId(STR_QUERY_CONNECT))); + if (RET_NO == xQueryBox->run()) pBox->Check( false ); } if( bFile ) @@ -1265,7 +1271,10 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox, void ) } else { - ScopedVclPtrInstance<MessageDialog>(pBox, SwResId(STR_WRONG_PASSWD_REPEAT), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pBox->GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_WRONG_PASSWD_REPEAT))); + xInfoBox->run(); ChangePasswdHdl(pBox); break; } @@ -1702,7 +1711,10 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton, void ) } else { - ScopedVclPtrInstance<MessageDialog>(pButton, SwResId(STR_WRONG_PASSWD_REPEAT), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pButton->GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_WRONG_PASSWD_REPEAT))); + xInfoBox->run(); } } else if(!bChange) @@ -1725,9 +1737,14 @@ IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, Button *, pButton, void ) CheckBox* pBox = static_cast<CheckBox*>(pButton); if( pBox->IsChecked() ) { - if( m_pWrtSh->HasSelection() && - RET_NO == ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_QUERY_CONNECT), VclMessageType::Question, VclButtonsType::YesNo)->Execute()) - pBox->Check( false ); + if (m_pWrtSh->HasSelection()) + { + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + SwResId(STR_QUERY_CONNECT))); + if (RET_NO == xQueryBox->run()) + pBox->Check( false ); + } } bool bFile = pBox->IsChecked(); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 18c4b2feb4bd..82a5b754f9c7 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -18,7 +18,7 @@ */ #include <tools/poly.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/settings.hxx> #include <vcl/builderfactory.hxx> @@ -639,19 +639,20 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl, Button*, void) if ( rCfg.IsPredefinedLabel(sMake, sType) ) { SAL_WARN( "sw.envelp", "label is predefined and cannot be overwritten" ); - ScopedVclPtrInstance<MessageDialog>(this, "CannotSaveLabelDialog", "modules/swriter/ui/cannotsavelabeldialog.ui")->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/cannotsavelabeldialog.ui")); + std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("CannotSaveLabelDialog")); + xBox->run(); return; } - ScopedVclPtrInstance<MessageDialog> aQuery(this, "QuerySaveLabelDialog", - "modules/swriter/ui/querysavelabeldialog.ui"); - - aQuery->set_primary_text(aQuery->get_primary_text(). + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/querysavelabeldialog.ui")); + std::unique_ptr<weld::MessageDialog> xQuery(xBuilder->weld_message_dialog("QuerySaveLabelDialog")); + xQuery->set_primary_text(xQuery->get_primary_text(). replaceAll("%1", sMake).replaceAll("%2", sType)); - aQuery->set_secondary_text(aQuery->get_secondary_text(). + xQuery->set_secondary_text(xQuery->get_secondary_text(). replaceAll("%1", sMake).replaceAll("%2", sType)); - if (RET_YES != aQuery->Execute()) + if (RET_YES != xQuery->run()) return; } rLabRec.m_aType = sType; diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 4de77fd36e65..c5628740ffdb 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/util/SearchFlags.hpp> #include <i18nutil/searchopt.hxx> #include <svl/stritem.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <sfx2/dispatch.hxx> #include <svl/eitem.hxx> #include <unotools/textsearch.hxx> @@ -1219,8 +1219,10 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl, Button*, void) bDifferent |= m_sFields[i] != pEntry->GetAuthorField(static_cast<ToxAuthorityField>(i)); if(bDifferent) { - ScopedVclPtrInstance< MessageDialog > aQuery(&m_rDialog, SwResId(STR_QUERY_CHANGE_AUTH_ENTRY), VclMessageType::Question, VclButtonsType::YesNo); - if(RET_YES != aQuery->Execute()) + std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(m_rDialog.GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + SwResId(STR_QUERY_CHANGE_AUTH_ENTRY))); + if (RET_YES != xQuery->run()) return; } } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index e69802781349..53eade41ba0c 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -21,7 +21,7 @@ #include <o3tl/any.hxx> #include <vcl/menu.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/help.hxx> #include <vcl/builderfactory.hxx> #include <svl/stritem.hxx> @@ -461,7 +461,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) const OUString aShortName(m_pShortNameEdit->GetText()); if(pGlossaryHdl->HasShortName(aShortName)) { - ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_DOUBLE_SHORTNAME), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_DOUBLE_SHORTNAME))); + xInfoBox->run(); m_pShortNameEdit->SetSelection(Selection(0, SELECTION_MAX)); m_pShortNameEdit->GrabFocus(); return true; @@ -589,7 +592,10 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) Init(); else { - ScopedVclPtrInstance<MessageDialog>(this, SwResId( STR_NO_GLOSSARIES ), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_NO_GLOSSARIES))); + xInfoBox->run(); } } } @@ -668,9 +674,10 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl, Button*, void) } else { - ScopedVclPtrInstance< MessageDialog > aBox(this, sReadonlyPath, VclMessageType::Question, VclButtonsType::YesNo); - - if(RET_YES == aBox->Execute()) + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + sReadonlyPath)); + if (RET_YES == xBox->run()) PathHdl(m_pPathBtn); } } @@ -802,7 +809,10 @@ IMPL_LINK_NOARG(SwNewGlosNameDlg, Rename, Button*, void) if( pDlg->pGlossaryHdl->HasShortName(m_pNewShort->GetText()) && sNew != m_pOldShort->GetText() ) { - ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_DOUBLE_SHORTNAME), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_DOUBLE_SHORTNAME))); + xBox->run(); m_pNewShort->GrabFocus(); } else @@ -1138,8 +1148,10 @@ void SwGlossaryDlg::DeleteEntry() const bool bExists = nullptr != pChild; const bool bIsGroup = pEntry && !pParent; - ScopedVclPtrInstance< MessageDialog > aQuery(this, SwResId(STR_QUERY_DELETE), VclMessageType::Question, VclButtonsType::YesNo); - if (bExists && !bIsGroup && RET_YES == aQuery->Execute()) + std::unique_ptr<weld::MessageDialog> xQuery(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + SwResId(STR_QUERY_DELETE))); + if (bExists && !bIsGroup && RET_YES == xQuery->run()) { if (!aTitle.isEmpty() && pGlossaryHdl->DelGlossary(aShortName)) { diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index e20fb410a7bb..da09f637d51e 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -23,6 +23,7 @@ #include <vcl/lstbox.hxx> #include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <svl/intitem.hxx> #include <svl/eitem.hxx> #include <sfx2/dispatch.hxx> @@ -366,7 +367,13 @@ void SwSortDlg::Apply() } if( !bRet ) - ScopedVclPtrInstance<MessageDialog>(GetParent(), SwResId(STR_SRTERR), VclMessageType::Info)->Execute(); + { + vcl::Window* pWin = GetParent(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr, + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_SRTERR))); + xInfoBox->run(); + } } IMPL_LINK( SwSortDlg, DelimHdl, Button*, pButton, void ) diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index fe915df54d11..c7d65cb6f2db 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -19,7 +19,7 @@ #include <hintids.hxx> #include <comphelper/string.hxx> -#include <vcl/layout.hxx> +#include <vcl/weld.hxx> #include <vcl/msgbox.hxx> #include <svl/stritem.hxx> #include <svl/intitem.hxx> @@ -633,7 +633,10 @@ DeactivateRC SwFormatTablePage::DeactivatePage( SfxItemSet* _pSet ) OUString sTableName = m_pNameED->GetText(); if(sTableName.indexOf(' ') != -1) { - ScopedVclPtrInstance<MessageDialog>(this, SwResId(STR_WRONG_TABLENAME), VclMessageType::Info)->Execute(); + std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Info, VclButtonsType::Ok, + SwResId(STR_WRONG_TABLENAME))); + xInfoBox->run(); m_pNameED->GrabFocus(); return DeactivateRC::KeepPage; } |