annotate libgui/src/main-window.h @ 16452:744ff2fe11ce

add create script context menu to history window * history-dockwidget.h (history_doc_widget::command_create_script): New signal. * history-dockwidget.cc, history-dockwidget.h (history_dock_widget::ctxMenu): New menu item, Create script. (history_dock_widget::handle_contextmenu_create_script): New function. * file-editor-interface.h (file-editor-interface::request_new_file): New argument, commands. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::new_file): New argument, commands. * m-editor/file-editor.h, m-editor/file-editor.cc (file_editor::new_file, file_editor::request_new_file): New argument, commands. * main-window.h, main-window.cc (main_window::new_file): New argument, commands. main_window::construct): Connect history_window::command_create_script signal to main_window::new_file.
author John Donoghue <john.donoghue@ieee.org>
date Sat, 06 Apr 2013 23:58:58 -0400
parents d4c3736e1e28
children 2e3c652c89d1
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
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
3 Copyright (C) 2011-2012 Jacob Dawid
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
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16446
diff changeset
23 #if !defined (main_window_h)
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16446
diff changeset
24 #define main_window_h 1
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
26 // Qt includes
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27 #include <QtGui/QMainWindow>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 #include <QThread>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 #include <QTabWidget>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 #include <QMdiArea>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 #include <QStatusBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 #include <QToolBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 #include <QQueue>
13626
cc90c62ada21 Removed terminal, instead now using QPlainTextEdit, which looks much nicer and is not that error-prone...
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13614
diff changeset
34 #include <QMdiSubWindow>
14318
df86157a4912 Re-enable MSVC/Win32 compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 14308
diff changeset
35 #include <QCloseEvent>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14602
diff changeset
36 #include <QToolButton>
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
37 #include <QComboBox>
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
38
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14674
diff changeset
39 // Editor includes
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
40 #include "file-editor-interface.h"
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
41
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
42 // QTerminal includes
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
43 #include "QTerminal.h"
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
44
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
45 // Own includes
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
46 #include "resource-manager.h"
16445
3f8d3fc907af store workspace model in main_window, not in workspace view
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
47 #include "workspace-model.h"
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
48 #include "workspace-view.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
49 #include "history-dockwidget.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
50 #include "files-dockwidget.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
51 #include "terminal-dockwidget.h"
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15045
diff changeset
52 #include "documentation-dockwidget.h"
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
53 #include "octave-qt-event-listener.h"
16421
40d1ddca4db5 improve use of octave_link
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
54 #include "octave-qt-link.h"
13614
5cb93c6d8aab Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13611
diff changeset
55
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
56 /**
15367
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
57 * \class MainWindow
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
58 *
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
59 * Represents the main window.
501a9cc2c68f maint: whitespace cleanup in GUI code
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15300
diff changeset
60 */
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
61 class main_window : public QMainWindow
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
62 {
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
63 Q_OBJECT
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
64
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
65 public:
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
66
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
67 main_window (QWidget *parent = 0);
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
68
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
69 ~main_window ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
70
16449
c129a8b73d25 avoid unneeded signals for window focus
John W. Eaton <jwe@octave.org>
parents: 16448
diff changeset
71 void focus_command_window (void);
c129a8b73d25 avoid unneeded signals for window focus
John W. Eaton <jwe@octave.org>
parents: 16448
diff changeset
72
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13533
diff changeset
73 signals:
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
74 void settings_changed (const QSettings *);
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
75 void relay_command_signal (const QString&);
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
76
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13533
diff changeset
77 public slots:
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
78 void report_status_message (const QString& statusMessage);
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
79 void handle_save_workspace_request ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
80 void handle_load_workspace_request ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
81 void handle_clear_workspace_request ();
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
82 void handle_clear_history_request (void);
16452
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16451
diff changeset
83 void new_file (const QString& commands = QString ());
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
84 void open_file ();
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
85 void open_file (const QString& file_name);
15989
afc4e08f2143 Add access to documentation and to online html page via Help menu
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15987
diff changeset
86 void open_online_documentation_page ();
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
87 void open_bug_tracker_page ();
15989
afc4e08f2143 Add access to documentation and to online html page via Help menu
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15987
diff changeset
88 void open_octave_forge_page ();
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
89 void open_agora_page ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
90 void process_settings_dialog_request ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
91 void show_about_octave ();
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
92 void notice_settings (const QSettings *settings);
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
93 void prepare_for_quit ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
94 void reset_windows ();
16350
d4b6ad43bc87 use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents: 15989
diff changeset
95 void update_workspace (void);
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
96
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
97 void change_directory (const QString& dir);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
98 void browse_for_directory (void);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
99 void set_current_working_directory (const QString& dir);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
100 void change_directory_up (void);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
101 void accept_directory_line_edit (void);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
102
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
103 void handle_command_double_clicked (const QString& command);
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
104
14812
9d9eb9bac65e Improved menu structure of file, edit and window menu. Removed ambiguous shortcuts, improved focus handling for operating the GUI with the keyboard. Added new shortcuts to focus subwindows directly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14803
diff changeset
105 void focus_workspace ();
9d9eb9bac65e Improved menu structure of file, edit and window menu. Removed ambiguous shortcuts, improved focus handling for operating the GUI with the keyboard. Added new shortcuts to focus subwindows directly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14803
diff changeset
106 void focus_editor ();
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15045
diff changeset
107 void focus_documentation ();
15980
6c0fce0632a4 gui: set keyboard focus when switching between dock widgets (bug #36957)
Torsten <ttl@justmail.de>
parents: 15873
diff changeset
108 void handle_workspace_visible (bool);
6c0fce0632a4 gui: set keyboard focus when switching between dock widgets (bug #36957)
Torsten <ttl@justmail.de>
parents: 15873
diff changeset
109 void handle_editor_visible (bool);
6c0fce0632a4 gui: set keyboard focus when switching between dock widgets (bug #36957)
Torsten <ttl@justmail.de>
parents: 15873
diff changeset
110 void handle_documentation_visible (bool);
14812
9d9eb9bac65e Improved menu structure of file, edit and window menu. Removed ambiguous shortcuts, improved focus handling for operating the GUI with the keyboard. Added new shortcuts to focus subwindows directly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14803
diff changeset
111
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
112 void handle_enter_debugger (void);
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
113 void handle_exit_debugger (void);
14752
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
114 void debug_continue ();
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
115 void debug_step_into ();
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
116 void debug_step_over ();
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
117 void debug_step_out ();
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
118 void debug_quit ();
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
119
15425
8ae34ffe5c1b Retain QsciAPIs lexer_api as part of lexer_octave_gui object (bug #37359)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15402
diff changeset
120 void read_settings ();
8ae34ffe5c1b Retain QsciAPIs lexer_api as part of lexer_octave_gui object (bug #37359)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15402
diff changeset
121 void write_settings ();
15987
47a4c92924a7 gui: prevent error messages at start-up (regression from changeset 6c0fce0632a4)
Torsten <ttl@justmail.de>
parents: 15980
diff changeset
122 void connect_visibility_changed ();
15425
8ae34ffe5c1b Retain QsciAPIs lexer_api as part of lexer_octave_gui object (bug #37359)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15402
diff changeset
123
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
124 protected:
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
125 void closeEvent (QCloseEvent * closeEvent);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
126
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
127 private:
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
128 void construct ();
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
129 void establish_octave_link ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
130
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
131 void save_workspace_callback (const std::string& file);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
132
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
133 void load_workspace_callback (const std::string& file);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
134
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
135 void clear_workspace_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
136
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
137 void clear_history_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
138
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
139 void change_directory_callback (const std::string& directory);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
140
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
141 void debug_continue_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
142
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
143 void debug_step_into_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
144
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
145 void debug_step_over_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
146
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
147 void debug_step_out_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
148
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
149 void debug_quit_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
150
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
151 void exit_callback (void);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
152
16448
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
153 // Data models.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
154 workspace_model *_workspace_model;
16448
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
155
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
156 // Toolbars.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
157 QStatusBar *status_bar;
16448
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
158
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
159 // Subwindows.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
160 terminal_dock_widget *command_window;
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
161 history_dock_widget *history_window;
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16449
diff changeset
162 files_dock_widget *file_browser_window;
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16446
diff changeset
163
15873
7d300b85ee25 allow build to proceed if either Qt or QScintilla is missing
John W. Eaton <jwe@octave.org>
parents: 15626
diff changeset
164 #ifdef HAVE_QSCINTILLA
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
165 file_editor_interface * _file_editor;
15873
7d300b85ee25 allow build to proceed if either Qt or QScintilla is missing
John W. Eaton <jwe@octave.org>
parents: 15626
diff changeset
166 #endif
14752
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
167 QMenu * _debug_menu;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
168
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
169 QAction * _debug_continue;
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
170 QAction * _debug_step_into;
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
171 QAction * _debug_step_over;
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
172 QAction * _debug_step_out;
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
173 QAction * _debug_quit;
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
174
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
175 // Dock widgets.
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
176 workspace_view * _workspace_view;
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15045
diff changeset
177 documentation_dock_widget*_documentation_dock_widget;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
178
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
179 // Toolbars.
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
180 QComboBox * _current_directory_combo_box;
15626
1cc10ce368ea enable entering a new directory in the current directory combobox
Torsten <ttl@justmail.de>
parents: 15607
diff changeset
181 static const int current_directory_width = 300;
1cc10ce368ea enable entering a new directory in the current directory combobox
Torsten <ttl@justmail.de>
parents: 15607
diff changeset
182 static const int current_directory_max_visible = 16;
1cc10ce368ea enable entering a new directory in the current directory combobox
Torsten <ttl@justmail.de>
parents: 15607
diff changeset
183 static const int current_directory_max_count = 16;
1cc10ce368ea enable entering a new directory in the current directory combobox
Torsten <ttl@justmail.de>
parents: 15607
diff changeset
184 QLineEdit * _current_directory_line_edit;
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14602
diff changeset
185
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
186 octave_qt_event_listener *_octave_qt_event_listener;
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
187
16421
40d1ddca4db5 improve use of octave_link
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
188 octave_qt_link *_octave_qt_link;
40d1ddca4db5 improve use of octave_link
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
189
13657
347dfbea2c8a modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents: 13648
diff changeset
190 // Flag for closing whole application
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
191 bool _closing;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
192 };
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
193
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
194 #endif // MAINWINDOW_H