MythTV master
rawsettingseditor.h
Go to the documentation of this file.
1#ifndef RAW_SETTINGS_EDITOR_H_
2#define RAW_SETTINGS_EDITOR_H_
3
4#include <QEvent>
5#include <QHash>
6#include <QObject>
7
8#include "mythuiexp.h"
10#include "mythuibuttonlist.h"
11
12class MythUIText;
13class MythUITextEdit;
14class MythUIButton;
15class MythUIShape;
16
25{
26 Q_OBJECT
27
28 public:
29 // Constructor
30 explicit RawSettingsEditor(MythScreenStack *parent, const char *name = nullptr);
31
32 // Destructor
33 ~RawSettingsEditor() override = default;
34
35 // MythScreenType overrides
36 bool Create(void) override; // MythScreenType
37
38 protected:
39 void Load(void) override; // MythScreenType
40 void Init(void) override; // MythScreenType
41
42 private slots:
43 // Saves changes
44 void Save(void);
45
46 // Helpers for keeping track of current value and updating the screen
47 void selectionChanged(MythUIButtonListItem *item);
48 void valueChanged(void);
49
50 protected:
51 // Protected data, directly accessed by inheritting classes
52 QString m_title;
53 QMap <QString, QString> m_settings;
54
55 private:
56 // Helper for updating prev/next values on screen
57 void updatePrevNextTexts(void);
58
59 // UI Widgets on screen
60 MythUIButtonList *m_settingsList {nullptr};
61 MythUITextEdit *m_settingValue {nullptr};
62
63 MythUIButton *m_saveButton {nullptr};
64 MythUIButton *m_cancelButton {nullptr};
65
66 MythUIText *m_textLabel {nullptr};
67
68 // Prev/Next text areas on screen
69 QHash <int, MythUIText*> m_prevNextTexts;
70 QHash <int, MythUIShape*> m_prevNextShapes;
71
72 // Original and current settings values used for selective saving
73 QHash <QString, QString> m_origValues;
74 QHash <QString, QString> m_settingValues;
75};
76
77#endif
78
79/* vim: set expandtab tabstop=4 shiftwidth=4: */
Screen in which all other widgets are contained and rendered.
virtual bool Create(void)
virtual void Init(void)
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
virtual void Load(void)
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A single button widget.
Definition: mythuibutton.h:22
A widget for rendering primitive shapes and lines.
Definition: mythuishape.h:22
A text entry and edit widget.
All purpose text widget, displays a text string.
Definition: mythuitext.h:29
An editor screen that allows manipulation of raw settings values.
QHash< QString, QString > m_origValues
QHash< int, MythUIText * > m_prevNextTexts
QHash< QString, QString > m_settingValues
~RawSettingsEditor() override=default
QMap< QString, QString > m_settings
QHash< int, MythUIShape * > m_prevNextShapes
#define MUI_PUBLIC
Definition: mythuiexp.h:9