summaryrefslogtreecommitdiff
path: root/src/CommandItemSetup.cpp
diff options
context:
space:
mode:
authorsvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-10-05 15:08:09 +0000
committersvntcreutz <svntcreutz@cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f>2007-10-05 15:08:09 +0000
commitedcd570a06ed28ffa661fd5e127b6f1729c098a6 (patch)
treefb3ecd100bf3227e4b1dde053771d85f960af131 /src/CommandItemSetup.cpp
parentb0b81edb026ecce4e65c3a18263a7b5f79089204 (diff)
downloadvdr-plugin-menuorg-edcd570a06ed28ffa661fd5e127b6f1729c098a6.tar.gz
vdr-plugin-menuorg-edcd570a06ed28ffa661fd5e127b6f1729c098a6.tar.bz2
added Store()-Procedures to Item-Setups
git-svn-id: file:///home/tobias/sandbox/vdr/--/vdr-pkg/vdr-pkg/menuorg/trunk@6180 cd0d6b48-d4f9-0310-940f-ab8c4eb44d3f
Diffstat (limited to 'src/CommandItemSetup.cpp')
-rw-r--r--src/CommandItemSetup.cpp25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/CommandItemSetup.cpp b/src/CommandItemSetup.cpp
index 7262795..9085b95 100644
--- a/src/CommandItemSetup.cpp
+++ b/src/CommandItemSetup.cpp
@@ -24,21 +24,22 @@
const char AllowedChars[] = "$ abcdefghijklmnopqrstuvwxyz0123456789-.#~\\^$[]|()*+?{}/:%";
-cCommandItemSetup::cCommandItemSetup(CommandMenuNode* node)
+CommandItemSetup::CommandItemSetup(CommandMenuNode* node)
:cOsdMenu(tr("Edit Command Menu Item"), 10)
{
strn0cpy(_newName, node->Text().c_str(), sizeof(_newName));
strn0cpy(_newCommand, node->Command().c_str(), sizeof(_newCommand));
_newConfirm = (int) node->ShouldConfirm();
+ _node = node;
CreateMenuItems();
}
-cCommandItemSetup::~cCommandItemSetup()
+CommandItemSetup::~CommandItemSetup()
{
// TODO: write back the changes
}
-void cCommandItemSetup::CreateMenuItems()
+void CommandItemSetup::CreateMenuItems()
{
// Add textItem for name attribute
Add(new cMenuEditStrItem(tr("name"), _newName, sizeof(_newName), tr(AllowedChars)));
@@ -50,8 +51,24 @@ void cCommandItemSetup::CreateMenuItems()
Add(new cMenuEditBoolItem(tr("confirm"), &_newConfirm));
}
-eOSState cCommandItemSetup::ProcessKey(eKeys Key)
+void CommandItemSetup::Store()
+{
+ _node->Text(_newName);
+ _node->Command(_newCommand);
+ _node->ShouldConfirm(_newConfirm);
+}
+
+eOSState CommandItemSetup::ProcessKey(eKeys Key)
{
eOSState state = cOsdMenu::ProcessKey(Key);
+
+ if(state == osUnknown)
+ {
+ if(Key == kOk)
+ {
+ Store();
+ state = osBack;
+ }
+ }
return state;
}