| | 2082 | else if (action == "1" || action == "2" || action == "3" || |
| | 2083 | action == "4" || action == "5" || action == "6" || |
| | 2084 | action == "7" || action == "8" || action == "9" || |
| | 2085 | action == "0") |
| | 2086 | { |
| | 2087 | /* |
| | 2088 | * Select a menu item by number |
| | 2089 | * More suitable for remote keypad : |
| | 2090 | * 1 2 3 |
| | 2091 | * 4 5 6 |
| | 2092 | * 7 8 9 |
| | 2093 | * 0 |
| | 2094 | * than keyboard : |
| | 2095 | * 7 8 9 |
| | 2096 | * 4 5 6 |
| | 2097 | * 1 2 3 |
| | 2098 | * 0 |
| | 2099 | */ |
| | 2100 | int pos = action.toInt()-1; |
| | 2101 | if (pos==-1) pos=9; |
| | 2102 | int row=0; |
| | 2103 | while (row < (int)buttonRows.size() |
| | 2104 | && pos >= buttonRows[row].numitems) |
| | 2105 | { |
| | 2106 | pos -= buttonRows[row].numitems; |
| | 2107 | row++; |
| | 2108 | } |
| | 2109 | if (row < (int)buttonRows.size() && pos < buttonRows[row].numitems) |
| | 2110 | { |
| | 2111 | lastbutton = buttonRows[row].buttons[pos]; |
| | 2112 | activebutton = NULL; |
| | 2113 | QStringList::Iterator it = lastbutton->action.begin(); |
| | 2114 | for (; it != lastbutton->action.end(); it++) |
| | 2115 | { |
| | 2116 | if (handleAction(*it)) |
| | 2117 | break; |
| | 2118 | } |
| | 2119 | } |
| | 2120 | } |