aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-01-18 23:17:14 +0000
committerjmarshallnz <jmarshallnz@svn>2010-01-18 23:17:14 +0000
commitd29a9081e31c5423692c77aec869471a6eb95247 (patch)
tree48eb7699f591c9dac5c0f731554ba1967648c619
parent4c93098fa69804ed40526f5b76c2513e081f01f5 (diff)
changed: Moved the XML filename of windows into a property. Retrieve using Window.Property(xmlfile). Ticket #8551, thanks to EqUiNoX
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26995 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--guilib/GUIWindow.cpp19
-rw-r--r--guilib/GUIWindow.h3
-rw-r--r--guilib/GUIWindowManager.cpp6
-rw-r--r--xbmc/Application.cpp2
-rw-r--r--xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp2
-rw-r--r--xbmc/utils/GUIInfoManager.cpp4
6 files changed, 17 insertions, 19 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;
}
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index 4986f73d40..bd10366a46 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -1959,7 +1959,7 @@ bool CApplication::LoadUserWindows(const CStdString& strSkinPath)
continue;
}
// set the window's xml file, and add it to the window manager.
- pWindow->SetXMLFile(FindFileData.cFileName);
+ pWindow->SetProperty("xmlfile", FindFileData.cFileName);
pWindow->SetID(WINDOW_HOME + id);
g_windowManager.AddCustomWindow(pWindow);
}
diff --git a/xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp b/xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp
index 0b0d97ebb2..6a7408f7f5 100644
--- a/xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp
+++ b/xbmc/lib/libPython/xbmcmodule/GUIPythonWindowXML.cpp
@@ -282,7 +282,7 @@ void CGUIPythonWindowXML::PulseActionEvent()
void CGUIPythonWindowXML::AllocResources(bool forceLoad /*= FALSE */)
{
CStdString tmpDir;
- CUtil::GetDirectory(m_xmlFile, tmpDir);
+ CUtil::GetDirectory(GetProperty("xmlfile"), tmpDir);
CStdString fallbackMediaPath;
CUtil::GetParentPath(tmpDir, fallbackMediaPath);
CUtil::RemoveSlashAtEnd(fallbackMediaPath);
diff --git a/xbmc/utils/GUIInfoManager.cpp b/xbmc/utils/GUIInfoManager.cpp
index c99ea60b4b..a1a3c8861f 100644
--- a/xbmc/utils/GUIInfoManager.cpp
+++ b/xbmc/utils/GUIInfoManager.cpp
@@ -2154,7 +2154,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
else
{
CGUIWindow *window = g_windowManager.GetWindow(m_nextWindowID);
- if (window && CUtil::GetFileName(window->GetXMLFile()).Equals(m_stringParameters[info.GetData2()]))
+ if (window && CUtil::GetFileName(window->GetProperty("xmlfile")).Equals(m_stringParameters[info.GetData2()]))
bReturn = true;
}
break;
@@ -2164,7 +2164,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
else
{
CGUIWindow *window = g_windowManager.GetWindow(m_prevWindowID);
- if (window && CUtil::GetFileName(window->GetXMLFile()).Equals(m_stringParameters[info.GetData2()]))
+ if (window && CUtil::GetFileName(window->GetProperty("xmlfile")).Equals(m_stringParameters[info.GetData2()]))
bReturn = true;
}
break;