Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
How to globally disable Add to favourites?
#1
Hi all,

I am trying to setup a very custom Kodi build (for grand parents) that has literally NO extra options to click on.

I have got it quite stripped down but I am a little stuck on how to disable the "Add to favourites" in the global context menu.

I am using Kodi 16.1 and the Xonfluence skin. It does not seem to be related to the skin, so I thought I would check in the general forum.

Any advice on how to do this would be greatly appreciated!

Cheers,
Ken
Reply
#2
you can't
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
(2016-07-16, 19:35)Martijn Wrote: you can't

Hey Martijn,

Thanks for your quick reply!

I am not looking for an easy answer by selecting a radio button, I am not worried about editing XML etc. There must be a way to edit a file to remove the right click (context) choices.

This is codeing, anything can be done :-)

I found the entry for it in the addons\resource.language.en_gb\resources\strings.po:

#: xbmc/windows/GUIMediaWindow.cpp
#: xbmc/windows/GUIWindowFileManager.cpp
msgctxt "#14076"
msgid "Add to favourites"
msgstr ""

I assume that in previous versions of Kodi, I could edit the GUIMediaWindow.cpp file, but in this version it has been deprecated.

I have been unable to fine which file calls the msgctxt "#14076"

Any help would be greatly appreciated.

Cheers,
Ken
Reply
#4
music/windows/GUIWindowMusicPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;

video/windows/GUIWindowVideoPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;

windows/GUIWindowFileManager.cpp:
Code:
choices.Add(CONTROL_BTNFAVOURITES,  XFILE::CFavouritesDirectory::IsFavourite(pItem.get(), GetID()) ? 14077 : 14076); // Add/Remove Favourite

windows/GUIMediaWindow.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
(2016-07-16, 22:27)ronie Wrote: music/windows/GUIWindowMusicPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;

video/windows/GUIWindowVideoPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;

windows/GUIWindowFileManager.cpp:
Code:
choices.Add(CONTROL_BTNFAVOURITES,  XFILE::CFavouritesDirectory::IsFavourite(pItem.get(), GetID()) ? 14077 : 14076); // Add/Remove Favourite

windows/GUIMediaWindow.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076);     // Add To Favourites;

Thanks ronie for your fast reply!

This folder structure doesn't seem to be present in Kodi 16.1, unless I am missing something?

I am on Android, and checking the following folders:

/usr/share/kodi
/storage/.kodi

Cheers,
Ken
Reply
#6
You need to change the source code and recompile
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
(2016-07-16, 23:49)Martijn Wrote: You need to change the source code and recompile

Ah, darn, I was hoping that wouldn't be the case. Oh well, I'm off to recompile. I was going to move them over to LibreELEC anyways. Now would be a good time to do that, since I need to recompile anyways.

Do you know which file(s) specifically that I need to edit? That would probably save me a load of time. Big Grin

Thanks!
Ken
Reply
#8
(2016-07-17, 00:02)kenmills Wrote: Do you know which file(s) specifically that I need to edit? That would probably save me a load of time. Big Grin

the files in my reply above ;-)
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#9
AHA!!!!

Lol, thanks to you both!!!

Ken
Reply
#10
Why not just remove the context menu from keymaps?
Reply
#11
Hey Ned!

While that is a simple and elegant solution, they want to be able to use functions like mark as watched and mark as unwatched.

Cheers,
Ken
Reply
#12
you can use the "w" key for that if that solves it
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#13
Hi all,

Sorry to resurrect an old thread, but I am recompiling Kodi and could use some advice.

In the file windows/GUIWindowFileManager.cpp how would I edit to get rid of the "Add to favourites", just comment out the lines, like this?

CContextButtons choices;
if (item >= 0)
{
//The ".." item is not selectable. Take that into account when figuring out if all items are selected
int notSelectable = CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS) ? 1 : 0;
if (NumSelected(list) < m_vecItems
  • ->Size() - notSelectable)
    choices.Add(CONTROL_BTNSELECTALL, 188); // SelectAll
    // if (!pItem->IsParentFolder())
    // choices.Add(CONTROL_BTNFAVOURITES, XFILE::CFavouritesDirectory::IsFavourite(pItem.get(), GetID()) ? 14077 : 14076); // Add/Remove Favourite
    if (players.size() > 1)
    choices.Add(CONTROL_BTNPLAYWITH, 15213);
    if (CanRename(list) && !pItem->IsParentFolder())
    choices.Add(CONTROL_BTNRENAME, 118);
    if (CanDelete(list) && showEntry)
    choices.Add(CONTROL_BTNDELETE, 117);
    if (CanCopy(list) && showEntry)
    choices.Add(CONTROL_BTNCOPY, 115);
    if (CanMove(list) && showEntry)
    choices.Add(CONTROL_BTNMOVE, 116);
    }
    if (CanNewFolder(list))
    choices.Add(CONTROL_BTNNEWFOLDER, 20309);
    if (item >= 0 && pItem->m_bIsFolder && !pItem->IsParentFolder())
    choices.Add(CONTROL_BTNCALCSIZE, 13393);
    choices.Add(CONTROL_BTNSWITCHMEDIA, 523);
    if (CJobManager::GetInstance().IsProcessing("filemanager"))
    choices.Add(CONTROL_BTNCANCELJOB, 167);


    Thanks!!
Reply
#14
Wiuld also need to comment out the few lines a bit further down?

if (CanNewFolder(list))
choices.Add(CONTROL_BTNNEWFOLDER, 20309);
if (item >= 0 && pItem->m_bIsFolder && !pItem->IsParentFolder())
choices.Add(CONTROL_BTNCALCSIZE, 13393);
choices.Add(CONTROL_BTNSWITCHMEDIA, 523);
if (CJobManager::GetInstance().IsProcessing("filemanager"))
choices.Add(CONTROL_BTNCANCELJOB, 167);

int btnid = CGUIDialogContextMenu::ShowAndGetChoice(choices);
if (btnid == CONTROL_BTNSELECTALL)
{
OnSelectAll(list);
bDeselect=false;
}
// if (btnid == CONTROL_BTNFAVOURITES)
// {
// XFILE::CFavouritesDirectory::AddOrRemove(pItem.get(), GetID());
// return;
}
if (btnid == CONTROL_BTNPLAYWITH)
{
std::vector<std:Confusedtring>players;
CPlayerCoreFactory::GetInstance().GetPlayers(*pItem, players);
std:Confusedtring player = CPlayerCoreFactory::GetInstance().SelectPlayerDialog(players);
if (!player.empty())
OnStart(pItem.get(), player);
Reply
#15
(2016-07-16, 22:27)ronie Wrote: music/windows/GUIWindowMusicPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;

video/windows/GUIWindowVideoPlaylist.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;

windows/GUIWindowFileManager.cpp:
Code:
choices.Add(CONTROL_BTNFAVOURITES, XFILE::CFavouritesDirectory::IsFavourite(pItem.get(), GetID()) ? 14077 : 14076); // Add/Remove Favourite

windows/GUIMediaWindow.cpp:
Code:
buttons.Add(CONTEXT_BUTTON_ADD_FAVOURITE, 14076); // Add To Favourites;
 Hey mate!  Resurrecting an old thread.  I assume the location of the files needed to remove Add to Favourites has changed in Leia?  DO you happen to know where they are?

Thanks!!
Ken
Reply

Logout Mark Read Team Forum Stats Members Help
How to globally disable Add to favourites?0