msgid "Lock Add-on manager"
msgstr ""
-#empty strings from id 24091 to 24093
+#: xbmc\addons\GUIDialogAddonInfo.cpp
+msgctxt "#24091"
+msgid "This Add-on cannot be disabled"
+msgstr ""
+
+#empty strings from id 24092 to 24093
#: xbmc/addons/guidialogaddoninfo.cpp
msgctxt "#24094"
Close();
}
-void CGUIDialogAddonInfo::OnUninstall()
+bool CGUIDialogAddonInfo::PromptIfDependency(int heading, int line2)
{
- if (!m_localAddon.get())
- return;
+ if (!m_localAddon)
+ return false;
- // ensure the addon is not a dependency of other installed addons
VECADDONS addons;
CStdStringArray deps;
CAddonMgr::Get().GetAllAddons(addons);
CStdString strLine0, strLine1;
StringUtils::JoinString(deps, ", ", strLine1);
strLine0.Format(g_localizeStrings.Get(24046), m_localAddon->Name().c_str());
- CGUIDialogOK::ShowAndGetInput(24037, strLine0, strLine1, 24047);
- return;
+ CGUIDialogOK::ShowAndGetInput(heading, strLine0, strLine1, line2);
+ return true;
}
+ return false;
+}
+
+void CGUIDialogAddonInfo::OnUninstall()
+{
+ if (!m_localAddon.get())
+ return;
+
+ // ensure the addon is not a dependency of other installed addons
+ if (PromptIfDependency(24037, 24047))
+ return;
// prompt user to be sure
if (CGUIDialogYesNo::ShowAndGetInput(24037, 750, 0, 0))
if (!m_localAddon.get())
return;
+ if (!enable && PromptIfDependency(24075, 24091))
+ return;
+
CAddonMgr::Get().DisableAddon(m_localAddon->ID(), !enable);
SetItem(m_item);
UpdateControls();
void OnChangeLog();
void OnRollback();
+ /*! \brief check if the add-on is a dependency of others, and if so prompt the user.
+ \param heading the label for the heading of the prompt dialog
+ \param line2 the action that could not be completed.
+ \return true if prompted, false otherwise.
+ */
+ bool PromptIfDependency(int heading, int line2);
+
CFileItemPtr m_item;
ADDON::AddonPtr m_addon;
ADDON::AddonPtr m_localAddon;