diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 16:53:37 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-27 11:22:49 +0100 |
commit | 082e69fefb7439fd4f3d543f0c402039e94c1e9c (patch) | |
tree | 8348cacdc54a15dae722b93fc198995756924fc0 /uui/source/openlocked.cxx | |
parent | f41a08183504a59d6ffc7a00ed7f24e6b19995ab (diff) |
convert various MessBox to weld::MessageDialog
Change-Id: I4d2d0393c753114aeb9bb7e646dfdc810f6caa38
Reviewed-on: https://gerrit.libreoffice.org/50398
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'uui/source/openlocked.cxx')
-rw-r--r-- | uui/source/openlocked.cxx | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index 81d8b896477e..453067f8e3ae 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -20,34 +20,21 @@ #include <strings.hrc> #include "openlocked.hxx" #include <unotools/resmgr.hxx> +#include <vcl/button.hxx> +#include <vcl/svapp.hxx> -OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage, bool bEnableOverride ) : - MessBox(pParent, MessBoxStyle::NONE, 0, - Translate::get(STR_OPENLOCKED_TITLE, rResLocale), - aMessage ) +OpenLockedQueryBox::OpenLockedQueryBox(weld::Window* pParent, const std::locale& rResLocale, const OUString& rMessage, bool bEnableOverride) + : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question, VclButtonsType::NONE, rMessage)) { - SetImage(GetStandardQueryBoxImage()); - - AddButton(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES, - ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus); - SetButtonHelpText(RET_YES, OUString()); - - AddButton(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO); - SetButtonHelpText(RET_NO, OUString()); - + m_xQueryBox->set_title(Translate::get(STR_OPENLOCKED_TITLE, rResLocale)); + m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENREADONLY_BTN, rResLocale), RET_YES); + m_xQueryBox->add_button(Translate::get(STR_OPENLOCKED_OPENCOPY_BTN, rResLocale), RET_NO); if (bEnableOverride) { // Present option to ignore the (stale?) lock file and open the document - AddButton(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rResLocale), RET_IGNORE); - SetButtonHelpText(RET_IGNORE, OUString()); + m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rResLocale), RET_IGNORE); } - - AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel ); + m_xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); } -OpenLockedQueryBox::~OpenLockedQueryBox() -{ -} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |