From 19dc1cc8cb6179d853d7e34668cab17062326fd0 Mon Sep 17 00:00:00 2001 From: Noldor Date: Thu, 20 Mar 2008 08:27:16 +0000 Subject: Fixed bugs #40(please test command exec() ),#41 (added optional parameter quiet), #42 git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@1236 17fca916-40b9-46aa-a4ea-0a15b648b75c --- src/modules/objects/class_combobox.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/modules/objects/class_combobox.cpp') diff --git a/src/modules/objects/class_combobox.cpp b/src/modules/objects/class_combobox.cpp index f8c3d3d6b..fa9341b85 100644 --- a/src/modules/objects/class_combobox.cpp +++ b/src/modules/objects/class_combobox.cpp @@ -71,10 +71,10 @@ If the parameter is ommited, it is assumed to be false. !fn: $editable() Returns whether the combobox is editable or not. - !fn: $setEditText() + !fn: $setEditText(,[]) Sets the text in the embedded line edit to newText without changing the combo's contents. Does nothing if the combo - isn't editable. + isn't editable. If the optional quiet parameter is true no warning will be print if text will be empty. !fn: $clear() Removes all the items from the combo box !fn: $textAt() @@ -274,11 +274,13 @@ bool KviKvsObject_combobox::functioneditable(KviKvsObjectFunctionCall *c) bool KviKvsObject_combobox::functionsetEditText(KviKvsObjectFunctionCall *c) { QString szText; + bool bQuiet=false; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("quiet",KVS_PT_BOOLEAN,KVS_PF_OPTIONAL,bQuiet) KVSO_PARAMETERS_END(c) if(!widget()) return true; - if (szText.isEmpty()) c->warning("No string parameter given - using empty string"); + if (szText.isEmpty() && !bQuiet) c->warning("No string parameter given - using empty string"); ((QComboBox *)widget())->setEditText(szText); return true; } -- cgit v1.3.1-10-gc9f91