msgid "Changelog"
msgstr ""
-#empty strings from id 24055 to 24058
+#. Used in the Add-on Manager
+#: xbmc/addons/GUIViewStateAddonBrowser.cpp
+msgctxt "#24055"
+msgid "Check for updates"
+msgstr ""
+
+#. Used in the Add-on Manager to specify last update time
+#: xbmc/addons/GUIViewStateAddonBrowser.cpp
+msgctxt "#24056"
+msgid "Last updated %s"
+msgstr ""
+
+#empty strings from id 24057 to 24058
msgctxt "#24059"
msgid "Would you like to enable this Add-on?"
#include "view/ViewState.h"
#include "addons/Addon.h"
#include "addons/AddonManager.h"
+#include "addons/AddonInstaller.h"
#include "AddonDatabase.h"
+#include "utils/StringUtils.h"
using namespace XFILE;
using namespace ADDON;
{
m_sources.clear();
+ { // check for updates
+ CMediaSource share;
+ share.strPath = "addons://check/";
+ share.m_iDriveType = CMediaSource::SOURCE_TYPE_REMOTE; // hack for sorting
+ share.strName = g_localizeStrings.Get(24055); // "Check for updates"
+ CDateTime lastChecked = CAddonInstaller::Get().LastRepoUpdate();
+ if (lastChecked.IsValid())
+ share.strStatus = StringUtils::Format(g_localizeStrings.Get(24056).c_str(),
+ lastChecked.GetAsLocalizedDateTime(false, false).c_str());
+ m_sources.push_back(share);
+ }
if (CAddonMgr::Get().HasOutdatedAddons())
{
CMediaSource share;
{
reposAsFolders = false;
groupAddons = false;
+ // ensure our repos are up to date
+ CAddonInstaller::Get().UpdateRepos(false, true);
CAddonMgr::Get().GetAllOutdatedAddons(addons);
items.SetProperty("reponame",g_localizeStrings.Get(24043));
items.SetLabel(g_localizeStrings.Get(24043));
}
+ else if (path.GetHostName().Equals("check"))
+ {
+ reposAsFolders = false;
+ groupAddons = false;
+ // force a refresh
+ CAddonInstaller::Get().UpdateRepos(true, true);
+ CAddonMgr::Get().GetAllOutdatedAddons(addons);
+ items.SetProperty("reponame",g_localizeStrings.Get(24055));
+ items.SetLabel(g_localizeStrings.Get(24055));
+ }
else if (path.GetHostName().Equals("repos"))
{
groupAddons = false;
item->SetLabel(g_localizeStrings.Get(24032));
items.Add(item);
}
- else if (path.GetHostName().Equals("outdated") && items.Size() > 1)
+ else if ((path.GetHostName().Equals("outdated") ||
+ path.GetHostName().Equals("check")) && items.Size() > 1)
{
CFileItemPtr item(new CFileItem("addons://update_all/", true));
item->SetLabel(g_localizeStrings.Get(24122));