00001 #ifndef CHANNELEDITOR_H 00002 #define CHANNELEDITOR_H 00003 00004 #include <qsqldatabase.h> 00005 00006 #include "settings.h" 00007 00008 class SourceSetting; 00009 class ChannelListSetting; 00010 class MPUBLIC ChannelEditor : public QObject, public ConfigurationDialog 00011 { 00012 Q_OBJECT 00013 public: 00014 ChannelEditor(); 00015 virtual DialogCode exec(void); 00016 00017 MythDialog* dialogWidget(MythMainWindow *parent, const char* name); 00018 00019 public slots: 00020 void menu(int); 00021 void del(); 00022 void edit(); 00023 void edit(int); 00024 void scan(void); 00025 void transportEditor(void); 00026 void channelIconImport(void); 00027 void deleteChannels(void); 00028 00029 private: 00030 int id; 00031 SourceSetting *source; 00032 ChannelListSetting *list; 00033 TransButtonSetting *buttonScan; 00034 TransButtonSetting *buttonImportIcon; 00035 TransButtonSetting *buttonTransportEditor; 00036 }; 00037 00038 class ChannelID; 00039 00040 class MPUBLIC ChannelWizard : public QObject, public ConfigurationWizard 00041 { 00042 Q_OBJECT 00043 public: 00044 ChannelWizard(int id, int default_sourceid); 00045 QString getCardtype(); 00046 bool cardTypesInclude(const QString& cardtype); 00047 int countCardtypes(); 00048 00049 private: 00050 ChannelID *cid; 00051 }; 00052 00053 class ChannelListSetting : public ListBoxSetting, public Storage 00054 { 00055 Q_OBJECT 00056 public: 00057 ChannelListSetting() : ListBoxSetting(this) 00058 { 00059 currentSourceID = ""; 00060 currentSortMode = QObject::tr("Channel Name"); 00061 currentHideMode = false; 00062 }; 00063 00064 void load(void) { fillSelections(); } 00065 void save(void) { } 00066 void save(QString /*destination*/) { } 00067 00068 QString getSourceID() { return currentSourceID; }; 00069 QString getSortMode() { return currentSortMode; }; 00070 bool getHideMode() { return currentHideMode; }; 00071 00072 public slots: 00073 int fillSelections(void); 00074 void setSortMode(const QString& sort) { 00075 if (currentSortMode != sort) { 00076 currentSortMode = sort; 00077 fillSelections(); 00078 } 00079 }; 00080 00081 void setSourceID(const QString& sourceID) { 00082 if (currentSourceID != sourceID) { 00083 currentSourceID = sourceID; 00084 fillSelections(); 00085 } 00086 }; 00087 00088 void setHideMode(bool hide) { 00089 if (currentHideMode != hide) { 00090 currentHideMode = hide; 00091 fillSelections(); 00092 } 00093 }; 00094 00095 private: 00096 QString currentSourceID; 00097 QString currentSortMode; 00098 bool currentHideMode; 00099 }; 00100 00101 #endif
1.5.5