aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/objects
diff options
context:
space:
mode:
authorGravatar Noldor2008-03-20 08:27:16 +0000
committerGravatar Noldor2008-03-20 08:27:16 +0000
commit19dc1cc8cb6179d853d7e34668cab17062326fd0 (patch)
treea6e810515d7f78d2e02835c65cd2ea75e8059c30 /src/modules/objects
parentquick fix (diff)
downloadKVIrc-19dc1cc8cb6179d853d7e34668cab17062326fd0.tar.gz
KVIrc-19dc1cc8cb6179d853d7e34668cab17062326fd0.tar.bz2
KVIrc-19dc1cc8cb6179d853d7e34668cab17062326fd0.zip
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
Diffstat (limited to 'src/modules/objects')
-rw-r--r--src/modules/objects/class_combobox.cpp8
1 files changed, 5 insertions, 3 deletions
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: <boolean> $editable()
Returns whether the combobox is editable or not.
- !fn: $setEditText(<text:string>)
+ !fn: $setEditText(<text:string>,[<quiet:bool>])
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(<index:uint>)
@@ -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;
}