Kodi Community Forum
How to globally disable Add to favourites? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: How to globally disable Add to favourites? (/showthread.php?tid=282904)

Pages: 1 2


How to globally disable Add to favourites? - kenmills - 2016-07-16

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


RE: How to globally disable Add to favourites? - Martijn - 2016-07-16

you can't


RE: How to globally disable Add to favourites? - kenmills - 2016-07-16

(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


RE: How to globally disable Add to favourites? - ronie - 2016-07-16

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;



RE: How to globally disable Add to favourites? - kenmills - 2016-07-16

(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


RE: How to globally disable Add to favourites? - Martijn - 2016-07-16

You need to change the source code and recompile


RE: How to globally disable Add to favourites? - kenmills - 2016-07-17

(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


RE: How to globally disable Add to favourites? - ronie - 2016-07-17

(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 ;-)


RE: How to globally disable Add to favourites? - kenmills - 2016-07-17

AHA!!!!

Lol, thanks to you both!!!

Ken


RE: How to globally disable Add to favourites? - Ned Scott - 2016-07-17

Why not just remove the context menu from keymaps?


RE: How to globally disable Add to favourites? - kenmills - 2016-07-17

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


RE: How to globally disable Add to favourites? - Martijn - 2016-07-17

you can use the "w" key for that if that solves it


RE: How to globally disable Add to favourites? - kenmills - 2017-04-26

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!!



RE: How to globally disable Add to favourites? - kenmills - 2017-04-26

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);


RE: How to globally disable Add to favourites? - kenmills - 2019-02-26

(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