# HG changeset patch # User Torsten # Date 1359321739 -3600 # Node ID 131d40cd805b758632323cdfa0b1faf0315dfd53 # Parent e3873531dd7c63a66cb2e07a2652bf3132b412dd gui: cleanup some string constants for translations * file-editor.h: deleted constants for file filters and name for new files * file-editor.cc (request_open_file): translate file filter in open dialog * file-editor.cc (request_new_file): create new edit tab with empty title because the title is updated later * file-editor-tab.cc (update_window_title): translate unnamed title * file-editor-tab.cc (save_file_as): translate file filter, shorter warning message when new file name is the same as the current one diff -r e3873531dd7c -r 131d40cd805b libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Sun Jan 27 15:50:49 2013 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Sun Jan 27 22:22:19 2013 +0100 @@ -659,7 +659,7 @@ { QString title (""); if (_file_name.isEmpty () || _file_name.at (_file_name.count () - 1) == '/') - title = UNNAMED_FILE; + title = tr(""); else { if ( _long_title ) @@ -866,7 +866,7 @@ fileDialog->setDirectory (_file_name); } } - fileDialog->setNameFilter (SAVE_FILE_FILTER); + fileDialog->setNameFilter (tr("Octave Files (*.m);;All Files (*.*)")); fileDialog->setDefaultSuffix ("m"); fileDialog->setAcceptMode (QFileDialog::AcceptSave); fileDialog->setViewMode (QFileDialog::Detail); @@ -897,7 +897,8 @@ // Create a NonModal message about error. QMessageBox* msgBox = new QMessageBox ( QMessageBox::Critical, tr ("Octave Editor"), - tr ("File not saved! You've selected a file name\n\n %1\n\nwhich is the same as the current file name. Use ""Save"" to overwrite. (Could allow overwriting, with message, if that is what folks want.)"). + tr ("File not saved! The selected file name\n%1\n" + "is the same as the current file name"). arg (saveFileName), QMessageBox::Ok, 0); msgBox->setWindowModality (Qt::NonModal); diff -r e3873531dd7c -r 131d40cd805b libgui/src/m-editor/file-editor.cc --- a/libgui/src/m-editor/file-editor.cc Sun Jan 27 15:50:49 2013 +0100 +++ b/libgui/src/m-editor/file-editor.cc Sun Jan 27 22:22:19 2013 +0100 @@ -110,8 +110,8 @@ file_editor_tab *fileEditorTab = new file_editor_tab (ced); if (fileEditorTab) { - add_file_editor_tab (fileEditorTab, UNNAMED_FILE); - fileEditorTab->new_file (); + add_file_editor_tab (fileEditorTab, ""); // new tab with empty title + fileEditorTab->new_file (); // title is updated here } } @@ -124,7 +124,7 @@ // Create a NonModal message. QFileDialog* fileDialog = new QFileDialog (this); - fileDialog->setNameFilter (SAVE_FILE_FILTER); + fileDialog->setNameFilter (tr("Octave Files (*.m);;All Files (*.*)")); fileDialog->setAcceptMode (QFileDialog::AcceptOpen); fileDialog->setViewMode (QFileDialog::Detail); fileDialog->setDirectory (ced); diff -r e3873531dd7c -r 131d40cd805b libgui/src/m-editor/file-editor.h --- a/libgui/src/m-editor/file-editor.h Sun Jan 27 15:50:49 2013 +0100 +++ b/libgui/src/m-editor/file-editor.h Sun Jan 27 22:22:19 2013 +0100 @@ -33,8 +33,6 @@ #include "file-editor-interface.h" #include "file-editor-tab.h" -const char UNNAMED_FILE[] = ""; -const char SAVE_FILE_FILTER[] = "Octave Files (*.m);;All Files (*.*)"; enum editor_markers { bookmark,