Song handling simplification
Add languge field to songs Add lyric display
This commit is contained in:
parent
134e827053
commit
1fec61140c
13 changed files with 384 additions and 231 deletions
|
|
@ -2,7 +2,7 @@
|
|||
#include "ui_SongDialog.h"
|
||||
#include <QMessageBox>
|
||||
|
||||
SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics)
|
||||
SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &lyrics, const QString &vocalLanguage)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::SongDialog)
|
||||
{
|
||||
|
|
@ -15,6 +15,28 @@ SongDialog::SongDialog(QWidget *parent, const QString &caption, const QString &l
|
|||
if (!lyrics.isEmpty()) {
|
||||
ui->lyricsEdit->setPlainText(lyrics);
|
||||
}
|
||||
|
||||
// Setup vocal language combo box
|
||||
ui->vocalLanguageCombo->addItem("--", ""); // Unset
|
||||
ui->vocalLanguageCombo->addItem("English (en)", "en");
|
||||
ui->vocalLanguageCombo->addItem("German (de)", "de");
|
||||
ui->vocalLanguageCombo->addItem("French (fr)", "fr");
|
||||
ui->vocalLanguageCombo->addItem("Spanish (es)", "es");
|
||||
ui->vocalLanguageCombo->addItem("Japanese (ja)", "ja");
|
||||
ui->vocalLanguageCombo->addItem("Chinese (zh)", "zh");
|
||||
ui->vocalLanguageCombo->addItem("Italian (it)", "it");
|
||||
ui->vocalLanguageCombo->addItem("Portuguese (pt)", "pt");
|
||||
ui->vocalLanguageCombo->addItem("Russian (ru)", "ru");
|
||||
|
||||
// Set current language if provided
|
||||
if (!vocalLanguage.isEmpty()) {
|
||||
int index = ui->vocalLanguageCombo->findData(vocalLanguage);
|
||||
if (index >= 0) {
|
||||
ui->vocalLanguageCombo->setCurrentIndex(index);
|
||||
}
|
||||
} else {
|
||||
ui->vocalLanguageCombo->setCurrentIndex(0); // Default to unset
|
||||
}
|
||||
}
|
||||
|
||||
SongDialog::~SongDialog()
|
||||
|
|
@ -32,6 +54,11 @@ QString SongDialog::getLyrics() const
|
|||
return ui->lyricsEdit->toPlainText();
|
||||
}
|
||||
|
||||
QString SongDialog::getVocalLanguage() const
|
||||
{
|
||||
return ui->vocalLanguageCombo->currentData().toString();
|
||||
}
|
||||
|
||||
void SongDialog::on_okButton_clicked()
|
||||
{
|
||||
// Validate that caption is not empty
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue