Commit f019e6f3 authored by Jan Möbius's avatar Jan Möbius

Make all strings translateable in Core

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6733 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7f54146d
This diff is collapsed.
......@@ -614,12 +614,12 @@ void Core::openIniFile( QString _filename,
INIFile ini;
if ( ! ini.connect(_filename,false) ) {
emit log(LOGERR,"Failed to connect to ini file" + _filename);
emit log(LOGERR,tr("Failed to connect to ini file") + _filename);
return;
}
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Loading ini File " + _filename + " ...");
coreWidget_->statusMessage( tr("Loading ini File ") + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED );
}
......@@ -663,8 +663,8 @@ void Core::openIniFile( QString _filename,
if ( ini.get_entry( tmpType, sectionName , "type" )) {
type = DataType(tmpType);
emit log(LOGWARN, "This ini file uses old int style ObjectType fields!" );
emit log(LOGWARN, "Please convert it to new format! ( ... just save it )" );
emit log(LOGWARN, tr("This ini file uses old int style ObjectType fields!") );
emit log(LOGWARN, tr("Please convert it to new format! ( ... just save it )") );
} else {
QString typeName="";
......@@ -672,14 +672,14 @@ void Core::openIniFile( QString _filename,
if ( ini.get_entry( typeName, sectionName , "type" )) {
type = typeId(typeName);
} else
emit log(LOGWARN, "Unable to get DataType for object " + sectionName + " assuming Triangle Mesh" );
emit log(LOGWARN, tr("Unable to get DataType for object ") + sectionName + tr(" assuming Triangle Mesh") );
}
int newObjectId = loadObject(type, path);
BaseObject* object = objectRoot_->childExists( newObjectId );
if ( object == 0 ) {
emit log(LOGERR,"Unable to open Object " + path);
emit log(LOGERR,tr("Unable to open Object ") + path);
continue;
}
......@@ -714,7 +714,7 @@ void Core::openIniFile( QString _filename,
coreWidget_->examiner_widgets_[i]->viewAll();
}
coreWidget_->statusMessage( "Loading ini File " + _filename + " ... Done", 4000);
coreWidget_->statusMessage( tr("Loading ini File ") + _filename + tr(" ... Done"), 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
......@@ -730,12 +730,12 @@ void Core::writeIniFile(QString _filename,
INIFile ini;
if ( ! ini.connect(_filename,true) ) {
emit log(LOGERR,"Failed to connect to _ini file" + _filename);
emit log(LOGERR,tr("Failed to connect to _ini file") + _filename);
return;
}
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving ini File " + _filename + " ...");
coreWidget_->statusMessage( tr("Saving ini File ") + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED );
}
......@@ -796,7 +796,7 @@ void Core::writeIniFile(QString _filename,
ini.disconnect();
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving ini File " + _filename + " ... Done", 4000);
coreWidget_->statusMessage( tr("Saving ini File ") + _filename + tr(" ... Done"), 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
}
......
......@@ -76,13 +76,13 @@ void Core::openObjFile(QString _filename)
if (!in)
{
emit log(LOGERR,"Cannot open to obj file" + _filename);
emit log(LOGERR,tr("Cannot open to obj file") + _filename);
return;
}
if ( OpenFlipper::Options::gui() )
{
coreWidget_->statusMessage( "Loading obj File " + _filename + " ...");
coreWidget_->statusMessage( tr("Loading obj File ") + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED );
}
......@@ -129,7 +129,7 @@ void Core::openObjFile(QString _filename)
if ( OpenFlipper::Options::gui() )
{
coreWidget_->statusMessage( "Loading obj File " + _filename + " ... done", 4000);
coreWidget_->statusMessage( tr("Loading obj File ") + _filename + tr(" ... done"), 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
......@@ -168,7 +168,7 @@ void Core::preprocessObjFile(QString _filename)
std::fstream in(fname.c_str(), std::ios_base::in);
if (!in)
{
emit log(LOGERR,"Cannot open to obj file" + _filename);
emit log(LOGERR,tr("Cannot open to obj file") + _filename);
return;
}
......@@ -249,7 +249,7 @@ void Core::preprocessObjFile(QString _filename)
if (!typeFound)
{
dataType = DATA_TRIANGLE_MESH;
emit log(LOGWARN, "Unable to get DataType for object " + _filename + " - assuming Triangle Mesh" );
emit log(LOGWARN, tr("Unable to get DataType for object ") + _filename + tr(" - assuming Triangle Mesh") );
}
......@@ -269,7 +269,7 @@ void Core::preprocessObjFile(QString _filename)
BaseObject* object = objectRoot_->childExists( newObjectId );
if ( object == 0 )
emit log(LOGERR,"Unable to open Object " + path);
emit log(LOGERR,tr("Unable to open Object ") + path);
if ( newActiveObject )
emit objectSelectionChanged(-1);
......@@ -285,14 +285,14 @@ void Core::writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly
std::fstream out(fname.c_str(), std::ios_base::out);
if (!out)
{
emit log(LOGERR,"Cannot open to obj file" + _filename);
emit log(LOGERR,tr("Cannot open to obj file") + _filename);
return;
}
if ( OpenFlipper::Options::gui() )
{
coreWidget_->statusMessage( "Saving obj File " + _filename + " ...");
coreWidget_->statusMessage( tr("Saving obj File ") + _filename + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED );
}
......@@ -327,7 +327,7 @@ void Core::writeObjFile(QString _filename, bool _relativePaths, bool _targetOnly
if ( OpenFlipper::Options::gui() )
{
coreWidget_->statusMessage( "Saving obj File " + _filename + " ... done", 4000);
coreWidget_->statusMessage( tr("Saving obj File ") + _filename + tr(" ... done"), 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
......
......@@ -75,11 +75,11 @@ void Core::slotObjectUpdated(int _identifier) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + " ) called by " +
emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
} else {
emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + " ) called by Core" );
emit log(LOGINFO,"updatedObject( " + QString::number(_identifier) + tr(" ) called by Core") );
}
}
......@@ -90,7 +90,7 @@ void Core::slotObjectUpdated(int _identifier) {
BaseObject* object = 0;
if ( _identifier != -1 ) {
if ( !PluginFunctions::getObject(_identifier,object) ) {
emit log(LOGERR,"updated_objects called for non existing object with id : " + QString::number(_identifier) );
emit log(LOGERR,tr("updated_objects called for non existing object with id : ") + QString::number(_identifier) );
return;
}
}
......@@ -189,7 +189,7 @@ void Core::slotUpdateTexture( QString _name , int _identifier){
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotUpdateTexture( " + _name + " , " + QString::number(_identifier) + " ) called by " +
emit log(LOGINFO,"slotUpdateTexture( " + _name + " , " + QString::number(_identifier) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
}
......@@ -218,7 +218,7 @@ void Core::slotSetTextureMode(QString _textureName, QString _mode, int _id) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " , " + QString::number(_id) + " ) called by " +
emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " , " + QString::number(_id) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
}
......@@ -235,7 +235,7 @@ void Core::slotSetTextureMode(QString _textureName ,QString _mode) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + " ) called by " +
emit log(LOGINFO,"slotSetTextureMode( " + _textureName + " , " + _mode + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
}
......@@ -251,7 +251,7 @@ void Core::slotTextureUpdated( QString _textureName , int _identifier ) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotTextureUpdated( " + _textureName + " , " + QString::number(_identifier) + " ) called by " +
emit log(LOGINFO,"slotTextureUpdated( " + _textureName + " , " + QString::number(_identifier) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
}
......
This diff is collapsed.
......@@ -104,14 +104,14 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes
if ( plugin == -1 ) {
_success = false;
emit log(LOGERR, "Unable to call function from Plugin : " + _pluginName + " ( Plugin not Found! )");
emit log(LOGERR, tr("Unable to call function from Plugin : ") + _pluginName + tr(" ( Plugin not Found! )"));
return;
}
if ( !plugins[plugin].rpcFunctions.contains(_functionName) ) {
_success = false;
emit log(LOGERR, "Unable to call function from Plugin : " + _pluginName);
emit log(LOGERR, "Function " + _functionName + " not found!");
emit log(LOGERR, tr("Unable to call function from Plugin : ") + _pluginName);
emit log(LOGERR, tr("Function ") + _functionName + tr(" not found!"));
return;
}
......@@ -120,7 +120,7 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes
_success = false;
QScriptValue result = scriptEngine_.uncaughtException();
QString exception = result.toString();
emit log( LOGERR , "RPC failed with : " + exception );
emit log( LOGERR , tr("RPC failed with : ") + exception );
return;
}
......@@ -135,7 +135,7 @@ void Core::slotCall( QString _expression , bool& _success ) {
_success = false;
QScriptValue result = scriptEngine_.uncaughtException();
QString exception = result.toString();
emit log( LOGERR , "RPC failed with : " + exception );
emit log( LOGERR , tr("RPC failed with : ") + exception );
return;
}
......
......@@ -112,7 +112,7 @@ void Core::slotExecuteAfterStartup() {
bool scriptingSupport = false;
slotPluginExists("scripting",scriptingSupport);
if ( ! scriptingSupport ) {
emit log(LOGERR ,"No scripting support available, please check if we load a scripting plugin .. Skipping script execution on startup");
emit log(LOGERR ,tr("No scripting support available, please check if we load a scripting plugin .. Skipping script execution on startup"));
}
// Collect all script files from the scripting subdirectory and execute them if possible
......@@ -169,7 +169,7 @@ int Core::loadObject ( QString _filename ) {
return -2;
} else
if (_filename.endsWith(".ofs")) {
emit log(LOGINFO ,"Starting script execution of " + _filename);
emit log(LOGINFO ,tr("Starting script execution of ") + _filename);
emit executeFileScript(_filename);
} else
return loadObject( DATA_TRIANGLE_MESH, _filename);
......@@ -188,7 +188,7 @@ int Core::loadObject( DataType _type, QString _filename) {
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Loading " + _filename + " ...");
coreWidget_->statusMessage( tr("Loading ") + _filename + " ...");
if ( !OpenFlipper::Options::loadingSettings() )
coreWidget_->setStatus(ApplicationStatus::PROCESSING );
}
......@@ -198,9 +198,9 @@ int Core::loadObject( DataType _type, QString _filename) {
if ( OpenFlipper::Options::gui() ) {
if ( id != -1 )
coreWidget_->statusMessage( "Loading " + _filename + " ... done", 4000 );
coreWidget_->statusMessage( tr("Loading ") + _filename + tr(" ... done"), 4000 );
else
coreWidget_->statusMessage( "Loading " + _filename + " ... failed!", 4000 );
coreWidget_->statusMessage( tr("Loading ") + _filename + tr(" ... failed!"), 4000 );
if ( !OpenFlipper::Options::loadingSettings() )
coreWidget_->setStatus(ApplicationStatus::READY );
......@@ -232,7 +232,7 @@ void Core::slotAddEmptyObject( DataType _type , int& _id ) {
void Core::slotCopyObject( int _oldId , int& _newId ) {
if ( _oldId == -1 ) {
emit log(LOGERR,"Requested copy for illegal Object id : " + QString::number(_oldId) );
emit log(LOGERR,tr("Requested copy for illegal Object id : ") + QString::number(_oldId) );
_newId = -1;
return;
}
......@@ -241,7 +241,7 @@ void Core::slotCopyObject( int _oldId , int& _newId ) {
BaseObject* object = objectRoot_->childExists(_oldId);
if ( !object ) {
emit log(LOGERR,"Requested copy for unknown Object id : " + QString::number(_oldId) );
emit log(LOGERR,tr("Requested copy for unknown Object id : ") + QString::number(_oldId) );
_newId = -1;
return ;
}
......@@ -250,7 +250,7 @@ void Core::slotCopyObject( int _oldId , int& _newId ) {
BaseObject* copy = object->copy();
if ( copy == 0 ) {
emit log(LOGERR,"Unable to create a copy of the object.");
emit log(LOGERR,tr("Unable to create a copy of the object."));
return;
}
......@@ -287,11 +287,11 @@ void Core::slotObjectOpened ( int _id ) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotObjectOpened( " + QString::number(_id) + " ) called by " +
emit log(LOGINFO,tr("slotObjectOpened( ") + QString::number(_id) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
} else {
emit log(LOGINFO,"slotObjectOpened( " + QString::number(_id) + " ) called by Core" );
emit log(LOGINFO,tr("slotObjectOpened( ") + QString::number(_id) + tr(" ) called by Core") );
}
}
......@@ -390,11 +390,11 @@ void Core::slotEmptyObjectAdded ( int _id ) {
if ( OpenFlipper::Options::doSlotDebugging() ) {
if ( sender() != 0 ) {
if ( sender()->metaObject() != 0 ) {
emit log(LOGINFO,"slotEmptyObjectAdded( " + QString::number(_id) + " ) called by " +
emit log(LOGINFO,tr("slotEmptyObjectAdded( ") + QString::number(_id) + tr(" ) called by ") +
QString( sender()->metaObject()->className() ) );
}
} else {
emit log(LOGINFO,"slotEmptyObjectAdded( " + QString::number(_id) + " ) called by Core" );
emit log(LOGINFO,tr("slotEmptyObjectAdded( ") + QString::number(_id) + tr(" ) called by Core") );
}
}
......@@ -437,7 +437,7 @@ void Core::slotAddEmptyObjectMenu() {
}
widget->show();
}else
emit log(LOGERR,"Could not show 'add Empty' dialog. Missing file-plugins.");
emit log(LOGERR,tr("Could not show 'add Empty' dialog. Missing file-plugins."));
}
//========================================================================================
......@@ -462,7 +462,7 @@ void Core::loadObject() {
delete widget;
}else
emit log(LOGERR,"Could not show 'load objects' dialog. Missing file-plugins.");
emit log(LOGERR,tr("Could not show 'load objects' dialog. Missing file-plugins."));
}
}
......@@ -488,22 +488,22 @@ void Core::loadSettings(){
QGroupBox* optionsBox = new QGroupBox( &fileDialog ) ;
optionsBox->setSizePolicy( QSizePolicy ( QSizePolicy::Expanding , QSizePolicy::Preferred ) );
optionsBox->setTitle("Options");
optionsBox->setTitle(tr("Options"));
layout->addWidget( optionsBox, layout->rowCount() , 0 , 1,layout->columnCount() );
QCheckBox *loadProgramSettings = new QCheckBox(optionsBox);
loadProgramSettings->setText("Load program settings");
loadProgramSettings->setToolTip("Load all current program settings from the file ( This will include view settings, colors,...) ");
loadProgramSettings->setText(tr("Load program settings"));
loadProgramSettings->setToolTip(tr("Load all current program settings from the file ( This will include view settings, colors,...) "));
loadProgramSettings->setCheckState( Qt::Unchecked );
QCheckBox *loadPluginSettings = new QCheckBox(optionsBox);
loadPluginSettings->setText("Load per Plugin Settings");
loadPluginSettings->setToolTip("Plugins should load their current global settings from the file");
loadPluginSettings->setText(tr("Load per Plugin Settings"));
loadPluginSettings->setToolTip(tr("Plugins should load their current global settings from the file"));
loadPluginSettings->setCheckState( Qt::Checked );
QCheckBox *loadObjectInfo = new QCheckBox(optionsBox);
loadObjectInfo->setText("Load all objects defined in the file");
loadObjectInfo->setToolTip("Load all objects which are defined in the file");
loadObjectInfo->setText(tr("Load all objects defined in the file"));
loadObjectInfo->setToolTip(tr("Load all objects which are defined in the file"));
loadObjectInfo->setCheckState( Qt::Checked );
QBoxLayout* frameLayout = new QBoxLayout(QBoxLayout::TopToBottom,optionsBox);
......
......@@ -159,10 +159,10 @@ void Core::saveOptions(){
INIFile ini;
if ( ! ini.connect( inifile ,false) ) {
emit log(LOGERR,"Failed to connect to users ini file");
emit log(LOGERR,tr("Failed to connect to users ini file"));
if ( ! ini.connect( inifile,true) ) {
emit log(LOGERR,"Can not create user ini file");
emit log(LOGERR,tr("Can not create user ini file"));
} else {
writeApplicationOptions(ini);
ini.disconnect();
......@@ -179,10 +179,10 @@ void Core::setupOptions() {
QDir configDir = QDir::home();
if ( ! configDir.cd(".OpenFlipper") ) {
emit log(LOGOUT,"Creating config Dir ~/.OpenFlipper");
emit log(LOGOUT,tr("Creating config Dir ~/.OpenFlipper"));
configDir.mkdir(".OpenFlipper");
if ( ! configDir.cd(".OpenFlipper") ) {
emit log(LOGERR,"Unable to create config dir ~/.OpenFlipper");
emit log(LOGERR,tr("Unable to create config dir ~/.OpenFlipper"));
return;
}
}
......@@ -341,7 +341,7 @@ void Core::setupOptions() {
INIFile _ini;
if ( ! _ini.connect(optionFiles[i],false) ) {
emit log(LOGERR,"Failed to connect to _ini file" + optionFiles[i]);
emit log(LOGERR,tr("Failed to connect to _ini file") + optionFiles[i]);
continue;
}
......@@ -384,7 +384,7 @@ void Core::restoreKeyBindings(){
INIFile _ini;
if ( ! _ini.connect(optionFiles[i],false) ) {
emit log(LOGERR,"Failed to connect to _ini file" + optionFiles[i]);
emit log(LOGERR,tr("Failed to connect to _ini file") + optionFiles[i]);
continue;
}
......
......@@ -64,7 +64,7 @@ bool Core::saveObject( int _id, QString _filename ) {
if (object->dataType() == supportedTypes_[i].type) {
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving " + _filename + " ...");
coreWidget_->statusMessage( tr("Saving ") + _filename + " ...");
if ( !OpenFlipper::Options::savingSettings() )
coreWidget_->setStatus(ApplicationStatus::PROCESSING );
}
......@@ -74,9 +74,9 @@ bool Core::saveObject( int _id, QString _filename ) {
if ( OpenFlipper::Options::gui() ) {
if (ok)
coreWidget_->statusMessage( "Saving " + _filename + " ... done", 4000 );
coreWidget_->statusMessage( tr("Saving ") + _filename + tr(" ... done"), 4000 );
else
coreWidget_->statusMessage( "Saving " + _filename + " ... failed!", 4000 );
coreWidget_->statusMessage( tr("Saving ") + _filename + tr(" ... failed!"), 4000 );
if ( !OpenFlipper::Options::savingSettings() )
coreWidget_->setStatus(ApplicationStatus::READY );
......@@ -92,7 +92,7 @@ bool Core::saveObject( int _id, QString _filename ) {
// no plugin found
if ( OpenFlipper::Options::gui() )
coreWidget_->statusMessage( "Saving " + _filename + " ... failed!", 4000 );
coreWidget_->statusMessage( tr("Saving ") + _filename + tr(" ... failed!"), 4000 );
return false;
}
......@@ -120,7 +120,7 @@ bool Core::saveObjectTo( int _id, QString _filename ) {
if (supportedTypes_.size() != 0)
result = widget->showSave(_id,_filename);
else
emit log(LOGERR,"Could not show 'save objects' dialog. Missing file-plugins.");
emit log(LOGERR,tr("Could not show 'save objects' dialog. Missing file-plugins."));
widget->disconnect();
delete widget;
......@@ -168,7 +168,7 @@ void Core::saveAllObjectsTo(){
saveObjectTo(o_it->id(),filename);
}
}else
emit log(LOGERR,"Could not show 'save objects' dialog. Missing file-plugins.");
emit log(LOGERR,tr("Could not show 'save objects' dialog. Missing file-plugins."));
}
}
......
......@@ -75,37 +75,37 @@ void Core::saveSettings(){
QGroupBox* optionsBox = new QGroupBox( &fileDialog ) ;
optionsBox->setSizePolicy( QSizePolicy ( QSizePolicy::Expanding , QSizePolicy::Preferred ) );
optionsBox->setTitle("Options");
optionsBox->setTitle(tr("Options"));
layout->addWidget( optionsBox, layout->rowCount() , 0 , 1,layout->columnCount() );
QCheckBox *saveProgramSettings = new QCheckBox(optionsBox);
saveProgramSettings->setText("Save program settings");
saveProgramSettings->setToolTip("Save all current program settings to the file ( This will include view settings, colors,...) ");
saveProgramSettings->setText(tr("Save program settings"));
saveProgramSettings->setToolTip(tr("Save all current program settings to the file ( This will include view settings, colors,...) "));
saveProgramSettings->setCheckState( Qt::Unchecked );
QCheckBox *savePluginSettings = new QCheckBox(optionsBox);
savePluginSettings->setText("Save per Plugin Settings");
savePluginSettings->setToolTip("Plugins should add their current global settings to the file");
savePluginSettings->setText(tr("Save per Plugin Settings"));
savePluginSettings->setToolTip(tr("Plugins should add their current global settings to the file"));
savePluginSettings->setCheckState( Qt::Checked );
QCheckBox *saveObjectInfo = new QCheckBox(optionsBox);
saveObjectInfo->setText("Save open object information to the file");
saveObjectInfo->setToolTip("Save all open Objects and add them to the settings file ( they will be loaded if opening the settings file");
saveObjectInfo->setText(tr("Save open object information to the file"));
saveObjectInfo->setToolTip(tr("Save all open Objects and add them to the settings file ( they will be loaded if opening the settings file"));
saveObjectInfo->setCheckState( Qt::Checked );
QCheckBox *saveAllBox = new QCheckBox(optionsBox);
saveAllBox->setText("Save everything to same folder");
saveAllBox->setToolTip("Save all open files to the same folder as the ini file");
saveAllBox->setText(tr("Save everything to same folder"));
saveAllBox->setToolTip(tr("Save all open files to the same folder as the ini file"));
saveAllBox->setCheckState( Qt::Checked );
QCheckBox *askOverwrite = new QCheckBox(optionsBox);
askOverwrite->setText("Ask before overwriting files");
askOverwrite->setToolTip("If a file exists you will get asked what to do");
askOverwrite->setText(tr("Ask before overwriting files"));
askOverwrite->setToolTip(tr("If a file exists you will get asked what to do"));
askOverwrite->setCheckState( Qt::Checked );
QCheckBox *targetOnly = new QCheckBox(optionsBox);
targetOnly->setText("Save only target objects");
targetOnly->setToolTip("Only objects with target flag will be handled");
targetOnly->setText(tr("Save only target objects"));
targetOnly->setToolTip(tr("Only objects with target flag will be handled"));
targetOnly->setCheckState( Qt::Unchecked );
QBoxLayout* frameLayout = new QBoxLayout(QBoxLayout::TopToBottom,optionsBox);
......@@ -140,7 +140,7 @@ void Core::saveSettings(){
if ( !complete_name.endsWith(".ini", Qt::CaseInsensitive) && !complete_name.endsWith(".obj", Qt::CaseInsensitive) ){
// If its unknown, get the type from the currently selected filter and add this extension to the filename
if ( fileDialog.selectedNameFilter().contains("INI files (*.ini)") )
if ( fileDialog.selectedNameFilter().contains(tr("INI files (*.ini)")) )
complete_name += ".ini";
else
complete_name += ".obj";
......@@ -157,7 +157,7 @@ void Core::saveSettings(){
OpenFlipper::Options::savingSettings(true);
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving Settings to " + complete_name + " ...");
coreWidget_->statusMessage( tr("Saving Settings to ") + complete_name + " ...");
coreWidget_->setStatus(ApplicationStatus::BLOCKED );
}
......@@ -245,7 +245,7 @@ void Core::saveSettings(){
OpenFlipper::Options::savingSettings(false);
if ( OpenFlipper::Options::gui() ) {
coreWidget_->statusMessage( "Saving Settings to " + complete_name + " ... Done", 4000);
coreWidget_->statusMessage( tr("Saving Settings to ") + complete_name + tr(" ... Done"), 4000);
coreWidget_->setStatus(ApplicationStatus::READY );
}
......
......@@ -86,7 +86,7 @@ void Core::createWidget(QString _objectName, QString _uiFilename) {
QFile uiFile(_uiFilename);
if ( !uiFile.exists() ) {
emit log(LOGERR,"File does not exist : " + _uiFilename );
emit log(LOGERR,tr("File does not exist : ") + _uiFilename );
return;
}
......@@ -95,14 +95,14 @@ void Core::createWidget(QString _objectName, QString _uiFilename) {
uiFile.close();
if ( ui == 0 ) {
emit log(LOGERR,"Unable to create QWidget from ui file for " + _objectName );
emit log(LOGERR,tr("Unable to create QWidget from ui file for ") + _objectName );
return;
}
QScriptValue scriptUi = scriptEngine_.newQObject(ui, QScriptEngine::ScriptOwnership);
if ( !scriptUi.isValid() ) {
emit log(LOGERR,"Unable to generate script interface for " + _objectName );
emit log(LOGERR,tr("Unable to generate script interface for ") + _objectName );
return;
}
......
......@@ -268,7 +268,7 @@ bool LicenseManager::authenticate() {
if ( elements.size() != 6 ) {
QString sizeMismatchMessage = "The license file for plugin \"" + name() + "\" is invalid!";
QMessageBox::critical(0,"License file size invalid",sizeMismatchMessage );
QMessageBox::critical(0,tr("License file size invalid"),sizeMismatchMessage );
} else {
// Check signature of license file
......@@ -279,23 +279,23 @@ bool LicenseManager::authenticate() {
QDate expiryDate = QDate::fromString(elements[4],Qt::ISODate);
if ( licenseHash != elements[5] ) {
QString signatureMismatchMessage = "The license file signature for plugin \"" + name() + "\" is invalid!";
QMessageBox::critical(0,"License file signature invalid",signatureMismatchMessage );
QString signatureMismatchMessage = tr("The license file signature for plugin \"") + name() + tr("\" is invalid!");
QMessageBox::critical(0,tr("License file signature invalid"),signatureMismatchMessage );
} else if ( elements[0] != pluginFileName() ) {
QString nameMismatchMessage = "The license file contains plugin name\"" + elements[0] + "\" but this is plugin \"" + name() + "\"!";
QMessageBox::critical(0,"License invalid for this plugin",nameMismatchMessage );
QString nameMismatchMessage = tr("The license file contains plugin name\"") + elements[0] + tr("\" but this is plugin \"") + name() + "\"!";
QMessageBox::critical(0,tr("License invalid for this plugin"),nameMismatchMessage );
} else if ( elements[1] != coreHash ) {
QString coreMismatchMessage = "The license file for plugin \"" + name() + "\" is invalid for the currently running OpenFlipper Core!";
QMessageBox::critical(0,"License invalid for current core",coreMismatchMessage );
QString coreMismatchMessage = tr("The license file for plugin \"") + name() + tr("\" is invalid for the currently running OpenFlipper Core!");
QMessageBox::critical(0,tr("License invalid for current core"),coreMismatchMessage );
} else if ( elements[2] != pluginHash ) {
QString pluginMismatchMessage = "The plugin \"" + name() + "\" is a different version than specified in license file!";
QMessageBox::critical(0,"License invalid for this plugin",pluginMismatchMessage );
QString pluginMismatchMessage = tr("The plugin \"") + name() + tr("\" is a different version than specified in license file!");
QMessageBox::critical(0,tr("License invalid for this plugin"),pluginMismatchMessage );
} else if ( elements[3] != macHash ) {
QString hardwareMismatchMessage = "The plugin \"" + name() + "\" is not allowed to run on the current system (Changed Hardware?)!";
QMessageBox::critical(0,"License invalid for current System",hardwareMismatchMessage );
QMessageBox::critical(0,tr("License invalid for current System"),hardwareMismatchMessage );
} else if ( currentDate > expiryDate ) {
QString expiredMessage = "The license for plugin \"" + name() + "\" has expired on " + elements[1] + "!";
QMessageBox::critical(0,"License expired",expiredMessage );
QString expiredMessage = tr("The license for plugin \"") + name() + tr("\" has expired on ") + elements[1] + "!";
QMessageBox::critical(0,tr("License expired"),expiredMessage );
} else {
authenticated_ = true;
}
......@@ -305,9 +305,9 @@ bool LicenseManager::authenticate() {
if ( authenticated_ )
std::cerr << "Authentication succcessfull for Plugin " << name().toStdString() << std::endl;
else {
QString text = "License check for plugin has failed.\n";
text += "Please get a valid License!\n";
text += "Send the following Information to " + CONTACTMAIL + "\n\n";
QString text = tr("License check for plugin has failed.\n");
text += tr("Please get a valid License!\n");
text += tr("Send the following Information to ") + CONTACTMAIL + "\n\n";
text += pluginFileName() +"\n";
text += coreHash +"\n";
text += pluginHash +"\n";
......@@ -317,7 +317,7 @@ bool LicenseManager::authenticate() {
QString requestSig = QCryptographicHash::hash ( keyRequest.toAscii() , QCryptographicHash::Sha1 ).toHex();
text += requestSig + "\n";
QMessageBox::warning ( 0, "Plugin License check failed", text );
QMessageBox::warning ( 0, tr("Plugin License check failed"), text );
std::cerr << "Authentication failed" << std::endl;
authenticated_ = false;
}
......
......@@ -69,7 +69,7 @@ void KeyGenWidget::slotGenerateButton() {
QStringList data = inputData.split('\n',QString::SkipEmptyParts);
if ( data.size() != 5) {
QMessageBox::critical(this,"Wrong request data","The request has to contain 5 lines of data");
QMessageBox::critical(this,tr("Wrong request data","The request has to contain 5 lines of data"));
} else {
// Clean strings
......@@ -98,7 +98,7 @@ void KeyGenWidget::slotGenerateButton() {
QString requestSigCheck = QCryptographicHash::hash ( keyRequest.toAscii() , QCryptographicHash::Sha1 ).toHex();
if ( requestSig != requestSigCheck ) {
QMessageBox::critical(this,"Signature of request invalid","The signature of the request is not valid");
QMessageBox::critical(this,tr("Signature of request invalid","The signature of the request is not valid"));
return;
}
......@@ -106,7 +106,7 @@ void KeyGenWidget::slotGenerateButton() {
QFile outFile(name + ".lic");
if (!outFile.open(QIODevice::WriteOnly|QIODevice::Text)) {
QMessageBox::critical(this,"Unable to open file","Unable to Open output File");
QMessageBox::critical(this,tr("Unable to open file","Unable to Open output File"));
return;
}
......
......@@ -69,10 +69,10 @@ void CoreWidget::showAboutWidget( ) {
if ( aboutWidget_ == 0 ) {
aboutWidget_ = new AboutWidget( this );
aboutWidget_->OpenFlipperAbout->append("OpenFlipper Core Version: " + OpenFlipper::Options::coreVersion() );
aboutWidget_->OpenFlipperAbout->append(tr("OpenFlipper Core Version: ") + OpenFlipper::Options::coreVersion() ) ;
aboutWidget_->OpenFlipperAbout->append("\n");
aboutWidget_->OpenFlipperAbout->append("OpenFlipper Directories:");
aboutWidget_->OpenFlipperAbout->append(tr("OpenFlipper Directories:"));
// Set the Path to the shaders
QDir tempDir = QDir(OpenFlipper::Options::applicationDir());
#ifdef OPENFLIPPER_DATADIR
......@@ -87,38 +87,38 @@ void CoreWidget::showAboutWidget( ) {
aboutWidget_->OpenFlipperAbout->append("Help:\t" + OpenFlipper::Options::helpDirStr() );
aboutWidget_->OpenFlipperAbout->append("\n");