~ubuntu-branches/ubuntu/lucid/mythtv/lucid

« back to all changes in this revision

Viewing changes to programs/mythtv-setup/channeleditor.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2009-10-02 00:23:18 UTC
  • mfrom: (1.1.36 upstream)
  • Revision ID: james.westby@ubuntu.com-20091002002318-5qu2fr0gxl59egft
Tags: 0.22.0~trunk22167-0ubuntu1
* New upstream checkout (r22167).
  - Fixes some segfaults.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
        channelname = query.value(0).toString();
546
546
    }
547
547
 
548
 
    QStringList buttons;
549
 
    buttons.append(tr("Cancel"));
550
 
    buttons.append(tr("Download all icons.."));
551
 
    buttons.append(tr("Rescan for missing icons.."));
552
 
    if (!channelname.isEmpty())
553
 
        buttons.append(tr("Download icon for ") + channelname);
554
 
 
555
 
    int val = MythPopupBox::ShowButtonPopup(gContext->GetMainWindow(),
556
 
                                             "", "Channel Icon Import", buttons, kDialogCodeButton2);
557
 
 
558
 
    MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
559
 
 
560
 
    ImportIconsWizard *iconwizard;
561
 
    if (val == kDialogCodeButton0) // Cancel pressed
562
 
        return;
563
 
    else if (val == kDialogCodeButton1) // Import all icons pressed
564
 
        iconwizard = new ImportIconsWizard(mainStack, false);
565
 
    else if (val == kDialogCodeButton2) // Rescan for missing pressed
566
 
        iconwizard = new ImportIconsWizard(mainStack, true);
567
 
    else if (val == kDialogCodeButton3) // Import a single channel icon
568
 
        iconwizard = new ImportIconsWizard(mainStack, true, channelname);
569
 
    else
570
 
        return;
571
 
 
572
 
    if (iconwizard->Create())
573
 
    {
574
 
        connect(iconwizard, SIGNAL(Exiting()), SLOT(fillList()));
575
 
        mainStack->AddScreen(iconwizard);
576
 
    }
577
 
    else
578
 
        delete iconwizard;
 
548
    QString label = tr("Icon Import Options");
 
549
 
 
550
    MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
 
551
 
 
552
    MythDialogBox *menu = new MythDialogBox(label, popupStack, "iconoptmenu");
 
553
 
 
554
    if (menu->Create())
 
555
    {
 
556
        menu->SetReturnEvent(this, "iconimportopt");
 
557
 
 
558
        menu->AddButton(tr("Download all icons.."));
 
559
        menu->AddButton(tr("Rescan for missing icons.."));
 
560
        if (!channelname.isEmpty())
 
561
            menu->AddButton(tr("Download icon for %1").arg(channelname),
 
562
                            channelname);
 
563
 
 
564
        popupStack->AddScreen(menu);
 
565
    }
 
566
    else
 
567
    {
 
568
        delete menu;
 
569
        return;
 
570
    }
579
571
}
580
572
 
581
573
void ChannelEditor::customEvent(QEvent *event)
659
651
            
660
652
            fillList();
661
653
        }
662
 
    }
 
654
        else if (resultid == "iconimportopt")
 
655
        {
 
656
            MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack();
 
657
 
 
658
            ImportIconsWizard *iconwizard;
 
659
 
 
660
            QString channelname = dce->GetData().toString();
 
661
            
 
662
            switch (buttonnum)
 
663
            {
 
664
                case 0 : // Import all icons
 
665
                    iconwizard = new ImportIconsWizard(mainStack, false);
 
666
                    break;
 
667
                case 1 : // Rescan for missing
 
668
                    iconwizard = new ImportIconsWizard(mainStack, true);
 
669
                    break;
 
670
                case 2 : // Import a single channel icon
 
671
                    iconwizard = new ImportIconsWizard(mainStack, true,
 
672
                                                       channelname);
 
673
                    break;
 
674
                default:
 
675
                    return;
 
676
            }
 
677
 
 
678
            if (iconwizard->Create())
 
679
            {
 
680
                connect(iconwizard, SIGNAL(Exiting()), SLOT(fillList()));
 
681
                mainStack->AddScreen(iconwizard);
 
682
            }
 
683
            else
 
684
                delete iconwizard;
 
685
        }
 
686
    }   
663
687
}