Ticket #20: mythmusic_qual_chooser_fix_tr.diff

File mythmusic_qual_chooser_fix_tr.diff, 4.5 KB (added by jkondis <jkondis@…>, 15 years ago)

Oops - please ignore last diff. This one allows for translations (tr()) of the quality strings.

  • mythmusic/cdrip.h

     
    4949    QFrame *firstdiag;
    5050
    5151    MythComboBox *artistedit;
     52    MythComboBox *qualchooser;
    5253    MythLineEdit *albumedit;
    5354    MythComboBox *genreedit;
    5455    MythCheckBox *compilation;
     
    5657
    5758    MythTable *table;
    5859
    59     MythButtonGroup *qualitygroup;
    60 
    6160    QLabel *statusline;
    6261    QProgressBar *overall;
    6362    QProgressBar *current;
  • mythmusic/cdrip.cpp

     
    7373    inst->setBackgroundOrigin(WindowOrigin);
    7474    vbox->addWidget(inst);
    7575
    76     QHBoxLayout *qualbox = new QHBoxLayout(vbox, 10);
    77     qualitygroup = new MythButtonGroup(firstdiag);
    78     qualitygroup->setFrameStyle(QFrame::NoFrame);
    79     qualitygroup->hide();
     76    QLabel *quality = new QLabel(tr("Quality: "), firstdiag);
     77    quality->setBackgroundOrigin(WindowOrigin);
    8078
    81     QRadioButton *lowquality = new QRadioButton(tr("Low"), firstdiag);
    82     lowquality->setBackgroundOrigin(WindowOrigin);
    83     qualbox->addWidget(lowquality);
    84     qualitygroup->insert(lowquality);
     79    qualchooser = new MythComboBox(false, firstdiag);
     80    qualchooser->insertItem(tr("Low"));
     81    qualchooser->insertItem(tr("Medium"));
     82    qualchooser->insertItem(tr("High"));
     83    qualchooser->insertItem(tr("Perfect"));
     84    qualchooser->setCurrentItem(gContext->GetNumSetting("DefaultRipQuality", 1));
     85    qualchooser->setMaximumWidth(screenwidth / 2);
    8586
    86     QRadioButton *mediumquality = new QRadioButton(tr("Medium"), firstdiag);
    87     mediumquality->setBackgroundOrigin(WindowOrigin);
    88     qualbox->addWidget(mediumquality);
    89     qualitygroup->insert(mediumquality);
    90 
    91     QRadioButton *highquality = new QRadioButton(tr("High"), firstdiag);
    92     highquality->setBackgroundOrigin(WindowOrigin);
    93     qualbox->addWidget(highquality);
    94     qualitygroup->insert(highquality);
    95 
    96     QRadioButton *perfectflac = new QRadioButton(tr("Perfect"), firstdiag);
    97     perfectflac->setBackgroundOrigin(WindowOrigin);
    98     qualbox->addWidget(perfectflac);
    99     qualitygroup->insert(perfectflac);
    100 
    101     qualitygroup->setRadioButtonExclusive(true);
    102     qualitygroup->setButton(gContext->GetNumSetting("DefaultRipQuality", 1));
    103 
    10487    QGridLayout *grid = new QGridLayout(vbox, 1, 1, 20);
    10588   
    10689    QLabel *artistl = new QLabel(tr("Artist: "), firstdiag);
     
    136119    connect(switchtitleartist, SIGNAL(clicked()), this, SLOT(switchTitlesAndArtists()));
    137120   
    138121
    139     grid->addMultiCellWidget(artistl, 0, 0, 0, 0);
    140     grid->addMultiCellWidget(artistedit,  0, 0, 1, 2);
    141     grid->addMultiCellWidget(albuml, 1, 1, 0, 0);
    142     grid->addMultiCellWidget(albumedit,  1, 1, 1, 2);
    143     grid->addMultiCellWidget(genrelabel, 2, 2, 0, 0);
    144     grid->addMultiCellWidget(genreedit, 2, 2, 1, 2);
    145     grid->addMultiCellWidget(compilation, 3, 3, 0, 0);
    146     grid->addMultiCellWidget(switchtitleartist, 3, 3, 1, 2);
     122    grid->addMultiCellWidget(quality, 0, 0, 0, 0);
     123    grid->addMultiCellWidget(qualchooser,  0, 0, 1, 2);
     124    grid->addMultiCellWidget(artistl, 1, 1, 0, 0);
     125    grid->addMultiCellWidget(artistedit,  1, 1, 1, 2);
     126    grid->addMultiCellWidget(albuml, 2, 2, 0, 0);
     127    grid->addMultiCellWidget(albumedit,  2, 2, 1, 2);
     128    grid->addMultiCellWidget(genrelabel, 3, 3, 0, 0);
     129    grid->addMultiCellWidget(genreedit, 3, 3, 1, 2);
     130    grid->addMultiCellWidget(compilation, 4, 4, 0, 0);
     131    grid->addMultiCellWidget(switchtitleartist, 4, 4, 1, 2);
    147132
    148133    table = new MythTable(firstdiag);
    149     grid->addMultiCellWidget(table, 4, 4, 0, 2);
     134    grid->addMultiCellWidget(table, 5, 5, 0, 2);
    150135    table->setNumCols(4);
    151136    table->setLeftMargin(0);
    152137    table->setNumRows(1);
     
    625610    overall->setBackgroundOrigin(WindowOrigin);
    626611    overall->setProgress(0);
    627612    vb->addWidget(overall);
    628    
     613
    629614    statusline = new QLabel(" ", newdiag);
    630615    statusline->setBackgroundOrigin(WindowOrigin);
    631616    statusline->setAlignment(AlignAuto | AlignVCenter | ExpandTabs | WordBreak);
     
    644629    QString textstatus;
    645630    QString cddevice = gContext->GetSetting("CDDevice");
    646631    QString encodertype = gContext->GetSetting("EncoderType");
    647     int encodequal = qualitygroup->id(qualitygroup->selected());
     632    int encodequal = qualchooser->currentItem();
    648633    bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0);
    649634
    650635    CdDecoder *decoder = new CdDecoder("cda", NULL, NULL, NULL);