diff libgui/src/m-editor/file-editor-tab.cc @ 19439:9582fad68730 gui-release

add actions for converting the eol characters of the editor file * file-editor-tab.cc (convert_eol): new slot for converting the line endings * file-editor-tab.h: new slot convert_eol * file-editor.cc (request_conv_eol_windows, request_conv_eol_unix, request_conv_eol_mac): new slots for converting the line ending, emitting new signal for activating the slot convert_eol in file_editor_tab; (constructor): add separators to the edit/format menu, add new actions for converting the line endings; (set_shortcuts): set the shortcuts for the new actions * file-editor.h: new function, new actions, and new signal * shortcut_manager.cc (do_init_data): set the initial shortcuts for new actions
author Torsten <ttl@justmail.de>
date Sat, 11 Oct 2014 11:15:59 +0200
parents f3c4b48f3c53
children 54943eb0ce37
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc
+++ b/libgui/src/m-editor/file-editor-tab.cc
@@ -947,6 +947,16 @@
   do_indent_selected_text (false);
 }
 
+void
+file_editor_tab::convert_eol (const QWidget *ID, QsciScintilla::EolMode eol_mode)
+{
+  if (ID != this)
+    return;
+
+  _edit_area->convertEols (eol_mode);
+  _edit_area->setEolMode (eol_mode);
+  update_eol_indicator ();
+}
 
 void
 file_editor_tab::zoom_in (const QWidget *ID)