annotate libgui/src/m-editor/file-editor-tab.h @ 27919:1891570abac8

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2020.
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 22:29:51 -0500
parents b442ec6dda5c
children bd51beb6205e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
27919
1891570abac8 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27918
diff changeset
3 Copyright (C) 2011-2020 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27893
diff changeset
4
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27893
diff changeset
5 See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27893
diff changeset
6 or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 27893
diff changeset
7
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24484
diff changeset
11 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
12 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24484
diff changeset
13 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
14 (at your option) any later version.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
16 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
17 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
19 GNU General Public License for more details.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
22 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24484
diff changeset
23 <https://www.gnu.org/licenses/>.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
24
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
25 */
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20783
diff changeset
27 #if ! defined (octave_file_editor_tab_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17790
diff changeset
28 #define octave_file_editor_tab_h 1
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29
25883
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
30 #include <QAbstractButton>
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 #include <QCloseEvent>
25369
c89fa0989e7b prevent notifications on externally changed editor files (bug 53539)
Torsten <mttl@mailbox.org>
parents: 25054
diff changeset
32 #include <QDateTime>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
33 #include <QFileInfo>
14690
ca733a66be7a Fixed bug with not opening the editor when clicking a file from the file browser. Implemented watching the file on disk.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14680
diff changeset
34 #include <QFileSystemWatcher>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
35 #include <QLabel>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
36 #include <QStatusBar>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
37 #include <QWidget>
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
38 #include <Qsci/qsciapis.h>
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
39
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27605
diff changeset
40 #include "gui-settings.h"
27302
5f170ea12fa1 use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents: 27255
diff changeset
41 #include "marker.h"
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
42 #include "octave-qscintilla.h"
27302
5f170ea12fa1 use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents: 27255
diff changeset
43 #include "qt-interpreter-events.h"
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
44
21692
de138ebaa7a9 avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents: 21578
diff changeset
45 class octave_value_list;
de138ebaa7a9 avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents: 21578
diff changeset
46
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47 namespace octave
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
48 {
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
49 class base_qobject;
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
50 class file_editor;
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
51
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
52 class file_editor_tab : public QWidget
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
53 {
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
54 Q_OBJECT
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
55
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
56 public:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
57
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
58 file_editor_tab (base_qobject& oct_qobj, const QString& directory = "");
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
59
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
60 ~file_editor_tab (void);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
61
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
62 octave_qscintilla * qsci_edit_area (void) { return m_edit_area; }
18689
fac35875f6eb update enabled status of undo/redo actions in the editor
Torsten <ttl@justmail.de>
parents: 18687
diff changeset
63
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
64 // Will initiate close if associated with the identifier tag.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
65 bool conditional_close (void);
19411
ed0df431631b allow to cancel exiting if editor tabs are modified and exit is requested in gui
Torsten <ttl@justmail.de>
parents: 19256
diff changeset
66
25923
a7511a1489b8 call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents: 25914
diff changeset
67 void update_breakpoints ();
a7511a1489b8 call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents: 25914
diff changeset
68
27634
57b9cf9d8796 simplify loop over tabs in file_editor::find_tab_widget
John W. Eaton <jwe@octave.org>
parents: 27633
diff changeset
69 QString file_name (void) const { return m_file_name; }
27635
a10b3e56d678 simplify loop over tabs in file_editor::handle_dir_remove
John W. Eaton <jwe@octave.org>
parents: 27634
diff changeset
70 QString encoding (void) const { return m_encoding; }
27634
57b9cf9d8796 simplify loop over tabs in file_editor::find_tab_widget
John W. Eaton <jwe@octave.org>
parents: 27633
diff changeset
71
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
72 signals:
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
73
27605
60cecb3fed04 fix saving modified files when closing editor tabs or octave
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27590
diff changeset
74 void tab_ready_to_close (void);
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
75 void file_name_changed (const QString& fileName,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
76 const QString& toolTip,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
77 bool modified);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
78 void editor_state_changed (bool copy_available, bool is_octave_file);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
79 void set_focus_editor_signal (QWidget *);
27787
5169ed0ff0f0 only one find dialog for all editor tabs (bug #57238)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27639
diff changeset
80 void edit_area_changed (octave_qscintilla *edit_area);
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
81 void tab_remove_request (void);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
82 void mru_add_file (const QString& file_name, const QString& encoding);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
83 void editor_check_conflict_save (const QString& saveFileName,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
84 bool remove_on_success);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
85 void run_file_signal (const QFileInfo& info);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
86 void request_open_file (const QString&, const QString& = QString ());
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
87 void edit_mfile_request (const QString&, const QString&,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
88 const QString&, int);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
89
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
90 void update_breakpoints_signal (const octave_value_list& args);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
91
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
92 void remove_breakpoint_via_debugger_linenr (int debugger_linenr);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
93 void request_remove_breakpoint_via_editor_linenr (int editor_linenr);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
94 void remove_all_breakpoints (void);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
95 void find_translated_line_number (int original_linenr,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
96 int& translated_linenr, marker*&);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
97 void find_linenr_just_before (int linenr, int& original_linenr,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
98 int& editor_linenr);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
99 void report_marker_linenr (QIntList& lines, QStringList& conditions);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
100 void remove_position_via_debugger_linenr (int debugger_linenr);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
101 void remove_all_positions (void);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
102
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
103 void debug_quit_signal (void);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
104
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
105 void interpreter_event (const fcn_callback& fcn);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
106 void interpreter_event (const meth_callback& meth);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
107
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
108 void maybe_remove_next (int remove_line);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
109
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
110 void dbstop_if (const QString& prompt, int line, const QString& cond);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
111 void request_add_breakpoint (int line, const QString& cond);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
112 void request_add_octave_apis (const QStringList&);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
113 void api_entries_added (void);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
114
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
115 void do_save_file_signal (const QString& file_to_save,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
116 bool remove_on_success, bool restore_breakpoints);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
117
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
118 void confirm_dbquit_and_save_signal (const QString& file_to_save,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
119 const QString& base_name,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
120 bool remove_on_success,
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
121 bool restore_breakpoints);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
122
27893
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
123 // FIXME: The following is similar to "process_octave_code" signal.
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
124 // However, currently that signal is connected to something that simply
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
125 // focuses a window and does not actually communicate with Octave.
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
126 //
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
127 // void evaluate_octave_command (const QString& command);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
128
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
129 public slots:
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
130
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
131 void update_window_title (bool modified);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
132 void handle_copy_available (bool enableCopy);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
133 void handle_margin_clicked (int line, int margin,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
134 Qt::KeyboardModifiers state);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
135
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
136 // Tells the editor tab to react on changed settings.
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27605
diff changeset
137 void notice_settings (const gui_settings *settings, bool init = false);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
138
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
139 // Change to a different editor tab by identifier tag.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
140 void change_editor_state (const QWidget *ID);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
141
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
142 void set_focus (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
143 void set_current_directory (const QString& dir);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
144 void context_help (const QWidget *ID, bool);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
145 void context_edit (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
146 void save_file (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
147 void save_file (const QWidget *ID, const QString& fileName,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
148 bool remove_on_success);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
149 void save_file_as (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
150 void print_file (const QWidget *ID);
26873
9ec36417c262 debug step starts script if not already running in debug mode (bug #44728)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
151 void run_file (const QWidget *ID, bool step_into = false);
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
152 void context_run (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
153 void toggle_bookmark (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
154 void next_bookmark (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
155 void previous_bookmark (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
156 void remove_bookmark (const QWidget *ID);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
157
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
158 void toggle_breakpoint (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
159 void next_breakpoint (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
160 void previous_breakpoint (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
161 void remove_all_breakpoints (const QWidget *ID);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
162
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
163 void scintilla_command (const QWidget *, unsigned int);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
164
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
165 void comment_selected_text (const QWidget *ID, bool input_str);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
166 void uncomment_selected_text (const QWidget *ID);
18656
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18560
diff changeset
167
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
168 void indent_selected_text (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
169 void unindent_selected_text (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
170 void smart_indent_line_or_selected_text (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
171 void convert_eol (const QWidget *ID, QsciScintilla::EolMode);
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 18275
diff changeset
172
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
173 void zoom_in (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
174 void zoom_out (const QWidget *ID);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
175 void zoom_normal (const QWidget *ID);
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 18275
diff changeset
176
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
177 void goto_line (const QWidget *ID, int line = -1);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
178 void move_match_brace (const QWidget *ID, bool select);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
179 void show_auto_completion (const QWidget *ID);
18560
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18555
diff changeset
180
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
181 void insert_debugger_pointer (const QWidget *ID, int line = -1);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
182 void delete_debugger_pointer (const QWidget *ID, int line = -1);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
183
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
184 void do_breakpoint_marker (bool insert, const QWidget *ID, int line = -1,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
185 const QString& cond = "");
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
186
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
187 void recover_from_exit (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
188 void set_modified (bool modified = true);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
189
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
190 void set_encoding (const QString& new_encoding);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
191
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
192 QString load_file (const QString& fileName);
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16389
diff changeset
193
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
194 void new_file (const QString& commands = QString ());
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
195
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
196 void file_has_changed (const QString& path, bool do_close = false);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
197
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
198 void handle_context_menu_edit (const QString&);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
199 void handle_context_menu_break_condition (int linenr);
20793
f7b0572fff6e allow to select an encoding when opening a file
Torsten <ttl@justmail.de>
parents: 20791
diff changeset
200
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
201 void handle_request_add_breakpoint (int line, const QString& cond);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
202 void handle_request_remove_breakpoint (int line);
14690
ca733a66be7a Fixed bug with not opening the editor when clicking a file from the file browser. Implemented watching the file on disk.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14680
diff changeset
203
25923
a7511a1489b8 call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents: 25914
diff changeset
204 void update_breakpoints_handler (const octave_value_list& argout);
16731
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
205
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
206 private slots:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
207
25883
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
208 // When user closes message box for decoding problems
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
209 void handle_decode_warning_answer (QAbstractButton *btn);
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
210
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
211 // When user closes message box for reload question.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
212 void handle_file_reload_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
213
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
214 // When user closes message box for resave question.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
215 void handle_file_resave_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
216
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
217 // When user closes QFileDialog box.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
218 void handle_save_file_as_answer (const QString& fileName);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
219 void handle_save_file_as_answer_close (const QString& fileName);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
220 void handle_save_file_as_answer_cancel (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
221 void handle_save_as_filter_selected (const QString& filter);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
222
27893
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
223 // When user changes encoding after decoding errors were found
25895
bb0c58796275 allow to change the encoding when editor detects decoding errors (bug #54607)
Torsten <mttl@mailbox.org>
parents: 25883
diff changeset
224 void handle_current_enc_changed (const QString& enc);
bb0c58796275 allow to change the encoding when editor detects decoding errors (bug #54607)
Torsten <mttl@mailbox.org>
parents: 25883
diff changeset
225
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
226 // When apis preparation has finished and is ready to save
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
227 void save_apis_info (void);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
228
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
229 // When the numer of lines changes -> adapt width of margin
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
230 void auto_margin_width (void);
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
231
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
232 void handle_cursor_moved (int line, int col);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
233 void handle_char_added (int character);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
234 void handle_double_click (int p, int l, int modifier);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
235 void handle_lines_changed (void);
16716
23b5dde25367 make octave lexer the default and dynamically set margin width for line numbers
Torsten <ttl@justmail.de>
parents: 16715
diff changeset
236
27397
8132797b4a6a use signal/slot connection in file-editor-tab for thread safety
John W. Eaton <jwe@octave.org>
parents: 27378
diff changeset
237 void handle_remove_next (int remove_line);
27398
db22b63b9c59 attempt to fix threading issues when setting conditional breakpoints in GUI
John W. Eaton <jwe@octave.org>
parents: 27397
diff changeset
238 void handle_dbstop_if (const QString& prompt, int line,
db22b63b9c59 attempt to fix threading issues when setting conditional breakpoints in GUI
John W. Eaton <jwe@octave.org>
parents: 27397
diff changeset
239 const QString& cond);
27401
1f595192b5a5 attempt to avoid threading issues when updating lexer in file editor tab
John W. Eaton <jwe@octave.org>
parents: 27398
diff changeset
240 void handle_add_octave_apis (const QStringList& api_entries);
1f595192b5a5 attempt to avoid threading issues when updating lexer in file editor tab
John W. Eaton <jwe@octave.org>
parents: 27398
diff changeset
241 void handle_api_entries_added (void);
27397
8132797b4a6a use signal/slot connection in file-editor-tab for thread safety
John W. Eaton <jwe@octave.org>
parents: 27378
diff changeset
242
27403
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
243 void do_save_file (const QString& file_to_save, bool remove_on_success,
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
244 bool restore_breakpoints);
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
245
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
246 void confirm_dbquit_and_save (const QString& file_to_save,
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
247 const QString& base_name,
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
248 bool remove_on_success,
27967cb3dea5 attempt to avoid threading issues when saving a file in the file editor tab
John W. Eaton <jwe@octave.org>
parents: 27401
diff changeset
249 bool restore_breakpoints);
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
250
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
251 protected:
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
252
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
253 void closeEvent (QCloseEvent *event);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
254 void set_file_name (const QString& fileName);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
255
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
256 private:
17962
4a53bcc1a4ae GUI: Add statusbar with line/col indicator to editor window (Bug #40626)
John Donoghue <john.donoghue@ieee.org>
parents: 17822
diff changeset
257
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
258 base_qobject& m_octave_qobj;
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27611
diff changeset
259
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
260 struct bp_info
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
261 {
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
262 bp_info (const QString& fname, int l = 0, const QString& cond = "");
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
263
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
264 int line;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
265 std::string file;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
266 std::string dir;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
267 std::string function_name;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
268 std::string condition;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
269 };
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
270
27247
9e5a825bb966 replace more explicit callback functions with lambda expressions
John W. Eaton <jwe@octave.org>
parents: 27198
diff changeset
271 void add_breakpoint_event (const bp_info& info);
9e5a825bb966 replace more explicit callback functions with lambda expressions
John W. Eaton <jwe@octave.org>
parents: 27198
diff changeset
272
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
273 bool valid_file_name (const QString& file = QString ());
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
274 void save_file (const QString& saveFileName, bool remove_on_success = false,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
275 bool restore_breakpoints = true);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
276 void save_file_as (bool remove_on_success = false);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
277 bool check_valid_identifier (QString file_name);
26291
f73bcf1d0b5a make SYSTEM alias for locale encoding if not suported on windows (bug #55139)
Torsten <mttl@mailbox.org>
parents: 25923
diff changeset
278 QTextCodec* check_valid_codec (void);
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
279
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
280 bool unchanged_or_saved (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
281
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
282 void update_lexer (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
283 void update_lexer_settings (void);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
284
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
285 void show_dialog (QDialog *dlg, bool modal);
27633
fd009322dd9f eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27629
diff changeset
286 public:
27605
60cecb3fed04 fix saving modified files when closing editor tabs or octave
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27590
diff changeset
287 int check_file_modified (bool remove = false);
27633
fd009322dd9f eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27629
diff changeset
288 private:
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
289 void do_comment_selected_text (bool comment, bool input_str = false);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
290 void do_indent_selected_text (bool indent);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
291 void do_smart_indent_line_or_selected_text (void);
14827
6b90737f69cc Very basic breakpoint setting and removing in the editor works.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14825
diff changeset
292
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
293 void check_restore_breakpoints (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
294 void center_current_line (bool always=true);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
295
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
296 QString get_function_name (void);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
297
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
298 QsciScintilla::EolMode detect_eol_mode (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
299 void update_eol_indicator (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
300
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
301 octave_qscintilla *m_edit_area;
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
302
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
303 QStatusBar *m_status_bar;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
304 QLabel *m_row_indicator;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
305 QLabel *m_col_indicator;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
306 QLabel *m_eol_indicator;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
307 QLabel *m_enc_indicator;
18833
6504a1932637 auto completion offers builtins and file functions for octave (bug #41371)
Torsten <ttl@justmail.de>
parents: 18767
diff changeset
308
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
309 QsciScintilla::EolMode m_save_as_desired_eol;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
310
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
311 QString m_file_name;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
312 QString m_file_name_short;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
313 QString m_ced;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
314 QString m_encoding;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
315 QString m_new_encoding;
25369
c89fa0989e7b prevent notifications on externally changed editor files (bug 53539)
Torsten <mttl@mailbox.org>
parents: 25054
diff changeset
316 QDateTime m_last_modified;
19249
d10c711a08d8 add a drop down menu with the eol mode in the save-file-as-dialog
Torsten <ttl@justmail.de>
parents: 19247
diff changeset
317
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
318 bool m_long_title;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
319 bool m_copy_available;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
320 bool m_is_octave_file;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
321 bool m_always_reload_changed_files;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
322 bool m_smart_indent;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
323 int m_auto_endif;
27198
dffdabfd0213 fix cursor position for editor smart indent after keyword (bug #56533)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27089
diff changeset
324 int m_ind_char_width;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
325
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
326 QFileSystemWatcher m_file_system_watcher;
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
327
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
328 QIntList m_bp_lines;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
329 QStringList m_bp_conditions;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
330
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
331 QsciAPIs *m_lexer_apis;
27401
1f595192b5a5 attempt to avoid threading issues when updating lexer in file editor tab
John W. Eaton <jwe@octave.org>
parents: 27398
diff changeset
332 QString m_prep_apis_path;
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
333 QString m_prep_apis_file;
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
334
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
335 int m_line_break;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
336 bool m_line_break_comments;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
337 int m_line;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
338 int m_col;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
339 bool m_lines_changed;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
340 bool m_highlight_all_occurrences;
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
341 int m_bp_restore_count;
27008
e93b8887fedf remove additionally added breakpoint when stepping into a file (bug #44728)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26873
diff changeset
342
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
343 struct breakpoint_info
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
344 {
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
345 bool remove_next;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
346 int remove_line;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
347 int do_not_remove_line;
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
348 };
27089
9326c2258e60 fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27053
diff changeset
349
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
350 breakpoint_info m_breakpoint_info;
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
351 };
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
352 }
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
353
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
354 #endif