Ticket #6143: selectedimage.diff
File selectedimage.diff, 2.4 KB (added by , 15 years ago) |
---|
-
mythgallery/mythgallery/iconview.cpp
114 114 115 115 m_captionText = NULL; 116 116 m_noImagesText = NULL; 117 m_selectedImage = NULL; 117 118 118 119 m_menuPopup = NULL; 119 120 … … 151 152 m_captionText = dynamic_cast<MythUIText *> (GetChild("text")); 152 153 m_noImagesText = dynamic_cast<MythUIText *> (GetChild("noimages")); 153 154 155 m_selectedImage = dynamic_cast<MythUIImage *> 156 (GetChild("selectedimage")); 157 154 158 if (!m_imageList) 155 159 { 156 160 VERBOSE(VB_IMPORTANT, "Theme is missing critical theme elements."); … … 161 165 this, SLOT( HandleItemSelect(MythUIButtonListItem*))); 162 166 connect(m_imageList, SIGNAL(itemSelected( MythUIButtonListItem*)), 163 167 this, SLOT( UpdateText(MythUIButtonListItem*))); 168 connect(m_imageList, SIGNAL(itemSelected( MythUIButtonListItem*)), 169 this, SLOT( UpdateImage(MythUIButtonListItem*))); 164 170 165 171 if (m_noImagesText) 166 172 { … … 349 355 m_captionText->SetText(caption); 350 356 } 351 357 358 void IconView::UpdateImage(MythUIButtonListItem *item) 359 { 360 if (!m_selectedImage) 361 return; 362 363 ThumbItem *thumbitem = qVariantValue<ThumbItem *>(item->GetData()); 364 365 QString selectedimage; 366 if (thumbitem) 367 { 368 selectedimage = thumbitem->GetImageFilename(); 369 selectedimage = (selectedimage.isNull()) ? "" : selectedimage; 370 } 371 m_selectedImage->SetFilename(selectedimage); 372 m_selectedImage->Load(); 373 } 374 375 352 376 bool IconView::keyPressEvent(QKeyEvent *event) 353 377 { 354 378 if (GetFocusWidget()->keyPressEvent(event)) -
mythgallery/mythgallery/iconview.h
115 115 MythUIButtonList *m_imageList; 116 116 MythUIText *m_captionText; 117 117 MythUIText *m_noImagesText; 118 MythUIImage *m_selectedImage; 118 119 MythDialogBox *m_menuPopup; 119 120 MythScreenStack *m_popupStack; 120 121 … … 137 138 void mediaStatusChanged(MediaStatus oldStatus, MythMediaDevice *pMedia); 138 139 void HandleItemSelect(MythUIButtonListItem *); 139 140 void UpdateText(MythUIButtonListItem *); 141 void UpdateImage(MythUIButtonListItem *); 140 142 141 143 friend class FileCopyThread; 142 144 };