Implemented combo boxes handling in addLines().
git-svn-id: http://yate.null.ro/svn/yate/trunk@2607 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
419bbb3123
commit
5ee84b978a
|
@ -1305,7 +1305,7 @@ bool QtWindow::addLines(const String& name, const NamedList* lines, unsigned int
|
||||||
return false;
|
return false;
|
||||||
if (!lines)
|
if (!lines)
|
||||||
return true;
|
return true;
|
||||||
unsigned int count = lines->count();
|
unsigned int count = lines->length();
|
||||||
if (!count)
|
if (!count)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@ -1321,10 +1321,9 @@ bool QtWindow::addLines(const String& name, const NamedList* lines, unsigned int
|
||||||
{
|
{
|
||||||
// FIXME: delete lines from begining if appending and the number
|
// FIXME: delete lines from begining if appending and the number
|
||||||
// of lines exceeds the maximum allowed
|
// of lines exceeds the maximum allowed
|
||||||
unsigned int n = lines->length();
|
|
||||||
QString s = w.textEdit()->toPlainText();
|
QString s = w.textEdit()->toPlainText();
|
||||||
int pos = atStart ? 0 : s.length();
|
int pos = atStart ? 0 : s.length();
|
||||||
for (unsigned int i = 0; i < n; i++) {
|
for (unsigned int i = 0; i < count; i++) {
|
||||||
NamedString* ns = lines->getParam(i);
|
NamedString* ns = lines->getParam(i);
|
||||||
if (!ns)
|
if (!ns)
|
||||||
continue;
|
continue;
|
||||||
|
@ -1350,8 +1349,23 @@ bool QtWindow::addLines(const String& name, const NamedList* lines, unsigned int
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
break;
|
break;
|
||||||
case QtWidget::ComboBox:
|
case QtWidget::ComboBox:
|
||||||
// TODO: implement
|
if (atStart) {
|
||||||
break;
|
for (unsigned int i = count; i >= 0; i--) {
|
||||||
|
NamedString* ns = lines->getParam(i);
|
||||||
|
if (ns)
|
||||||
|
w.combo()->insertItem(0,QtClient::setUtf8(ns->name()));
|
||||||
|
}
|
||||||
|
if (w.combo()->lineEdit())
|
||||||
|
w.combo()->lineEdit()->setText(w.combo()->itemText(0));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (unsigned int i = 0; i < count; i++) {
|
||||||
|
NamedString* ns = lines->getParam(i);
|
||||||
|
if (ns)
|
||||||
|
w.combo()->addItem(QtClient::setUtf8(ns->name()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
case QtWidget::ListBox:
|
case QtWidget::ListBox:
|
||||||
// TODO: implement
|
// TODO: implement
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue