Permalink
Browse files

GUIContextManager should now be hooked up everywhere (not just the so…

…urces views)... but it seems kind of strange that GUIMediaWindows is the point to add global context items and not GUIDialogContextMenu ;)

actually handle the oncontextmenu events
  • Loading branch information...
1 parent 9b3fa50 commit 154bbcf85df35ad6b2fe2e1826c15bc183019de3 Fice committed Oct 21, 2012
Showing with 10 additions and 9 deletions.
  1. +1 −8 xbmc/dialogs/GUIDialogContextMenu.cpp
  2. +9 −1 xbmc/windows/GUIMediaWindow.cpp
@@ -382,10 +382,6 @@ void CGUIDialogContextMenu::GetContextButtons(const CStdString &type, const CFil
}
if (share && !g_passwordManager.bMasterUser && item->m_iHasLock == 1)
buttons.Add(CONTEXT_BUTTON_REACTIVATE_LOCK, 12353);
-
- std::list<ContextItemPtr> additional_context_items;
- GUIContextMenuManager::Get().GetVisibleContextItems(0, &*item, additional_context_items);
- std::transform(additional_context_items.begin(), additional_context_items.end(), back_inserter(buttons), ConvertFromContextItem());
}
bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileItemPtr item, CONTEXT_BUTTON button)
@@ -647,10 +643,7 @@ bool CGUIDialogContextMenu::OnContextButton(const CStdString &type, const CFileI
default:
break;
}
- ContextItemPtr context_item = GUIContextMenuManager::Get().GetContextItemByID(button);
- if(context_item==0)
- return false;
- return (*context_item)(&*item); //execute our context item logic
+ return false;
}
CMediaSource *CGUIDialogContextMenu::GetShare(const CStdString &type, const CFileItem *item)
@@ -1575,6 +1575,11 @@ void CGUIMediaWindow::GetContextButtons(int itemNumber, CContextButtons &buttons
else
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;
}
+
+ std::list<ContextItemPtr> additional_context_items;
+ GUIContextMenuManager::Get().GetVisibleContextItems(0, &*item, additional_context_items);
+ std::transform(additional_context_items.begin(), additional_context_items.end(), back_inserter(buttons), ConvertFromContextItem());
+
}
bool CGUIMediaWindow::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
@@ -1599,7 +1604,10 @@ bool CGUIMediaWindow::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
default:
break;
}
- return false;
+ ContextItemPtr context_item = GUIContextMenuManager::Get().GetContextItemByID(button);
+ if(context_item==0)
+ return false;
+ return (*context_item)(&*(m_vecItems->Get(itemNumber))); //execute our context item logic
}
const CGUIViewState *CGUIMediaWindow::GetViewState() const

0 comments on commit 154bbcf

Please sign in to comment.