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