diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/guilib/GUIComponent.cpp | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/guilib/GUIComponent.cpp')
-rw-r--r-- | xbmc/guilib/GUIComponent.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/xbmc/guilib/GUIComponent.cpp b/xbmc/guilib/GUIComponent.cpp new file mode 100644 index 0000000..e143e75 --- /dev/null +++ b/xbmc/guilib/GUIComponent.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#include "GUIComponent.h" + +#include "GUIAudioManager.h" +#include "GUIColorManager.h" +#include "GUIInfoManager.h" +#include "GUILargeTextureManager.h" +#include "GUIWindowManager.h" +#include "ServiceBroker.h" +#include "StereoscopicsManager.h" +#include "TextureManager.h" +#include "URL.h" +#include "dialogs/GUIDialogYesNo.h" + +CGUIComponent::CGUIComponent() +{ + m_pWindowManager.reset(new CGUIWindowManager()); + m_pTextureManager.reset(new CGUITextureManager()); + m_pLargeTextureManager.reset(new CGUILargeTextureManager()); + m_stereoscopicsManager.reset(new CStereoscopicsManager()); + m_guiInfoManager.reset(new CGUIInfoManager()); + m_guiColorManager.reset(new CGUIColorManager()); + m_guiAudioManager.reset(new CGUIAudioManager()); +} + +CGUIComponent::~CGUIComponent() +{ + Deinit(); +} + +void CGUIComponent::Init() +{ + m_pWindowManager->Initialize(); + m_stereoscopicsManager->Initialize(); + m_guiInfoManager->Initialize(); + + CServiceBroker::RegisterGUI(this); +} + +void CGUIComponent::Deinit() +{ + CServiceBroker::UnregisterGUI(); + + m_pWindowManager->DeInitialize(); +} + +CGUIWindowManager& CGUIComponent::GetWindowManager() +{ + return *m_pWindowManager; +} + +CGUITextureManager& CGUIComponent::GetTextureManager() +{ + return *m_pTextureManager; +} + +CGUILargeTextureManager& CGUIComponent::GetLargeTextureManager() +{ + return *m_pLargeTextureManager; +} + +CStereoscopicsManager &CGUIComponent::GetStereoscopicsManager() +{ + return *m_stereoscopicsManager; +} + +CGUIInfoManager &CGUIComponent::GetInfoManager() +{ + return *m_guiInfoManager; +} + +CGUIColorManager &CGUIComponent::GetColorManager() +{ + return *m_guiColorManager; +} + +CGUIAudioManager &CGUIComponent::GetAudioManager() +{ + return *m_guiAudioManager; +} + +bool CGUIComponent::ConfirmDelete(const std::string& path) +{ + CGUIDialogYesNo* pDialog = GetWindowManager().GetWindow<CGUIDialogYesNo>(WINDOW_DIALOG_YES_NO); + if (pDialog) + { + pDialog->SetHeading(CVariant{122}); + pDialog->SetLine(0, CVariant{125}); + pDialog->SetLine(1, CVariant{CURL(path).GetWithoutUserDetails()}); + pDialog->SetLine(2, CVariant{""}); + pDialog->Open(); + if (pDialog->IsConfirmed()) + return true; + } + return false; +} |