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/alreadyopen.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/alreadyopen.cxx')
-rw-r--r-- | uui/source/alreadyopen.cxx | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx index 6a5660fda6b7..9f94e22dc49a 100644 --- a/uui/source/alreadyopen.cxx +++ b/uui/source/alreadyopen.cxx @@ -20,35 +20,25 @@ #include <strings.hrc> #include "alreadyopen.hxx" #include <unotools/resmgr.hxx> +#include <vcl/button.hxx> +#include <vcl/svapp.hxx> -AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, const std::locale& rLocale, const OUString& aMessage, bool bIsStoring ) : - MessBox(pParent, MessBoxStyle::NONE, 0, - Translate::get(STR_ALREADYOPEN_TITLE, rLocale), - aMessage ) +AlreadyOpenQueryBox::AlreadyOpenQueryBox(weld::Window* pParent, const std::locale& rLocale, const OUString& rMessage, bool bIsStoring) + : m_xQueryBox(Application::CreateMessageDialog(pParent, VclMessageType::Question, VclButtonsType::NONE, rMessage)) { - SetImage(GetStandardQueryBoxImage()); - - if ( bIsStoring ) + m_xQueryBox->set_title(Translate::get(STR_ALREADYOPEN_TITLE, rLocale)); + if (bIsStoring) { - AddButton( Translate::get(STR_ALREADYOPEN_RETRY_SAVE_BTN, rLocale), RET_YES, - ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus ); - AddButton( Translate::get(STR_ALREADYOPEN_SAVE_BTN, rLocale), RET_NO); - AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel ); + m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_RETRY_SAVE_BTN, rLocale), RET_YES); + m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_SAVE_BTN, rLocale), RET_NO); } else { - AddButton( Translate::get(STR_ALREADYOPEN_READONLY_BTN, rLocale), RET_YES, - ButtonDialogFlags::Default | ButtonDialogFlags::OK | ButtonDialogFlags::Focus ); - AddButton( Translate::get(STR_ALREADYOPEN_OPEN_BTN, rLocale), RET_NO); - AddButton( StandardButtonType::Cancel, RET_CANCEL, ButtonDialogFlags::Cancel ); + m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_READONLY_BTN, rLocale), RET_YES); + m_xQueryBox->add_button(Translate::get(STR_ALREADYOPEN_OPEN_BTN, rLocale), RET_NO); } - - SetButtonHelpText( RET_YES, OUString() ); - SetButtonHelpText( RET_NO, OUString() ); -} - -AlreadyOpenQueryBox::~AlreadyOpenQueryBox() -{ + m_xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + m_xQueryBox->set_default_response(RET_YES); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |