annotate libgui/src/main-window.h @ 16502:45ae1038ee89

allow renaming of variables in workspace viewer * main-window.h, main-window.cc (main_window::handle_rename_variable_request): New function. (main_window::construct_octave_qt_link): Connect _workspace_model::rename_variable to main_window::handle_rename_variable_request. (main_window::rename_variable_callback): New function. * octave-qt-link.h, octave-qt-link.cc (octave_qt_link::do_set_workspace, octave_qt_link::set_workspace_signal): New argument, top_level. Change all uses. * octave-link.h, octave-link.cc (octave_link::post_event): Provide two-argument version. (octave_link::set_workspace, octave_link::do_set_workspace): New argument, top_level. Change all uses. * workspace-model.h, workspace-model.cc (workspace_model::flags): Conditionally add Qt::ItemIsEditable to flags. (workspace_model::data): Also return value for column 0 if it is editable. (workspace_model::setData): Handle setting new values. (workspace_model::_top_level): New data member. (workspace_model::set_workspace): New argument, top_level. (workspace_model::rename_variable): New signal. * workspace-view.h, workspace-view.cc (variable_name_editor): New class. (workspace_view::var_name_editor): New data member. (workspace_view::workspace_view): Initialize it. Set var_name_editor as delegate for column 0. (workspace_view::~workspace_view): Delete var_name_editor. (workspace_view::item_double_clicked): Delete. * symtab.h (symbol_table::rename, symbol_table::do_rename, symbol_table::symbol_record::rename): New functions.
author John W. Eaton <jwe@octave.org>
date Fri, 12 Apr 2013 14:50:56 -0400
parents 8b783661e03f
children 49b059bf27c7
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
16453
2e3c652c89d1 improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
3 Copyright (C) 2013 John W. Eaton
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4 Copyright (C) 2011-2012 Jacob Dawid
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 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
9 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
10 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
11 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 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
14 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
15 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
16 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 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
19 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
20 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
22 */
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23
16447
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16446
diff changeset
24 #if !defined (main_window_h)
e3b33a7530bc improve encapsulation of history window object
John W. Eaton <jwe@octave.org>
parents: 16446
diff changeset
25 #define main_window_h 1
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
27 // Qt includes
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 #include <QtGui/QMainWindow>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 #include <QThread>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 #include <QTabWidget>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31 #include <QMdiArea>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 #include <QStatusBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 #include <QToolBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 #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
35 #include <QMdiSubWindow>
14318
df86157a4912 Re-enable MSVC/Win32 compilation.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 14308
diff changeset
36 #include <QCloseEvent>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14602
diff changeset
37 #include <QToolButton>
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
38 #include <QComboBox>
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
39
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14674
diff changeset
40 // Editor includes
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
41 #include "file-editor-interface.h"
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
42
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
43 // QTerminal includes
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
44 #include "QTerminal.h"
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
45
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
46 // Own includes
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
47 #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
48 #include "workspace-model.h"
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
49 #include "workspace-view.h"
16460
4d4e7c6f839d use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents: 16459
diff changeset
50 #include "history-dock-widget.h"
4d4e7c6f839d use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents: 16459
diff changeset
51 #include "files-dock-widget.h"
4d4e7c6f839d use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents: 16459
diff changeset
52 #include "terminal-dock-widget.h"
4d4e7c6f839d use consistent names for dock-widget files
John W. Eaton <jwe@octave.org>
parents: 16459
diff changeset
53 #include "documentation-dock-widget.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
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
67 typedef std::pair <std::string, std::string> name_pair;
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
68
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
69 main_window (QWidget *parent = 0);
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
70
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
71 ~main_window (void);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
72
16449
c129a8b73d25 avoid unneeded signals for window focus
John W. Eaton <jwe@octave.org>
parents: 16448
diff changeset
73 void focus_command_window (void);
c129a8b73d25 avoid unneeded signals for window focus
John W. Eaton <jwe@octave.org>
parents: 16448
diff changeset
74
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13533
diff changeset
75 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
76 void settings_changed (const QSettings *);
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
77 void relay_command_signal (const QString&);
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16456
diff changeset
78 void new_file_signal (const QString&);
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16456
diff changeset
79 void open_file_signal (const QString&);
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
80
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13533
diff changeset
81 public slots:
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
82 void report_status_message (const QString& statusMessage);
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
83 void handle_save_workspace_request (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
84 void handle_load_workspace_request (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
85 void handle_clear_workspace_request (void);
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
86 void handle_clear_history_request (void);
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
87 void handle_rename_variable_request (const QString& old_name,
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
88 const QString& new_name);
16452
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16451
diff changeset
89 void new_file (const QString& commands = QString ());
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16456
diff changeset
90 void open_file (const QString& file_name = QString ());
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
91 void open_online_documentation_page (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
92 void open_bug_tracker_page (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
93 void open_octave_forge_page (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
94 void open_agora_page (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
95 void process_settings_dialog_request (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
96 void show_about_octave (void);
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
97 void notice_settings (const QSettings *settings);
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16460
diff changeset
98 void prepare_to_exit (void);
16485
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
99 void exit (int status);
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
100 void reset_windows (void);
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
101
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
102 void change_directory (const QString& dir);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
103 void browse_for_directory (void);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
104 void set_current_working_directory (const QString& dir);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
105 void change_directory_up (void);
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
106 void accept_directory_line_edit (void);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
107
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16445
diff changeset
108 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
109
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
110 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
111 void handle_exit_debugger (void);
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
112 void debug_continue (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
113 void debug_step_into (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
114 void debug_step_over (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
115 void debug_step_out (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
116 void debug_quit (void);
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
117
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
118 void read_settings (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
119 void write_settings (void);
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
120 void connect_visibility_changed (void);
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
121
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
122 protected:
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
123 void closeEvent (QCloseEvent * closeEvent);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
124
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
125 private:
16454
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
126
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
127 void construct (void);
16454
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
128
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
129 void construct_octave_qt_link (void);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
130
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
131 void construct_menu_bar (void);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
132 void construct_file_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
133 void construct_new_menu (QMenu *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
134 void construct_edit_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
135 void construct_debug_menu_item (QMenu *p, const QString& item,
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
136 const QKeySequence& key);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
137 QAction *construct_debug_menu_item (const char *icon_file,
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
138 const QString& item,
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
139 const QKeySequence& key);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
140 void construct_debug_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
141 void construct_desktop_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
142 QAction *construct_window_menu_item (QMenu *p, const QString& item,
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
143 bool checkable,
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
144 const QKeySequence& key);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
145 void construct_window_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
146 void construct_help_menu (QMenuBar *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
147 void construct_documentation_menu (QMenu *p);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
148
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
149 void construct_tool_bar (void);
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
150
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
151 void establish_octave_link (void);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
152
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
153 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
154
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
155 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
156
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
157 void rename_variable_callback (const name_pair& names);
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
158
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
159 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
160
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
161 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
162
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
163 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
164
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
165 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
166
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
167 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
168
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
169 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
170
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
171 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
172
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
173 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
174
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
175 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
176
16448
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
177 // Data models.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
178 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
179
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
180 // Toolbars.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
181 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
182
47fe533ec85b avoid using new for status bar and workspace_model objects
John W. Eaton <jwe@octave.org>
parents: 16447
diff changeset
183 // Subwindows.
16451
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
184 terminal_dock_widget *command_window;
d4c3736e1e28 dynamically allocate Qt widgets
John W. Eaton <jwe@octave.org>
parents: 16450
diff changeset
185 history_dock_widget *history_window;
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16449
diff changeset
186 files_dock_widget *file_browser_window;
16453
2e3c652c89d1 improve encapsulation of documentation browser window object
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
187 documentation_dock_widget *doc_browser_window;
16457
10edb6f1ae98 improve encapsulation of file editor window object
John W. Eaton <jwe@octave.org>
parents: 16456
diff changeset
188 file_editor_interface *editor_window;
16459
cbc39a3d0c42 improve encapsulation of workspace window object
John W. Eaton <jwe@octave.org>
parents: 16457
diff changeset
189 workspace_view *workspace_window;
16454
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
190
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
191 QMenu *_debug_menu;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
192
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
193 QAction *_debug_continue;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
194 QAction *_debug_step_into;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
195 QAction *_debug_step_over;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
196 QAction *_debug_step_out;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
197 QAction *_debug_quit;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
198
16454
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
199 QAction *_new_script_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
200 QAction *_open_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
201
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
202 QAction *_cut_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
203 QAction *_copy_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
204 QAction *_paste_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
205 QAction *_undo_action;
246d25c8761b split main_window::construct for clarity
John W. Eaton <jwe@octave.org>
parents: 16453
diff changeset
206 QAction *_redo_action;
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
207
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
208 // Toolbars.
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
209 QComboBox *_current_directory_combo_box;
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
210 static const int current_directory_width = 300;
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
211 static const int current_directory_max_visible = 16;
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
212 static const int current_directory_max_count = 16;
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
213 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
214
16485
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
215 octave_main_thread *_octave_main_thread;
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
216
16421
40d1ddca4db5 improve use of octave_link
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
217 octave_qt_link *_octave_qt_link;
40d1ddca4db5 improve use of octave_link
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
218
16456
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
219 // Flag for closing whole application.
203efbbcea63 * main-window.h, main-window.cc: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 16454
diff changeset
220 bool _closing;
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
221 };
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
222
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
223 #endif // MAINWINDOW_H