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 @@ -872,6 +872,14 @@ MetaInfoModel + Not Specified + + + + Unknown + + + Full Path @@ -936,6 +944,14 @@ + OK + + + + Cancel + + + Edit Title @@ -1130,6 +1146,10 @@ + 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..bbb61c782f843a4ea6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QZSsx3%7CJJc`BMRwB2R}qKOM&Euz_YOVMl~PJ#Z4j^#UK{YQnf zi|#x)spwr0NNIvCiWZ|mS^61G)eS1kk5cjUZ!1s5uL4fLP_}t#Z%$%al8!53hb0r2 z%GxB8(%^e&djO%VXQPtE?@iyY(+Nz&obRMW^WD!_plsr@S(0oqu2Ef_ryh3Hs@$F@ zl%!oX=6@Mj{jX}=IZN2yWo|h-s8ntG=NE#Prq0oluaFFN&K`o-`+)r+n~V|aR?kyP zHBs$ISq<#4tA~2~=&lI0=LI$DoRuXh^!)pMtU#eN=4&?JCBe$;nxdW=AX3y6yQmVa zm71D%U+V2X=2V39&A+ly#ZZDuyS}W6!g6b0zDat0{@S;6H9+R9c5mL#^iNM{iwEh9 rX>Ey>*q(Q5OLHgbg@eqcjFX)!^dVejBXi0|>qy73-&7+bb}{rnLH9u1 diff --git a/res/localization/LameXP_IT.qm b/res/localization/LameXP_IT.qm index bf335d56639ca15ab6991a52ec6009615dd311d8..1b9c800152fae45aa56f8f782b9ec73705533199 100644 GIT binary patch delta 1187 zcwQw_drXyO82^3W`7Y;%Ck;7VCPxT3!;+gF31$JYz=M|*2O)}wV-f?;0TU1-NiGta z2pnH=VB!TQgq&lTvhc#aBtl&ZD{Z2~axS)XxyF_v^)&x^pS|1rJkRg;etVVg9p>xZ zz3KtP01F-f;`=}x-Pa}qUsO95$Aq`SEwc{@`3;LIeSwN*yqUNO2=qqc;X}agVk{5t z0diYl?hgR=KXEkca~w!o+5pu2ffZXm13sC>s_(0S{8prmdBk zg_*m3uL4-QjQe$hsCw?$J=c}#`SNN39lB!c|KA)&Mqj22{2kPTk79SH_ zF1!~V4b*iDsinJs(21(r(R>BisuGS3ECbXE;k2_F zC$@p!6 z*EMmp37$qM4a}%BBYb@c9MSBPK)?=~Ovi)3cr9Dq9g{+7Pa) zh@1oLxv6R^AyQG5s`kGKyi}mNl9WwtYnVwga?e?YWKflUalzpRHD>ym@~OFq`_bv~xWGg?RNt3Yg*wyo(14PCEw zPE+9aY1s?ez?HHEO1<9-x3E!KY`3~)HjV+om))$*6qKrTw}M(VrP+(6D2?1OD^<2d z4eJ)>mH~P3I{%CRue+&B(H8(ov$_w`?@{PFbk>t}$4|O!JLz4Qpvy@cCZ=I5Llr5t s(J&!We5HL12}+Z`v3p{ delta 1140 zcwQxxdrX#P7{;&X{ocd(eh0r42!Y@W0={rl1O$Vj2u={vBpXCPoCYz@OF$4s4uW9F z$w!=I2zVkD2_u)7B8b3%X-!#LGo2V?bAf9$wn$ue^RH*m_CEK0UBBzT-+?jV`%$6E z+O8Zx5a2isNIQVwCg8)Jz!z^cuMYC^gfZzRu;v+79dH6F-LWn#0dTWN*s-HP8L-vk z29S9Q;e)O~U2$`pZH7G}{91s+yYPPMeqc`xwvSW;dAW!gzYT;>B4)A`I8u$+K{sIA zL&WLnd~^QwxqB9IpZNeWJ%~5Y(7R5=AGiV(y+m5CH;^-mB0FE8I)FPe+cG~UDY?K$ zrlq@b}P$){oip%jV%k|z8W*jJ5iL`PvnU1eu^Ybjy*xr ze52*WZz;N*eR6VQ1JLXsS6rf^4LjtHi)(;_6Fg0{uwq^>TD(#eOFY?4eW1MC?hnL` zDn5Tq09F%9U?>9$7nG#?c{FqO%I?S%in*50Q0v?|<*S*?G^zv2>6O8x`;l@^9VguO zN^kjE%HfuBc^T=>d!bzYClg4>Q^q|h|GhnYi)3LDNucDqZcL^UM;7>u>@MUlaibFE zyitGZ35{S~kN#};EQPsQKeXaJV0~3T+%iRU?RlZ%X%}U%{QEmG)*E)3NTic!*cnZX zkG;i56nB?Bi-y|nd1`pu(7eeC*mT9v)%qogpEh(a5a!wzZq%BY%vWn|ovn;(C#hkM zhcW5+eZb=fV{#j9WYsfceuED9{3%bT&e?zX` 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; }; -- 2.11.4.GIT