summaryrefslogtreecommitdiff
path: root/vcl/unx/x11
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-26 13:28:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-27 09:52:32 +0000
commit0fad8d308122a862aa49dece498d56a418df2afe (patch)
treee67e7df1f9d315648535f436b424c9941dea589e /vcl/unx/x11
parentf3a4129ed5946e2b8661dc8df23e00c4b6c6ecc8 (diff)
convert remaining WarningBox to weld::MessageDialog
Change-Id: I7e3c156a6ad47ac232636ae274280c1cb7556d4a
Diffstat (limited to 'vcl/unx/x11')
-rw-r--r--vcl/unx/x11/x11sys.cxx27
1 files changed, 8 insertions, 19 deletions
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 50471e8fc06f..c354269b3a3d 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -22,8 +22,7 @@
#include <unx/saldisp.hxx>
#include <unx/x11/x11sys.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/button.hxx>
+#include <vcl/weld.hxx>
#include <svdata.hxx>
@@ -86,31 +85,21 @@ tools::Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScree
int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMessage, const std::vector< OUString >& rButtons )
{
- int nRet = -1;
-
ImplSVData* pSVData = ImplGetSVData();
if( pSVData->mpIntroWindow )
pSVData->mpIntroWindow->Hide();
- ScopedVclPtrInstance<WarningBox> aWarn(nullptr, MessBoxStyle::NONE, WB_STDWORK, rMessage);
- aWarn->SetText( rTitle );
- aWarn->Clear();
+ std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(nullptr,
+ VclMessageType::Warning, VclButtonsType::NONE,
+ rMessage));
+ xWarn->set_title(rTitle);
sal_uInt16 nButton = 0;
for (auto const& button : rButtons)
- {
- aWarn->AddButton( button, nButton+1, (nButton == 0) ? ButtonDialogFlags::Default : ButtonDialogFlags::NONE );
- nButton++;
- }
- aWarn->SetFocusButton( sal_uInt16(1) );
-
- nRet = static_cast<int>(aWarn->Execute()) - 1;
-
- // normalize behaviour, actually this should never happen
- if( nRet < -1 || nRet >= int(rButtons.size()) )
- nRet = -1;
+ xWarn->add_button(button, nButton++);
+ xWarn->set_default_response(0);
- return nRet;
+ return xWarn->run();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */