[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / addons / gui / GUIHelpers.cpp
blob62fb9d3ec455dd0c5536c5afede9465e6a4d8114
1 /*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "GUIHelpers.h"
11 #include "addons/IAddon.h"
12 #include "addons/addoninfo/AddonInfo.h"
13 #include "dialogs/GUIDialogYesNo.h"
14 #include "guilib/LocalizeStrings.h"
15 #include "utils/StringUtils.h"
17 using namespace ADDON;
18 using namespace ADDON::GUI;
20 bool CHelpers::DialogAddonLifecycleUseAsk(const std::shared_ptr<const IAddon>& addon)
22 int header_nr;
23 int text_nr;
24 switch (addon->LifecycleState())
26 case AddonLifecycleState::BROKEN:
27 header_nr = 24164;
28 text_nr = 24165;
29 break;
30 case AddonLifecycleState::DEPRECATED:
31 header_nr = 24166;
32 text_nr = 24167;
33 break;
34 default:
35 header_nr = 0;
36 text_nr = 0;
37 break;
39 if (header_nr > 0)
41 std::string header = StringUtils::Format(g_localizeStrings.Get(header_nr), addon->ID());
42 std::string text =
43 StringUtils::Format(g_localizeStrings.Get(text_nr), addon->LifecycleStateDescription());
44 if (!CGUIDialogYesNo::ShowAndGetInput(header, text))
45 return false;
48 return true;