diff libgui/src/m-editor/file-editor-tab.h @ 25895:bb0c58796275

allow to change the encoding when editor detects decoding errors (bug #54607) * file-editor-tab.cc (load_file): set tab contents to read only during user dialog on decoding errors, add button for changing encoding and reloading the file; (handle_decode_warning_answer): add dialog box for changing the encoding and reloading the file, reload file if desired by the user; (handle_current_enc_changed): save new encoding if a new encoding is selected in the dialogs combo box * file-editor-tab.h: update signal for opening a file together with the desired encoding, new slot for selecting the encoding in a combo box * file-editor.cc (add_file_editor_tab): update the connection between new file editor tab signal for opening a file with desired encoding and the related slot
author Torsten <mttl@mailbox.org>
date Mon, 24 Sep 2018 21:45:36 +0200
parents cfdc768b661c
children b33d4fbce33e
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.h	Sat Sep 22 22:29:15 2018 +0200
+++ b/libgui/src/m-editor/file-editor-tab.h	Mon Sep 24 21:45:36 2018 +0200
@@ -161,7 +161,7 @@
     void editor_check_conflict_save (const QString& saveFileName,
                                      bool remove_on_success);
     void run_file_signal (const QFileInfo& info);
-    void request_open_file (const QString&);
+    void request_open_file (const QString&, const QString& = QString ());
     void edit_mfile_request (const QString&, const QString&,
                              const QString&, int);
 
@@ -215,6 +215,9 @@
     void handle_save_file_as_answer_cancel (void);
     void handle_save_as_filter_selected (const QString& filter);
 
+    // When user changes encoding after decoding errors where found
+    void handle_current_enc_changed (const QString& enc);
+
     // When apis preparation has finished and is ready to save
     void save_apis_info (void);