annotate libgui/src/m-editor/file-editor.h @ 19748:21015ca26566

Restructure shutdown flow and behavior for improved robustness * file-editor-interface.h (file_editor_interface::check_closing): Remove closing_state argument from input. * file-editor-tab.cc (file_editor_tab::_cancelled): New static variable for managing chain of file closes. (file_editor_tab::file_editor_tab): Discard _app_closing and _modal_dialog initializations. (file_editor_tab::closeEvent): Upon accepting the close event, als request tab removal. (file_editor_tab::check_modified_file): New simple routine checking for modified file if there hasn't been cancellation yet. (file_editor_tab::run_file): Remove use of _modal_dialog. (file_editor_tab::show_dialog): Add modal input setting. Remove use of _app_closing and _modal_dialog. (file_editor_tab::check_file_modified): Remove situational message for just one. If modified, call show_dialog with modal true, return QMessageBox::Cancel if anything cancelled, otherwise the user decision. (file_editor_tab::handle_file_modified_answer): Do not remove file editor tab in any case. If user cancelled, set _cancelled true. (file_editor_tab::save_file): Add "false" (non-modal) to show_dialog() call. (file_editor_tab::save_file_as): Add "false" (non-modal) to show_dialog() call. (file_editor_tab::conditional_close): Remove input argument and use of variable _app_closing. * file-editor-tab.h (file_editor_tab::conditional_close): Remove input argument. (file_editor_tab::reset_cancel): New member function declaration for managing cancellation of tab chain saves. (file_editor_tab::was_cancel): New member function for indicating any cancellation when saving modified files. (file_editor_tab::check_modified_file): New slot declaration for checking and saving file modifications. (file_editor_tab::show_dialog): Add modal option input argument. (file_editor_tab::_app_closing, file_editor_tab::_modal_dialog): Remove. (file_editor_tab::_cancelled): Add. * file-editor.cc (file_editor::file_editor): Remove _check_closing_done initialization. (file_editor::~file_editor): Remove use of _check_closing_done and check_closing(). (file_editor::check_closing): Clear cancellation history and check all files for modifications, without closing. Close all tabs and delete associated widgets if no cancellation. Remove use of _check_closing_done. (file_editor::request_close_file): Remove argument from conditional_close() function call. (file_editor::request_close_all_files): Ditto. (file_editor::request_close_other_files): Ditto. (file_editor::handle_tab_close_request): Ditto. (file_editor::handle_tab_remove_request): Add comment about deleting sender. (file_editor::add_file_editor_tab): Connect fetab_check_modified_file signal to check_modified_file slot. * file-editor.h (file_editor::fetab_check_modified_file): New signal. (file_editor::check_closing): Remove input argument. (file_editor::_check_closing_done): Remove. * main-window.cc (main_window::confirm_shutdown_octave): Rename of member function main_window::confirm_exit_octave(). Change return type to void. Set octave/qt link confirmation result then awake worker process. (main_window::exit_app): Rename of member function main_window::exit(). (main_window::closeEvent): Rather than post callback event, queue "exit" in the command buffer. (main_window::construct_octave_qt_link): Connect confirm_shutdown_signal to confirm_shutdown_octave slot. Connect exit_app_signal to exit_app slot. (main_window::exit_callback): Remove. (main_window::confirm_exit_octave): Renamed as confirm_shutdown_octave(). * main-window.h (main_window::confirm_shutdown_octave): Rename of slot confirm_exit_octave(). (main_window::exit): Renamed exit_app(). (main_window::exit_callback): Removed declaration. (main_window::confirm_exit_octave): Renamed confirm_shutdown_octave(). * octave-qt-link.cc (octave_qt_link::do_confirm_shutdown): New virtual function definition for initiating GUI shutdown and confirm exit. Worker process goes into sleep mode after issuing cross-thread signal. Return confirmation result. (octave_qt_link::do_exit): Change exit_signal to exit_app_signal. octave-qt-link.h (octave_qt_link::do_confirm_shutdown): New virtual function declaration for qt GUI. (octave_qt_link::mutex): Added. A QMutex for communicating with Qt GUI. (octave_qt_link::waitcondition): Added. For process wait. (octave_qt_link::shutdown_confirmation): Added. Store confirmation result. (octave_qt_link::_shutdown_confirm_result): Added. Confirmation result. (octave_qt_link::exit_signal): Signal renamed exit_app_signal. (octave_qt_link::confirm_shutdown_signal): Added. (octave_qt_link::exit_app_signal): Renamed of exit_signal. octave-link.h (octave_link::confirm_shutdown): Added. Access virtual function do_confirm_shutdown. (octave_link::do_confirm_shutdown): Added. Virtual function for GUI link. toplev.cc (clean_up_and_exit): Change 'retval' to 'status', as header file uses argument name 'status'. (quit): First initiate GUI shutdown via octave_link::confirm_shutdown() and if not confirmed, immediately return thereby avoiding exit sequence.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Sat, 14 Feb 2015 11:27:10 -0600
parents 4197fc428c7d
children 415864f5b85f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
19731
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19726
diff changeset
3 Copyright (C) 2011-2015 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 along with Octave; see the file COPYING. If not, see
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
19 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 #ifndef FILEEDITORMDISUBWINDOW_H
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #define FILEEDITORMDISUBWINDOW_H
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #include <QToolBar>
13584
e76a22bfe406 editor: added bookmark feature
ttl <ttl@justmail.de>
parents: 13562
diff changeset
27 #include <QAction>
13562
a89aa9e05e19 editor: menu bar, run editor file in octave
ttl <ttl@justmail.de>
parents: 13558
diff changeset
28 #include <QMenuBar>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 #include <QStatusBar>
13524
8c143d6d0330 gui-editor: improved behaviour when closing a modified file
ttl (Torsten) <ttl@justmail.de>
parents: 13506
diff changeset
30 #include <QCloseEvent>
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14674
diff changeset
31 #include <QTabWidget>
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
32 #include <QStackedWidget>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33
18685
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
34 #include <QDragEnterEvent>
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
35 #include <QDropEvent>
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
36
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
37 #include <map>
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
38
15155
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15106
diff changeset
39 #include "file-editor-interface.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15106
diff changeset
40 #include "file-editor-tab.h"
9e62d5a3a45e partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents: 15106
diff changeset
41
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
42 class file_editor : public file_editor_interface
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
43 {
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15365
diff changeset
44 Q_OBJECT
14307
be3e1a14a6de Added an interface settings tab to the settings dialog. Made a few improvements on the editor. Wrote a small welcome text in the welcome wizard. Moved configuration file to ~/.config/octave-gui/settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14290
diff changeset
45
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
46 public:
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
47
16546
c1e90c7cfd30 try harder to find editor tab widgets for files with multiple names
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
48 typedef std::map<QString, QWidget *>::iterator editor_tab_map_iterator;
c1e90c7cfd30 try harder to find editor tab widgets for files with multiple names
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
49 typedef std::map<QString, QWidget *>::const_iterator editor_tab_map_const_iterator;
c1e90c7cfd30 try harder to find editor tab widgets for files with multiple names
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
50
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
51 file_editor (QWidget *p);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
52 ~file_editor (void);
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
53
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
54 void loadFile (const QString& fileName);
14715
b4db843b1f26 Done some extra method renaming to fit the overall octave coding style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
55
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
56 QMenu *get_mru_menu (void) { return _mru_file_menu; }
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
57 QMenu *debug_menu (void);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
58 QToolBar *toolbar (void);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
59 void insert_new_open_actions (QAction*,QAction*,QAction*);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
60
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
61 void handle_enter_debug_mode (void);
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
62 void handle_exit_debug_mode (void);
14830
41b86dc61306 Removed run command, instead cding into the script directory and executing script directly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14825
diff changeset
63
17009
adf06e03fbdd Enable/disable editor actions based on available editor windows
John Donoghue <john.donoghue@ieee.org>
parents: 16981
diff changeset
64 void check_actions (void);
18399
2ea741d22554 create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents: 18303
diff changeset
65 void empty_script (bool startup, bool visible);
2ea741d22554 create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents: 18303
diff changeset
66
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
67 signals:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
68
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16399
diff changeset
69 void fetab_settings_changed (const QSettings *settings);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
70 void fetab_change_request (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
71 void fetab_file_name_query (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
72 // Save is a ping-pong type of communication
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
73 void fetab_save_file (const QWidget* ID, const QString& fileName,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
74 bool remove_on_success);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
75 // No fetab_open, functionality in editor
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
76 // No fetab_new, functionality in editor
17627
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 17009
diff changeset
77 void fetab_context_help (const QWidget* ID, bool);
17628
99ffa521ecec Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents: 17627
diff changeset
78 void fetab_context_edit (const QWidget* ID);
19748
21015ca26566 Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 19731
diff changeset
79 void fetab_check_modified_file (void);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
80 void fetab_save_file (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
81 void fetab_save_file_as (const QWidget* ID);
16440
aaf024ac8015 Add editor print menu/toolbutton implementation
John Donoghue <john.donoghue@ieee.org>
parents: 16438
diff changeset
82 void fetab_print_file (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: 15552
diff changeset
83 void fetab_run_file (const QWidget* ID);
17635
7945344506ae Add possibility to run selected text of the editor in the terminal
Torsten <ttl@justmail.de>
parents: 17628
diff changeset
84 void fetab_context_run (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: 15552
diff changeset
85 void fetab_toggle_bookmark (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
86 void fetab_next_bookmark (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
87 void fetab_previous_bookmark (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
88 void fetab_remove_bookmark (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
89 void fetab_toggle_breakpoint (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
90 void fetab_next_breakpoint (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
91 void fetab_previous_breakpoint (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
92 void fetab_remove_all_breakpoints (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
93 void fetab_comment_selected_text (const QWidget* ID);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
94 void fetab_uncomment_selected_text (const QWidget* ID);
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
95 void fetab_indent_selected_text (const QWidget* ID);
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
96 void fetab_unindent_selected_text (const QWidget* ID);
19281
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
97 void fetab_convert_eol (const QWidget* ID, QsciScintilla::EolMode eol_mode);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
98 void fetab_find (const QWidget* ID);
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
99 void fetab_goto_line (const QWidget* ID, int line = -1);
19663
8ef79bc61d8a add actions for moving/selecting to matching brace
Torsten <ttl@justmail.de>
parents: 19629
diff changeset
100 void fetab_move_match_brace (const QWidget* ID, bool select);
18482
3a509de8e791 automatic completion list as user preference (bug #41469)
Torsten <ttl@justmail.de>
parents: 18460
diff changeset
101 void fetab_completion (const QWidget*);
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
102 void fetab_insert_debugger_pointer (const QWidget* ID, int line = -1);
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
103 void fetab_delete_debugger_pointer (const QWidget* ID, int line = -1);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
104 void fetab_do_breakpoint_marker (bool insert, const QWidget* ID,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
105 int line = -1);
15980
6c0fce0632a4 gui: set keyboard focus when switching between dock widgets (bug #36957)
Torsten <ttl@justmail.de>
parents: 15860
diff changeset
106 void fetab_set_focus (const QWidget* ID);
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
107 void fetab_scintilla_command (const QWidget* ID, unsigned int sci_msg);
18573
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
108
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
109 void fetab_zoom_in (const QWidget* ID);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
110 void fetab_zoom_out (const QWidget* ID);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
111 void fetab_zoom_normal (const QWidget* ID);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
112
17676
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
113 void request_settings_dialog (const QString&);
17901
2c241092b47b use edit.m for creating a new function with the gui (bug #40502)
Torsten <ttl@justmail.de>
parents: 17744
diff changeset
114 void execute_command_in_terminal_signal (const QString&);
2c241092b47b use edit.m for creating a new function with the gui (bug #40502)
Torsten <ttl@justmail.de>
parents: 17744
diff changeset
115 void file_loaded_signal ();
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
116
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13557
diff changeset
117 public slots:
19463
be53bf420464 fix access to already removed editor window at exit
Torsten <ttl@justmail.de>
parents: 19461
diff changeset
118
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
119 void focus (void);
19463
be53bf420464 fix access to already removed editor window at exit
Torsten <ttl@justmail.de>
parents: 19461
diff changeset
120 void enable_menu_shortcuts (bool);
19748
21015ca26566 Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 19731
diff changeset
121 bool check_closing (void);
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
122
16452
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16443
diff changeset
123 void request_new_file (const QString& commands);
16566
662a712b8fd5 partial menu bar cleanup
John W. Eaton <jwe@octave.org>
parents: 16558
diff changeset
124 void request_new_script (const QString& commands);
17901
2c241092b47b use edit.m for creating a new function with the gui (bug #40502)
Torsten <ttl@justmail.de>
parents: 17744
diff changeset
125 void request_new_function (bool triggered = true);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
126 void request_open_file (void);
16615
cb09eecbd84e add close actions to the file menu of the editor
Torsten <ttl@justmail.de>
parents: 16614
diff changeset
127 void request_close_file (bool);
cb09eecbd84e add close actions to the file menu of the editor
Torsten <ttl@justmail.de>
parents: 16614
diff changeset
128 void request_close_all_files (bool);
cb09eecbd84e add close actions to the file menu of the editor
Torsten <ttl@justmail.de>
parents: 16614
diff changeset
129 void request_close_other_files (bool);
16614
49653ed9561b Use menu triggered signal instead of action triggered signal to rid cast.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16611
diff changeset
130 void request_mru_open_file (QAction *action);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
131 void request_print_file (bool);
13524
8c143d6d0330 gui-editor: improved behaviour when closing a modified file
ttl (Torsten) <ttl@justmail.de>
parents: 13506
diff changeset
132
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
133 void request_undo (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
134 void request_redo (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
135 void request_copy (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
136 void request_cut (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
137 void request_paste (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
138 void request_selectall (bool);
17627
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 17009
diff changeset
139 void request_context_help (bool);
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 17009
diff changeset
140 void request_context_doc (bool);
17628
99ffa521ecec Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents: 17627
diff changeset
141 void request_context_edit (bool);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
142 void request_save_file (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
143 void request_save_file_as (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
144 void request_run_file (bool);
17635
7945344506ae Add possibility to run selected text of the editor in the terminal
Torsten <ttl@justmail.de>
parents: 17628
diff changeset
145 void request_context_run (bool);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
146 void request_toggle_bookmark (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
147 void request_next_bookmark (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
148 void request_previous_bookmark (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
149 void request_remove_bookmark (bool);
14825
eae0e9f2a8c6 Added menus, markers and methods to visualize debugging in the editor and add, remove and navigate breakpoints* .
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14795
diff changeset
150
19663
8ef79bc61d8a add actions for moving/selecting to matching brace
Torsten <ttl@justmail.de>
parents: 19629
diff changeset
151 void request_move_match_brace (bool);
8ef79bc61d8a add actions for moving/selecting to matching brace
Torsten <ttl@justmail.de>
parents: 19629
diff changeset
152 void request_sel_match_brace (bool);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
153 void request_toggle_breakpoint (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
154 void request_next_breakpoint (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
155 void request_previous_breakpoint (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
156 void request_remove_breakpoint (bool);
14825
eae0e9f2a8c6 Added menus, markers and methods to visualize debugging in the editor and add, remove and navigate breakpoints* .
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14795
diff changeset
157
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
158 void request_delete_start_word (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
159 void request_delete_end_word (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
160 void request_delete_start_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
161 void request_delete_end_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
162 void request_delete_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
163 void request_copy_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
164 void request_cut_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
165 void request_duplicate_selection (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
166 void request_transpose_line (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
167
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
168 void request_comment_selected_text (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
169 void request_uncomment_selected_text (bool);
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
170
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
171 void request_upper_case (bool);
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
172 void request_lower_case (bool);
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
173 void request_indent_selected_text (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
174 void request_unindent_selected_text (bool);
19281
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
175 void request_conv_eol_windows (bool);
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
176 void request_conv_eol_unix (bool);
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
177 void request_conv_eol_mac (bool);
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
178
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
179 void request_find (bool);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
180
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
181 void request_goto_line (bool);
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
182 void request_completion (bool);
16375
f482302d81c9 editor goto line menu item (bug #38590)
John Donoghue <john.donoghue@ieee.org>
parents: 16291
diff changeset
183
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
184 void handle_file_name_changed (const QString& fileName,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
185 const QString& toolTip);
14715
b4db843b1f26 Done some extra method renaming to fit the overall octave coding style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
186 void handle_tab_close_request (int index);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
187 void handle_tab_remove_request (void);
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
188 void handle_add_filename_to_list (const QString& fileName, QWidget *ID);
14715
b4db843b1f26 Done some extra method renaming to fit the overall octave coding style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
189 void active_tab_changed (int index);
18801
095fdef3d67c use editors run selection action for the context menu
Torsten <ttl@justmail.de>
parents: 18782
diff changeset
190 void handle_editor_state_changed (bool enableCopy, const QString& fileName,
095fdef3d67c use editors run selection action for the context menu
Torsten <ttl@justmail.de>
parents: 18782
diff changeset
191 bool is_octave_file);
15860
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
192 void handle_mru_add_file (const QString& file_name);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
193 void check_conflict_save (const QString& fileName, bool remove_on_success);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
194
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
195 void handle_insert_debugger_pointer_request (const QString& file, int line);
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
196 void handle_delete_debugger_pointer_request (const QString& file, int line);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
197 void handle_update_breakpoint_marker_request (bool insert,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
198 const QString& file, int line);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
199
16399
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
200 void handle_edit_file_request (const QString& file);
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
201
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
202 // Tells the editor to react on changed settings.
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16399
diff changeset
203 void notice_settings (const QSettings *settings);
13524
8c143d6d0330 gui-editor: improved behaviour when closing a modified file
ttl (Torsten) <ttl@justmail.de>
parents: 13506
diff changeset
204
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
205 void set_shortcuts ();
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
206
18399
2ea741d22554 create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents: 18303
diff changeset
207 void handle_visibility (bool visible);
2ea741d22554 create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents: 18303
diff changeset
208
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
209
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16809
diff changeset
210 protected slots:
18782
64bd9afac22c Add back main menu copy,paste,select all in editor
John Donoghue <john.donoghue@ieee.org>
parents: 18723
diff changeset
211 void copyClipboard ();
64bd9afac22c Add back main menu copy,paste,select all in editor
John Donoghue <john.donoghue@ieee.org>
parents: 18723
diff changeset
212 void pasteClipboard ();
64bd9afac22c Add back main menu copy,paste,select all in editor
John Donoghue <john.donoghue@ieee.org>
parents: 18723
diff changeset
213 void selectAll ();
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16809
diff changeset
214
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
215 private slots:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
216
18521
713193ffc8c4 allow to select mutliple files in the editors open file dialog (bug #41664)
Torsten <ttl@justmail.de>
parents: 18482
diff changeset
217 void request_open_files (const QStringList&);
16386
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
218 void request_open_file (const QString& fileName, int line = -1,
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
219 bool debug_pointer = false,
16443
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16440
diff changeset
220 bool breakpoint_marker = false, bool insert = true);
17676
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
221 void request_preferences (bool);
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
222 void request_styles_preferences (bool);
17901
2c241092b47b use edit.m for creating a new function with the gui (bug #40502)
Torsten <ttl@justmail.de>
parents: 17744
diff changeset
223 void restore_create_file_setting ();
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
224
19280
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
225 void show_line_numbers (bool);
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
226 void show_white_space (bool);
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
227 void show_eol_chars (bool);
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
228 void show_indent_guides (bool);
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
229 void show_long_line (bool);
18573
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
230 void zoom_in (bool);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
231 void zoom_out (bool);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
232 void zoom_normal (bool);
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
233
18721
99e26cb0f87f use the actions from the editor for the context menu
Torsten <ttl@justmail.de>
parents: 18720
diff changeset
234 void create_context_menu (QMenu *);
18723
fac35875f6eb update enabled status of undo/redo actions in the editor
Torsten <ttl@justmail.de>
parents: 18721
diff changeset
235 void edit_status_update (bool, bool);
18721
99e26cb0f87f use the actions from the editor for the context menu
Torsten <ttl@justmail.de>
parents: 18720
diff changeset
236
18685
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
237 protected:
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
238
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
239 void dragEnterEvent(QDragEnterEvent *event);
992b6354c8c6 GUI: implement file drag and drop to command and edit window (Bug #41443)
John Donoghue
parents: 18573
diff changeset
240 void dropEvent(QDropEvent *event);
19629
be7ac98fab43 strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19463
diff changeset
241
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
242 private:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
243
18545
17baa684892c fix flashing while debuggung and editor is tabbed behind console (bug #41757)
Torsten <ttl@justmail.de>
parents: 17903
diff changeset
244 bool is_editor_console_tabbed ();
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
245 void construct (void);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
246 void add_file_editor_tab (file_editor_tab *f, const QString& fn);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
247 void save_file_as (QWidget *fetabID = 0);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
248 void mru_menu_update (void);
17903
de8591a19bc6 check for custom editor when opening a new file from the gui (bug #40496)
Torsten <ttl@justmail.de>
parents: 17901
diff changeset
249 bool call_custom_editor (const QString& file_name = QString (), int line = -1);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
250
19280
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
251 void toggle_preference (const QString& preference, bool def);
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
252
16546
c1e90c7cfd30 try harder to find editor tab widgets for files with multiple names
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
253 QWidget *find_tab_widget (const QString& openFileName) const;
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
254 QAction *add_action (QMenu *menu, const QIcon &icon, const QString &text,
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
255 const char *member);
16546
c1e90c7cfd30 try harder to find editor tab widgets for files with multiple names
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
256
18978
b2c4d6d461f0 fix conflict between main and editor menus when using alt keys (bug #42659)
Torsten <ttl@justmail.de>
parents: 18801
diff changeset
257 QMenu* m_add_menu (QMenuBar *p, QString text);
b2c4d6d461f0 fix conflict between main and editor menus when using alt keys (bug #42659)
Torsten <ttl@justmail.de>
parents: 18801
diff changeset
258
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
259 std::map<QString, QWidget *> editor_tab_map;
18978
b2c4d6d461f0 fix conflict between main and editor menus when using alt keys (bug #42659)
Torsten <ttl@justmail.de>
parents: 18801
diff changeset
260 QHash<QMenu*, QStringList> _hash_menu_text;
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
261
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15552
diff changeset
262 QString ced;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14674
diff changeset
263
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
264 QMenuBar *_menu_bar;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
265 QToolBar *_tool_bar;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
266 QMenu *_debug_menu;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
267
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
268 QAction *_new_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
269 QAction *_new_function_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
270 QAction *_open_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
271
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
272 QAction *_upper_case_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
273 QAction *_lower_case_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
274 QAction *_comment_selection_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
275 QAction *_uncomment_selection_action;
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
276 QAction *_indent_selection_action;
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
277 QAction *_unindent_selection_action;
19281
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
278 QAction *_conv_eol_windows_action;
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
279 QAction *_conv_eol_unix_action;
9582fad68730 add actions for converting the eol characters of the editor file
Torsten <ttl@justmail.de>
parents: 19280
diff changeset
280 QAction *_conv_eol_mac_action;
18303
106da7544504 gui: Add indent/unindent edit menu to editor (Bug #41223)
John Donoghue <john.donoghue@ieee.org>
parents: 17903
diff changeset
281
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
282 QAction *_copy_action;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
283 QAction *_cut_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
284 QAction *_paste_action;
18568
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 18551
diff changeset
285 QAction *_selectall_action;
17627
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 17009
diff changeset
286 QAction *_context_help_action;
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 17009
diff changeset
287 QAction *_context_doc_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
288
19280
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
289 QAction *_show_linenum_action;
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
290 QAction *_show_whitespace_action;
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
291 QAction *_show_eol_action;
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
292 QAction *_show_indguide_action;
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
293 QAction *_show_longline_action;
18573
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
294 QAction *_zoom_in_action;
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
295 QAction *_zoom_out_action;
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
296 QAction *_zoom_normal_action;
26d15a57f45b add menu entries and shortcuts for zoom functions in the editor (bug #41516)
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
297
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
298 QAction *_delete_start_word_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
299 QAction *_delete_end_word_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
300 QAction *_delete_start_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
301 QAction *_delete_end_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
302 QAction *_delete_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
303 QAction *_copy_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
304 QAction *_cut_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
305 QAction *_duplicate_selection_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
306 QAction *_transpose_line_action;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
307
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
308 QAction *_find_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
309 QAction *_goto_line_action;
18482
3a509de8e791 automatic completion list as user preference (bug #41469)
Torsten <ttl@justmail.de>
parents: 18460
diff changeset
310 QAction *_completion_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
311
19663
8ef79bc61d8a add actions for moving/selecting to matching brace
Torsten <ttl@justmail.de>
parents: 19629
diff changeset
312 QAction *_move_to_matching_brace;
8ef79bc61d8a add actions for moving/selecting to matching brace
Torsten <ttl@justmail.de>
parents: 19629
diff changeset
313 QAction *_sel_to_matching_brace;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
314 QAction *_next_bookmark_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
315 QAction *_previous_bookmark_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
316 QAction *_toggle_bookmark_action;
17009
adf06e03fbdd Enable/disable editor actions based on available editor windows
John Donoghue <john.donoghue@ieee.org>
parents: 16981
diff changeset
317 QAction * _remove_bookmark_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
318
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
319 QAction *_print_action;
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
320 QAction *_run_action;
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
321 QAction *_run_selection_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
322
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
323 QAction *_edit_function_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
324 QAction *_save_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
325 QAction *_save_as_action;
16981
e86df0d43309 make ctrl-w available for readline in the gui terminal
Torsten <ttl@justmail.de>
parents: 16970
diff changeset
326 QAction *_close_action;
17009
adf06e03fbdd Enable/disable editor actions based on available editor windows
John Donoghue <john.donoghue@ieee.org>
parents: 16981
diff changeset
327 QAction *_close_all_action;
adf06e03fbdd Enable/disable editor actions based on available editor windows
John Donoghue <john.donoghue@ieee.org>
parents: 16981
diff changeset
328 QAction *_close_others_action;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
329
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
330 QAction *_redo_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
331 QAction *_undo_action;
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
332
17676
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
333 QAction *_preferences_action;
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
334 QAction *_styles_preferences_action;
c060ad097056 add menu entries to the editor for directly accessing the editor's settings
Torsten <ttl@justmail.de>
parents: 17635
diff changeset
335
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
336 QAction *_toggle_breakpoint_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
337 QAction *_next_breakpoint_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
338 QAction *_previous_breakpoint_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
339 QAction *_remove_all_breakpoints_action;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
340
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
341 QMenu *_edit_cmd_menu;
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
342 QMenu *_edit_fmt_menu;
18699
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
343 QMenu *_edit_nav_menu;
777281eeb3d4 add all editor actions to the shortcut manager and fix their shortcut context
Torsten <ttl@justmail.de>
parents: 18690
diff changeset
344 QMenu *_fileMenu;
19280
62756ba9e4e5 add actions for showing text formatting chars and guides in the editor
Torsten <ttl@justmail.de>
parents: 18978
diff changeset
345 QMenu *_view_editor_menu;
18690
1b289f45187f add some qscintilla actions to the menu and to the shortcut manager
Torsten <ttl@justmail.de>
parents: 18685
diff changeset
346
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
347 QTabWidget *_tab_widget;
16970
78116b88dbf5 enable readline key bindings in terminal widget of gui (bug #36986)
Torsten <ttl@justmail.de>
parents: 16881
diff changeset
348
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16546
diff changeset
349 int _marker_breakpoint;
15860
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
350
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
351 enum { MaxMRUFiles = 10 };
15993
41471c02d51c gui: show menu with recently used editor files also in file menu of main window
Torsten <ttl@justmail.de>
parents: 15984
diff changeset
352 QMenu *_mru_file_menu;
15860
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
353 QAction *_mru_file_actions[MaxMRUFiles];
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
354 QStringList _mru_files;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
355 };
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
356
16291
c22a6cecaedd build: Use AMCOND to build GUI editor if Qscintilla available.
Rik <rik@octave.org>
parents: 16290
diff changeset
357 #endif // FILEEDITORMDISUBWINDOW_H