diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-27 10:11:52 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-27 17:25:59 +0100 |
commit | 9fcef57a34dbd88a98621dfaf8668fa076dd98f1 (patch) | |
tree | 844e9ca54e0b30faf1b71b42397b4a8143460a43 /uui | |
parent | aa4548d1f91e15b8711bbcbd2ad939247579f9a8 (diff) |
convert Redline warning dialog to .ui to get helpids
etc.
Change-Id: Ic5e6031fe99347f19002d5d8527b5632333fefb0
Reviewed-on: https://gerrit.libreoffice.org/50431
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/iahndl.cxx | 63 | ||||
-rw-r--r-- | uui/source/secmacrowarnings.hxx | 1 |
2 files changed, 31 insertions, 33 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index b45b9cea2c2d..228ff20af632 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -63,13 +63,13 @@ #include <osl/conditn.hxx> #include <unotools/resmgr.hxx> #include <vcl/errinf.hxx> +#include <vcl/svapp.hxx> +#include <vcl/weld.hxx> #include <osl/thread.hxx> #include <tools/diagnose_ex.h> #include <comphelper/documentconstants.hxx> #include <comphelper/propertysequence.hxx> #include <svtools/sfxecode.hxx> -#include <vcl/msgbox.hxx> -#include <vcl/svapp.hxx> #include <unotools/configmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> @@ -965,36 +965,35 @@ namespace { DialogMask executeMessageBox( - vcl::Window * pParent, + weld::Window * pParent, OUString const & rTitle, OUString const & rMessage, - MessBoxStyle nButtonMask) + VclMessageType eMessageType) { SolarMutexGuard aGuard; - WinBits nStyle(0); - ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, nStyle, rTitle, rMessage); + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent, eMessageType, + eMessageType == VclMessageType::Question ? VclButtonsType::YesNo : VclButtonsType::Ok, rMessage)); + xBox->set_title(rTitle); - sal_uInt16 aMessResult = xBox->Execute(); + short nMessResult = xBox->run(); DialogMask aResult = DialogMask::NONE; - switch( aMessResult ) + switch (nMessResult) { - case RET_OK: - aResult = DialogMask::ButtonsOk; - break; - case RET_CANCEL: - aResult = DialogMask::ButtonsCancel; - break; - case RET_YES: - aResult = DialogMask::ButtonsYes; - break; - case RET_NO: - aResult = DialogMask::ButtonsNo; - break; - case RET_RETRY: - aResult = DialogMask::ButtonsRetry; - break; - default: assert(false); + case RET_OK: + aResult = DialogMask::ButtonsOk; + break; + case RET_CANCEL: + aResult = DialogMask::ButtonsCancel; + break; + case RET_YES: + aResult = DialogMask::ButtonsYes; + break; + case RET_NO: + aResult = DialogMask::ButtonsNo; + break; + default: + assert(false); } return aResult; @@ -1117,7 +1116,8 @@ UUIInteractionHelper::handleGenericErrorRequest( aTitle += " - " ; aTitle += aErrTitle; - executeMessageBox(getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok); + vcl::Window* pWin = getParentProperty(); + executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aErrorString, VclMessageType::Error); } else { @@ -1218,15 +1218,11 @@ UUIInteractionHelper::handleBrokenPackageRequest( return; } - MessBoxStyle nButtonMask; + VclMessageType eMessageType; if( xApprove.is() && xDisapprove.is() ) - { - nButtonMask = MessBoxStyle::YesNo | MessBoxStyle::DefaultYes; - } + eMessageType = VclMessageType::Question; else if ( xAbort.is() ) - { - nButtonMask = MessBoxStyle::Ok; - } + eMessageType = VclMessageType::Warning; else return; @@ -1235,7 +1231,8 @@ UUIInteractionHelper::handleBrokenPackageRequest( " " + utl::ConfigManager::getProductVersion() ); - switch (executeMessageBox(getParentProperty(), title, aMessage, nButtonMask)) + vcl::Window* pWin = getParentProperty(); + switch (executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, title, aMessage, eMessageType)) { case DialogMask::ButtonsOk: OSL_ENSURE( xAbort.is(), "unexpected situation" ); diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx index 62517709d66b..8a34d90ffd9c 100644 --- a/uui/source/secmacrowarnings.hxx +++ b/uui/source/secmacrowarnings.hxx @@ -23,6 +23,7 @@ #include <vcl/dialog.hxx> #include <unotools/securityoptions.hxx> #include <vcl/button.hxx> +#include <vcl/fixed.hxx> #include <com/sun/star/uno/Sequence.hxx> namespace com { |