| 519 | void MythFlix::slotShowNetFlixPage() |
| 520 | { |
| 521 | if (expectingPopup) |
| 522 | slotCancelPopup(); |
| 523 | |
| 524 | UIListBtnTypeItem *articleUIItem = m_UIArticles->GetItemCurrent(); |
| 525 | if (articleUIItem && articleUIItem->getData()) |
| 526 | { |
| 527 | NewsArticle *article = (NewsArticle*) articleUIItem->getData(); |
| 528 | if(article) |
| 529 | { |
| 530 | QString cmdUrl(article->articleURL()); |
| 531 | cmdUrl.replace('\'', "%27"); |
| 532 | |
| 533 | QString cmd = QString("%1 %2 '%3'") |
| 534 | .arg(browser) |
| 535 | .arg(zoom) |
| 536 | .arg(cmdUrl); |
| 537 | VERBOSE(VB_GENERAL, QString("MythFlixBrowse: Opening Neflix site: (%1)").arg(cmd)); |
| 538 | myth_system(cmd); |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | |
| 594 | void MythFlix::displayOptions() |
| 595 | { |
| 596 | |
| 597 | popup = new MythPopupBox(gContext->GetMainWindow(), "menu popup"); |
| 598 | |
| 599 | QLabel *label = popup->addLabel(tr("Browse Options"), |
| 600 | MythPopupBox::Large, false); |
| 601 | label->setAlignment(Qt::AlignCenter | Qt::WordBreak); |
| 602 | |
| 603 | QButton *topButton = popup->addButton(tr("Add To Queue"), this, |
| 604 | SLOT(slotViewArticle())); |
| 605 | |
| 606 | popup->addButton(tr("Show NetFlix Page"), this, |
| 607 | SLOT(slotShowNetFlixPage())); |
| 608 | |
| 609 | popup->addButton(tr("Cancel"), this, SLOT(slotCancelPopup())); |
| 610 | |
| 611 | popup->ShowPopup(this, SLOT(slotCancelPopup())); |
| 612 | |
| 613 | topButton->setFocus(); |
| 614 | |
| 615 | expectingPopup = true; |
| 616 | |
| 617 | } |
| 618 | |
| 619 | void MythFlix::slotCancelPopup(void) |
| 620 | { |
| 621 | popup->hide(); |
| 622 | expectingPopup = false; |
| 623 | |
| 624 | delete popup; |
| 625 | popup = NULL; |
| 626 | |
| 627 | setActiveWindow(); |
| 628 | } |
| 629 | |
| 630 | |