From f6465c7c743803d0447d566fb9b962ecc7029cfd Mon Sep 17 00:00:00 2001 From: lordmulder Date: Fri, 14 Jan 2011 19:45:14 +0100 Subject: [PATCH] Make 5 more strings translatable. --- etc/NSIS/setup.nsi | 7 +++ etc/Translation/Blank.ts | 20 +++++++++ etc/Translation/LameXP_DE.ts | 20 +++++++++ etc/Translation/LameXP_FR.ts | 20 +++++++++ etc/Translation/LameXP_IT.ts | 20 +++++++++ etc/Translation/update.bat | 2 + res/localization/LameXP_DE.qm | Bin 41475 -> 41910 bytes res/localization/LameXP_FR.qm | Bin 42811 -> 42936 bytes res/localization/LameXP_IT.qm | Bin 41783 -> 41918 bytes src/Config.h | 2 +- src/Dialog_Processing.cpp | 2 +- src/Model_MetaInfo.cpp | 79 ++++++++++++++++++++++++++-------- src/Model_MetaInfo.h | 2 + 13 files changed, 153 insertions(+), 21 deletions(-) diff --git a/etc/NSIS/setup.nsi b/etc/NSIS/setup.nsi index 52765a9b..a132425e 100644 --- a/etc/NSIS/setup.nsi +++ b/etc/NSIS/setup.nsi @@ -434,6 +434,13 @@ SectionEnd Function CheckForUpdate !insertmacro GetCommandlineParameter "Update" "error" $R0 StrCmp $R0 "error" 0 EnableUpdateMode + + StrCmp "$INSTDIR" "" 0 +2 + Return + + IfFileExists "$INSTDIR\*.*" +2 + Return + IfFileExists "$INSTDIR\LameXP.exe" EnableUpdateMode Return diff --git a/etc/Translation/Blank.ts b/etc/Translation/Blank.ts index 7041a6b6..81ed165e 100644 --- a/etc/Translation/Blank.ts +++ b/etc/Translation/Blank.ts @@ -871,6 +871,14 @@ MetaInfoModel + + Not Specified + + + + Unknown + + Full Path @@ -935,6 +943,14 @@ Unspecified + + OK + + + + Cancel + + Edit Title @@ -1129,6 +1145,10 @@ Process was aborted by the user after %1 file(s)! + + Process was aborted prematurely by the user! + + LameXP - Aborted diff --git a/etc/Translation/LameXP_DE.ts b/etc/Translation/LameXP_DE.ts index 4875fed8..1baa5715 100644 --- a/etc/Translation/LameXP_DE.ts +++ b/etc/Translation/LameXP_DE.ts @@ -1012,6 +1012,22 @@ Unspecified Keine Angabe + + OK + OK + + + Cancel + Abbrechen + + + Not Specified + Keine Angabe + + + Unknown + Unbekannt + ProcessThread @@ -1170,6 +1186,10 @@ The playlist file could not be created: Die Wiedergabeliste konnte nicht erstellt werden: + + Process was aborted prematurely by the user! + Der Vorgang wurde vom Benutzer abgebrochen! + ProgressModel diff --git a/etc/Translation/LameXP_FR.ts b/etc/Translation/LameXP_FR.ts index dc8301c9..7bee31ec 100644 --- a/etc/Translation/LameXP_FR.ts +++ b/etc/Translation/LameXP_FR.ts @@ -1016,6 +1016,22 @@ Votre dossier TEMP est situé ici: Sorry, this property of the source file cannot be edited! Désolé, cette propriété du fichier source ne peut pas être modifiée! + + OK + + + + Cancel + Annuler + + + Not Specified + + + + Unknown + Inconnu + ProcessThread @@ -1174,6 +1190,10 @@ Votre dossier TEMP est situé ici: The playlist file could not be created: La liste de lecture n'a pas pu être créée: + + Process was aborted prematurely by the user! + + ProgressModel diff --git a/etc/Translation/LameXP_IT.ts b/etc/Translation/LameXP_IT.ts index 77d60c0a..7df507f7 100644 --- a/etc/Translation/LameXP_IT.ts +++ b/etc/Translation/LameXP_IT.ts @@ -1012,6 +1012,22 @@ Unspecified Non specificato + + OK + + + + Cancel + Cancella + + + Not Specified + + + + Unknown + Sconosciuto + ProcessThread @@ -1170,6 +1186,10 @@ Alle files completed successfully. + + Process was aborted prematurely by the user! + + ProgressModel diff --git a/etc/Translation/update.bat b/etc/Translation/update.bat index 9f331c99..39765d67 100644 --- a/etc/Translation/update.bat +++ b/etc/Translation/update.bat @@ -23,6 +23,8 @@ for %%f in (..\..\src\*.h) do ( ) REM --------------------------- for %%f in (*.ts) do ( + del %%f.bak 2> NUL + copy %%f %%f.bak lupdate.exe @update.lst -no-obsolete -ts %%f ) REM --------------------------- diff --git a/res/localization/LameXP_DE.qm b/res/localization/LameXP_DE.qm index d0a694752e47d5633d6d417b4c8e11c5d95398f6..bb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hsIO0NcjQpF_?y|~0FX=ew4v(YR> zFeX+?8KERyRVrn=Zvw|XQvL^IKkl(qbS<0$P)j969YFVE>7<8L&WB4Eu0#WMi_9uS z@QuC9B^bGF?0Z4)mm(L>Q~{gr$#ri~jn2HpmPz2aJg|5bNbQn8TC;=fek@;7PEi0G z<&oyiKybW#brspIvC238DhG-iVH+^j#c&k7YfLxE=VT@tLit|{)F0ir}riIXbP zR;8)!@TK1FV-7_G-|{OPRSYMpwCl^8DJ+-v<(s6}@2`DJR|{m#YWL>@%6QqaLLb6e?wwOMS-hRcep7k9HZkl!LH9u1 diff --git a/res/localization/LameXP_IT.qm b/res/localization/LameXP_IT.qm index bf335d56639ca15ab6991a52ec6009615dd311d8..1b9c800152fae45aa56f8f782b9ec73705533199 100644 GIT binary patch delta 1187 zcmX9-ZA?>V7(Ms)ezZ{RU_b?8D~!_MCQuwYh#N98uqX~OFhsH7WCU!%2?%3W0Y%(Y zpuA#$i6TZA+B%(*Au95*$rx&;kWCjqf}1fT8D?f7nICLV;-CBE&3m8coadbLes`7c zAK@Fk{Tcwo0`ndM;)g&SomZy454syq&lKF!&?!&_Q5l z8J34$1`0Z09tZ~ZJ#n;Y^BqW9+yw0Z6Dv0D06v>V@((pYQ71A+zX!}?$QWw@8ebrD zzyPegjdku+eWzd5GCkIPvIxjHjrICR)OQE#cl7|}#mGGq3D{;)<`)IjoMrPk?ao3@ zlna41$2srIM&ON~IBn%5aNsEy`}G3AewbS+Du9q_&XRrx;3B!4l(~S6--tvYu%H}g&(%?aRUtfzrwi8rK`0mdYLx#k~WZ7`o#+7I|Q zmGDL46u{g0_GS4%@BrVv{~55gpIztl+->$3r*o?{DFW=Xr0Nv&;S*IS6|P$*pdpUs z^0A>+!Ur)iKz*-}Zr=`skG`r0ngwgXDj@!@u(i|yH2=!3^MQ%Y=1ah4m2hNmDd46M zPB?3U3X{;8eGI4y5Ke6%BXkzQDSMJZZwjtq(mr#QaB1=>ZFf-^nok~BE7(GXp6g)A z3d`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OFo{p>9rV$a?x0v@!E5q_1sOjI(v!YMctO8nKYpA*>Vj57MqIML!fyljT=byw% z&QmWZY$b%h@Wrx?m2;)^QGPO7~!AIpFA#aKs zl{mj8`u5>$x|%Ni3C}Y!bGiQdj84G&qQ19bh}5<40wrWtqQUm>@1(Kbu--%zRC&f}V4uOg)C*X8!O+q4C4nC?cqT~Zss?VwGYCL~Rot}CAuY9B7e9Z1r G|Nj7&s!opp diff --git a/src/Config.h b/src/Config.h index 75998e3a..c0fdcf57 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 228 +#define VER_LAMEXP_BUILD 231 #define VER_LAMEXP_SUFFIX TechPreview /* diff --git a/src/Dialog_Processing.cpp b/src/Dialog_Processing.cpp index cb6542ae..40954ec3 100644 --- a/src/Dialog_Processing.cpp +++ b/src/Dialog_Processing.cpp @@ -321,7 +321,7 @@ void ProcessingDialog::doneEncoding(void) CHANGE_BACKGROUND_COLOR(frame_header, QColor("#FFF3BA")); WinSevenTaskbar::setTaskbarState(this, WinSevenTaskbar::WinSevenTaskbarErrorState); WinSevenTaskbar::setOverlayIcon(this, &QIcon(":/icons/error.png")); - SET_PROGRESS_TEXT((m_succeededJobs.count() > 0) ? tr("Process was aborted by the user after %1 file(s)!").arg(QString::number(m_succeededJobs.count())) : "Process was aborted prematurely by the user!"); + SET_PROGRESS_TEXT((m_succeededJobs.count() > 0) ? tr("Process was aborted by the user after %1 file(s)!").arg(QString::number(m_succeededJobs.count())) : tr("Process was aborted prematurely by the user!")); m_systemTray->showMessage(tr("LameXP - Aborted"), tr("Process was aborted by the user."), QSystemTrayIcon::Warning); m_systemTray->setIcon(QIcon(":/icons/cd_delete.png")); QApplication::processEvents(); diff --git a/src/Model_MetaInfo.cpp b/src/Model_MetaInfo.cpp index 1b87f875..fe985e9d 100644 --- a/src/Model_MetaInfo.cpp +++ b/src/Model_MetaInfo.cpp @@ -28,8 +28,8 @@ #define MODEL_ROW_COUNT 12 -#define CHECK1(STR) (STR.isEmpty() ? (m_offset ? "(Not Specified)" : "(Unknown)") : STR) -#define CHECK2(VAL) ((VAL > 0) ? QString::number(VAL) : (m_offset ? "(Not Specified)" : "(Unknown)")) +#define CHECK1(STR) (STR.isEmpty() ? (m_offset ? m_textNotSpecified : m_textUnknown) : STR) +#define CHECK2(VAL) ((VAL > 0) ? QString::number(VAL) : (m_offset ? m_textNotSpecified : m_textUnknown)) #define CHECK3(STR) (STR.isEmpty() ? Qt::darkGray : QVariant()) #define CHECK4(VAL) ((VAL == 0) ? Qt::darkGray : QVariant()) @@ -46,6 +46,9 @@ MetaInfoModel::MetaInfoModel(AudioFileModel *file, unsigned int offset) throw "Offset is out of range!"; } + m_textUnknown = QString("(%1)").arg(tr("Unknown")); + m_textNotSpecified = QString("(%1)").arg(tr("Not Specified")); + m_audioFile = file; m_offset = offset; } @@ -247,13 +250,21 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent) int val = -1; QStringList generes(QString("(%1)").arg(tr("Unspecified"))); QString temp; - + + QInputDialog input(parent); + input.setOkButtonText(tr("OK")); + input.setCancelButtonText(tr("Cancel")); + input.setTextEchoMode(QLineEdit::Normal); + switch(index.row() + m_offset) { case 5: - temp = QInputDialog::getText(parent, tr("Edit Title"), EXPAND(tr("Please enter the title for this file:")), QLineEdit::Normal, m_audioFile->fileName(), &ok).simplified(); - if(ok) + input.setWindowTitle(tr("Edit Title")); + input.setLabelText(EXPAND(tr("Please enter the title for this file:"))); + input.setTextValue(m_audioFile->fileName()); + if(input.exec() != 0) { + temp = input.textValue().simplified(); if(temp.isEmpty()) { QMessageBox::warning(parent, tr("Edit Title"), tr("The title must not be empty. Generating title from file name!")); @@ -267,37 +278,52 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent) } break; case 6: - temp = QInputDialog::getText(parent, tr("Edit Artist"), EXPAND(tr("Please enter the artist for this file:")), QLineEdit::Normal, m_audioFile->fileArtist(), &ok).simplified(); - if(ok) + input.setWindowTitle(tr("Edit Artist")); + input.setLabelText(EXPAND(tr("Please enter the artist for this file:"))); + input.setTextValue(m_audioFile->fileArtist()); + if(input.exec() != 0) { + temp = input.textValue().simplified(); beginResetModel(); m_audioFile->setFileArtist(temp.isEmpty() ? QString() : temp); endResetModel(); } break; case 7: - temp = QInputDialog::getText(parent, tr("Edit Album"), EXPAND(tr("Please enter the album for this file:")), QLineEdit::Normal, m_audioFile->fileAlbum(), &ok).simplified(); - if(ok) + input.setWindowTitle(tr("Edit Album")); + input.setLabelText(EXPAND(tr("Please enter the album for this file:"))); + input.setTextValue(m_audioFile->fileAlbum()); + if(input.exec() != 0) { + temp = input.textValue().simplified(); beginResetModel(); m_audioFile->setFileAlbum(temp.isEmpty() ? QString() : temp); endResetModel(); } break; case 8: + input.setWindowTitle(tr("Edit Genre")); + input.setLabelText(EXPAND(tr("Please enter the genre for this file:"))); for(int i = 0; g_lamexp_generes[i]; i++) generes << g_lamexp_generes[i]; - temp = QInputDialog::getItem(parent, tr("Edit Genre"), EXPAND(tr("Please enter the genre for this file:")), generes, (m_audioFile->fileGenre().isEmpty() ? 1 : generes.indexOf(m_audioFile->fileGenre())), false, &ok); - if(ok) + input.setComboBoxItems(generes); + input.setTextValue(m_audioFile->fileGenre()); + if(input.exec() != 0) { + temp = input.textValue().simplified(); beginResetModel(); m_audioFile->setFileGenre((temp.isEmpty() || !temp.compare(generes.at(0), Qt::CaseInsensitive)) ? QString() : temp); endResetModel(); } break; case 9: - val = QInputDialog::getInt(parent, tr("Edit Year"), EXPAND(tr("Please enter the year for this file:")), (m_audioFile->fileYear() ? m_audioFile->fileYear() : 1900), 0, 2100, 1, &ok); - if(ok) + input.setWindowTitle(tr("Edit Year")); + input.setLabelText(EXPAND(tr("Please enter the year for this file:"))); + input.setIntRange(0, 2100); + input.setIntValue((m_audioFile->fileYear() ? m_audioFile->fileYear() : 1900)); + input.setIntStep(1); + if(input.exec() != 0) { + val = input.intValue(); beginResetModel(); m_audioFile->setFileYear(val); endResetModel(); @@ -306,9 +332,14 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent) case 10: if(!m_offset) { - val = QInputDialog::getInt(parent, tr("Edit Position"), EXPAND(tr("Please enter the position (track no.) for this file:")), (m_audioFile->filePosition() ? m_audioFile->filePosition() : 1), 0, 99, 1, &ok); - if(ok) + input.setWindowTitle(tr("Edit Position")); + input.setLabelText(EXPAND(tr("Please enter the position (track no.) for this file:"))); + input.setIntRange(0, 99); + input.setIntValue((m_audioFile->filePosition() ? m_audioFile->filePosition() : 1)); + input.setIntStep(1); + if(input.exec() != 0) { + val = input.intValue(); beginResetModel(); m_audioFile->setFilePosition(val); endResetModel(); @@ -318,9 +349,13 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent) { QStringList options; options << tr("Unspecified (copy from source file)") << tr("Generate from list position"); - temp = QInputDialog::getItem(parent, tr("Edit Position"), EXPAND(tr("Please enter the position (track no.) for this file:")), options, ((m_audioFile->filePosition() == UINT_MAX) ? 1 : 0), false, &ok); - if(ok) + input.setWindowTitle(tr("Edit Position")); + input.setLabelText(EXPAND(tr("Please enter the position (track no.) for this file:"))); + input.setComboBoxItems(options); + input.setTextValue(options.value((m_audioFile->filePosition() == UINT_MAX) ? 1 : 0)); + if(input.exec() != 0) { + temp = input.textValue().simplified(); beginResetModel(); m_audioFile->setFilePosition((options.indexOf(temp) == 1) ? UINT_MAX : 0); endResetModel(); @@ -328,9 +363,12 @@ void MetaInfoModel::editItem(const QModelIndex &index, QWidget *parent) } break; case 11: - temp = QInputDialog::getText(parent, tr("Edit Comment"), EXPAND(tr("Please enter the comment for this file:")), QLineEdit::Normal, (m_audioFile->fileComment().isEmpty() ? tr("Encoded with LameXP") : m_audioFile->fileComment()), &ok).simplified(); - if(ok) + input.setWindowTitle(tr("Edit Comment")); + input.setLabelText(EXPAND(tr("Please enter the comment for this file:"))); + input.setTextValue((m_audioFile->fileComment().isEmpty() ? tr("Encoded with LameXP") : m_audioFile->fileComment())); + if(input.exec() != 0) { + temp = input.textValue().simplified(); beginResetModel(); m_audioFile->setFileComment(temp.isEmpty() ? QString() : temp); endResetModel(); @@ -346,6 +384,9 @@ void MetaInfoModel::clearData(void) { beginResetModel(); + m_textUnknown = QString("(%1)").arg(tr("Unknown")); + m_textNotSpecified = QString("(%1)").arg(tr("Not Specified")); + m_audioFile->setFilePath(QString()); m_audioFile->setFileName(QString()); m_audioFile->setFileArtist(QString()); diff --git a/src/Model_MetaInfo.h b/src/Model_MetaInfo.h index 77b6f79a..ff030228 100644 --- a/src/Model_MetaInfo.h +++ b/src/Model_MetaInfo.h @@ -46,4 +46,6 @@ public: private: AudioFileModel* m_audioFile; unsigned int m_offset; + QString m_textNotSpecified; + QString m_textUnknown; };