Skip to content

Commit

Permalink
Merge pull request xbmc#18986 from howie-f/v19-depdialog
Browse files Browse the repository at this point in the history
[addons] introduce advanced setting to allow showing all dependencies in dialog
  • Loading branch information
howie-f authored Dec 28, 2020
2 parents a11f67a + 10ba88b commit af8aded
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xbmc/addons/gui/GUIDialogAddonInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "messaging/helpers/DialogHelper.h"
#include "messaging/helpers/DialogOKHelper.h"
#include "pictures/GUIWindowSlideShow.h"
#include "settings/AdvancedSettings.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
#include "utils/Digest.h"
Expand Down Expand Up @@ -737,6 +738,9 @@ void CGUIDialogAddonInfo::BuildDependencyList()
m_deps = CServiceBroker::GetAddonMgr().GetDepsRecursive(m_item->GetAddonInfo()->ID(),
OnlyEnabledRootAddon::NO);

const bool showAllDependencies =
CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_showAllDependencies;

for (const auto& dep : m_deps)
{
std::shared_ptr<IAddon> addonInstalled;
Expand All @@ -756,10 +760,12 @@ void CGUIDialogAddonInfo::BuildDependencyList()
addonAvailable = nullptr;
}

// Depending on advancedsettings.xml <showalldependencies>:
// AddonType ADDON_SCRIPT_MODULE needs to be filtered as these low-level add-ons
// should be hidden to the user in the dependency select dialog

if ((addonInstalled && addonInstalled->MainType() != ADDON_SCRIPT_MODULE) ||
if (showAllDependencies ||
(addonInstalled && addonInstalled->MainType() != ADDON_SCRIPT_MODULE) ||
(addonAvailable && addonAvailable->MainType() != ADDON_SCRIPT_MODULE) ||
(!addonAvailable && !addonInstalled))
{
Expand Down
2 changes: 2 additions & 0 deletions xbmc/settings/AdvancedSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ void CAdvancedSettings::Initialize()
#endif
m_showExitButton = true;
m_splashImage = true;
m_showAllDependencies = false;

m_playlistRetries = 100;
m_playlistTimeout = 20; // 20 seconds timeout
Expand Down Expand Up @@ -883,6 +884,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file)
XMLUtils::GetBoolean(pRootElement, "fullscreen", m_startFullScreen);
#endif
XMLUtils::GetBoolean(pRootElement, "splash", m_splashImage);
XMLUtils::GetBoolean(pRootElement, "showalldependencies", m_showAllDependencies);
XMLUtils::GetBoolean(pRootElement, "showexitbutton", m_showExitButton);
XMLUtils::GetBoolean(pRootElement, "canwindowed", m_canWindowed);

Expand Down
6 changes: 6 additions & 0 deletions xbmc/settings/AdvancedSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
bool m_GLRectangleHack;
int m_iSkipLoopFilter;

/*!< @brief Decision flag to show or hide specific dependencies in the list of the AddonInfo dialog
as this information usually adds no value for a consumer.
True to recursively show any dependency of the selected add-on
False to hide 'low-level' dependencies like e.g. scripts/modules (default) */
bool m_showAllDependencies;

bool m_bVirtualShares;
bool m_bTry10bitOutput;

Expand Down

0 comments on commit af8aded

Please sign in to comment.