Ticket #3642: localAction_over_jumppoint_v1.diff
File localAction_over_jumppoint_v1.diff, 4.6 KB (added by , 16 years ago) |
---|
-
libs/libmythui/mythmainwindow.cpp
125 125 QString destination; 126 126 QString description; 127 127 bool exittomain; 128 QString localAction; 128 129 }; 129 130 130 131 struct MHData … … 755 756 actions.clear(); 756 757 int keynum = d->TranslateKeyNum(e); 757 758 759 QStringList localActions; 760 if (allowJumps && (d->jumpMap.count(keynum) > 0) && 761 (d->jumpMap[keynum]->localAction != "") && 762 (d->keyContexts[context]) && 763 (d->keyContexts[context]->GetMapping(keynum, localActions))) 764 { 765 if (localActions.contains(d->jumpMap[keynum]->localAction)) 766 allowJumps = false; 767 } 768 758 769 if (allowJumps && d->jumpMap.count(keynum) > 0 && 759 770 !d->jumpMap[keynum]->exittomain && d->exitmenucallback == NULL) 760 771 { … … 973 984 void MythMainWindow::RegisterJump(const QString &destination, 974 985 const QString &description, 975 986 const QString &key, void (*callback)(void), 976 bool exittomain )987 bool exittomain, QString localAction) 977 988 { 978 989 QString keybind = key; 979 990 … … 994 1005 { 995 1006 QString inskey = keybind; 996 1007 1008 #if MODIFIED_DBCHECK_CPP_TO_ADD_NEW_COLUMN 997 1009 query.prepare("INSERT INTO jumppoints (destination, description, " 998 "keylist, hostname) VALUES ( :DEST, :DESC, :KEYLIST, " 999 ":HOST );"); 1010 "keylist, hostname, localaction) " 1011 "VALUES ( :DEST, :DESC, :KEYLIST, :HOST, " 1012 ":LOCALACTION );"); 1000 1013 query.bindValue(":DEST", destination); 1001 1014 query.bindValue(":DESC", description); 1002 1015 query.bindValue(":KEYLIST", inskey); 1003 1016 query.bindValue(":HOST", gContext->GetHostName()); 1017 query.bindValue(":LOCALACTION", localAction); 1004 1018 1005 1019 if (!query.exec() || !query.isActive()) 1006 1020 { 1007 1021 MythContext::DBError("Insert Jump Point", query); 1008 1022 } 1023 #endif 1009 1024 } 1010 1025 } 1011 1026 1012 JumpData jd = { callback, destination, description, exittomain }; 1027 JumpData jd = 1028 { callback, destination, description, exittomain, localAction }; 1013 1029 d->destinationMap[destination] = jd; 1014 1030 1015 1031 BindJump(destination, keybind); … … 1607 1623 return d->uiScreenRect; 1608 1624 } 1609 1625 1626 /* vim: set expandtab tabstop=4 shiftwidth=4: */ -
libs/libmythui/mythmainwindow.h
39 39 #define GET_KEY(a, b) GetMythMainWindow()->GetKey(a, b) 40 40 #define REG_JUMP(a, b, c, d) GetMythMainWindow()->RegisterJump(a, b, c, d) 41 41 #define REG_JUMPEX(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, e) 42 #define REG_JUMPLOC(a, b, c, d, e) GetMythMainWindow()->RegisterJump(a, b, c, d, true, e) 42 43 #define REG_MEDIA_HANDLER(a, b, c, d, e, f) GetMythMainWindow()->RegisterMediaHandler(a, b, c, d, e, f) 43 44 #define REG_MEDIAPLAYER(a,b,c) GetMythMainWindow()->RegisterMediaPlugin(a, b, c) 44 45 … … 76 77 void BindJump(const QString &destination, const QString &key); 77 78 void RegisterJump(const QString &destination, const QString &description, 78 79 const QString &key, void (*callback)(void), 79 bool exittomain = true );80 bool exittomain = true, QString localAction = ""); 80 81 void RegisterMediaHandler(const QString &destination, 81 82 const QString &description, const QString &key, 82 83 void (*callback)(MythMediaDevice* mediadevice), -
programs/mythfrontend/main.cpp
782 782 { 783 783 REG_JUMP("Reload Theme", "", "", reloadTheme); 784 784 REG_JUMP("Main Menu", "", "", gotoMainMenu); 785 REG_JUMP ("Program Guide", "", "", startGuide);786 REG_JUMP ("Program Finder", "", "", startFinder);785 REG_JUMPLOC("Program Guide", "", "", startGuide, "GUIDE"); 786 REG_JUMPLOC("Program Finder", "", "", startFinder, "FINDER"); 787 787 //REG_JUMP("Search Listings", "", "", startSearch); 788 788 REG_JUMP("Manage Recordings / Fix Conflicts", "", "", startManaged); 789 789 REG_JUMP("Program Recording Priorities", "", "", startProgramRecPriorities);