annotate libgui/src/m-editor/file-editor-tab.h @ 31649:deb553ac2c54

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2022 15:45:27 -0500
parents 431f80aba37a 29d734430e5f
children 276a992d0c08
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 30398
diff changeset
3 // Copyright (C) 2011-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20783
diff changeset
26 #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
27 #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
28
25883
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
29 #include <QAbstractButton>
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 #include <QCloseEvent>
25369
c89fa0989e7b prevent notifications on externally changed editor files (bug 53539)
Torsten <mttl@mailbox.org>
parents: 25054
diff changeset
31 #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
32 #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
33 #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
34 #include <QLabel>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
35 #include <QStatusBar>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27405
diff changeset
36 #include <QWidget>
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
37 #include <Qsci/qsciapis.h>
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
38
27302
5f170ea12fa1 use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents: 27255
diff changeset
39 #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
40 #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
41 #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
42
21692
de138ebaa7a9 avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents: 21578
diff changeset
43 class octave_value_list;
de138ebaa7a9 avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents: 21578
diff changeset
44
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31181
diff changeset
45 OCTAVE_BEGIN_NAMESPACE(octave)
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31181
diff changeset
46
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
47 class base_qobject;
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
48 class file_editor;
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
49
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
50 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
51 {
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
52 Q_OBJECT
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
53
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
54 public:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
55
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
56 file_editor_tab (base_qobject& oct_qobj, const QString& directory = "");
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
57
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
58 ~file_editor_tab (void);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
59
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
60 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
61
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
62 // 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
63 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
64
25923
a7511a1489b8 call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents: 25914
diff changeset
65 void update_breakpoints ();
30745
2f6904439d3c fix updating the name of renamed editor files
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30564
diff changeset
66 void set_file_name (const QString& fileName);
2f6904439d3c fix updating the name of renamed editor files
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30564
diff changeset
67 void enable_file_watcher (bool do_enable);
25923
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);
29698
bbf5d4ea616c fix enabled state of editor save action depending on modification state
Torsten Lilge <ttl-octave@mailbox.org>
parents: 29542
diff changeset
78 void editor_state_changed (bool copy_available, bool is_octave_file,
bbf5d4ea616c fix enabled state of editor save action depending on modification state
Torsten Lilge <ttl-octave@mailbox.org>
parents: 29542
diff changeset
79 bool is_modified);
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
80 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
81 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
82 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
83 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
84 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
85 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
86 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
87 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
88 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
89 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
90
28382
2b52e473b6ef fix focus issues in editor due to qt bug with focus proxy chains (bug #57635)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
91 void autoc_closed (void);
2b52e473b6ef fix focus issues in editor due to qt bug with focus proxy chains (bug #57635)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
92
27590
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 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
94
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 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
96 void request_remove_breakpoint_via_editor_linenr (int editor_linenr);
29542
3d34b70b5a49 connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents: 29468
diff changeset
97 void remove_all_breakpoints_signal (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
98 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
99 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
100 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
101 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
102 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
103 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
104 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
105
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 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
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 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
109 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
110
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 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
112
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 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
114 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
115 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
116 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
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 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
119 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
120
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
121 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
122 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
123 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
124 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
125
27893
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
126 // 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
127 // 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
128 // 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
129 //
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
130 // 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
131
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
132 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
133
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
134 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
135 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
136 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
137 Qt::KeyboardModifiers state);
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 // Tells the editor tab to react on changed settings.
31619
ad014fc78bd6 use individual local gui_settings objects
John W. Eaton <jwe@octave.org>
parents: 31181
diff changeset
140 void notice_settings (bool init = false);
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 // 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
143 void change_editor_state (const QWidget *ID);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
144
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
145 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
146 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
147 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
148 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
149 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
150 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
151 bool remove_on_success);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
152 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
153 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
154 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
155 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
156 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
157 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
158 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
159 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
160
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
161 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
162 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
163 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
164 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
165
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
166 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
167
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
168 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
169 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
170
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
171 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
172 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
173 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
174 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
175
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
176 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
177 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
178 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
179
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
180 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
181 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
182 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
183
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
184 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
185 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
186
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
187 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
188 const QString& cond = "");
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
189
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
190 void recover_from_exit (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
191 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
192
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
193 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
194
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
195 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
196
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
197 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
198
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
199 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
200
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
201 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
202 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
203
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
204 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
205 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
206
25923
a7511a1489b8 call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents: 25914
diff changeset
207 void update_breakpoints_handler (const octave_value_list& argout);
29716
da9c55b3e9fa fix wring row/col indicator in GUI editor when auto intending (bug #60690)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 29698
diff changeset
208 void update_rowcol_indicator (int line, int col);
28788
aba2c4eadb83 add functions of loaded packages to auto-completion list (bug #56207)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 28390
diff changeset
209 void update_lexer_settings (bool update_apis_only = false);
aba2c4eadb83 add functions of loaded packages to auto-completion list (bug #56207)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 28390
diff changeset
210
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
211 private slots:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
212
25883
cfdc768b661c allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents: 25369
diff changeset
213 // 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
214 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
215
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
216 // 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
217 void handle_file_reload_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
218
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
219 // 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
220 void handle_file_resave_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
221
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
222 // When user closes QFileDialog box.
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
223 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
224 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
225 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
226 void handle_save_as_filter_selected (const QString& filter);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
227
27893
465ac679e976 Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents: 27787
diff changeset
228 // 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
229 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
230
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
231 // 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
232 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
233
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
234 // 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
235 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
236
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
237 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
238 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
239 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
240 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
241
27397
8132797b4a6a use signal/slot connection in file-editor-tab for thread safety
John W. Eaton <jwe@octave.org>
parents: 27378
diff changeset
242 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
243 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
244 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
245 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
246 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
247
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
248 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
249 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
250
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
251 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
252 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
253 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
254 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
255
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
256 protected:
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
257
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
258 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
259
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
260 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
261
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
262 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
263
29458
c0f86150aa6c begin allowing breakpoints to be set using file name
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
264 void add_breakpoint_event (int line, const QString& cond);
27247
9e5a825bb966 replace more explicit callback functions with lambda expressions
John W. Eaton <jwe@octave.org>
parents: 27198
diff changeset
265
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
266 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
267 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
268 bool restore_breakpoints = true);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
269 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
270 bool check_valid_identifier (QString file_name);
30398
d4d83344d653 maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 29716
diff changeset
271 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
272
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
273 bool unchanged_or_saved (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
274
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
275 void update_lexer (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
276
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
277 void show_dialog (QDialog *dlg, bool modal);
31181
c6c4c6f04170 also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30745
diff changeset
278
27633
fd009322dd9f eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27629
diff changeset
279 public:
31181
c6c4c6f04170 also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30745
diff changeset
280
27605
60cecb3fed04 fix saving modified files when closing editor tabs or octave
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27590
diff changeset
281 int check_file_modified (bool remove = false);
31181
c6c4c6f04170 also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30745
diff changeset
282 QString get_all_bookmarks (void);
c6c4c6f04170 also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30745
diff changeset
283
27633
fd009322dd9f eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27629
diff changeset
284 private:
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
285 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
286 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
287 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
288
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
289 void check_restore_breakpoints (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
290 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
291
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
292 QString get_function_name (void);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
293
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
294 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
295 void update_eol_indicator (void);
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
296
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
297 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
298
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
299 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
300 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
301 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
302 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
303 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
304
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
305 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
306
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
307 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
308 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
309 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
310 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
311 QString m_new_encoding;
25369
c89fa0989e7b prevent notifications on externally changed editor files (bug 53539)
Torsten <mttl@mailbox.org>
parents: 25054
diff changeset
312 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
313
28382
2b52e473b6ef fix focus issues in editor due to qt bug with focus proxy chains (bug #57635)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27923
diff changeset
314 bool m_autoc_active;
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
315 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
316 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
317 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
318 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
319 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
320 int m_ind_char_width;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
321
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
322 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
323
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
324 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
325 QStringList m_bp_conditions;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
326
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
327 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
328 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
329 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
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 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
332 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
333 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
334 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
335 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
336 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
337 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
338
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
339 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
340 {
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
341 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
342 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
343 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
344 };
27089
9326c2258e60 fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27053
diff changeset
345
27378
6d0585c8ee11 use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents: 27302
diff changeset
346 breakpoint_info m_breakpoint_info;
31648
29d734430e5f maint: Re-indent code after switch to using namespace macros.
John W. Eaton <jwe@octave.org>
parents: 31646
diff changeset
347 };
27089
9326c2258e60 fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27053
diff changeset
348
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31181
diff changeset
349 OCTAVE_END_NAMESPACE(octave)
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
350
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
351 #endif