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