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) override = 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  };
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:50
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:17
arg
arg(title).arg(filename).arg(doDelete))
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
SettingsHelper::RunEpilog
void RunEpilog(void)
Definition: settingshelper.h:29
scheduledrecording.h
SettingsHelper::SettingsHelper
SettingsHelper(void)=default
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
ScheduledRecording::ReschedulePlace
static void ReschedulePlace(const QString &why)
Definition: scheduledrecording.h:33
SettingsHelper
Definition: settingshelper.h:8
mythuihelper.h
mythcorecontext.h
MythCoreContext::ActivateSettingsCache
void ActivateSettingsCache(bool activate=true)
Definition: mythcorecontext.cpp:854
SettingsHelper::RunProlog
void RunProlog(const QString &settingsPage)
Definition: settingshelper.h:18
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:1734