Ticket #8297: channeleditor.patch
File channeleditor.patch, 3.1 KB (added by , 16 years ago) |
---|
-
channeleditor.cpp
140 140 MythUIButtonList *sortList = dynamic_cast<MythUIButtonList *>(GetChild("sorting")); 141 141 m_sourceList = dynamic_cast<MythUIButtonList *>(GetChild("source")); 142 142 m_channelList = dynamic_cast<MythUIButtonList *>(GetChild("channels")); 143 m_preview = dynamic_cast<MythUIImage *>(GetChild("preview")); 144 m_channame = dynamic_cast<MythUIText *>(GetChild("name")); 145 m_channum = dynamic_cast<MythUIText *>(GetChild("channum")); 146 m_callsign = dynamic_cast<MythUIText *>(GetChild("callsign")); 147 m_chanid = dynamic_cast<MythUIText *>(GetChild("chanid")); 148 m_sourcename = dynamic_cast<MythUIText *>(GetChild("sourcename")); 149 m_compoundname = dynamic_cast<MythUIText *>(GetChild("compoundname")); 143 150 144 151 MythUIButton *deleteButton = dynamic_cast<MythUIButton *>(GetChild("delete")); 145 152 MythUIButton *scanButton = dynamic_cast<MythUIButton *>(GetChild("scan")); … … 210 217 // Other signals 211 218 connect(m_channelList, SIGNAL(itemClicked(MythUIButtonListItem *)), 212 219 SLOT(edit(MythUIButtonListItem *))); 220 connect(m_channelList, SIGNAL(itemSelected(MythUIButtonListItem *)), 221 SLOT(itemChanged(MythUIButtonListItem *))); 213 222 connect(scanButton, SIGNAL(Clicked()), SLOT(scan())); 214 223 connect(deleteButton, SIGNAL(Clicked()), SLOT(deleteChannels())); 215 224 … … 248 257 return handled; 249 258 } 250 259 260 void ChannelEditor::itemChanged(MythUIButtonListItem *item) 261 { 262 if (!item) 263 return; 264 265 if (m_preview) 266 { 267 m_preview->Reset(); 268 QString iconpath = item->GetImage(); 269 if (!iconpath.isEmpty()) 270 { 271 m_preview->SetFilename(iconpath); 272 m_preview->Load(); 273 } 274 } 275 276 if (m_channame) 277 m_channame->SetText(item->GetText("name")); 278 279 if (m_channum) 280 m_channum->SetText(item->GetText("channum")); 281 282 if (m_callsign) 283 m_callsign->SetText(item->GetText("callsign")); 284 285 if (m_chanid) 286 m_chanid->SetText(item->GetText("chanid")); 287 288 if (m_sourcename) 289 m_sourcename->SetText(item->GetText("sourcename")); 290 291 if (m_compoundname) 292 m_compoundname->SetText(item->GetText("compoundname")); 293 } 294 251 295 void ChannelEditor::fillList(void) 252 296 { 253 297 QString currentValue = m_channelList->GetValue(); -
channeleditor.h
33 33 void setHideMode(bool hide); 34 34 void fillList(); 35 35 36 private slots: 37 void itemChanged(MythUIButtonListItem *item); 38 36 39 private: 37 40 enum sourceFilter { 38 41 FILTER_ALL = -1, … … 46 49 47 50 MythUIButtonList *m_channelList; 48 51 MythUIButtonList *m_sourceList; 52 53 MythUIImage *m_preview; 54 MythUIText *m_channame; 55 MythUIText *m_channum; 56 MythUIText *m_callsign; 57 MythUIText *m_chanid; 58 MythUIText *m_sourcename; 59 MythUIText *m_compoundname; 49 60 }; 50 61 51 62 class ChannelID;