1 | Index: mythvideo/mtd/mtd.cpp |
---|
2 | =================================================================== |
---|
3 | --- mythvideo/mtd/mtd.cpp (revision 12717) |
---|
4 | +++ mythvideo/mtd/mtd.cpp (working copy) |
---|
5 | @@ -174,6 +174,8 @@ |
---|
6 | // |
---|
7 | |
---|
8 | QString dvd_device = gContext->GetSetting("DVDDeviceLocation"); |
---|
9 | + if (dvd_device == "default") |
---|
10 | + dvd_device = gContext->GetSetting("defaultDVDDevice"); |
---|
11 | if(dvd_device.length() < 1) |
---|
12 | { |
---|
13 | cerr << "dvdripbox.o: Can't get a value for DVD device location. Did you run setup?" << endl; |
---|
14 | @@ -680,6 +682,8 @@ |
---|
15 | |
---|
16 | |
---|
17 | QString dvd_device = gContext->GetSetting("DVDDeviceLocation"); |
---|
18 | + if (dvd_device == "default") |
---|
19 | + dvd_device = gContext->GetSetting("defaultDVDDevice"); |
---|
20 | if(dvd_device.length() < 1) |
---|
21 | { |
---|
22 | emit writeToLog("crapity crap crap - all set to launch a dvd job and you don't have a dvd device defined"); |
---|
23 | Index: mythvideo/mythvideo/globalsettings.cpp |
---|
24 | =================================================================== |
---|
25 | --- mythvideo/mythvideo/globalsettings.cpp (revision 12717) |
---|
26 | +++ mythvideo/mythvideo/globalsettings.cpp (working copy) |
---|
27 | @@ -1,10 +1,11 @@ |
---|
28 | #include <mythtv/mythcontext.h> |
---|
29 | +#include <mythtv/mythmediamonitor.h> |
---|
30 | |
---|
31 | #include "globalsettings.h" |
---|
32 | #include "globals.h" |
---|
33 | |
---|
34 | namespace |
---|
35 | { |
---|
36 | // General Settings |
---|
37 | @@ -272,25 +274,31 @@ |
---|
38 | |
---|
39 | // General Settings |
---|
40 | |
---|
41 | -HostLineEdit *SetVCDDevice() |
---|
42 | +HostComboBox *SetVCDDevice() |
---|
43 | { |
---|
44 | - HostLineEdit *gc = new HostLineEdit("VCDDeviceLocation"); |
---|
45 | + HostComboBox *gc = new HostComboBox("VCDDeviceLocation", true); |
---|
46 | gc->setLabel(QObject::tr("Location of VCD device")); |
---|
47 | - gc->setValue("/dev/cdrom"); |
---|
48 | - gc->setHelpText(QObject::tr("This device must exist, and the user " |
---|
49 | - "running MythDVD needs to have read permission " |
---|
50 | - "on the device.")); |
---|
51 | + gc->addSelection(QObject::tr("default"), "default"); |
---|
52 | + MediaMonitor *mon = MediaMonitor::GetMediaMonitor(); |
---|
53 | + QStringList cdroms = mon->GetCDROMBlockDevices(); |
---|
54 | + QStringList::iterator iter = cdroms.begin(); |
---|
55 | + for (; iter != cdroms.end(); iter++ ) |
---|
56 | + gc->addSelection("/dev/"+*iter); |
---|
57 | + gc->setHelpText(QObject::tr("Device used for VCD Playback")); |
---|
58 | return gc; |
---|
59 | } |
---|
60 | |
---|
61 | -HostLineEdit *SetDVDDevice() |
---|
62 | +HostComboBox *SetDVDDevice() |
---|
63 | { |
---|
64 | - HostLineEdit *gc = new HostLineEdit("DVDDeviceLocation"); |
---|
65 | + HostComboBox *gc = new HostComboBox("DVDDeviceLocation", true); |
---|
66 | gc->setLabel(QObject::tr("Location of DVD device")); |
---|
67 | - gc->setValue("/dev/dvd"); |
---|
68 | - gc->setHelpText(QObject::tr("This device must exist, and the user " |
---|
69 | - "running MythDVD needs to have read permission " |
---|
70 | - "on the device.")); |
---|
71 | + gc->addSelection(QObject::tr("default"), "default"); |
---|
72 | + MediaMonitor *mon = MediaMonitor::GetMediaMonitor(); |
---|
73 | + QStringList cdroms = mon->GetCDROMBlockDevices(); |
---|
74 | + QStringList::iterator iter = cdroms.begin(); |
---|
75 | + for (; iter != cdroms.end(); iter++ ) |
---|
76 | + gc->addSelection("/dev/"+*iter); |
---|
77 | + gc->setHelpText(QObject::tr("Device used for DVD Playback")); |
---|
78 | return gc; |
---|
79 | } |
---|
80 | Index: mythvideo/mythvideo/main.cpp |
---|
81 | =================================================================== |
---|
82 | --- mythvideo/mythvideo/main.cpp (revision 12717) |
---|
83 | +++ mythvideo/mythvideo/main.cpp (working copy) |
---|
84 | @@ -252,6 +252,9 @@ |
---|
85 | // Need to do device substitution |
---|
86 | // |
---|
87 | QString vcd_device = gContext->GetSetting("VCDDeviceLocation"); |
---|
88 | + if (vcd_device == "default") |
---|
89 | + vcd_device = gContext->GetSetting("defaultCDDevice"); |
---|
90 | + |
---|
91 | if(vcd_device.length() < 1) |
---|
92 | { |
---|
93 | // |
---|
94 | @@ -297,6 +300,8 @@ |
---|
95 | |
---|
96 | if (dvd_device.isNull()) |
---|
97 | dvd_device = gContext->GetSetting("DVDDeviceLocation"); |
---|
98 | + if (dvd_device == "default") |
---|
99 | + dvd_device = gContext->GetSetting("defaultDVDDevice"); |
---|
100 | |
---|
101 | if(dvd_device.length() < 1) |
---|
102 | { |
---|
103 | Index: mythvideo/mythvideo/dvdripbox.cpp |
---|
104 | =================================================================== |
---|
105 | --- mythvideo/mythvideo/dvdripbox.cpp (revision 12717) |
---|
106 | +++ mythvideo/mythvideo/dvdripbox.cpp (working copy) |
---|
107 | @@ -139,6 +139,9 @@ |
---|
108 | // |
---|
109 | |
---|
110 | QString dvd_device = gContext->GetSetting("DVDDeviceLocation"); |
---|
111 | + if (dvd_device == "default") |
---|
112 | + dvd_device = gContext->GetSetting("defaultDVDDevice"); |
---|
113 | + |
---|
114 | if(dvd_device.length() < 1) |
---|
115 | { |
---|
116 | cerr << "dvdripbox.o: Can't get a value for DVD device location. Did you run setup?" << endl; |
---|
117 | Index: mythvideo/mythvideo/titledialog.cpp |
---|
118 | =================================================================== |
---|
119 | --- mythvideo/mythvideo/titledialog.cpp (revision 12717) |
---|
120 | +++ mythvideo/mythvideo/titledialog.cpp (working copy) |
---|
121 | @@ -325,6 +325,8 @@ |
---|
122 | } |
---|
123 | |
---|
124 | QString dvd_device = gContext->GetSetting("DVDDeviceLocation"); |
---|
125 | + if (dvd_device == "default") |
---|
126 | + dvd_device = gContext->GetSetting("defaultDVDDevice"); |
---|
127 | if(dvd_device.length() < 1) |
---|
128 | { |
---|
129 | cerr << "titledialog.o: No DVD device defined" << endl; |
---|