2 * Copyright (C) 2017-2018 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.
11 #include "addons/Addon.h"
12 #include "addons/Scraper.h"
13 #include "settings/dialogs/GUIDialogSettingsManualBase.h"
20 // Enumeration of what combination of items to apply the scraper settings
21 enum INFOPROVIDERAPPLYOPTIONS
23 INFOPROVIDER_DEFAULT
= 0x0000,
24 INFOPROVIDER_ALLVIEW
= 0x0001,
25 INFOPROVIDER_THISITEM
= 0x0002
28 class CGUIDialogInfoProviderSettings
: public CGUIDialogSettingsManualBase
31 CGUIDialogInfoProviderSettings();
33 // specialization of CGUIWindow
34 bool HasListItems() const override
{ return true; }
36 const ADDON::ScraperPtr
& GetAlbumScraper() const { return m_albumscraper
; }
37 void SetAlbumScraper(ADDON::ScraperPtr scraper
) { m_albumscraper
= std::move(scraper
); }
38 const ADDON::ScraperPtr
& GetArtistScraper() const { return m_artistscraper
; }
39 void SetArtistScraper(ADDON::ScraperPtr scraper
) { m_artistscraper
= std::move(scraper
); }
41 /*! \brief Show dialog to change information provider for either artists or albums (not both).
42 Has a list to select how settings are to be applied - as system default, to just current item or to all the filtered items on the node.
43 This does not save the settings itself, that is left to the caller
44 \param scraper [in/out] the selected scraper addon and settings. Scraper content must be artists or albums.
45 \return 0 settings apply as system default, 1 to all items on node, 2 to just the selected item or -1 if dialog cancelled or error occurs
47 static int Show(ADDON::ScraperPtr
& scraper
);
49 /*! \brief Show dialog to change the music scraping settings including default information providers for both artists or albums.
50 This saves the settings when the dialog is confirmed.
51 \return true if the dialog is confirmed, false otherwise
56 // specializations of CGUIWindow
57 void OnInitWindow() override
;
59 // implementations of ISettingCallback
60 void OnSettingChanged(const std::shared_ptr
<const CSetting
>& setting
) override
;
61 void OnSettingAction(const std::shared_ptr
<const CSetting
>& setting
) override
;
63 // specialization of CGUIDialogSettingsBase
64 bool AllowResettingSettings() const override
{ return false; }
66 void SetupView() override
;
68 // specialization of CGUIDialogSettingsManualBase
69 void InitializeSettings() override
;
72 void SetLabel2(const std::string
&settingid
, const std::string
&label
);
73 void ToggleState(const std::string
&settingid
, bool enabled
);
74 using CGUIDialogSettingsManualBase::SetFocus
;
75 void SetFocus(const std::string
&settingid
);
79 * @brief The currently selected album scraper
81 ADDON::ScraperPtr m_albumscraper
;
83 * @brief The currently selected artist scraper
85 ADDON::ScraperPtr m_artistscraper
;
87 std::string m_strArtistInfoPath
;
88 bool m_showSingleScraper
= false;
89 CONTENT_TYPE m_singleScraperType
= CONTENT_NONE
;
91 unsigned int m_applyToItems
= INFOPROVIDER_THISITEM
;