summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-21 11:02:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-21 13:10:59 +0100
commita614ae36e8688f070819804dc25cbaa8bbddba8f (patch)
treef440428da777738090b57b70adccfe5190f68c9a /dbaccess
parent4dbb33a1c21948bebcf890c2f8ceb56b15a87936 (diff)
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx27
-rw-r--r--dbaccess/source/ui/inc/paramdialog.hxx2
2 files changed, 13 insertions, 16 deletions
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();
};