Ticket #2239: mythcontrols-20060824.diff
File mythcontrols-20060824.diff, 3.9 KB (added by , 19 years ago) |
---|
-
mythcontrols/mythcontrols/action.h
26 26 27 27 #include <qstring.h> 28 28 #include <qstringlist.h> 29 #include <mythtv/mythkeysequence.h> 29 30 30 31 /** 31 32 * @class Action -
mythcontrols/mythcontrols/mythcontrols.cpp
389 389 if (key.left(6) == "remote") { 390 390 key = KeyToDisplay(key); 391 391 } else { 392 key = QString(QKeySequence(e->key())); 393 if (key.isEmpty()) return false; 394 QString modifiers = ""; 395 if (e->state()&Qt::ShiftButton) modifiers+="Shift+"; 396 if (e->state()&Qt::ControlButton) modifiers+="Ctrl+"; 397 if (e->state()&Qt::AltButton) modifiers+="Alt+"; 398 if (e->state()&Qt::MetaButton) modifiers+="Meta+"; 399 key = modifiers + key; 392 #ifdef USE_LIRC 393 if (key.left( 2 ) != "ir") 394 { 395 #endif // USE_LIRC 396 key = QString(QKeySequence(e->key())); 397 if (key.isEmpty()) return false; 398 QString modifiers = ""; 399 if (e->state()&Qt::ShiftButton) modifiers+="Shift+"; 400 if (e->state()&Qt::ControlButton) modifiers+="Ctrl+"; 401 if (e->state()&Qt::AltButton) modifiers+="Alt+"; 402 if (e->state()&Qt::MetaButton) modifiers+="Meta+"; 403 key = modifiers + key; 404 #ifdef USE_LIRC 405 } 406 #endif // USE_LIRC 400 407 } 401 408 402 409 UIListBtnTypeItem *b; … … 926 933 QString key = *it; 927 934 928 935 QString keydesc = "3 "; 929 if ( key.left(6) == "remote")936 if ((key.left(6) == "remote") || (key.left(2) == "ir")) 930 937 { 931 938 keydesc = "0 "; 932 939 } -
mythcontrols/mythcontrols/mythcontrols.h
26 26 27 27 #include <mythtv/mythdialogs.h> 28 28 #include <mythtv/uilistbtntype.h> 29 #include <mythtv/mythkeysequence.h> 29 30 30 31 #include "keybindings.h" 31 32 -
mythcontrols/mythcontrols/action.cpp
35 35 Action::Action(const QString & description, const QString & keys) 36 36 { 37 37 this->description() = description; 38 this->keys() = QStringList::split(", ", QString( QKeySequence(keys)));38 this->keys() = QStringList::split(", ", QString(MythKeySequence(keys))); 39 39 } 40 40 41 41 -
mythcontrols/mythcontrols/keygrabber.cpp
29 29 #include "keygrabber.h" 30 30 31 31 #include <mythtv/mythcontext.h> 32 #include <mythtv/mythkeysequence.h> 32 33 33 34 34 35 KeyGrabPopupBox::KeyGrabPopupBox(MythMainWindow *window) … … 58 59 /* get the base name of the qkeysequence */ 59 60 QString key_name = QString(QKeySequence(e->key())); 60 61 62 if ((e->text().length( ) > 6) && (e->text().left(6) == "remote")) 63 { 64 captured_key_event = e->text( ); 65 key_label->setText(tr("Add button '[%1]'?").arg(e->text().mid(6))); 66 ok_button->setFocus(); 67 } 68 else 61 69 /* if we really have a key, then process it */ 62 70 if (!key_name.isEmpty() && !key_name.isNull()) 63 71 { … … 70 78 if (e->state()&Qt::MetaButton) modifiers+="Meta+"; 71 79 key_name = modifiers + key_name; 72 80 } 73 81 else 74 82 /* keys without a name are no good to us */ 75 83 if (key_name.isEmpty()) 76 84 {