Changed: #841 Change the wrong header in the source code

This commit is contained in:
kervala 2010-07-10 16:13:31 +02:00
parent d49ff11325
commit fb3d4f7a19
10 changed files with 242 additions and 84 deletions

View file

@ -1,3 +1,18 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nel/misc/types_nl.h>
#include "browser_model.h"
@ -130,7 +145,7 @@ bool TileInfo::Load (int index, std::vector<NLMISC::CBGRA>* Alpha)
if ( !loadPixmapBuffer( path, Bits, Alpha, 0))
{
bRes=false;
QMessageBox::information( NULL, "Can't load Diffuse file", QString( (path.c_str()) ));
QMessageBox::information( NULL, QObject::tr("Can't load Diffuse file"), QString( (path.c_str()) ));
}
else
@ -142,7 +157,7 @@ bool TileInfo::Load (int index, std::vector<NLMISC::CBGRA>* Alpha)
if (!loadPixmapBuffer( nightPath, nightBits, Alpha, 0))
{
bRes=false;
QMessageBox::information( NULL, "Can't load Additive file", QString( nightPath.c_str() ) );
QMessageBox::information( NULL, QObject::tr("Can't load Additive file"), QString( nightPath.c_str() ) );
}
else
nightLoaded=1;
@ -153,7 +168,7 @@ bool TileInfo::Load (int index, std::vector<NLMISC::CBGRA>* Alpha)
if (!loadPixmapBuffer( alphaPath, alphaBits, NULL, tileBankBrowser.getTile (index)->getRotAlpha ()))
{
bRes=false;
QMessageBox::information( NULL, "Can't load Alpha file", QString( alphaPath.c_str() ) );
QMessageBox::information( NULL, QObject::tr("Can't load Alpha file"), QString( alphaPath.c_str() ) );
}
else
@ -273,7 +288,7 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No));
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No));
}
else
{
@ -290,8 +305,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm
if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ())
{
QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) );
QString pixelMessage = QObject::tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -318,8 +333,8 @@ bool TileList::setTile128 (int tile, const std::string& name, NL3D::CTile::TBitm
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
}
return true;
@ -336,7 +351,7 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
@ -354,8 +369,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
error=tileBankBrowser.getTileSet(_tileSet)->checkTile256 (type, border, pixel, composante);
if ((error!=CTileSet::ok)&&!zouille())
{
QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) );
QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -379,8 +394,8 @@ bool TileList::setTile256 (int tile, const std::string& name, NL3D::CTile::TBitm
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No));
}
return true;
@ -400,7 +415,7 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap."), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -416,8 +431,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
error=tileBankBrowser.getTileSet(_tileSet)->checkTile128 (type, border, pixel, composante);
if ((error!=CTileSet::ok)&&(error!=CTileSet::addFirstA128128)&&!zouille ())
{
QString pixelMessage = QString("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) );
QString pixelMessage = tr("%1\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -443,8 +458,8 @@ bool TileList::setTileTransition (int tile, const std::string& name, NL3D::CTile
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
}
return true;
@ -462,7 +477,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap.", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -470,7 +485,7 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
if ( (Width!=32) || (Height!=32) )
{
// Error message
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't set Bitmap"), QString( (troncated+"\nInvalid size: displacement map must be 32x32 8 bits.\nContinue ?").c_str()), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -487,8 +502,8 @@ bool TileList::setDisplacement (int tile, const std::string& name, NL3D::CTile::
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
QString notInAbsolutePathMessage = tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
}
return true;
@ -505,7 +520,7 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro
uint Height;
if (!PIC_LoadPic(tileBankBrowser.getAbsPath ()+troncated, tampon, Width, Height))
{
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't load bitmap", QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, tr("Can't load bitmap"), QString( ((tileBankBrowser.getAbsPath ()+troncated)+"\nContinue ?").c_str() ), QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -533,15 +548,15 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro
||(error==CTileSet::topInterfaceProblem))
{
if (indexError!=-1)
pixelMessage = QString("%1.\nIncompatible with tile nb %4.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]).arg(indexError);
pixelMessage = QObject::tr("%1.\nIncompatible with tile nb %4.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]).arg(indexError);
else
pixelMessage = QString("%1.\nIncompatible with the 128x128 tile.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
pixelMessage = QObject::tr("%1.\nIncompatible with the 128x128 tile.\nPixel: %2(%3).\nContinue ?").arg(CTileSet::getErrorMessage (error)).arg(pixel).arg(comp[composante]);
}
else
pixelMessage = QString("%1.\nIncompatible filled tile.\nContinue ?").arg(CTileSet::getErrorMessage (error));
pixelMessage = QObject::tr("%1.\nIncompatible filled tile.\nContinue ?").arg(CTileSet::getErrorMessage (error));
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Can't set Bitmap", pixelMessage, QMessageBox::Yes | QMessageBox::No) );
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Can't set Bitmap"), pixelMessage, QMessageBox::Yes | QMessageBox::No) );
}
else
{
@ -554,8 +569,8 @@ bool TileList::setTileTransitionAlpha (int tile, const std::string& name, int ro
else
{
// Error: bitmap not in the absolute path..
QString notInAbsolutePathMessage = QString("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, "Load error", notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
QString notInAbsolutePathMessage = QObject::tr("The bitmap %1 is not in the absolute path %2.\nContinue ?").arg(name.c_str()).arg(tileBankBrowser.getAbsPath ().c_str());
return ( QMessageBox::Yes == QMessageBox::question( NULL, QObject::tr("Load error"), notInAbsolutePathMessage, QMessageBox::Yes | QMessageBox::No) );
}
return true;

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtGui/QListWidgetItem>
@ -390,7 +406,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , tr("Targa Bitmap (*.tga);;PNG Image (*.png);;All Files (*.*);;"), &selectedFilter, options);
QFileInfo fi(fileName);
QString baseName = fi.baseName() ;
@ -402,7 +418,7 @@ void CTile_browser_dlg::on_batchLoadPushButton_clicked()
//TODO titegus: What's the point in asking for rotation if Texture != Alpha ???
bool rotate = (QMessageBox::Yes == QMessageBox::question(this, "Import rotated tiles", "Do you want to use rotation to reuse alpha tiles ?", QMessageBox::Yes | QMessageBox::No ));
bool rotate = (QMessageBox::Yes == QMessageBox::question(this, tr("Import rotated tiles"), tr("Do you want to use rotation to reuse alpha tiles?"), QMessageBox::Yes | QMessageBox::No ));
for (int i=0; i<CTileSet::count; i++)
{
@ -491,7 +507,7 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked()
// Select a file
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getSaveFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getSaveFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
if (!fileName.isEmpty())
{
@ -547,8 +563,8 @@ void CTile_browser_dlg::on_exportBorderPushButton_clicked()
if (error)
{
// Error message
QString s = QString ("Can't write bitmap %1").arg(fileName);
QMessageBox::information (this, "Export border", s);
QString s = tr("Can't write bitmap %1").arg(fileName);
QMessageBox::information (this, tr("Export border"), s);
}
}
}
@ -562,7 +578,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, "Choose Bitmap", QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Bitmap"), QString(tileBankBrowser.getAbsPath().c_str()) , "Targa Bitmap(*.tga);;All Files (*.*);;", &selectedFilter, options);
if (!fileName.isEmpty())
{
@ -596,8 +612,8 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
if (error)
{
// Error message
QString s = QString ("Can't read bitmap %1").arg(fileName);
QMessageBox::information (this, "Import border", s);
QString s = tr("Can't read bitmap %1").arg(fileName);
QMessageBox::information (this, tr("Import border"), s);
}
// Get pixel
@ -620,8 +636,8 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
else
{
// Error message
QString s = QString ("The bitmap must have a size of 128x128 (%1)").arg(fileName);
QMessageBox::information (this, "Import border", s);
QString s = tr("The bitmap must have a size of 128x128 (%1)").arg(fileName);
QMessageBox::information (this, tr("Import border"), s);
}
// 256 or 128 ?
@ -630,7 +646,7 @@ void CTile_browser_dlg::on_importBorderPushButton_clicked()
tileBankBrowser.getTileSet (tileSetIndex)->setBorder ((CTile::TBitmap) tileTextureButtonGroup->checkedId(), border);
// Message
QMessageBox::information (this, "Import border", "The border has been changed.");
QMessageBox::information (this, tr("Import border"), tr("The border has been changed."));
}
}
@ -745,7 +761,7 @@ void CTile_browser_dlg::RefreshView()
image = image.scaled(tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1), tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1));
QString fileInfo = QString("%1").arg(p->getId());
QString fileInfo = QString::number(p->getId());
if (tileLabelButtonGroup->checkedId() == CTile_browser_dlg::FileName)
{
QFileInfo fi = QFileInfo(QString( tilePath.c_str()));
@ -761,7 +777,7 @@ void CTile_browser_dlg::RefreshView()
QString fileInfo;
if (tileLabelButtonGroup->checkedId() == CTile_browser_dlg::Index)
{
fileInfo = QString("%1").arg(p->getId());
fileInfo = QString::number(p->getId());
}
TileModel tile = TileModel(tileZoomButtonGroup->checkedId() * (tileTypeButtonGroup->checkedId()==_256x256 ? 2 : 1), fileInfo, p->getId());
tileViewModel->addTile(tile);
@ -785,7 +801,7 @@ void CTile_browser_dlg::LoadInThread(void)
void CTile_browser_dlg::closeEvent(QCloseEvent *event)
{
int reply = QMessageBox::question(this, "Quit", "Are you sure you want to Quit TileSet Edition without Saving?", QMessageBox::Yes | QMessageBox::No);
int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to Quit TileSet Edition without Saving?"), QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
event->accept();
@ -811,7 +827,7 @@ void CTile_browser_dlg::accept()
void CTile_browser_dlg::reject()
{
int reply = QMessageBox::question(this, "Quit", "Are you sure you want to Quit TileSet Edition without Saving?", QMessageBox::Yes | QMessageBox::No);
int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to Quit TileSet Edition without Saving?"), QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
QDialog::reject();

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TILE_BROWSERDLG_H
#define TILE_BROWSERDLG_H

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QString>
#include <QtGui/QListWidgetItem>
#include <QtGui/QMessageBox>
@ -78,12 +94,12 @@ void CTile_edit_dlg::on_landListWidget_itemSelectionChanged()
void CTile_edit_dlg::on_addLandPushButton_clicked()
{
bool ok;
QString text = QInputDialog::getText(this, "Add Land", "Enter land name:", QLineEdit::Normal, "", &ok);
QString text = QInputDialog::getText(this, tr("Add Land"), tr("Enter land name:"), QLineEdit::Normal, "", &ok);
if (ok && !text.isEmpty())
{
if (ui.landListWidget->findItems(text, Qt::MatchExactly).count() > 0)
{
QMessageBox::information( this, "Error Adding Land", "This name already exists" );
QMessageBox::information( this, tr("Error Adding Land"), tr("This name already exists") );
}
else
{
@ -110,7 +126,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked()
}
bool ok = false;
QStringList items = CItems_edit_dlg::getItems(this, "Edit Land", ui.landListWidget->item(nindex)->text(), availableTileSetList, landTileSetList, &ok);
QStringList items = CItems_edit_dlg::getItems(this, tr("Edit Land"), ui.landListWidget->item(nindex)->text(), availableTileSetList, landTileSetList, &ok);
if (ok)
{
@ -128,7 +144,7 @@ void CTile_edit_dlg::on_editLandPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Land Selected", "Please, select the Land to edit first ..." );
QMessageBox::information( this, tr("No Land Selected"), tr("Please, select the Land to edit first ...") );
}
}
@ -144,19 +160,19 @@ void CTile_edit_dlg::on_deleteLandPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Land Selected", "Please, select the Land to delete first ..." );
QMessageBox::information( this, tr("No Land Selected"), tr("Please, select the Land to delete first ...") );
}
}
void CTile_edit_dlg::on_addTileSetPushButton_clicked()
{
bool ok;
QString text = QInputDialog::getText(this, "Add Tile Set", "Enter Tile Set name:", QLineEdit::Normal, "", &ok);
QString text = QInputDialog::getText(this, tr("Add Tile Set"), tr("Enter Tile Set name:"), QLineEdit::Normal, "", &ok);
if (ok && !text.isEmpty())
{
if (ui.tileSetListWidget->findItems(text, Qt::MatchExactly).count() > 0)
{
QMessageBox::information( this, "Error Adding Tile Set", "This name already exists" );
QMessageBox::information( this, tr("Error Adding Tile Set"), tr("This name already exists") );
}
else
{
@ -182,7 +198,7 @@ void CTile_edit_dlg::on_editTileSetPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set to edit first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set to edit first ...") );
}
}
void CTile_edit_dlg::on_deleteTileSetPushButton_clicked()
@ -208,7 +224,7 @@ void CTile_edit_dlg::on_deleteTileSetPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set to delete first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set to delete first ...") );
}
}
void CTile_edit_dlg::on_chooseVegetPushButton_clicked()
@ -218,7 +234,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, "Choose Veget Set", ui.chooseVegetPushButton->text() , "NeL VegetSet Files (*.vegetset);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getOpenFileName(this, tr("Choose Veget Set"), ui.chooseVegetPushButton->text() , tr("NeL VegetSet Files (*.vegetset);;All Files (*.*);;"), &selectedFilter, options);
if (!fileName.isEmpty())
{
@ -229,7 +245,7 @@ void CTile_edit_dlg::on_chooseVegetPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
void CTile_edit_dlg::on_resetVegetPushButton_clicked()
@ -242,7 +258,7 @@ void CTile_edit_dlg::on_resetVegetPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
@ -262,7 +278,7 @@ void CTile_edit_dlg::on_surfaceDataLineEdit_textChanged()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
}
@ -278,7 +294,7 @@ void CTile_edit_dlg::on_orientedCheckBox_stateChanged ( int state )
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
}
@ -326,7 +342,7 @@ void CTile_edit_dlg::on_loadPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getOpenFileName(this, "Open Bank", ui.absolutePathPushButton->text() , "NeL tile bank files (*.bank);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Bank"), ui.absolutePathPushButton->text() , tr("NeL tile bank files (*.bank);;All Files (*.*);;"), &selectedFilter, options);
if (!fileName.isEmpty())
{
@ -374,20 +390,20 @@ void CTile_edit_dlg::on_savePushButton_clicked()
if ( stream.open( fullPath.c_str() ) )
{
tileBank.serial (stream);
QString s = QString("Bank %1 saved").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, "Bank Saved", s);
QString s = tr("Bank %1 saved").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, tr("Bank Saved"), s);
return;
}
}
QMessageBox::information(this, "Error", "Can't Save Bank, check the path");
QMessageBox::information(this, tr("Error"), tr("Can't Save Bank, check the path"));
}
void CTile_edit_dlg::on_saveAsPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getSaveFileName(this, "Save Bank", this->mainFile.absoluteFilePath(), "NeL tile bank files (*.bank);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getSaveFileName(this, tr("Save Bank"), this->mainFile.absoluteFilePath(), tr("NeL tile bank files (*.bank);;All Files (*.*);;"), &selectedFilter, options);
if (!fileName.isEmpty())
{
// Set MainFile
@ -402,13 +418,13 @@ void CTile_edit_dlg::on_saveAsPushButton_clicked()
if ( stream.open( fullPath.c_str() ) )
{
tileBank.serial (stream);
QString s = QString("Bank %1 saved").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, "Bank Saved", s);
QString s = tr("Bank %1 saved").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, tr("Bank Saved"), s);
return;
}
}
QMessageBox::information(this, "Error", "Can't Save Bank, check the path");
QMessageBox::information(this, tr("Error"), tr("Can't Save Bank, check the path"));
}
@ -419,7 +435,7 @@ void CTile_edit_dlg::on_exportPushButton_clicked()
{
QFileDialog::Options options;
QString selectedFilter;
QString fileName = QFileDialog::getSaveFileName(this, "Export Bank", this->mainFile.absolutePath() + QDir::separator() + "*.smallbank", "NeL tile small bank files (*.smallbank);;All Files (*.*);;", &selectedFilter, options);
QString fileName = QFileDialog::getSaveFileName(this, tr("Export Bank"), this->mainFile.absolutePath() + QDir::separator() + tr("*.smallbank"), tr("NeL tile small bank files (*.smallbank);;All Files (*.*);;"), &selectedFilter, options);
if (!fileName.isEmpty())
{
// Copy the bank
@ -436,13 +452,13 @@ void CTile_edit_dlg::on_exportPushButton_clicked()
if ( stream.open( fullPath.c_str() ) )
{
copy.serial (stream);
QString s = QString("Bank %1 exported").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, "Bank Saved", s);
QString s = tr("Bank %1 exported").arg( QString( fullPath.c_str() ) );
QMessageBox::information(this, tr("Bank Saved"), s);
return;
}
}
QMessageBox::information(this, "Error", "Can't Export the Bank, check the path");
QMessageBox::information(this, tr("Error"), tr("Can't Export the Bank, check the path"));
}
}
@ -450,7 +466,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
{
// Build the struct
QFileDialog::Options options = QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly;
QString directory = QFileDialog::getExistingDirectory(this, "Select the absolute base path of the bank", ui.absolutePathPushButton->text(), options);
QString directory = QFileDialog::getExistingDirectory(this, tr("Select the absolute base path of the bank"), ui.absolutePathPushButton->text(), options);
// Select the path
if (!directory.isEmpty())
@ -467,8 +483,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
//// Last check
QMessageBox::StandardButton reply;
QString confirmMessage = QString("Do you really want to set %1 as base path of the bank ?").arg(path);
reply = QMessageBox::question(this, "Confirm Path", confirmMessage, QMessageBox::Yes | QMessageBox::No);
QString confirmMessage = tr("Do you really want to set %1 as base path of the bank?").arg(path);
reply = QMessageBox::question(this, tr("Confirm Path"), confirmMessage, QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
// Set as default path..
@ -514,8 +530,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
goodPath=false;
// Message
QString continueMessage = QString("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath.c_str()));
reply = QMessageBox::question(this, "Continue", continueMessage, QMessageBox::Yes | QMessageBox::No);
QString continueMessage = tr("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath.c_str()));
reply = QMessageBox::question(this, tr("Continue"), continueMessage, QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::No)
break;
}
@ -542,8 +558,8 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
goodPath=false;
// Message
QString continueMessage = QString("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath));
reply = QMessageBox::question(this, "Continue", continueMessage, QMessageBox::Yes | QMessageBox::No);
QString continueMessage = tr("Path '%1' can't be found in bitmap '%2'. Continue ?").arg(path).arg(QString(bitmapPath));
reply = QMessageBox::question(this, tr("Continue"), continueMessage, QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::No)
break;
}
@ -608,7 +624,7 @@ void CTile_edit_dlg::on_absolutePathPushButton_clicked()
else
{
// Info message
QMessageBox::information(this, "Error", "Can't set the path.");
QMessageBox::information(this, tr("Error"), tr("Can't set the path."));
}
}
@ -646,7 +662,7 @@ void CTile_edit_dlg::on_downPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
@ -666,13 +682,13 @@ void CTile_edit_dlg::on_upPushButton_clicked()
}
else
{
QMessageBox::information( this, "No Tile Set Selected", "Please, select a Tile Set first ..." );
QMessageBox::information( this, tr("No Tile Set Selected"), tr("Please, select a Tile Set first ...") );
}
}
void CTile_edit_dlg::closeEvent(QCloseEvent *event)
{
int reply = QMessageBox::question(this, "Quit", "Are you sure you want to quit?", QMessageBox::Yes | QMessageBox::No);
int reply = QMessageBox::question(this, tr("Quit"), tr("Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::No);
if (reply == QMessageBox::Yes)
{
event->accept();

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TILE_EDITDLG_H
#define TILE_EDITDLG_H

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "tile_listwidgetitem.h"
//tile_listwidgetitem::tile_listwidgetitem(void)

View file

@ -1,3 +1,18 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TILE_WIDGET_H
#define TILE_WIDGET_H

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "tile_rotation_dlg.h"
CTile_rotation_dlg::CTile_rotation_dlg(QWidget *parent, Qt::WindowFlags flags)

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef TILE_ROTATIONDLG_H
#define TILE_ROTATIONDLG_H

View file

@ -1,3 +1,19 @@
// NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtGui/QtGui>
#include "tiles_model.h"
#include "tile_widget.h"
@ -9,7 +25,7 @@ bool caseInsensitiveLessThan(const TileModel &t1, const TileModel &t2)
}
TileModel::TileModel():pixmapSide(128),tileLabel("Right-Click to select Bitmap"), index(-1)
TileModel::TileModel():pixmapSide(128),tileLabel(QObject::tr("Right-Click to select Bitmap")), index(-1)
{
}
@ -23,7 +39,7 @@ TileModel::TileModel(int pixmapSide, QString tileLabel, int index):pixmapSide(pi
if (!tileLabel.isEmpty())
this->tileLabel = tileLabel;
else
this->tileLabel = "Right-Click to select Bitmap";
this->tileLabel = QObject::tr("Right-Click to select Bitmap");
}