[mythtv] [patch] minor bugfix and function addition to uilistbtntype

Renchi Raju renchi at pooh.tam.uiuc.edu
Wed Dec 31 22:54:16 EST 2003


patch attached for minor bugfix and function addition to uilistbtntype

renchi
-------------- next part --------------
diff -uBr libs/libmyth/uitypes.cpp ../mythtv-work/libs/libmyth/uitypes.cpp
--- libs/libmyth/uitypes.cpp	2003-12-31 08:39:58.000000000 -0600
+++ ../mythtv-work/libs/libmyth/uitypes.cpp	2003-12-31 21:43:01.000000000 -0600
@@ -3931,11 +3931,11 @@
     m_showDnArrow = false;
 }
 
-void UIListBtnType::AddItem(const QString& text)
+void UIListBtnType::AddItem(const QString& text, bool checked)
 {
     UIListBtnTypeItem* item = new UIListBtnTypeItem;
     item->text = text;
-    item->checked = false;
+    item->checked = checked;
     UIListBtnTypeItem* lastItem = m_itemList.last();
     if (!lastItem) 
     {
@@ -4047,6 +4047,13 @@
     emit itemChecked(m_itemList.find(m_selItem), m_selItem->checked);
 }
 
+void UIListBtnType::SetItemChecked(int itemPos, bool checked)
+{
+    UIListBtnTypeItem* item = m_itemList.at(itemPos);
+    if (item)
+        item->checked = checked;
+}
+
 void UIListBtnType::Draw(QPainter *p, int order, int)
 {
     if (!m_initialized)
diff -uBr libs/libmyth/uitypes.h ../mythtv-work/libs/libmyth/uitypes.h
--- libs/libmyth/uitypes.h	2003-12-31 08:39:58.000000000 -0600
+++ ../mythtv-work/libs/libmyth/uitypes.h	2003-12-31 21:36:40.000000000 -0600
@@ -983,11 +983,12 @@
     void SetActive(bool active) {m_active = active;}
 
     void Reset();
-    void AddItem(const QString& text);
+    void AddItem(const QString& text, bool checked=false);
     void SetItemCurrent(int current);
     int  GetItemCurrent();
     int  GetCount();
     const UIListBtnTypeItem* GetItem(int itemPos);
+    void SetItemChecked(int itemPos, bool checked);
     
     void MoveDown();
     void MoveUp();
diff -uBr libs/libmyth/xmlparse.cpp ../mythtv-work/libs/libmyth/xmlparse.cpp
--- libs/libmyth/xmlparse.cpp	2003-12-31 08:39:58.000000000 -0600
+++ ../mythtv-work/libs/libmyth/xmlparse.cpp	2003-12-31 21:34:01.000000000 -0600
@@ -2247,7 +2247,7 @@
     }
 
     QString layerNum = element.attribute("draworder", "");
-    if (layerNum.isNull() && layerNum.isEmpty())
+    if (layerNum.isNull() || layerNum.isEmpty())
     {
         cerr << "ListBtn area needs a draworder\n";
         exit(0);


More information about the mythtv-dev mailing list