Changeset 15776b172 in mythtv
- Timestamp:
- Nov 22, 2016, 9:18:55 PM (8 years ago)
- Branches:
- devel/2020-player, devel/ffmpeg-resync, fixes/29, fixes/30, fixes/31, github-templates, master
- Children:
- ec642bba15
- Parents:
- 1925478899
- git-author:
- Jonatan Lindblad <jlindblad@…> (11/22/16 21:18:55)
- git-committer:
- Jonatan Lindblad <jlindblad@…> (02/13/17 21:23:50)
- Location:
- mythtv
- Files:
-
- 3 edited
-
libs/libmythtv/videosource.cpp (modified) (2 diffs)
-
libs/libmythtv/videosource.h (modified) (2 diffs)
-
programs/mythtv-setup/main.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mythtv/libs/libmythtv/videosource.cpp
r1925478899 r15776b172 692 692 } 693 693 694 VideoSourceDialog::VideoSourceDialog(MythScreenStack *parent) : 695 StandardSettingDialog(parent, "videosourceeditor", new VideoSourceEditor()) 696 { 697 } 698 699 void VideoSourceDialog::ShowDeleteSourceDialog(void) 700 { 701 MythUIButtonListItem *item = m_buttonList->GetItemCurrent(); 702 if (!item) 703 return; 704 705 VideoSource *videosource = item->GetData().value<VideoSource*>(); 706 if (!videosource) 707 return; 708 709 QString message = tr("Do you want to delete the '%1' video source?") 710 .arg(videosource->getSourceName()); 711 ShowOkPopup(message, this, 712 [videosource, this](bool result) 713 { 714 if (result) 715 DeleteSource(videosource); 716 }, 717 true); 718 } 719 720 void VideoSourceDialog::ShowMenu() 721 { 722 MythUIButtonListItem *item = m_buttonList->GetItemCurrent(); 723 if (!item) 724 return; 725 726 VideoSource *videosource = item->GetData().value<VideoSource*>(); 727 if (!videosource) 728 return; 729 730 MythMenu *menu = new MythMenu(tr("Video Source Menu"), this, "mainmenu"); 731 menu->AddItem(tr("Delete"), SLOT(ShowDeleteSourceDialog())); 732 733 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack"); 734 735 MythDialogBox *menuPopup = new MythDialogBox(menu, popupStack, 736 "menudialog"); 737 menuPopup->SetReturnEvent(this, "mainmenu"); 738 739 if (menuPopup->Create()) 740 popupStack->AddScreen(menuPopup); 741 else 742 delete menuPopup; 743 } 744 694 745 bool VideoSourceEditor::cardTypesInclude(const int &sourceID, 695 746 const QString &thecardtype) … … 3835 3886 } 3836 3887 3837 /* TODO 3838 void VideoSourceEditor::del() 3839 { 3840 DialogCode val = MythPopupBox::Show2ButtonPopup( 3841 GetMythMainWindow(), "", 3842 tr("Are you sure you want to delete " 3843 "this video source?"), 3844 tr("Yes, delete video source"), 3845 tr("No, don't"), 3846 kDialogCodeButton1); 3847 3848 if (kDialogCodeButton0 == val) 3849 { 3850 SourceUtil::DeleteSource(listbox->getValue().toUInt()); 3851 Load(); 3852 } 3853 } 3854 */ 3888 void VideoSourceDialog::DeleteSource(VideoSource *videosource) 3889 { 3890 SourceUtil::DeleteSource(videosource->getSourceID()); 3891 GetGroupSettings()->removeChild(videosource); 3892 } 3855 3893 3856 3894 void VideoSourceEditor::NewSource(void) -
mythtv/libs/libmythtv/videosource.h
r1925478899 r15776b172 224 224 225 225 class VideoSource : public GroupSetting { 226 public: 226 Q_OBJECT 227 228 public: 227 229 VideoSource(); 228 230 … … 779 781 }; 780 782 783 class MTV_PUBLIC VideoSourceDialog : public StandardSettingDialog 784 { 785 Q_OBJECT 786 787 public: 788 VideoSourceDialog(MythScreenStack *parent); 789 void ShowMenu(void); 790 791 private slots: 792 void ShowDeleteSourceDialog(void); 793 794 private: 795 void DeleteSource(VideoSource *videosource); 796 }; 797 781 798 class MTV_PUBLIC VideoSourceEditor : public GroupSetting 782 799 { -
mythtv/programs/mythtv-setup/main.cpp
r1925478899 r15776b172 101 101 { 102 102 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 103 StandardSettingDialog *ssd = 104 new StandardSettingDialog(mainStack, "videosourceeditor", 105 new VideoSourceEditor()); 103 StandardSettingDialog *ssd = new VideoSourceDialog(mainStack); 106 104 107 105 if (ssd->Create())
Note: See TracChangeset
for help on using the changeset viewer.
