[mythtv] [PATCH] Add user functions
Neil Whelchel
koyama at firstlight.net
Tue Apr 5 22:36:57 UTC 2005
Hello,
Here is a patch to add the ability to run any outside command by pressing
a key. I am using it to call irsend to switch on and off my television by
pressing a button on my remote. Soon I will create a patch to add it to
the configuration menu.
-Neil Whelchel-
First Light Internet Services
760 366-0145
- We don't do Window$, that's what the janitor is for -
Bubble Memory, n.:
A derogatory term, usually referring to a person's
intelligence. See also "vacuum tube".
-------------- next part --------------
--- dist/mythtv/libs/libmyth/mythdialogs.cpp Fri Apr 1 12:18:40 2005
+++ mythtv/libs/libmyth/mythdialogs.cpp Tue Apr 5 15:28:16 2005
@@ -224,6 +224,9 @@
RegisterKey("Global", "HELP", "Help", "F1");
+ RegisterKey("Global", "FUNCTION1", "User defined function 1", "F2");
+ RegisterKey("Global", "FUNCTION2", "User defined function 2", "F3");
+
RegisterKey("Global", "0", "0", "0");
RegisterKey("Global", "1", "1", "1");
RegisterKey("Global", "2", "2", "2");
@@ -999,6 +1002,16 @@
}
else
focusNextPrevChild(true);
+ }
+ else if (action == "FUNCTION1"){
+ QString command = gContext->GetSetting("Function1", "");
+ if(action != "")
+ myth_system((QString("%1 ").arg(command)).local8Bit());
+ }
+ else if (action == "FUNCTION2"){
+ QString command = gContext->GetSetting("Function2", "");
+ if(action != "")
+ myth_system((QString("%1 ").arg(command)).local8Bit());
}
else if (action == "MENU")
emit menuButtonPressed();
More information about the mythtv-dev
mailing list