diff options
-rw-r--r-- | menuitems.c | 19 | ||||
-rw-r--r-- | menuitems.h | 12 |
2 files changed, 21 insertions, 10 deletions
diff --git a/menuitems.c b/menuitems.c index afbc9fc8..8c8ef755 100644 --- a/menuitems.c +++ b/menuitems.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menuitems.c,v 1.1 2006-06-03 10:01:17 phintuka Exp $ + * $Id: menuitems.c,v 1.2 2006-07-21 22:50:58 phintuka Exp $ * */ @@ -60,21 +60,25 @@ cFileListItem::cFileListItem(const char *name, bool isDir) { m_Name = strdup(name); m_IsDir = isDir; + m_IsDvd = false; m_HasResume = false; m_HasSubs = false; m_ShowFlags = false; - m_Up = m_IsDir && !strcmp(m_Name,".."); + m_Up = m_IsDir && !strcmp(m_Name, ".."); Set(); } -cFileListItem::cFileListItem(const char *name, bool isDir, bool HasResume, bool HasSubs) +cFileListItem::cFileListItem(const char *name, bool IsDir, + bool HasResume, bool HasSubs, + bool IsDvd) { m_Name = strdup(name); - m_IsDir = isDir; + m_IsDir = IsDir; + m_IsDvd = IsDvd; m_HasResume = HasResume; m_HasSubs = HasSubs; m_ShowFlags = true; - m_Up = m_IsDir && !strcmp(m_Name,".."); + m_Up = m_IsDir && !strcmp(m_Name, ".."); Set(); } @@ -88,7 +92,10 @@ void cFileListItem::Set(void) char *txt = NULL,*pt; if(m_ShowFlags) { if(m_IsDir) { - asprintf(&txt, "\t\t[%s] ", m_Name); // text2skin requires space at end of string to display item correctly ... + if(m_IsDvd) + asprintf(&txt, "\tD\t[%s] ", m_Name); // text2skin requires space at end of string to display item correctly ... + else + asprintf(&txt, "\t\t[%s] ", m_Name); // text2skin requires space at end of string to display item correctly ... } else { asprintf(&txt, "%c\t%c\t%s", m_HasResume?' ':'*', m_HasSubs ? 'S' : ' ', m_Name); if(NULL != (pt = strrchr(txt,'.'))) diff --git a/menuitems.h b/menuitems.h index 09ae0630..21afb97d 100644 --- a/menuitems.h +++ b/menuitems.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menuitems.h,v 1.1 2006-06-03 09:50:54 phintuka Exp $ + * $Id: menuitems.h,v 1.2 2006-07-21 22:50:58 phintuka Exp $ * */ @@ -51,17 +51,21 @@ class cFileListItem : public cOsdItem private: char *m_Name; bool m_IsDir, m_HasResume, m_HasSubs, m_ShowFlags, m_Up; + bool m_IsDvd; protected: virtual void Set(void); public: - cFileListItem(const char *name, bool isDir, bool HasResume, bool HasSubs); + cFileListItem(const char *name, bool isDir, + bool HasResume, bool HasSubs, + bool IsDvd = false); cFileListItem(const char *name, bool isDir); ~cFileListItem(); - const char *Name() { return m_Name; } - bool IsDir() { return m_IsDir; } + const char *Name(void) { return m_Name; } + bool IsDir(void) { return m_IsDir; } + bool IsDvd(void) { return m_IsDvd; } virtual bool operator< (const cListObject &ListObject); virtual int Compare(const cListObject &ListObject) const; |