dbaccess/source/ui/dlg/paramdialog.cxx | 27 ++++++++++++--------------- dbaccess/source/ui/inc/paramdialog.hxx | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-)
New commits: commit a614ae36e8688f070819804dc25cbaa8bbddba8f Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Nov 21 11:02:00 2019 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Nov 21 13:10:59 2019 +0100 tdf#128748 replace warning dialog with tooltip so the TreeList does not get the mouse release it expects stolen from it by the dialog, leaving it stuck in "selecting" limbo Change-Id: If83dcdd8697b2a67e67fb062ae65ad947f49e8cd Reviewed-on: https://gerrit.libreoffice.org/83372 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index a163e8a7606a..9b028c668ee7 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -144,10 +144,10 @@ namespace dbaui IMPL_LINK_NOARG(OParameterDialog, OnValueLoseFocusHdl, weld::Widget&, void) { - CheckValueForError(false); + CheckValueForError(); } - bool OParameterDialog::CheckValueForError(bool bShowDialog) + bool OParameterDialog::CheckValueForError() { if (m_nCurrentlySelected != -1) { @@ -156,6 +156,8 @@ namespace dbaui return false; } + bool bRet = false; + Reference< XPropertySet > xParamAsSet; m_xParams->getByIndex(m_nCurrentlySelected) >>= xParamAsSet; if (xParamAsSet.is()) @@ -166,6 +168,7 @@ namespace dbaui bool bValid = m_aPredicateInput.normalizePredicateString( sParamValue, xParamAsSet ); m_xParam->set_text(sParamValue); m_xParam->set_message_type(bValid ? weld::EntryMessageType::Normal : weld::EntryMessageType::Error); + OUString sToolTip; if ( bValid ) { // with this the value isn't dirty anymore @@ -184,22 +187,16 @@ namespace dbaui DBG_UNHANDLED_EXCEPTION("dbaccess"); } - if (bShowDialog) - { - OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); - sMessage = sMessage.replaceAll( "$name$", sName ); - std::unique_ptr<weld::MessageDialog> xDialog(Application::CreateMessageDialog(m_xDialog.get(), - VclMessageType::Warning, VclButtonsType::Ok, - sMessage)); - xDialog->run(); - m_xParam->grab_focus(); - } - return true; + OUString sMessage(DBA_RES(STR_COULD_NOT_CONVERT_PARAM)); + sToolTip = sMessage.replaceAll( "$name$", sName ); + m_xParam->grab_focus(); + bRet = true; } + m_xParam->set_tooltip_text(sToolTip); } } - return false; + return bRet; } IMPL_LINK(OParameterDialog, OnButtonClicked, weld::Button&, rButton, void) @@ -280,7 +277,7 @@ namespace dbaui if (m_nCurrentlySelected != -1) { // do the transformation of the current text - if (CheckValueForError(true)) + if (CheckValueForError()) { // there was an error interpreting the text m_xAllParams->select(m_nCurrentlySelected); return true; diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx index 5a434e49e1cb..bf3f453c9e3f 100644 --- a/dbaccess/source/ui/inc/paramdialog.hxx +++ b/dbaccess/source/ui/inc/paramdialog.hxx @@ -98,7 +98,7 @@ namespace dbaui DECL_LINK(OnEntryListBoxSelected, weld::TreeView&, void); DECL_LINK(OnButtonClicked, weld::Button&, void); DECL_LINK(OnValueLoseFocusHdl, weld::Widget&, void); - bool CheckValueForError(bool bShowDialog); + bool CheckValueForError(); bool OnEntrySelected(); }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits