Add-on info window on info-action and via context-menu on add-ons #892

Merged
merged 4 commits into from Jun 1, 2012

2 participants

@dersphere
Team Kodi member

This is a pull request for my self wanted features/improvements on add-on info-window call possibility's.

These changes resulting in:

  • adding "Add-On Informations" to the context-menu of add-ons in their media windows (video, music, pictures and programs)
  • opening the add-on window on the info-action

I opened a forum thread (http://forum.xbmc.org/showthread.php?tid=128475) and spiff told me the relevant files so that I can change myself.

On video, music and picture add-ons the changes are minimal but to get this working on program add-ons I had to add a little more lines.
I also fixed a small inequality in the context-menu between picture scripts and plugins (there was already an entry "Picture Information" on scripts but not an plugins which is now removed) by adding "Add-on Information" to both.

This is my first code pull request to xbmc and to be honest, I'm better on Python than on C++ ;)
I only tested this on windows but I guess it doesn't makes a difference on other OS's.

If you want me to change or squash something, just tell me.

regards,
sphere

@Montellese Montellese and 1 other commented on an outdated diff Apr 21, 2012
xbmc/programs/GUIWindowPrograms.cpp
@@ -210,6 +221,12 @@ bool CGUIWindowPrograms::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
OnClick(itemNumber);
return true;
+ case CONTEXT_BUTTON_INFO:
+ {
@Montellese
Team Kodi member
Montellese added a line comment Apr 21, 2012

Bad indentation. Either remove the { and } or fix their indentation.

@dersphere
Team Kodi member
dersphere added a line comment Apr 22, 2012

Of course - will be fixed by removing { and }. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Montellese Montellese and 1 other commented on an outdated diff Apr 21, 2012
xbmc/programs/GUIWindowPrograms.cpp
@@ -291,3 +308,16 @@ CStdString CGUIWindowPrograms::GetStartFolder(const CStdString &dir)
}
return CGUIMediaWindow::GetStartFolder(dir);
}
+
+void CGUIWindowPrograms::OnInfo(int iItem)
+{
+ if ( iItem < 0 || iItem >= m_vecItems->Size() )
+ return;
+
+ CFileItemPtr item = m_vecItems->Get(iItem);
+ if (!m_vecItems->IsPlugin() && (item->IsPlugin() || item->IsScript()))
+ {
+ CGUIDialogAddonInfo::ShowForItem(item);
+ return;
@Montellese
Team Kodi member
Montellese added a line comment Apr 21, 2012

This is not really needed as you don't do anything else after this if-statement.

@dersphere
Team Kodi member
dersphere added a line comment Apr 22, 2012

You are right - then I guess best is to just remove the "return;".
I will also remove the white-spaces in L314.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jmarshallnz
Team Kodi member

What happens if you uninstall the add-on from the info dialog and it's the last add-on in the list? Do you get left with a blank list?

@dersphere
Team Kodi member

Firstly, thanks for your comments.
Regarding your question: If you uninstall the last remaining add-on from the list you will see an (addon empty) list plus the "Get more..." (path=add) entry. I guess this is the expected and wanted behavior, not?

@jmarshallnz
Team Kodi member

Looks good. Squish the fixes down into the appropriate commits and we'll take another round.

@dersphere
Team Kodi member

done

@dersphere
Team Kodi member

Does this have a chance to be merged in May?

@dersphere
Team Kodi member

All previous comments were code-related - what about the addition itself? Is that something you want or want not in?

@jmarshallnz
Team Kodi member

I don't have a problem with it going in. Anyone else?

@ghost

no problem. june it

@jmarshallnz jmarshallnz was assigned May 30, 2012
@dersphere
Team Kodi member

I can't see if this needs to be rebased - please tell me then.

@jmarshallnz jmarshallnz merged commit 6d8cb00 into xbmc:master Jun 1, 2012
@dersphere
Team Kodi member

Thanks for merging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment