diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 16:33:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-22 22:07:38 +0100 |
commit | 6a4c464b49dbfa2801818ead1b50bc9580824d00 (patch) | |
tree | 3d6381b6b13576bc536670992b36784436486e95 /cui/source/tabpages/tplneend.cxx | |
parent | f7733528e88a6619f82b54b59e92a9bca72c0a89 (diff) |
weld native message dialogs
just the straight-forward MessageDialog cases first
a) remove border_width from message dialog .ui so as to take
the default border width
b) retain 12 as default message dialog border for vcl widget case
c) remove layour_style from message dialog button boxes so as to
take the default mode (a no-op for vcl widget case)
d) use gtk response ids (vcl builder will converts to vcl ones)
Change-Id: I7de281093a1b64f92f71ca11e7cbba42bb658154
Reviewed-on: https://gerrit.libreoffice.org/50143
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/tabpages/tplneend.cxx')
-rw-r--r-- | cui/source/tabpages/tplneend.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx index e669b92135ec..621d90929028 100644 --- a/cui/source/tabpages/tplneend.cxx +++ b/cui/source/tabpages/tplneend.cxx @@ -20,6 +20,7 @@ #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> #include <vcl/settings.hxx> +#include <vcl/weld.hxx> #include <unotools/pathoptions.hxx> #include <sfx2/app.hxx> #include <sfx2/filedlghelper.hxx> @@ -200,10 +201,9 @@ void SvxLineEndDefTabPage::CheckChanges_Impl() if( aString != m_pLbLineEnds->GetSelectedEntry() ) { - ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog() - ,"AskChangeLineEndDialog" - ,"cui/ui/querychangelineenddialog.ui" ); - if ( aQueryBox->Execute() == RET_YES ) + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querychangelineenddialog.ui")); + std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskChangeLineEndDialog")); + if (xQueryBox->run() == RET_YES) ClickModifyHdl_Impl( nullptr ); } } @@ -321,10 +321,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void) // if yes, repeat and demand a new name if ( !bDifferent ) { - ScopedVclPtrInstance<MessageDialog> aWarningBox( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui" ); - aWarningBox->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); + xWarningBox->run(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "Dialog creation failed!"); @@ -346,7 +345,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void) if( bDifferent ) bLoop = false; else - aWarningBox->Execute(); + xWarningBox->run(); } } @@ -466,10 +465,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl, Button*, void) } else { - ScopedVclPtrInstance<MessageDialog> aBox( GetParentDialog() - ,"DuplicateNameDialog" - ,"cui/ui/queryduplicatedialog.ui" ); - aBox->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/queryduplicatedialog.ui")); + std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("DuplicateNameDialog")); + xWarningBox->run(); } } } @@ -492,11 +490,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void) if( nPos != LISTBOX_ENTRY_NOTFOUND ) { - ScopedVclPtrInstance<MessageDialog> aQueryBox( GetParentDialog() - ,"AskDelLineEndDialog" - ,"cui/ui/querydeletelineenddialog.ui" ); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querydeletelineenddialog.ui")); + std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("AskDelLineEndDialog")); - if ( aQueryBox->Execute() == RET_YES ) + if (xQueryBox->run() == RET_YES) { pLineEndList->Remove(nPos); m_pLbLineEnds->RemoveEntry( nPos ); @@ -526,9 +523,10 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void) if ( *pnLineEndListState & ChangeType::MODIFIED ) { - nReturn = ScopedVclPtrInstance<MessageDialog>(GetParentDialog() - ,"AskSaveList" - ,"cui/ui/querysavelistdialog.ui")->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querysavelistdialog.ui")); + std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("AskSaveList")); + + nReturn = xBox->run(); if ( nReturn == RET_YES ) pLineEndList->Save(); @@ -580,9 +578,11 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl, Button*, void) *pnLineEndListState &= ~ChangeType::MODIFIED; } else - ScopedVclPtrInstance<MessageDialog>(GetParentDialog() - ,"NoLoadedFileDialog" - ,"cui/ui/querynoloadedfiledialog.ui")->Execute(); + { + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynoloadedfiledialog.ui")); + std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoLoadedFileDialog")); + xBox->run(); + } } } @@ -647,9 +647,9 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl, Button*, void) } else { - ScopedVclPtrInstance<MessageDialog>(GetParentDialog() - ,"NoSaveFileDialog" - ,"cui/ui/querynosavefiledialog.ui")->Execute(); + std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "cui/ui/querynosavefiledialog.ui")); + std::unique_ptr<weld::MessageDialog> xBox(xBuilder->weld_message_dialog("NoSaveFileDialog")); + xBox->run(); } } } |