From c18428aa59e693af9debf9f760f52e4c40d2fa47 Mon Sep 17 00:00:00 2001
From: deva <deva>
Date: Mon, 8 Dec 2008 08:52:46 +0000
Subject: Fixed som enabling/disabling of altcombobox innerwidget in setValue.

---
 client/widgets/altcombobox.cc | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/client/widgets/altcombobox.cc b/client/widgets/altcombobox.cc
index e3b1eb7..01fd36f 100644
--- a/client/widgets/altcombobox.cc
+++ b/client/widgets/altcombobox.cc
@@ -143,18 +143,9 @@ void AltComboBox::setValue(QString value)
   if(combobox->isValid() == false) { // Combobox contain idx == -1 (invalid) if value didn't exist.
     combobox->setValue(altvalue);
 
-    printf("Value %s not in combo.\n", value.toStdString().c_str());
-
     if(innerwidget) {
-      printf("\tSetting value on inner widget (%s) to \"%s\".\n", innerwidget->getName().toStdString().c_str(), value.toStdString().c_str());
-      printf("\told value (%s).\n", innerwidget->getValue().toStdString().c_str());
       innerwidget->setValue(value);
-    } else {
-      printf("Could not set value in AltComboBox, no innerwidget!\n");
     }
-    altframe->setEnabled(true);
-  } else {
-    altframe->setEnabled(false);
   }
 }
 
@@ -169,12 +160,7 @@ void AltComboBox::onValueChange(int index)
 
 void AltComboBox::onValueChange(const QString &text)
 {
-  int index = combobox->findText(text);
-  if(index != -1 && combobox->itemData(index).toString() == altvalue) {
-    altframe->setEnabled(true);
-  } else {
-    altframe->setEnabled(false);
-  }
+  onValueChange(combobox->findText(text));
 }
 
 void AltComboBox::enable()
-- 
cgit v1.2.3