summaryrefslogtreecommitdiff
path: root/FacilityEngine.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-03-21 11:01:59 +0100
committerThomas Preud'homme <robotux@celest.fr>2013-03-21 11:01:59 +0100
commite297dbd8052ef4e66f069e2dd1865ae7fa8af28e (patch)
tree342fea0a2f6f33b8b62dad2d1729f8209da1a1ba /FacilityEngine.cpp
parent8f9f382e1c97cab2e72e97495650c73ac4b97314 (diff)
Imported Upstream version 0.3.1.0
Diffstat (limited to 'FacilityEngine.cpp')
-rw-r--r--FacilityEngine.cpp86
1 files changed, 62 insertions, 24 deletions
diff --git a/FacilityEngine.cpp b/FacilityEngine.cpp
index 1f18894..30c5168 100644
--- a/FacilityEngine.cpp
+++ b/FacilityEngine.cpp
@@ -20,14 +20,6 @@ FacilityEngine::FacilityEngine()
/// \brief To force the text re-translation
void FacilityEngine::retranslate()
{
- //translated string
- Translation_Copy_engine=tr("Copy engine");
- Translation_Copy=tr("Copy");
- Translation_Move=tr("Move");
- Translation_Pause=tr("Pause");
- Translation_Resume=tr("Resume");
- Translation_Skip=tr("Skip");
- Translation_Unlimited=tr("Unlimited");
//undirect translated string
Translation_perSecond="/"+tr("s");
Translation_tooBig=tr("Too big");
@@ -40,6 +32,46 @@ void FacilityEngine::retranslate()
Translation_EB=tr("EB");
Translation_ZB=tr("ZB");
Translation_YB=tr("YB");
+ Translation_SimplifiedRemaningTime_LessThan10s=tr("Less than %10 seconds");
+ Translation_SimplifiedRemaningTime_AboutSeconds=tr("About %10 seconds remaining");
+ Translation_SimplifiedRemaningTime_AboutMinutes=tr("About %1 minutes remaining");
+ Translation_SimplifiedRemaningTime_AboutHours=tr("About %1 hours remaining");
+ //load the translations tab
+ translations["Copy engine"]=tr("Copy engine");
+ translations["Copy"]=tr("Copy");
+ translations["Move"]=tr("Move");
+ translations["Pause"]=tr("Pause");
+ translations["Resume"]=tr("Resume");
+ translations["Skip"]=tr("Skip");
+ translations["Unlimited"]=tr("Unlimited");
+ translations["Source"]=tr("Source");
+ translations["Size"]=tr("Size");
+ translations["Destination"]=tr("Destination");
+ translations["Quit"]=tr("Quit");
+ translations["Target"]=tr("Target");
+ translations["Time remaining:"]=tr("Time remaining:");
+ translations["Listing"]=tr("Listing");
+ translations["Copying"]=tr("Copying");
+ translations["Listing and copying"]=tr("Listing and copying");
+ translations["Time remaining:"]=tr("Time remaining:");
+ //for copy engine
+ translations["Ask"]=tr("Ask");
+ translations["Skip"]=tr("Skip");
+ translations["Overwrite"]=tr("Overwrite");
+ translations["Overwrite if newer"]=tr("Overwrite if newer");
+ translations["Overwrite if the last modification dates are different"]=tr("Overwrite if the last modification dates are different");
+ translations["Rename"]=tr("Rename");
+ translations["Put to end of the list"]=tr("Put to end of the list");
+ translations["Select source directory"]=tr("Select source directory");
+ translations["Select destination directory"]=tr("Select destination directory");
+ translations["Internal error"]=tr("Internal error");
+ translations["Select one or more files to open"]=tr("Select one or more files to open");
+ translations["All files"]=tr("All files");
+ translations["Save transfer list"]=tr("Save transfer list");
+ translations["Open transfer list"]=tr("Open transfer list");
+ translations["Transfer list"]=tr("Transfer list");
+ translations["Error"]=tr("Error");
+ translations["Not supported on this platform"]=tr("Not supported on this platform");
}
/// \brief convert size in Byte to String
@@ -108,22 +140,13 @@ QString FacilityEngine::sizeUnitToString(const SizeUnit &sizeUnit)
/// \brief translate the text
QString FacilityEngine::translateText(const QString &text)
{
- if(text=="Copy engine")
- return Translation_Copy_engine;
- if(text=="Copy")
- return Translation_Copy;
- if(text=="Move")
- return Translation_Move;
- if(text=="Pause")
- return Translation_Pause;
- if(text=="Resume")
- return Translation_Resume;
- if(text=="Skip")
- return Translation_Skip;
- if(text=="Unlimited")
- return Translation_Unlimited;
- ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"text: "+text);
- return text;
+ if(translations.contains(text))
+ return translations[text];
+ else
+ {
+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"text: "+text);
+ return text;
+ }
}
/// \brief speed to string in byte per seconds
@@ -168,3 +191,18 @@ QVariant FacilityEngine::callFunctionality(const QString &fonctionnality,const Q
Q_UNUSED(args);
return QVariant();
}
+
+/// \brief Do the simplified time
+QString FacilityEngine::simplifiedRemainingTime(const quint32 &seconds)
+{
+ if(seconds<50)
+ {
+ if(seconds<10)
+ return Translation_SimplifiedRemaningTime_LessThan10s.arg(seconds/10+1);
+ else
+ return Translation_SimplifiedRemaningTime_AboutSeconds.arg(seconds/10+1);
+ }
+ if(seconds<3600)
+ return Translation_SimplifiedRemaningTime_AboutMinutes.arg(seconds/60);
+ return Translation_SimplifiedRemaningTime_AboutHours.arg(seconds/3600);
+}