Mercurial > octave-dspies
comparison libgui/src/m-editor/file-editor.cc @ 15982:131d40cd805b
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
author | Torsten <ttl@justmail.de> |
---|---|
date | Sun, 27 Jan 2013 22:22:19 +0100 |
parents | 6c0fce0632a4 |
children | 1eb3c67139f6 |
comparison
equal
deleted
inserted
replaced
15981:e3873531dd7c | 15982:131d40cd805b |
---|---|
108 // pass a signal to. Hence, functionality is here. | 108 // pass a signal to. Hence, functionality is here. |
109 | 109 |
110 file_editor_tab *fileEditorTab = new file_editor_tab (ced); | 110 file_editor_tab *fileEditorTab = new file_editor_tab (ced); |
111 if (fileEditorTab) | 111 if (fileEditorTab) |
112 { | 112 { |
113 add_file_editor_tab (fileEditorTab, UNNAMED_FILE); | 113 add_file_editor_tab (fileEditorTab, ""); // new tab with empty title |
114 fileEditorTab->new_file (); | 114 fileEditorTab->new_file (); // title is updated here |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 void | 118 void |
119 file_editor::request_open_file () | 119 file_editor::request_open_file () |
122 // editor tab has yet to be created and there is no object to | 122 // editor tab has yet to be created and there is no object to |
123 // pass a signal to. Hence, functionality is here. | 123 // pass a signal to. Hence, functionality is here. |
124 | 124 |
125 // Create a NonModal message. | 125 // Create a NonModal message. |
126 QFileDialog* fileDialog = new QFileDialog (this); | 126 QFileDialog* fileDialog = new QFileDialog (this); |
127 fileDialog->setNameFilter (SAVE_FILE_FILTER); | 127 fileDialog->setNameFilter (tr("Octave Files (*.m);;All Files (*.*)")); |
128 fileDialog->setAcceptMode (QFileDialog::AcceptOpen); | 128 fileDialog->setAcceptMode (QFileDialog::AcceptOpen); |
129 fileDialog->setViewMode (QFileDialog::Detail); | 129 fileDialog->setViewMode (QFileDialog::Detail); |
130 fileDialog->setDirectory (ced); | 130 fileDialog->setDirectory (ced); |
131 connect (fileDialog, SIGNAL (fileSelected (const QString&)), | 131 connect (fileDialog, SIGNAL (fileSelected (const QString&)), |
132 this, SLOT (request_open_file (const QString&))); | 132 this, SLOT (request_open_file (const QString&))); |