Ticket #3077: mythtv-defaultcddevices.diff
File mythtv-defaultcddevices.diff, 2.5 KB (added by , 17 years ago) |
---|
-
libs/libmyth/mythmediamonitor.h
72 72 73 73 void MonitorRegisterExtensions(uint mediaType, const QString &extensions); 74 74 75 static QStringList GetCDROMBlockDevices(void); 76 75 77 public slots: 76 78 void mediaStatusChanged(MediaStatus oldStatus, MythMediaDevice* pMedia); 77 79 … … 89 91 90 92 QString GetDeviceFile(const QString &sysfs); 91 93 92 static QStringList GetCDROMBlockDevices(void);93 94 95 94 96 protected: 95 97 QMutex m_DevicesLock; 96 98 QValueList<MythMediaDevice*> m_Devices; -
programs/mythfrontend/globalsettings.cpp
20 20 #include "util-x11.h" 21 21 #include "DisplayRes.h" 22 22 #include "uitypes.h" 23 #include <mythtv/mythmediamonitor.h> 23 24 24 25 static HostComboBox *AudioOutputDevice() 25 26 { … … (this hunk was shorter than expected) 2622 2623 return gs; 2623 2624 } 2624 2625 2626 static HostComboBox *defaultCDDevice() 2627 { 2628 HostComboBox *gc = new HostComboBox("defaultCDDevice", true); 2629 gc->setLabel(QObject::tr("Default CD Device")); 2630 MediaMonitor *mon = MediaMonitor::GetMediaMonitor(); 2631 QStringList cdroms = mon->GetCDROMBlockDevices(); 2632 QStringList::iterator iter = cdroms.begin(); 2633 for (; iter != cdroms.end(); iter++ ) 2634 gc->addSelection("/dev/"+*iter); 2635 gc->setHelpText(QObject::tr("Default CD device")); 2636 return gc; 2637 } 2638 2639 static HostComboBox *defaultDVDDevice() 2640 { 2641 HostComboBox *gc = new HostComboBox("defaultDVDDevice", true); 2642 gc->setLabel(QObject::tr("Default DVD device")); 2643 MediaMonitor *mon = MediaMonitor::GetMediaMonitor(); 2644 QStringList cdroms = mon->GetCDROMBlockDevices(); 2645 QStringList::iterator iter = cdroms.begin(); 2646 for (; iter != cdroms.end(); iter++ ) 2647 gc->addSelection("/dev/"+*iter); 2648 gc->setHelpText(QObject::tr("Default DVD device")); 2649 return gc; 2650 } 2651 2625 2652 static HostCheckBox *EnableMediaMon() 2626 2653 { 2627 2654 HostCheckBox *gc = new HostCheckBox("MonitorDrives"); … … 3474 3517 general->setLabel(QObject::tr("General")); 3475 3518 general->addChild(SetupPinCodeRequired()); 3476 3519 general->addChild(SetupPinCode()); 3520 general->addChild(defaultCDDevice()); 3521 general->addChild(defaultDVDDevice()); 3477 3522 general->addChild(EnableMediaMon()); 3478 3523 general->addChild(EnableXbox()); 3479 3524 addChild(general);