There are a couple of things that I found with the EPG channel jumping
that this patch addresses:
1) If you enter two numbers and then a DELETE, the screen doesn't
refresh correctly.
Example: enter 2, 3, DELETE. The channel jumper should be on
channel 2, and it should display 2. Before this patch, it will still
show "23" although internally it's only "2" now.
2) When numbers are mapped to other keys, channel jumping will not
work for channels with those numbers.
Example: enter 2, 3, 0. The channel jumper will only recognize
2 and 0, ending with the result of "20". The reason is because by
default the number keys get mapped to other keys (7 == HOME, 9 ==
PgUp, 1 == END, 3 == PgDn).
This patch checks if channel jumping option is selected. If so, it
will assume that all numbers entered are an attempt to jump channels.
Attached is the diff of the changes.
--Harvard
As an aside, I was thinking of implementing a user requested feature
in which you can change the video source (say if you have Cable and
Satellite video sources) in the EPG. Is anyone aware of any pitfalls
to implementing this feature?
Index: libs/libmythtv/guidegrid.h
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/guidegrid.h,v
retrieving revision 1.60
diff -u -r1.60 guidegrid.h
--- libs/libmythtv/guidegrid.h 23 Feb 2005 05:04:36 -0000 1.60
+++ libs/libmythtv/guidegrid.h 3 May 2005 08:00:57 -0000
@@ -175,6 +175,7 @@
void jumpToChannelShowSelection();
void jumpToChannelDeleteLastDigit();
void jumpToChannelDigitPress(int);
+ bool jumpToChannelGetInputDigit(QStringList & actions, int & digit);
int jumpToChannel;
int jumpToChannelPreviousStartChannel;
int jumpToChannelPreviousRow;
Index: libs/libmythtv/guidegrid.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/guidegrid.cpp,v
retrieving revision 1.172
diff -u -r1.172 guidegrid.cpp
--- libs/libmythtv/guidegrid.cpp 23 Feb 2005 05:04:36 -0000 1.172
+++ libs/libmythtv/guidegrid.cpp 3 May 2005 08:00:58 -0000
@@ -324,6 +324,20 @@
}
else
{
+ // We want to handle jump to channel before everything else
+ // The reason is because the number keys could be mapped to
+ // other things. If this is the case, then the jump to channel
+ // will not work correctly.
+ if (jumpToChannelEnabled) {
+ int digit;
+ if (jumpToChannelGetInputDigit (actions, digit)) {
+ jumpToChannelDigitPress (digit);
+ // Set handled = true here so that it won't process any
+ // more actions.
+ handled = true;
+ }
+ }
+
for (unsigned int i = 0; i < actions.size() && !handled; i++)
{
QString action = actions[i];
@@ -349,9 +363,6 @@
dayLeft();
else if (action == "DAYRIGHT")
dayRight();
- else if (jumpToChannelEnabled &&
- ((action[0] >= '0') && (action[0] <= '9')))
- jumpToChannelDigitPress(action.toInt());
else if (jumpToChannelEnabled && jumpToChannelActive &&
(action == "ESCAPE"))
jumpToChannelCancel();
@@ -1763,6 +1774,9 @@
if (jumpToChannel == 0) {
jumpToChannelCancel();
}
+ else {
+ jumpToChannelShowSelection();
+ }
}
void GuideGrid::jumpToChannelShowSelection()
@@ -1819,3 +1833,18 @@
jumpToChannelCommit();
}
+// function returns true if it is able to find a mapping to a digit and false
+// otherwise.
+bool GuideGrid::jumpToChannelGetInputDigit (QStringList & actions, int & digit)
+{
+ for (unsigned int i = 0; i < actions.size (); ++i) {
+ QString action = actions[i];
+ if (action[0] >= '0' && action[0] <= '9') {
+ digit = action.toInt ();
+ return true;
+ }
+ }
+
+ // There were no actions that resolved to a digit
+ return false;
+}
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev