[mythtv-commits] Ticket #10078: MythUIButtonTree emit itemSelected too early
MythTV
noreply at mythtv.org
Wed Oct 5 14:36:18 UTC 2011
#10078: MythUIButtonTree emit itemSelected too early
-------------------------------------------------+-------------------------
Reporter: Xavier Hervy <xavier.hervy@…> | Owner: stuartm
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - User Interface Library | Version: Trunk Head
Severity: medium | Keywords:
Ticket locked: 0 | mythuibuttontree
-------------------------------------------------+-------------------------
I believe the itemSelected signal is emitted too early, it should be
emitted after the currentNode have been set.
My use case:
I have a MythUIScreen with a m_title (MythUIText)
I also have m_buttonTree (MythUIButtonTree)
I connected itemSelected from the buttonTree to a itemSelected slot of my
MythUIScreen:
{{{
void MyScreen::itemSelected(MythUIButtonListItem *item)
{
MythGenericTree * node = m_buttonTree->GetCurrentNode();
if (node)
{
MythGenericTree * parentNode = node->getParent();
if (parentNode)
m_title->SetText(parentNode->GetText());
}
}
}}}
because the signal is emitted before the current node is actually updated,
I get the parent's name of the previous current node instead of the
parent's name of the current node.
This patch emit itemSelected after the currentNode is updated
--
Ticket URL: <http://code.mythtv.org/trac/ticket/10078>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list