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
13class MythUIText;
14class MythUITextEdit;
15class MythUIButton;
16class MythUIShape;
17
26{
27 Q_OBJECT
28
29 public:
30 // Constructor
31 explicit RawSettingsEditor(MythScreenStack *parent, const char *name = nullptr);
32
33 // Destructor
34 ~RawSettingsEditor() override = default;
35
36 // MythScreenType overrides
37 bool Create(void) override; // MythScreenType
38 void Load(void) override; // MythScreenType
39 void Init(void) override; // MythScreenType
40
41 private slots:
42 // Saves changes
43 void Save(void);
44
45 // Helpers for keeping track of current value and updating the screen
46 void selectionChanged(MythUIButtonListItem *item);
47 void valueChanged(void);
48
49 protected:
50 // Protected data, directly accessed by inheritting classes
51 QString m_title;
52 QMap <QString, QString> m_settings;
53
54 private:
55 // Helper for updating prev/next values on screen
56 void updatePrevNextTexts(void);
57
58 // UI Widgets on screen
59 MythUIButtonList *m_settingsList {nullptr};
60 MythUITextEdit *m_settingValue {nullptr};
61
62 MythUIButton *m_saveButton {nullptr};
63 MythUIButton *m_cancelButton {nullptr};
64
65 MythUIText *m_textLabel {nullptr};
66
67 // Prev/Next text areas on screen
68 QHash <int, MythUIText*> m_prevNextTexts;
69 QHash <int, MythUIShape*> m_prevNextShapes;
70
71 // Original and current settings values used for selective saving
72 QHash <QString, QString> m_origValues;
73 QHash <QString, QString> m_settingValues;
74};
75
76#endif
77
78/* 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