diff options
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIWindow.cpp | 19 | ||||
-rw-r--r-- | guilib/GUIWindow.h | 3 | ||||
-rw-r--r-- | guilib/GUIWindowManager.cpp | 6 |
3 files changed, 13 insertions, 15 deletions
diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index 4e19ce5af0..90ca9cffb5 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -50,7 +50,7 @@ using namespace std; CGUIWindow::CGUIWindow(int id, const CStdString &xmlFile) { SetID(id); - m_xmlFile = xmlFile; + SetProperty("xmlfile", xmlFile); m_idRange = 1; m_lastControlID = 0; m_bRelativeCoords = false; @@ -106,7 +106,7 @@ bool CGUIWindow::Load(const CStdString& strFileName, bool bContainsPath) int64_t end, freq; end = CurrentHostCounter(); freq = CurrentHostFrequency(); - CLog::Log(LOGDEBUG,"Load %s: %.2fms", m_xmlFile.c_str(), 1000.f * (end - start) / freq); + CLog::Log(LOGDEBUG,"Load %s: %.2fms", GetProperty("xmlfile").c_str(), 1000.f * (end - start) / freq); return ret; } @@ -476,7 +476,7 @@ bool CGUIWindow::OnMessage(CGUIMessage& message) { case GUI_MSG_WINDOW_INIT: { - CLog::Log(LOGDEBUG, "------ Window Init (%s) ------", m_xmlFile.c_str()); + CLog::Log(LOGDEBUG, "------ Window Init (%s) ------", GetProperty("xmlfile").c_str()); if (m_dynamicResourceAlloc || !m_bAllocated) AllocResources(); OnInitWindow(); return true; @@ -485,7 +485,7 @@ bool CGUIWindow::OnMessage(CGUIMessage& message) case GUI_MSG_WINDOW_DEINIT: { - CLog::Log(LOGDEBUG, "------ Window Deinit (%s) ------", m_xmlFile.c_str()); + CLog::Log(LOGDEBUG, "------ Window Deinit (%s) ------", GetProperty("xmlfile").c_str()); OnDeinitWindow(message.GetParam1()); // now free the window if (m_dynamicResourceAlloc) FreeResources(); @@ -607,12 +607,13 @@ void CGUIWindow::AllocResources(bool forceLoad /*= FALSE */) int64_t start; start = CurrentHostCounter(); - // load skin xml file + // load skin xml fil + CStdString xmlFile = GetProperty("xmlfile"); bool bHasPath=false; - if (m_xmlFile.Find("\\") > -1 || m_xmlFile.Find("/") > -1 ) + if (xmlFile.Find("\\") > -1 || xmlFile.Find("/") > -1 ) bHasPath = true; - if (m_xmlFile.size() && (forceLoad || m_loadOnDemand || !m_windowLoaded)) - Load(m_xmlFile,bHasPath); + if (xmlFile.size() && (forceLoad || m_loadOnDemand || !m_windowLoaded)) + Load(xmlFile,bHasPath); int64_t slend; slend = CurrentHostCounter(); @@ -653,7 +654,7 @@ void CGUIWindow::ClearAll() bool CGUIWindow::Initialize() { - return Load(m_xmlFile); + return Load(GetProperty("xmlfile")); } void CGUIWindow::SetInitialVisibility() diff --git a/guilib/GUIWindow.h b/guilib/GUIWindow.h index 2bb5c34094..392d4d8593 100644 --- a/guilib/GUIWindow.h +++ b/guilib/GUIWindow.h @@ -120,8 +120,6 @@ public: virtual bool IsActive() const; void SetCoordsRes(RESOLUTION res) { m_coordsRes = res; }; RESOLUTION GetCoordsRes() const { return m_coordsRes; }; - void SetXMLFile(const CStdString &xmlFile) { m_xmlFile = xmlFile; }; - const CStdString &GetXMLFile() const { return m_xmlFile; }; void LoadOnDemand(bool loadOnDemand) { m_loadOnDemand = loadOnDemand; }; bool GetLoadOnDemand() { return m_loadOnDemand; } int GetRenderOrder() { return m_renderOrder; }; @@ -237,7 +235,6 @@ protected: OVERLAY_STATE m_overlayState; RESOLUTION m_coordsRes; // resolution that the window coordinates are in. bool m_needsScaling; - CStdString m_xmlFile; // xml file to load bool m_windowLoaded; // true if the window's xml file has been loaded bool m_loadOnDemand; // true if the window should be loaded only as needed bool m_isDialog; // true if we have a dialog, false otherwise. diff --git a/guilib/GUIWindowManager.cpp b/guilib/GUIWindowManager.cpp index 43f756b7d6..7cf12f73c3 100644 --- a/guilib/GUIWindowManager.cpp +++ b/guilib/GUIWindowManager.cpp @@ -753,12 +753,12 @@ bool CGUIWindowManager::IsWindowActive(const CStdString &xmlFile, bool ignoreClo { CSingleLock lock(g_graphicsContext); CGUIWindow *window = GetWindow(GetActiveWindow()); - if (window && CUtil::GetFileName(window->GetXMLFile()).Equals(xmlFile)) return true; + if (window && CUtil::GetFileName(window->GetProperty("xmlfile")).Equals(xmlFile)) return true; // run through the dialogs for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it) { CGUIWindow *window = *it; - if (CUtil::GetFileName(window->GetXMLFile()).Equals(xmlFile) && (!ignoreClosing || !window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))) + if (CUtil::GetFileName(window->GetProperty("xmlfile")).Equals(xmlFile) && (!ignoreClosing || !window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))) return true; } return false; // window isn't active @@ -880,7 +880,7 @@ bool CGUIWindowManager::IsWindowTopMost(int id) const bool CGUIWindowManager::IsWindowTopMost(const CStdString &xmlFile) const { CGUIWindow *topMost = GetTopMostDialog(); - if (topMost && CUtil::GetFileName(topMost->GetXMLFile()).Equals(xmlFile)) + if (topMost && CUtil::GetFileName(topMost->GetProperty("xmlfile")).Equals(xmlFile)) return true; return false; } |