From 5178c386e200025d9edfe0427bcb176be4b95814 Mon Sep 17 00:00:00 2001 From: "Michael T. Dean" Date: Tue, 2 Aug 2011 18:33:08 -0400 Subject: [PATCH] Clean up jump point clearing for reset keys. Let MythMainWindow clear all the jump points for us before we re-init them. --- mythtv/libs/libmythui/mythmainwindow.cpp | 8 ++++++++ mythtv/libs/libmythui/mythmainwindow.h | 1 + mythtv/programs/mythfrontend/main.cpp | 25 +----------------------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp index 28310a74771..c849476c422 100644 --- a/mythtv/libs/libmythui/mythmainwindow.cpp +++ b/mythtv/libs/libmythui/mythmainwindow.cpp @@ -1763,6 +1763,14 @@ void MythMainWindow::RegisterJump(const QString &destination, BindJump(destination, keybind); } +void MythMainWindow::ClearAllJumps() +{ + QList destinations = d->destinationMap.keys(); + QList::Iterator it; + for (it = destinations.begin(); it != destinations.end(); ++it) + ClearJump(*it); +} + void MythMainWindow::JumpTo(const QString& destination, bool pop) { if (d->destinationMap.count(destination) > 0 && d->exitmenucallback == NULL) diff --git a/mythtv/libs/libmythui/mythmainwindow.h b/mythtv/libs/libmythui/mythmainwindow.h index 8536dc145f4..46ea69d9828 100644 --- a/mythtv/libs/libmythui/mythmainwindow.h +++ b/mythtv/libs/libmythui/mythmainwindow.h @@ -66,6 +66,7 @@ class MUI_PUBLIC MythMainWindow : public QWidget void RegisterJump(const QString &destination, const QString &description, const QString &key, void (*callback)(void), bool exittomain = true, QString localAction = ""); + void ClearAllJumps(); void RegisterMediaPlugin(const QString &name, const QString &desc, MediaPlayCallback fn); diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp index cd3fc3c4c61..cfc96f88cc8 100644 --- a/mythtv/programs/mythfrontend/main.cpp +++ b/mythtv/programs/mythfrontend/main.cpp @@ -1318,30 +1318,7 @@ static void InitJumpPoints(void) static void ReloadJumpPoints(void) { MythMainWindow *mainWindow = GetMythMainWindow(); - mainWindow->ClearJump("Reload Theme"); - mainWindow->ClearJump("Main Menu"); - mainWindow->ClearJump("Program Guide"); - mainWindow->ClearJump("Program Finder"); - //mainWindow->ClearJump("Search Listings"); - mainWindow->ClearJump("Manage Recordings / Fix Conflicts"); - mainWindow->ClearJump("Program Recording Priorities"); - mainWindow->ClearJump("Manage Recording Rules"); - mainWindow->ClearJump("Channel Recording Priorities"); - mainWindow->ClearJump("TV Recording Playback"); - mainWindow->ClearJump("TV Recording Deletion"); - mainWindow->ClearJump("Live TV"); - mainWindow->ClearJump("Live TV In Guide"); - mainWindow->ClearJump("Status Screen"); - mainWindow->ClearJump("Previously Recorded"); - mainWindow->ClearJump("Video Default"); - mainWindow->ClearJump("Video Manager"); - mainWindow->ClearJump("Video Browser"); - mainWindow->ClearJump("Video Listings"); - mainWindow->ClearJump("Video Gallery"); - mainWindow->ClearJump("Play Disc"); - mainWindow->ClearJump("Toggle Show Widget Borders"); - mainWindow->ClearJump("Toggle Show Widget Names"); - mainWindow->ClearJump("Reset All Keys"); + mainWindow->ClearAllJumps(); InitJumpPoints(); }