Ticket #3077: mytharchive-cddevices.diff

File mytharchive-cddevices.diff, 2.8 KB (added by devel@…, 14 years ago)

Add default cd/dvd device selection to mytharchive

  • mytharchive/archivesettings.cpp

     
    66
    77// myth
    88#include <mythtv/mythcontext.h>
     9#include <mythtv/mythmediamonitor.h>
    910
    1011// mytharchive
    1112#include "archivesettings.h"
     
    5051    return gc;
    5152};
    5253
    53 static HostLineEdit *MythArchiveDVDLocation()
     54static HostComboBox *MythArchiveDVDLocation()
    5455{
    55     HostLineEdit *gc = new HostLineEdit("MythArchiveDVDLocation");
     56    HostComboBox *gc = new HostComboBox("MythArchiveDVDLocation", true);
    5657    gc->setLabel(QObject::tr("Location of DVD"));
    57     gc->setValue("/dev/dvd");
    58     gc->setHelpText(QObject::tr("Which DVD drive to use when burning discs."));
     58    gc->addSelection(QObject::tr("default"), "default");
     59    MediaMonitor *mon = MediaMonitor::GetMediaMonitor();
     60    QStringList cdroms = mon->GetCDROMBlockDevices();
     61    QStringList::iterator iter = cdroms.begin();
     62        for (; iter != cdroms.end(); iter++ )
     63            gc->addSelection("/dev/"+*iter);
     64    gc->setHelpText(QObject::tr("Which DVD drive to use when burning discs. 'default' will use the device specified in MythTV"));
    5965    return gc;
    6066};
    6167
  • mytharchivehelper/main.cpp

     
    167167int burnISOImage(int mediaType, bool bEraseDVDRW, bool nativeFormat)
    168168{
    169169    QString dvdDrive = gContext->GetSetting("MythArchiveDVDLocation", "/dev/dvd");
     170    if (dvdDrive == "default")
     171        dvdDrive = gContext->GetSetting("defaultDVDDevice");
     172
    170173    VERBOSE(VB_JOBQUEUE, "Burning ISO image to " + dvdDrive);
    171174
    172175    QString tempDirectory = gContext->GetSetting("MythArchiveTempDir", "");
  • mythburn/scripts/mythburn.py

     
    553553                        'MythArchiveMpg123Cmd',
    554554                        'MythArchiveProjectXCmd',
    555555                        'MythArchiveDVDLocation',
     556                        'defaultDVDDevice',
    556557                        'MythArchiveGrowisofsCmd',
    557558                        'MythArchiveJpeg2yuvCmd',
    558559                        'MythArchiveSpumuxCmd',
     
    38853886temppath = defaultsettings["MythArchiveTempDir"] + "/work"
    38863887logpath = defaultsettings["MythArchiveTempDir"] + "/logs"
    38873888dvddrivepath = defaultsettings["MythArchiveDVDLocation"]
     3889if dvddrivepath == 'default':
     3890    dvddrivepath = defaultsettings["defaultDVDDevice"]
    38883891dbVersion = defaultsettings["DBSchemaVer"]
    38893892preferredlang1 = defaultsettings["ISO639Language0"]
    38903893preferredlang2 = defaultsettings["ISO639Language1"]