00001 #ifndef RAW_SETTINGS_EDITOR_H_ 00002 #define RAW_SETTINGS_EDITOR_H_ 00003 00004 #include <QEvent> 00005 #include <QHash> 00006 #include <QObject> 00007 00008 #include "mythexp.h" 00009 #include "mythscreentype.h" 00010 00011 #include "mythuibutton.h" 00012 #include "mythuishape.h" 00013 #include "mythuitextedit.h" 00014 00015 class MythUIButtonList; 00016 class MythUIButtonListItem; 00017 class MythUIText; 00018 class MythUITextEdit; 00019 class MythUIButton; 00020 00028 class MPUBLIC RawSettingsEditor : public MythScreenType 00029 { 00030 Q_OBJECT 00031 00032 public: 00033 // Constructor 00034 RawSettingsEditor(MythScreenStack *parent, const char *name = 0); 00035 00036 // Destructor 00037 ~RawSettingsEditor(); 00038 00039 // MythScreenType overrides 00040 bool Create(void); 00041 void Load(void); 00042 void Init(void); 00043 00044 private slots: 00045 // Saves changes 00046 void Save(void); 00047 00048 // Helpers for keeping track of current value and updating the screen 00049 void selectionChanged(MythUIButtonListItem *item); 00050 void valueChanged(void); 00051 00052 protected: 00053 // Protected data, directly accessed by inheritting classes 00054 QString m_title; 00055 QMap <QString, QString> m_settings; 00056 00057 private: 00058 // Helper for updating prev/next values on screen 00059 void updatePrevNextTexts(void); 00060 00061 // UI Widgets on screen 00062 MythUIButtonList *m_settingsList; 00063 MythUITextEdit *m_settingValue; 00064 00065 MythUIButton *m_saveButton; 00066 MythUIButton *m_cancelButton; 00067 00068 MythUIText *m_textLabel; 00069 00070 // Prev/Next text areas on screen 00071 QHash <int, MythUIText*> m_prevNextTexts; 00072 QHash <int, MythUIShape*> m_prevNextShapes; 00073 00074 // Original and current settings values used for selective saving 00075 QHash <QString, QString> m_origValues; 00076 QHash <QString, QString> m_settingValues; 00077 }; 00078 00079 #endif 00080 00081 /* vim: set expandtab tabstop=4 shiftwidth=4: */
1.6.3