diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-23 09:35:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-26 15:27:09 +0000 |
commit | 942f05996bc287923cdbcae12c64e57adf8ec975 (patch) | |
tree | 7005380763a9ecb93f5f27c28174633b9774abb7 /forms/source | |
parent | c410a3dcfeb68ba2247c0d879727afe4ca8ed3da (diff) |
convert remaining ErrorBox to weld::MessageDialog
and
convert remaining QueryBox to weld::MessageDialog
Change-Id: Ifb4c316dee8eabf57c4940c44e29c65a2781aa6c
Diffstat (limited to 'forms/source')
-rw-r--r-- | forms/source/runtime/formoperations.cxx | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 3597486f07ae..94684287a4b2 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -50,7 +50,8 @@ #include <connectivity/dbexception.hxx> #include <vcl/svapp.hxx> #include <vcl/stdtext.hxx> -#include <vcl/msgbox.hxx> +#include <vcl/button.hxx> +#include <vcl/weld.hxx> #include <vcl/waitobj.hxx> #include <tools/diagnose_ex.h> #include <comphelper/container.hxx> @@ -434,17 +435,22 @@ namespace frm if(needConfirmation) { // TODO: shouldn't this be done with an interaction handler? - ScopedVclPtrInstance< QueryBox > aQuery( nullptr, MessBoxStyle::YesNoCancel | MessBoxStyle::DefaultYes, FRM_RES_STRING( RID_STR_QUERY_SAVE_MODIFIED_ROW ) ); - switch ( aQuery->Execute() ) + std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(nullptr, + VclMessageType::Question, VclButtonsType::YesNo, + FRM_RES_STRING(RID_STR_QUERY_SAVE_MODIFIED_ROW))); + xQueryBox->add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + xQueryBox->set_default_response(RET_YES); + + switch (xQueryBox->run()) { - case RET_NO: - shouldCommit = false; - SAL_FALLTHROUGH; // don't ask again! - case RET_YES: - needConfirmation = false; - return true; - case RET_CANCEL: - return false; + case RET_NO: + shouldCommit = false; + SAL_FALLTHROUGH; // don't ask again! + case RET_YES: + needConfirmation = false; + return true; + case RET_CANCEL: + return false; } } return true; |