Commit 9be6d080 authored by Johnny Jazeix's avatar Johnny Jazeix

developer (with only one p ^^)

Messages in OTF are considered as links.
Manuals have the licence in entete.
Added methods for translation.
parent 268fc031
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -61,13 +61,13 @@ double convert_to_double(const string arg){
// We had dots initially, we need to have the english system
if(is_english_system_needed) {
if(setlocale(LC_NUMERIC, "en_GB.UTF-8") == NULL){
cerr << "The locale en_GB.UTF-8 is unavailable so the decimal pointed will not be printed" << endl;
cerr << QObject::tr("The locale en_GB.UTF-8 is unavailable so the decimal pointed will not be printed").toStdString() << endl;
}
}
else {
if ( setlocale(LC_NUMERIC, "fr_FR.UTF-8")==NULL && setlocale(LC_NUMERIC, "French") == NULL){
cerr << "The locale fr_FR.UTF-8 is unavailable so the decimal with comma will not be printed" << endl;
cerr << QObject::tr("The locale fr_FR.UTF-8 is unavailable so the decimal with comma will not be printed").toStdString() << endl;
}
}
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -54,6 +54,9 @@
// For dots or commas separator in double numbers
#include <locale.h>
// For translations
#include <QObject>
/*!
* \fn convert_to_double(const std::string args)
* \brief Convert the string in double
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -89,7 +89,7 @@ Interface_console::Interface_console(int argc, char ** argv){
QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
if (!useGUI){
cerr << "Error: Graphical window cannot be displayed." << endl;
cerr << QObject::tr("Error: Graphical window cannot be displayed.").toStdString() << endl;
exit(EXIT_FAILURE);
}
......@@ -192,8 +192,8 @@ bool Interface_console::draw_trace(const string & filename, const int format){
float loaded_f = 0.0f;/* floating value of the loading file state. (between 0 and 1) */
if(_main_window != NULL) { // If we have a window we show a progress bar
_progress_dialog = new QProgressDialog("Parsing", "Cancel", 0, 100, _main_window);
_progress_dialog->setWindowTitle(QString::fromStdString("Loading of "+filename));
_progress_dialog = new QProgressDialog(QObject::tr("Parsing"), QObject::tr("Cancel"), 0, 100, _main_window);
_progress_dialog->setWindowTitle(QObject::tr("Loading of ")+QString::fromStdString(filename));
_progress_dialog->show();
_main_window->setDisabled(true);
......@@ -213,7 +213,7 @@ bool Interface_console::draw_trace(const string & filename, const int format){
#else
sleep(1); // We wait 1 second
#endif
cout << "Loading of the trace : " << loaded << "%" ;
cout << QObject::tr("Loading of the trace : ").toStdString() << loaded << "%" ;
if (loaded_f>0.0f){
/* divided by to have in second 1000 since time_elapsed.elapsed() returns ms */
......@@ -245,9 +245,9 @@ bool Interface_console::draw_trace(const string & filename, const int format){
QApplication::processEvents();
if(_progress_dialog->wasCanceled()) {
cout << "Canceled at " << loaded << "%" << endl;
cout << QObject::tr("Canceled at ").toStdString() << loaded << "%" << endl;
parser->set_canceled();
*Message::get_instance() << "The trace opening was canceled by the user at " << loaded << "%" << Message::ende;
*Message::get_instance() << QObject::tr("The trace opening was canceled by the user at ").toStdString() << loaded << "%" << Message::ende;
break; // Quit the loop
}
......@@ -270,7 +270,7 @@ bool Interface_console::draw_trace(const string & filename, const int format){
delete parser;
}
else if ( _file_opened != filename) {/* just check if execution is normal */
*Message::get_instance() << "Try to use file: " << filename << " instead of a previous parsed file: " << _file_opened << Message::ende;
*Message::get_instance() << QObject::tr("Try to use file: ").toStdString() << filename << QObject::tr(" instead of a previous parsed file: ").toStdString() << _file_opened << Message::ende;
}
Interval interval(_time_start, ((0==_time_end)?_trace->get_max_date():_time_end) );
......@@ -285,7 +285,7 @@ bool Interface_console::draw_trace(const string & filename, const int format){
drawing_svg.build(&svg, _trace, 0, interval);
svg.end();
}else{/* error */
*Message::get_instance() << "No kind of render recognized" << Message::ende;
*Message::get_instance() << QObject::tr("No kind of render recognized").toStdString() << Message::ende;
return false;
}
......@@ -354,7 +354,7 @@ int Interface_console::get_state(int argc, char** argv){
state = _STATE_OPEN_FILE;
}
else {
cerr << "no filename to open" << endl;
cerr << QObject::tr("no filename to open").toStdString() << endl;
return _STATE_UNKNOWN;
}
}
......@@ -366,7 +366,7 @@ int Interface_console::get_state(int argc, char** argv){
state = _STATE_EXPORT_FILE;
}
else{
cerr << "no filename for export" << endl;
cerr << QObject::tr("no filename for export").toStdString() << endl;
return _STATE_UNKNOWN;
}
}
......@@ -374,11 +374,11 @@ int Interface_console::get_state(int argc, char** argv){
// We want to export the file which follows this argument
extract_times(argv[++ i]);
if(_time_end == -1 || _time_start == -1){
cerr << "One of the time do not exist" << endl;
cerr << QObject::tr("One of the time do not exist").toStdString() << endl;
state = _STATE_LAUNCH_GRAPHICAL_INTERFACE;
}
else if (_time_end < _time_start){
cerr << "The end time is lower than the start one!" << endl;
cerr << QObject::tr("The end time is lower than the start one!").toStdString() << endl;
state = _STATE_LAUNCH_GRAPHICAL_INTERFACE;
}
state |= _STATE_IN_AN_INTERVAL;
......@@ -389,13 +389,13 @@ int Interface_console::get_state(int argc, char** argv){
if((string)argv[i] == "-epsilon") {
i ++;
if(i > argc) {
cerr << "need an other argument for epsilon" << endl;
cerr << QObject::tr("need an other argument for epsilon").toStdString() << endl;
return _STATE_UNKNOWN;
}
else {
double accuracy = convert_to_double(argv[i]);
if(accuracy < 0.) {
cerr << "need a positive accuracy for epsilon" << endl;
cerr << QObject::tr("need a positive accuracy for epsilon").toStdString() << endl;
return _STATE_UNKNOWN;
}
else {
......@@ -406,12 +406,12 @@ int Interface_console::get_state(int argc, char** argv){
else if((string)argv[i] == "-wide") {
i ++;
if (i > argc) {
cerr << "need an other argument for wide" << endl;
cerr << QObject::tr("need an other argument for wide").toStdString() << endl;
return _STATE_UNKNOWN;
}
double wide = convert_to_double(argv[i]);
if(wide < 0.) {
cerr << "need a positive width for the export" << endl;
cerr << QObject::tr("need a positive width for the export").toStdString() << endl;
return _STATE_UNKNOWN;
}
else {
......@@ -421,12 +421,12 @@ int Interface_console::get_state(int argc, char** argv){
else if((string)argv[i] == "-grow") {
i ++;
if (i > argc) {
cerr << "need an other argument for grow" << endl;
cerr << QObject::tr("need an other argument for grow").toStdString() << endl;
return _STATE_UNKNOWN;
}
double grow = convert_to_double(argv[i]);
if(grow < 0.) {
cerr << "need a positive grown for the export" << endl;
cerr << QObject::tr("need a positive grown for the export").toStdString() << endl;
return _STATE_UNKNOWN;
}
else {
......@@ -436,12 +436,12 @@ int Interface_console::get_state(int argc, char** argv){
else if((string)argv[i] == "-scale") {
i ++;
if (i > argc) {
cerr << "need an other argument for scale" << endl;
cerr << QObject::tr("need an other argument for scale").toStdString() << endl;
return _STATE_UNKNOWN;
}
double scale = convert_to_double(argv[i]);
if(scale < 0.) {
cerr << "need a positive scale for the export" << endl;
cerr << QObject::tr("need a positive scale for the export").toStdString() << endl;
return _STATE_UNKNOWN;
}
else {
......@@ -475,7 +475,7 @@ int Interface_console::get_state(int argc, char** argv){
i += 2;
}
else {
cerr << "the argument "<< argv[i] << " is unknown." << endl;
cerr << QObject::tr("the argument ").toStdString() << argv[i] << QObject::tr(" is unknown.").toStdString() << endl;
return _STATE_DISPLAY_HELP;
}
......@@ -540,7 +540,7 @@ void Interface_console::launch_action(int state, void* arg) {
break;
case _STATE_OPEN_FILE:
information(string("Opening the file: ")+_file_opened);
information(QObject::tr("Opening the file: ").toStdString()+_file_opened);
_main_window = new Interface_graphic(this);/* launch the window interface and open a file */
Message::set_interface(_main_window);/* define which interface will receive messages */
_render_opengl = new Render_opengl_dl(this, _main_window);
......@@ -549,7 +549,7 @@ void Interface_console::launch_action(int state, void* arg) {
_main_window->opening_file(_file_opened);/* Must be called after binding the render area to the main window */
if(false==draw_trace(_file_opened, _DRAW_OPENGL))
message << "Draw trace failed" << Message::ende;
message << QObject::tr("Draw trace failed").toStdString() << Message::ende;
_is_window_displayed = true;
......@@ -563,17 +563,17 @@ void Interface_console::launch_action(int state, void* arg) {
case _STATE_RELEASE_RENDER_AREA:
if (_render_opengl->unbuild()==false)
message << "Close file : an error occured with trace releasing." << Message::ende;
message << QObject::tr("Close file : an error occured with trace releasing.").toStdString() << Message::ende;
_file_opened.clear();
if (false == _is_trace_loaded){
*Message::get_instance() << "Try to release a render area whereas no file was loaded" << Message::ende;
*Message::get_instance() << QObject::tr("Try to release a render area whereas no file was loaded").toStdString() << Message::ende;
}else{
_is_trace_loaded = false;
}
if (NULL == _trace){
*Message::get_instance() << "Try to release a render area whereas no trace is loaded" << Message::ende;
*Message::get_instance() << QObject::tr("Try to release a render area whereas no trace is loaded").toStdString() << Message::ende;
}else{
delete _trace;
_trace = NULL;
......@@ -586,29 +586,29 @@ void Interface_console::launch_action(int state, void* arg) {
case _STATE_EXPORT_FILE:
if (_file_opened.empty()){
*Message::get_instance() << "Please to previously open a trace." << Message::endw;
*Message::get_instance() << QObject::tr("Please to previously open a trace.").toStdString() << Message::endw;
return;
}
*Message::get_instance() << "export of " << _file_opened << " to " << _path_to_export << Message::endi;
*Message::get_instance() << QObject::tr("export of ").toStdString() << _file_opened << QObject::tr(" to ").toStdString() << _path_to_export << Message::endi;
draw_trace(_file_opened, _DRAW_SVG);
break;
case _STATE_EXPORT_FILE_IN_INTERVAL:
cout << "export of " << _file_opened << " to " << _path_to_export << " between ";
cout << QObject::tr("export of ").toStdString() << _file_opened << QObject::tr(" to ").toStdString() << _path_to_export << QObject::tr(" between ").toStdString();
if(_time_start == 0){
cout << "the beginning of the trace to ";
cout << QObject::tr("the beginning of the trace to ").toStdString();
}
else{
cout << _time_start << " seconds to ";
cout << _time_start << QObject::tr(" seconds to ").toStdString();
}
if(_time_end != 0){
cout << _time_end << " seconds." << endl;
cout << _time_end << QObject::tr(" seconds.").toStdString() << endl;
}
else{
cout << "the end of the trace.";
cout << QObject::tr("the end of the trace.").toStdString();
}
Svg::set_interval(_time_start, _time_end);
......@@ -674,7 +674,7 @@ void Interface_console::launch_action(int state, void* arg) {
default:/* like _STATE_UNKNOWN */
display_help();
warning(string("Cannot determine the arguments past. Please check the correct syntax."));
warning(QObject::tr("Cannot determine the arguments past. Please check the correct syntax.").toStdString());
}
}
......@@ -707,12 +707,12 @@ void Interface_console::display_help(){
**********************************/
void Interface_console::error(const string s) const{
cerr << "ERROR: " << s <<endl;
cerr << QObject::tr("ERROR: ").toStdString() << s <<endl;
}
void Interface_console::warning(const string s) const{
cerr << "Warning: "<< s <<endl;
cerr << QObject::tr("Warning: ").toStdString() << s <<endl;
}
void Interface_console::information(const string s) const{
......
......@@ -112,16 +112,16 @@ void Interface_graphic::load_windows(){
if (!QGLFormat::hasOpenGL())
qFatal("This system has no OpenGL support");
qFatal(tr("This system has no OpenGL support").toStdString().c_str());
/* Load the informative window from a .ui file */
file_info.open(QFile::ReadOnly);
CKFP(_ui_info_window = loader.load(&file_info, this), "Cannot open the .ui file : " << ":/window/info_window.ui");
CKFP(_ui_info_window = loader.load(&file_info, this), tr("Cannot open the .ui file : ").toStdString() << ":/window/info_window.ui");
file_info.close();
/* Load the _option_export_window from a .ui file */
file_selection_export.open(QFile::ReadOnly);
CKFP(_ui_time_selection_export = loader.load(&file_selection_export, this), "Cannot open the .ui file : " << "option_export_window.ui");
CKFP(_ui_time_selection_export = loader.load(&file_selection_export, this), tr("Cannot open the .ui file : ").toStdString() << "option_export_window.ui");
file_selection_export.close();
......@@ -130,33 +130,33 @@ void Interface_graphic::load_windows(){
_ui_time_selection_export->setWindowFlags(_ui_time_selection_export->windowFlags() | Qt::WindowStaysOnTopHint);
/* Load widget from the .ui file */
CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), "Cannot find the render_area layout in the .ui file");
CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), "Cannot find the fullscreen menu in the .ui file");
CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(_ui_info_window, "info_trace_text"), "Cannot find the info_trace_text QTextEdit widget in the .ui file");
CKFP(_ui_info_selection_text = qFindChild<QTextEdit*>(_ui_info_window, "info_selection_text"), "Cannot find the info_selection_text QTextEdit widget in the .ui file");
CKFP(_ui_toolbar_check = qFindChild<QAction*>(this, "toolbar_menu"), "Cannot find the tool bar checker in the .ui file");
CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), "Cannot find the tool bar in the .ui file");
CKFP(_ui_render_area_layout = qFindChild<QVBoxLayout*>(this, "render_area_layout"), tr("Cannot find the render_area layout in the .ui file").toStdString());
CKFP(_ui_fullscreen_menu = qFindChild<QAction*>(this, "fullscreen"), tr("Cannot find the fullscreen menu in the .ui file").toStdString());
CKFP(_ui_info_trace_text = qFindChild<QTextEdit*>(_ui_info_window, "info_trace_text"), tr("Cannot find the info_trace_text QTextEdit widget in the .ui file").toStdString());
CKFP(_ui_info_selection_text = qFindChild<QTextEdit*>(_ui_info_window, "info_selection_text"), tr("Cannot find the info_selection_text QTextEdit widget in the .ui file").toStdString());
CKFP(_ui_toolbar_check = qFindChild<QAction*>(this, "toolbar_menu"), tr("Cannot find the tool bar checker in the .ui file").toStdString());
CKFP(_ui_toolbar = qFindChild<QToolBar*>(this, "toolBar"), tr("Cannot find the tool bar in the .ui file").toStdString());
CKFP(_ui_x_scroll = qFindChild<QScrollBar*>(this, "x_scroll"), "Cannot find the horizontal scroll bar in the .ui file");
CKFP(_ui_y_scroll = qFindChild<QScrollBar*>(this, "y_scroll"), "Cannot find the vertical scroll bar in the .ui file");
CKFP(_ui_x_scroll = qFindChild<QScrollBar*>(this, "x_scroll"), tr("Cannot find the horizontal scroll bar in the .ui file").toStdString());
CKFP(_ui_y_scroll = qFindChild<QScrollBar*>(this, "y_scroll"), tr("Cannot find the vertical scroll bar in the .ui file").toStdString());
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), "Cannot find the zoom box in the .ui file");
CKFP(_ui_zoom_box = qFindChild<QComboBox*>(this, "zoom_box"), tr("Cannot find the zoom box in the .ui file").toStdString());
// Export window
CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_min_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "min_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_export_ok_button = qFindChild<QPushButton*>(_ui_time_selection_export, "option_export_ok"), tr("Cannot find the ok push button in the export dialog .ui file").toStdString());
CKFP(_ui_min_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "min_time"), tr("Cannot find the ok push button in the export dialog .ui file").toStdString());
CKFP(_ui_max_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "max_time"), "Cannot find the ok push button in the export dialog .ui file");
CKFP(_ui_max_time_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "max_time"), tr("Cannot find the ok push button in the export dialog .ui file").toStdString());
CKFP(_ui_CheckBox_time_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "export_all"), "Cannot find the Line text \"export_all\" in the export dialog .ui file");
CKFP(_ui_CheckBox_time_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "export_all"), tr("Cannot find the Line text \"export_all\" in the export dialog .ui file").toStdString());
CKFP(_ui_wide_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "wide"), "Cannot find the Line text \"wide\" in the export dialog .ui file");
CKFP(_ui_grow_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "grow"), "Cannot find the Line text \"grow\" in the export dialog .ui file");
CKFP(_ui_accuracy_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "accuracy"), "Cannot find the Line text \"accuracy\" in the export dialog .ui file");
CKFP(_ui_CheckBox_wide_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_wide"), "Cannot find the Line text \"wide\" in the export dialog .ui file");
CKFP(_ui_CheckBox_grow_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_grow"), "Cannot find the Line text \"grow\" in the export dialog .ui file");
CKFP(_ui_CheckBox_accuracy_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_accuracy"), "Cannot find the Line text \"accuracy\" in the export dialog .ui file");
CKFP(_ui_more_options_export = qFindChild<QCommandLinkButton*>(_ui_time_selection_export, "more_options"), "Cannot find the button \"more_options\" in the export dialog .ui file");
CKFP(_ui_wide_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "wide"), tr("Cannot find the Line text \"wide\" in the export dialog .ui file").toStdString());
CKFP(_ui_grow_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "grow"), tr("Cannot find the Line text \"grow\" in the export dialog .ui file").toStdString());
CKFP(_ui_accuracy_export = qFindChild<QLineEdit*>(_ui_time_selection_export, "accuracy"), tr("Cannot find the Line text \"accuracy\" in the export dialog .ui file").toStdString());
CKFP(_ui_CheckBox_wide_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_wide"), tr("Cannot find the Line text \"wide\" in the export dialog .ui file").toStdString());
CKFP(_ui_CheckBox_grow_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_grow"), tr("Cannot find the Line text \"grow\" in the export dialog .ui file").toStdString());
CKFP(_ui_CheckBox_accuracy_export = qFindChild<QCheckBox*>(_ui_time_selection_export, "checkBox_accuracy"), tr("Cannot find the Line text \"accuracy\" in the export dialog .ui file").toStdString());
CKFP(_ui_more_options_export = qFindChild<QCommandLinkButton*>(_ui_time_selection_export, "more_options"), tr("Cannot find the button \"more_options\" in the export dialog .ui file").toStdString());
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -52,37 +52,37 @@ const int Error::_EVERYTHING = 0;
const int Error::_WARNING = 1;
const int Error::_ERROR = 2;
string Error::_content = "";
const string Error::_PARSE = "expected \" before end of file";
const string Error::_MMAP = "mmap error";
const string Error::_EMPTY_FILE = "empty file";
const string Error::_FSTAT = "status file error";
const string Error::_OPEN = "open file error";
const string Error::_MUNMAP = "munmap error";
const string Error::_EXPECT_END_DEF = "expected %EndEventDef";
const string Error::_EXPECT_EVENT_DEF = "expected %EventDef";
const string Error::_EXPECT_NAME_DEF = "the definition is not named";
const string Error::_EXPECT_ID_DEF = "the definition is not identified";
const string Error::_UNKNOWN_ID_DEF = "there is no definition with the identity: ";
const string Error::_EXTRA_TOKEN = "extra token(s) ignored";
const string Error::_UNKNOWN_EVENT_DEF = "the following event doesn't match with any event known: ";
const string Error::_FIELD_TYPE_MISSING = "a field type is missing ";
const string Error::_FIELD_TYPE_UNKNOWN = "the following field type is unknown: ";
const string Error::_EMPTY_DEF = "a definition line is empty";
const string Error::_INCOMPATIBLE_VALUE_IN_EVENT = "incompatible value: ";
const string Error::_BAD_FILE_EXTENSION = "the extension of the file is not .trace";
const string Error::_LINE_TOO_SHORT_EVENT = "missing field value(s) in an event";
const string Error::_UNKNOWN_CONTAINER_TYPE = "Unknown container type: ";
const string Error::_UNKNOWN_CONTAINER = "Unknown container: ";
const string Error::_UNKNOWN_EVENT_TYPE = "Unknown event type: ";
const string Error::_UNKNOWN_STATE_TYPE = "Unknown state type: ";
const string Error::_UNKNOWN_VARIABLE_TYPE = "Unknown variable type: ";
const string Error::_UNKNOWN_LINK_TYPE = "Unknown link type: ";
const string Error::_UNKNOWN_ENTITY_TYPE = "Unknown entity type: ";
const string Error::_UNKNOWN_ENTITY_VALUE = "Unknown entity value: ";
string Error::_content = QObject::tr("").toStdString();
const string Error::_PARSE = QObject::tr("expected \" before end of file").toStdString();
const string Error::_MMAP = QObject::tr("mmap error").toStdString();
const string Error::_EMPTY_FILE = QObject::tr("empty file").toStdString();
const string Error::_FSTAT = QObject::tr("status file error").toStdString();
const string Error::_OPEN = QObject::tr("open file error").toStdString();
const string Error::_MUNMAP = QObject::tr("munmap error").toStdString();
const string Error::_EXPECT_END_DEF = QObject::tr("expected %EndEventDef").toStdString();
const string Error::_EXPECT_EVENT_DEF = QObject::tr("expected %EventDef").toStdString();
const string Error::_EXPECT_NAME_DEF = QObject::tr("the definition is not named").toStdString();
const string Error::_EXPECT_ID_DEF = QObject::tr("the definition is not identified").toStdString();
const string Error::_UNKNOWN_ID_DEF = QObject::tr("there is no definition with the identity: ").toStdString();
const string Error::_EXTRA_TOKEN = QObject::tr("extra token(s) ignored").toStdString();
const string Error::_UNKNOWN_EVENT_DEF = QObject::tr("the following event doesn't match with any event known: ").toStdString();
const string Error::_FIELD_TYPE_MISSING = QObject::tr("a field type is missing ").toStdString();
const string Error::_FIELD_TYPE_UNKNOWN = QObject::tr("the following field type is unknown: ").toStdString();
const string Error::_EMPTY_DEF = QObject::tr("a definition line is empty").toStdString();
const string Error::_INCOMPATIBLE_VALUE_IN_EVENT = QObject::tr("incompatible value: ").toStdString();
const string Error::_BAD_FILE_EXTENSION = QObject::tr("the extension of the file is not .trace").toStdString();
const string Error::_LINE_TOO_SHORT_EVENT = QObject::tr("missing field value(s) in an event").toStdString();
const string Error::_UNKNOWN_CONTAINER_TYPE = QObject::tr("Unknown container type: ").toStdString();
const string Error::_UNKNOWN_CONTAINER = QObject::tr("Unknown container: ").toStdString();
const string Error::_UNKNOWN_EVENT_TYPE = QObject::tr("Unknown event type: ").toStdString();
const string Error::_UNKNOWN_STATE_TYPE = QObject::tr("Unknown state type: ").toStdString();
const string Error::_UNKNOWN_VARIABLE_TYPE = QObject::tr("Unknown variable type: ").toStdString();
const string Error::_UNKNOWN_LINK_TYPE = QObject::tr("Unknown link type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_TYPE = QObject::tr("Unknown entity type: ").toStdString();
const string Error::_UNKNOWN_ENTITY_VALUE = QObject::tr("Unknown entity value: ").toStdString();
void Error::set(const string kind_of_error, const int priority){
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -43,7 +43,8 @@
#ifndef ERRORS_HPP
#define ERRORS_HPP
/**
/*!
* \file Errors.hpp
* This file contains all the significations of the errors or warnings that can be thrown by the parser
*
**/
......
......@@ -28,7 +28,7 @@
** knowledge of the CeCILL-A license and that you accept its terms.
**
**
** ViTE developpers are (for version 0.* to 1.0):
** ViTE developers are (for version 0.* to 1.0):
**
** - COULOMB Kevin
** - FAVERGE Mathieu
......@@ -78,7 +78,7 @@ std::ostream &operator<<(std::ostream &out, Message::end_error_t) {
interface->error(message->str());
message->str(""); // flush the stream
} else {
std::cerr << "Warning: no interface designed to display messages." << std::endl;
std::cerr << QObject::tr("Warning: no interface designed to display messages.").toStdString() << std::endl;
}
return out;
}
......@@ -91,7 +91,7 @@ std::ostream &operator<<(std::ostream &out, Message::end_warning_t) {
interface->warning(message->str());
message->str(""); // flush the stream
} else {
std::cerr << "Warning: no interface designed to display messages." << std::endl;
std::cerr << QObject::tr("Warning: no interface designed to display messages.").toStdString() << std::endl;
}
return out;
}
......@@ -104,7 +104,7 @@ std::ostream &operator<<(std::ostream &out, Message::end_information_t) {
interface->information(message->str());
message->str(""); // flush the stream
} else {
std::cerr << "Warning: no interface designed to display messages." << std::endl;
std::cerr << QObject::tr("Warning: no interface designed to display messages.").toStdString() << std::endl;
}
return out;