diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lineitem.cpp | 29 | ||||
-rw-r--r-- | src/lineitem.h | 32 | ||||
-rw-r--r-- | src/menuitemsetup.cpp | 27 | ||||
-rw-r--r-- | src/menuitemsetup.h | 7 |
4 files changed, 92 insertions, 3 deletions
diff --git a/src/lineitem.cpp b/src/lineitem.cpp new file mode 100644 index 0000000..26180e2 --- /dev/null +++ b/src/lineitem.cpp @@ -0,0 +1,29 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (C) 2007 Thomas Creutz, Tobias Grimm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + * + */ + +#include "lineitem.h" + +cLineItem::cLineItem(const char *Text) +{ + SetSelectable(false); + SetText(Text); +} diff --git a/src/lineitem.h b/src/lineitem.h new file mode 100644 index 0000000..27936f3 --- /dev/null +++ b/src/lineitem.h @@ -0,0 +1,32 @@ +/* + * vdr-menuorg - A plugin for the Linux Video Disk Recorder + * Copyright (C) 2007 Thomas Creutz, Tobias Grimm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Id$ + * + */ + +#ifndef ___LINEITEM_H +#define ___LINEITEM_H + +class cLineItem : public cOsdItem +{ + public: + cLineItem(const char *Text); +}; + +#endif diff --git a/src/menuitemsetup.cpp b/src/menuitemsetup.cpp index 3fac29b..c63aa1c 100644 --- a/src/menuitemsetup.cpp +++ b/src/menuitemsetup.cpp @@ -34,8 +34,31 @@ cMenuItemSetup::cMenuItemSetup(cOsdXmlItem* osdXmlItem) _osdXmlItem = osdXmlItem; _newItemType = _osdXmlItem->getItemType(); + //_newName = _osdXmlItem->getNameAttribute().c_str(); + //_newTitle = _osdXmlItem->getTitleAttribute().c_str(); + asprintf(&_newTitle, "%s", _osdXmlItem->getTitleAttribute().c_str()); + //_newCommand = _osdXmlItem->getCommandAttribute().c_str(); + CreateMenuItems(); +} + +cMenuItemSetup::~cMenuItemSetup() +{ + _osdXmlItem->setNameAttribute(_newName); + _osdXmlItem->setTitleAttribute(_newTitle); + _osdXmlItem->setCommandAttribute(_newCommand); + free(_newName); + free(_newTitle); + free(_newCommand); +} + +// TODO: When exit check if the type was menu and now is changed -> bring a warning on the osd that the subitems will be deleted +void cMenuItemSetup::CreateMenuItems(void) +{ esyslog("menuorg: _newItemType=%d", _newItemType); + esyslog("menuorg: _newTitle=%s", &_newTitle); + + Clear(); Add(new cMenuEditStraItem(tr("Item Type"), (int*) &_newItemType, 4, itemTypeText)); @@ -45,7 +68,7 @@ cMenuItemSetup::cMenuItemSetup(cOsdXmlItem* osdXmlItem) // Add listItem of valid System Items //Add(new cMenuEditStraItem(tr("available System Items"),)) // Add textItem for title attribute - //Add(new cMenuEditStrItem(tr("title"), VAR, 64, NULL)) + Add(new cMenuEditStrItem(tr("title"), _newTitle, 64, NULL)); break; case 1: @@ -71,8 +94,6 @@ cMenuItemSetup::cMenuItemSetup(cOsdXmlItem* osdXmlItem) } } -// TODO: When exit check if the type was menu and now is changed -> bring a warning on the osd that the subitems will be deleted - eOSState cMenuItemSetup::ProcessKey(eKeys Key) { eOSState state = cOsdMenu::ProcessKey(Key); diff --git a/src/menuitemsetup.h b/src/menuitemsetup.h index d56286c..7ecf373 100644 --- a/src/menuitemsetup.h +++ b/src/menuitemsetup.h @@ -32,10 +32,17 @@ class cMenuItemSetup : public cOsdMenu cOsdXmlItem* _osdXmlItem; cOsdXmlItem::sItemType _newItemType; const char* itemTypeText[4]; + char* _newName; + char* _newTitle; + char* _newCommand; public: cMenuItemSetup(cOsdXmlItem* osdXmlItem); + ~cMenuItemSetup(void); virtual eOSState ProcessKey(eKeys Key); + + private: + void CreateMenuItems(void); }; #endif |