Mercurial > octave
annotate libgui/src/m-editor/file-editor-tab.h @ 31181:c6c4c6f04170
also restore bookmarks when restoring an editor session at startup
* gui-preferences-ed.h: add setting for storing bookmarks of editor files
* file-editor-interface.h: additional argument in request_open_file
* file-editor-tab.cc (get_all_bookmarks): new function collecting all
bookmarks and returning it in a list of numbers in a string;
* file-editor-tab.h: new function get_all_bookmarks
* file-editor.cc (restore_session): get list of bookmarks from settings
file and them as argument to request_open_file;
(save_session): collect all bookmarks of open files and store them
into the settings file;
(request_open_file): string with bookmarks as new argument,
if string id non-empty, add all contained bookmarks to the file
* file-editor.h: add bookmarks to session_data, new string argument
with bookmarks for request_open_file
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Wed, 10 Aug 2022 22:24:58 +0200 |
parents | 2f6904439d3c |
children | ad014fc78bd6 c6d54dd31a7e |
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 | 38 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27605
diff
changeset
|
39 #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
|
40 #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
|
41 #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
|
42 #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
|
43 |
21692
de138ebaa7a9
avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents:
21578
diff
changeset
|
44 class octave_value_list; |
de138ebaa7a9
avoid including config.h multiple times
John W. Eaton <jwe@octave.org>
parents:
21578
diff
changeset
|
45 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
46 namespace octave |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
47 { |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
48 class base_qobject; |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
49 class file_editor; |
16558 | 50 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
51 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
|
52 { |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
53 Q_OBJECT |
16558 | 54 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
55 public: |
16558 | 56 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
57 file_editor_tab (base_qobject& oct_qobj, const QString& directory = ""); |
16558 | 58 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
59 ~file_editor_tab (void); |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
60 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
61 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
|
62 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
63 // 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
|
64 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
|
65 |
25923
a7511a1489b8
call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents:
25914
diff
changeset
|
66 void update_breakpoints (); |
30745
2f6904439d3c
fix updating the name of renamed editor files
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30564
diff
changeset
|
67 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
|
68 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
|
69 |
27634
57b9cf9d8796
simplify loop over tabs in file_editor::find_tab_widget
John W. Eaton <jwe@octave.org>
parents:
27633
diff
changeset
|
70 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
|
71 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
|
72 |
27590
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
73 signals: |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
74 |
27605
60cecb3fed04
fix saving modified files when closing editor tabs or octave
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27590
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 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
|
82 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
|
83 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
|
84 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
|
85 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
|
86 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
|
87 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
|
88 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
|
89 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
|
90 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
|
91 |
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
|
92 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
|
93 |
27590
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 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
|
95 |
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 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
|
97 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
|
98 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
|
99 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
|
100 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
|
101 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
|
102 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
|
103 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
|
104 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
|
105 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
|
106 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
107 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
|
108 |
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 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
|
110 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
|
111 |
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 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
|
113 |
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 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
|
115 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
|
116 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
|
117 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
|
118 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
119 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
|
120 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
|
121 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
122 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
|
123 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
|
124 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
|
125 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
|
126 |
27893
465ac679e976
Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents:
27787
diff
changeset
|
127 // 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
|
128 // 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
|
129 // 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
|
130 // |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
131 // 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
|
132 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
133 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
|
134 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
135 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
|
136 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
|
137 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
|
138 Qt::KeyboardModifiers state); |
16558 | 139 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
140 // 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
|
141 void notice_settings (const gui_settings *settings, bool init = false); |
16558 | 142 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
143 // 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
|
144 void change_editor_state (const QWidget *ID); |
16558 | 145 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
146 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
|
147 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
|
148 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
|
149 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
|
150 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
|
151 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
|
152 bool remove_on_success); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
153 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
|
154 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
|
155 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
|
156 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
|
157 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
|
158 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
|
159 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
|
160 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
|
161 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
162 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
|
163 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
|
164 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
|
165 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
|
166 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
167 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
|
168 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
169 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
|
170 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
|
171 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
172 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
|
173 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
|
174 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
|
175 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
|
176 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
177 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
|
178 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
|
179 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
|
180 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
181 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
|
182 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
|
183 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
|
184 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
185 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
|
186 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
|
187 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
188 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
|
189 const QString& cond = ""); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
190 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
191 void recover_from_exit (void); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
192 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
|
193 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
194 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
|
195 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
196 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
|
197 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
198 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
|
199 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
200 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
|
201 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
202 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
|
203 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
|
204 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
205 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
|
206 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
|
207 |
25923
a7511a1489b8
call octave functions with return value from GUI (bug #47585)
Torsten <mttl@mailbox.org>
parents:
25914
diff
changeset
|
208 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
|
209 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
|
210 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
|
211 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
212 private slots: |
16558 | 213 |
25883
cfdc768b661c
allow native dialogs for remaining file open/save dialogs (bug #5
Torsten <mttl@mailbox.org>
parents:
25369
diff
changeset
|
214 // 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
|
215 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
|
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 message box for reload question. |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
218 void handle_file_reload_answer (int decision); |
16558 | 219 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
220 // 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
|
221 void handle_file_resave_answer (int decision); |
16558 | 222 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
223 // When user closes QFileDialog box. |
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 (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_close (const QString& fileName); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
226 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
|
227 void handle_save_as_filter_selected (const QString& filter); |
16558 | 228 |
27893
465ac679e976
Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents:
27787
diff
changeset
|
229 // 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
|
230 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
|
231 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
232 // 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
|
233 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
|
234 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
235 // 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
|
236 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
|
237 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
238 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
|
239 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
|
240 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
|
241 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
|
242 |
27397
8132797b4a6a
use signal/slot connection in file-editor-tab for thread safety
John W. Eaton <jwe@octave.org>
parents:
27378
diff
changeset
|
243 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 |
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
|
249 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
|
250 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
|
251 |
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 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
|
253 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
|
254 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
|
255 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
|
256 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
257 protected: |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
258 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
259 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
|
260 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
261 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
|
262 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
263 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
|
264 |
29458
c0f86150aa6c
begin allowing breakpoints to be set using file name
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
265 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
|
266 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
267 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
|
268 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
|
269 bool restore_breakpoints = true); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
270 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
|
271 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
|
272 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
|
273 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
274 bool unchanged_or_saved (void); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
275 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
276 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
|
277 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
278 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
|
279 |
27633
fd009322dd9f
eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27629
diff
changeset
|
280 public: |
31181
c6c4c6f04170
also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30745
diff
changeset
|
281 |
27605
60cecb3fed04
fix saving modified files when closing editor tabs or octave
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27590
diff
changeset
|
282 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
|
283 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
|
284 |
27633
fd009322dd9f
eliminate static variable in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27629
diff
changeset
|
285 private: |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
286 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
|
287 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
|
288 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
|
289 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
290 void check_restore_breakpoints (void); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
291 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
|
292 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
293 QString get_function_name (void); |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
294 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
295 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
|
296 void update_eol_indicator (void); |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
297 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
298 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
|
299 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
300 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
|
301 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
|
302 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
|
303 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
|
304 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
|
305 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
306 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
|
307 |
27378
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; |
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_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
|
310 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
|
311 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
|
312 QString m_new_encoding; |
25369
c89fa0989e7b
prevent notifications on externally changed editor files (bug 53539)
Torsten <mttl@mailbox.org>
parents:
25054
diff
changeset
|
313 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
|
314 |
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
|
315 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
|
316 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
|
317 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
|
318 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
|
319 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
|
320 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
|
321 int m_ind_char_width; |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
322 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
323 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
|
324 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
325 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
|
326 QStringList m_bp_conditions; |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
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 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
|
329 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
|
330 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
|
331 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
332 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
|
333 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
|
334 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
|
335 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
|
336 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
|
337 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
|
338 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
|
339 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
340 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
|
341 { |
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
342 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
|
343 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
|
344 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
|
345 }; |
27089
9326c2258e60
fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27053
diff
changeset
|
346 |
27378
6d0585c8ee11
use m_ prefix for data members in file_editor_tab class
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
347 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
|
348 }; |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
349 } |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
350 |
16558 | 351 #endif |