Ticket #902: queueui.patch
| File queueui.patch, 3.3 KB (added by , 21 years ago) |
|---|
-
mythflix/mythflixqueue.cpp
332 332 else if (action == "PAGEDOWN") 333 333 cursorDown(true); 334 334 else if (action == "REMOVE") 335 removeFromQueue();335 slotRemoveFromQueue(); 336 336 else if (action == "MOVETOTOP") 337 moveToTop(); 337 slotMoveToTop(); 338 else if (action == "SELECT") 339 displayOptions(); 338 340 else 339 341 handled = false; 340 342 } … … 396 398 } 397 399 } 398 400 399 void MythFlixQueue:: moveToTop()401 void MythFlixQueue::slotMoveToTop() 400 402 { 403 404 if (expectingPopup) 405 slotCancelPopup(); 406 401 407 UIListBtnTypeItem *articleUIItem = m_UIArticles->GetItemCurrent(); 402 408 403 409 if (articleUIItem && articleUIItem->getData()) … … 435 441 436 442 } 437 443 438 void MythFlixQueue:: removeFromQueue()444 void MythFlixQueue::slotRemoveFromQueue() 439 445 { 446 447 if (expectingPopup) 448 slotCancelPopup(); 449 440 450 UIListBtnTypeItem *articleUIItem = m_UIArticles->GetItemCurrent(); 441 451 442 452 if (articleUIItem && articleUIItem->getData()) … … 480 490 update(m_InfoRect); 481 491 } 482 492 493 void MythFlixQueue::displayOptions() 494 { 495 496 popup = new MythPopupBox(gContext->GetMainWindow(), "menu popup"); 497 498 QLabel *label = popup->addLabel(tr("Manage Queue"), 499 MythPopupBox::Large, false); 500 label->setAlignment(Qt::AlignCenter | Qt::WordBreak); 501 502 QButton *topButton = popup->addButton(tr("Top Of Queue"), this, 503 SLOT(slotMoveToTop())); 504 505 popup->addButton(tr("Remove From Queue"), this, 506 SLOT(slotRemoveFromQueue())); 507 508 popup->addButton(tr("Cancel"), this, SLOT(slotCancelPopup())); 509 510 popup->ShowPopup(this, SLOT(slotCancelPopup())); 511 512 topButton->setFocus(); 513 514 expectingPopup = true; 515 516 } 517 518 void MythFlixQueue::slotCancelPopup(void) 519 { 520 popup->hide(); 521 expectingPopup = false; 522 523 delete popup; 524 popup = NULL; 525 526 setActiveWindow(); 527 } 528 483 529 // Execute an external command and return results in string 484 530 // probably should make this routing async vs polling like this 485 531 // but it would require a lot more code restructuring -
mythflix/mythflixqueue.h
57 57 void cursorUp(bool page=false); 58 58 void cursorDown(bool page=false); 59 59 60 void displayOptions(); 61 60 62 void cancelRetrieve(); 61 63 void processAndShowNews(NewsSite *site); 62 64 63 void moveToTop();64 void removeFromQueue();65 65 QString executeExternal(const QStringList& args, const QString& purpose); 66 66 67 67 XMLParse *m_Theme; … … 69 69 UIListBtnType *m_UIArticles; 70 70 QRect m_ArticlesRect; 71 71 QRect m_InfoRect; 72 MythPopupBox *popup; 72 73 73 74 NewsSite::List m_NewsSites; 74 75 75 76 QHttp *http; 76 77 78 bool expectingPopup; 79 77 80 private slots: 78 81 void slotViewArticle(); 79 82 void slotRetrieveNews(); … … 83 86 84 87 void slotArticleSelected(UIListBtnTypeItem *item); 85 88 89 void slotMoveToTop(); 90 void slotRemoveFromQueue(); 91 void slotCancelPopup(); 92 86 93 }; 87 94 88 95 #endif /* MYTHFLIXQUEUE_H */
