00001 #ifndef __BACKENDSELECT_H__ 00002 #define __BACKENDSELECT_H__ 00003 00004 #include "mythdialogs.h" 00005 #include "mythwidgets.h" 00006 00007 #include "libmythupnp/upnpdevice.h" 00008 00009 class ListBoxDevice : public QListBoxText 00010 { 00011 public: 00012 00013 ListBoxDevice(QListBox *list, const QString &name, DeviceLocation *dev) 00014 : QListBoxText(list, name) 00015 { 00016 if ((m_dev = dev) != NULL) 00017 m_dev->AddRef(); 00018 } 00019 00020 virtual ~ListBoxDevice() 00021 { 00022 if (m_dev != NULL) 00023 m_dev->Release(); 00024 } 00025 00026 DeviceLocation *m_dev; 00027 }; 00028 00029 typedef QMap< QString, ListBoxDevice *> ItemMap; 00030 00031 00032 class BackendSelect : public MythDialog 00033 { 00034 Q_OBJECT 00035 00036 public: 00037 BackendSelect(MythMainWindow *parent, DatabaseParams *params); 00038 virtual ~BackendSelect(); 00039 00040 void customEvent(QCustomEvent *e); 00041 00042 QString m_PIN; 00043 QString m_USN; 00044 00045 00046 public slots: 00047 00048 void Accept (void); 00049 void Manual (void); 00050 //void Search (void); 00051 00052 00053 protected: 00054 00055 void AddItem (DeviceLocation *dev); 00056 bool Connect (DeviceLocation *dev); 00057 void CreateUI (void); 00058 void FillListBox(void); 00059 void RemoveItem (QString URN); 00060 00061 DatabaseParams *m_DBparams; 00062 ItemMap m_devices; 00063 MythMainWindow *m_parent; 00064 MythListBox *m_backends; 00065 }; 00066 00067 #endif
1.5.5