Ticket #8305: importicons.patch
| File importicons.patch, 2.8 KB (added by , 16 years ago) |
|---|
-
importicons.cpp
75 75 m_manualButton = dynamic_cast<MythUIButton *>(GetChild("search")); 76 76 m_skipButton = dynamic_cast<MythUIButton *>(GetChild("skip")); 77 77 m_statusText = dynamic_cast<MythUIText *>(GetChild("status")); 78 m_preview = dynamic_cast<MythUIImage *>(GetChild("preview")); 79 m_previewtitle = dynamic_cast<MythUIText *>(GetChild("previewtitle")); 78 80 79 81 if (!m_iconsList || !m_manualEdit || !m_nameText || !m_manualButton || 80 82 !m_skipButton || !m_statusText) … … 96 98 connect(m_skipButton, SIGNAL(Clicked()), SLOT(skip())); 97 99 connect(m_iconsList, SIGNAL(itemClicked(MythUIButtonListItem *)), 98 100 SLOT(menuSelection(MythUIButtonListItem *))); 101 connect(m_iconsList, SIGNAL(itemSelected(MythUIButtonListItem *)), 102 SLOT(itemChanged(MythUIButtonListItem *))); 99 103 100 104 BuildFocusList(); 101 105 … … 238 242 239 243 } 240 244 245 void ImportIconsWizard::itemChanged(MythUIButtonListItem *item) 246 { 247 if (!item) 248 return; 249 250 if (m_preview) 251 { 252 m_preview->Reset(); 253 QString iconpath = item->GetImage("icon"); 254 if (!iconpath.isEmpty()) 255 { 256 m_preview->SetFilename(iconpath); 257 m_preview->Load(); 258 } 259 } 260 261 if (m_previewtitle) 262 m_previewtitle->SetText(item->GetText("iconname")); 263 } 264 241 265 bool ImportIconsWizard::initialLoad(QString name) 242 266 { 243 267 QString dirpath = GetConfDir(); … … 660 684 661 685 QString iconfile = entry.strLogo.section('/', -1); 662 686 iconfile = m_tmpDir.absoluteFilePath(iconfile); 687 QString iconname = entry.strName; 663 688 bool haveIcon = true; 664 689 if (!QFile(iconfile).exists()) 665 690 haveIcon = HttpComms::getHttpFile(iconfile, entry.strLogo); 666 691 667 692 if (haveIcon) 668 693 item->SetImage(iconfile, "icon"); 694 item->SetText(iconname, "iconname"); 669 695 prevIconName = entry.strName; 670 696 if (m_progressDialog) 671 697 m_progressDialog->SetProgress(x+1); -
importicons.h
153 153 void askSubmit(const QString& strParam); 154 154 void Close(); 155 155 156 private slots: 157 void itemChanged(MythUIButtonListItem *item); 158 156 159 protected: 157 160 void Init(void); 158 161 … … 185 188 MythUIButton *m_skipButton; //!< button skip 186 189 MythUIText *m_statusText; 187 190 191 MythUIImage *m_preview; 192 MythUIText *m_previewtitle; 193 188 194 }; 189 195 190 196 Q_DECLARE_METATYPE(ImportIconsWizard::SearchEntry)
