diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-23 09:35:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 15:27:09 +0000 |
commit | 942f05996bc287923cdbcae12c64e57adf8ec975 (patch) | |
tree | 7005380763a9ecb93f5f27c28174633b9774abb7 /cui | |
parent | c410a3dcfeb68ba2247c0d879727afe4ca8ed3da (diff) |
convert remaining ErrorBox to weld::MessageDialog
and
convert remaining QueryBox to weld::MessageDialog
Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/SvxMenuConfigPage.cxx | 8 | ||||
-rw-r--r-- | cui/source/customize/SvxToolbarConfigPage.cxx | 7 | ||||
-rw-r--r-- | cui/source/dialogs/linkdlg.cxx | 16 | ||||
-rw-r--r-- | cui/source/options/optinet2.cxx | 10 | ||||
-rw-r--r-- | cui/source/options/personalization.cxx | 27 | ||||
-rw-r--r-- | cui/source/tabpages/page.cxx | 8 |
6 files changed, 50 insertions, 26 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 1c2ad24094d6..a979233168b2 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -27,7 +27,6 @@ #include <vcl/commandinfoprovider.hxx> #include <vcl/help.hxx> #include <vcl/weld.hxx> -#include <vcl/msgbox.hxx> #include <vcl/decoview.hxx> #include <vcl/toolbox.hxx> #include <vcl/scrbar.hxx> @@ -286,9 +285,10 @@ short SvxMenuConfigPage::QueryReset() OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName ); - ScopedVclPtrInstance<QueryBox> qbox( this, MessBoxStyle::YesNo, label ); - - return qbox->Execute(); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + label)); + return xQueryBox->run(); } IMPL_LINK_NOARG( SvxMenuConfigPage, SelectMenu, ListBox&, void ) diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 49c4349c459b..dcd70890d45c 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -723,9 +723,10 @@ short SvxToolbarConfigPage::QueryReset() OUString label = SvxConfigPageHelper::replaceSaveInName( msg, saveInName ); - ScopedVclPtrInstance< QueryBox > qbox( this, MessBoxStyle::YesNo, label ); - - return qbox->Execute(); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + label)); + return xQueryBox->run(); } IMPL_LINK_NOARG( SvxToolbarConfigPage, SelectToolbar, ListBox&, void ) diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 73e3e4021be9..9b2478f8f746 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -27,7 +27,7 @@ #include <vcl/fixed.hxx> #include <vcl/group.hxx> #include <vcl/lstbox.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/timer.hxx> #include <vcl/idle.hxx> #include <svtools/svtabbx.hxx> @@ -416,9 +416,12 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void ) if( !xLink.is() ) return; - ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsg ); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + aStrCloselinkmsg)); + xQueryBox->set_default_response(RET_YES); - if( RET_YES == aBox->Execute() ) + if (RET_YES == xQueryBox->run()) { m_pTbLinks->GetModel()->Remove( m_pTbLinks->GetEntry( nPos ) ); @@ -447,9 +450,12 @@ IMPL_LINK_NOARG( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void ) } else { - ScopedVclPtrInstance< QueryBox > aBox( this, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, aStrCloselinkmsgMulti ); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + aStrCloselinkmsgMulti)); + xQueryBox->set_default_response(RET_YES); - if( RET_YES == aBox->Execute() ) + if (RET_YES == xQueryBox->run()) { SvBaseLinkMemberList aLinkList; diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 1b4161575e67..19de5d14b8ad 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -23,7 +23,7 @@ #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Security.hxx> #include <tools/config.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <svl/intitem.hxx> #include <svl/stritem.hxx> #include <svl/eitem.hxx> @@ -663,8 +663,12 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, SavePasswordHdl, Button*, void) } else { - ScopedVclPtrInstance< QueryBox > aQuery( this, MessBoxStyle::YesNo|MessBoxStyle::DefaultNo, m_sPasswordStoringDeactivateStr ); - sal_uInt16 nRet = aQuery->Execute(); + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + m_sPasswordStoringDeactivateStr)); + xQueryBox->set_default_response(RET_NO); + + sal_uInt16 nRet = xQueryBox->run(); if( RET_YES == nRet ) { diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 9b3e482b55d2..b6af6903d0c7 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -21,7 +21,7 @@ #include <rtl/strbuf.hxx> #include <tools/urlobj.hxx> #include <vcl/edit.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <vcl/lstbox.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -709,8 +709,11 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); - aBox->Execute(); + + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Error, VclButtonsType::Ok, + sError)); + xBox->run(); return; } } @@ -722,8 +725,10 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError ); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Error, VclButtonsType::Ok, + sError)); + xBox->run(); return; } @@ -763,8 +768,10 @@ void SearchAndParseThread::execute() sError = CuiResId(RID_SVXSTR_SEARCHERROR); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Error, VclButtonsType::Ok, + sError)); + xBox->run(); return; } continue; @@ -847,8 +854,10 @@ void SearchAndParseThread::execute() sError = CuiResId( RID_SVXSTR_SEARCHERROR ); sError = sError.replaceAll("%1", m_aURL); m_pPersonaDialog->SetProgress( OUString() ); - ScopedVclPtrInstance< ErrorBox > aBox( nullptr, MessBoxStyle::Ok, sError); - aBox->Execute(); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Error, VclButtonsType::Ok, + sError)); + xBox->run(); return; } diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index dbde0bf2dc9c..97aab18fd870 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -25,7 +25,7 @@ #include <sfx2/viewsh.hxx> #include <svl/itemiter.hxx> #include <svl/languageoptions.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/weld.hxx> #include <unotools/configitem.hxx> #include <sfx2/htmlmode.hxx> #include <sal/macros.h> @@ -1375,7 +1375,11 @@ DeactivateRC SvxPageDescPage::DeactivatePage( SfxItemSet* _pSet ) if ( ePaper != PAPER_SCREEN_4_3 && ePaper != PAPER_SCREEN_16_9 && ePaper != PAPER_SCREEN_16_10 && IsMarginOutOfRange() ) { - if (ScopedVclPtrInstance<QueryBox>(this, MessBoxStyle::YesNo | MessBoxStyle::DefaultNo, m_pPrintRangeQueryText->GetText())->Execute() == RET_NO) + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(), + VclMessageType::Question, VclButtonsType::YesNo, + m_pPrintRangeQueryText->GetText())); + xQueryBox->set_default_response(RET_NO); + if (xQueryBox->run() == RET_NO) { MetricField* pField = nullptr; if ( IsPrinterRangeOverflow( *m_pLeftMarginEdit, nFirstLeftMargin, nLastLeftMargin, MARGIN_LEFT ) ) |