MythTV  master
settingshelper.h
Go to the documentation of this file.
1 // Qt
2 #include <QObject>
3 
4 // MythTV
9 
10  class SettingsHelper : public QObject
11  {
12  Q_OBJECT
13 
14  public:
15 
16  SettingsHelper(void) = default;
17 
18  ~SettingsHelper(void) override = default;
19 
20  public slots:
21  void RunProlog(const QString &settingsPage)
22  {
23  m_settingsPage = settingsPage;
24 
25  LOG(VB_GENERAL, LOG_DEBUG,
26  QString("SettingHelper::RunProlog called: %1").arg(m_settingsPage));
27 
28  GetMythUI()->AddCurrentLocation("Setup");
30  }
31 
32  void RunEpilog(void)
33  {
34  LOG(VB_GENERAL, LOG_DEBUG,
35  QString("SettingHelper::RunEpilog called: %1").arg(m_settingsPage));
36 
38 
40 
41  // tell the backend the settings may have changed
42  gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
43 
44  // tell the frontend the settings may have changed
45  gCoreContext->dispatch(MythEvent(QString("CLEAR_SETTINGS_CACHE")));
46 
47  if (m_settingsPage == "settings general" ||
48  m_settingsPage == "settings generalrecpriorities")
49  ScheduledRecording::ReschedulePlace("TVMenuCallback");
50  }
51 
52  private:
53  QString m_settingsPage;
54  };
MythCoreContext::SendMessage
void SendMessage(const QString &message)
Definition: mythcorecontext.cpp:1527
MythUILocation::RemoveCurrentLocation
QString RemoveCurrentLocation()
Definition: mythuilocation.cpp:12
SettingsHelper::m_settingsPage
QString m_settingsPage
Definition: settingshelper.h:53
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
SettingsHelper::RunEpilog
void RunEpilog(void)
Definition: settingshelper.h:32
mythlogging.h
scheduledrecording.h
SettingsHelper::SettingsHelper
SettingsHelper(void)=default
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
ScheduledRecording::ReschedulePlace
static void ReschedulePlace(const QString &why)
Definition: scheduledrecording.h:33
SettingsHelper
Definition: settingshelper.h:10
mythuihelper.h
mythcorecontext.h
MythCoreContext::ActivateSettingsCache
void ActivateSettingsCache(bool activate=true)
Definition: mythcorecontext.cpp:839
SettingsHelper::RunProlog
void RunProlog(const QString &settingsPage)
Definition: settingshelper.h:21
SettingsHelper::~SettingsHelper
~SettingsHelper(void) override=default
MythUILocation::AddCurrentLocation
void AddCurrentLocation(const QString &Location)
Definition: mythuilocation.cpp:5
GetMythUI
MythUIHelper * GetMythUI()
Definition: mythuihelper.cpp:64
MythCoreContext::dispatch
void dispatch(const MythEvent &event)
Definition: mythcorecontext.cpp:1729