annotate gui/src/main-window.cc @ 14784:84d1d9c035c7 gui

Changing the directory one step up now does not use the terminal. * main-window.cc: Used event instead of sending text to terminal.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 21 Jun 2012 12:22:01 +0200
parents f43916137064
children e3ae0850b105
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13504
13e3d60aff2d Replaced Quint with OctaveGUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
1 /* OctaveGUI - A graphical user interface for Octave
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3 *
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4 * This program is free software: you can redistribute it and/or modify
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
5 * it under the terms of the GNU General Public License as
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
6 * published by the Free Software Foundation, either version 3 of the
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
7 * License, or (at your option) any later version.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
8 *
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
12 * GNU General Public License for more details.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
13 *
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
14 * You should have received a copy of the GNU General Public License
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16 */
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
18 #include <QMenuBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
19 #include <QMenu>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20 #include <QAction>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 #include <QSettings>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
22 #include <QStyle>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
23 #include <QToolBar>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #include <QDesktopServices>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25 #include <QFileDialog>
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: 13620
diff changeset
26 #include <QMessageBox>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
27 #include <QIcon>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
28
14707
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
29 #include "main-window.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
30 #include "file-editor.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14703
diff changeset
31 #include "settings-dialog.h"
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
33 main_window::main_window (QWidget * parent)
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
34 : QMainWindow (parent), octave_event_observer ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
35 {
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
36 // We have to set up all our windows, before we finally launch octave.
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
37 construct ();
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
38 octave_link::instance ()->launch_octave();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
41 main_window::~main_window ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
42 {
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
44
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
45 void
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
46 main_window::event_accepted (octave_event *e)
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
47 {
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
48 delete e;
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
49 }
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
50
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
51 void
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
52 main_window::event_reject (octave_event *e)
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
53 {
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
54 delete e;
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
55 }
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
56
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
57 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
58 main_window::new_file ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
59 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
60 _file_editor->request_new_file ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
61 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
62
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
63 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
64 main_window::open_file ()
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
65 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
66 _file_editor->request_open_file ();
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
67 }
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
68
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
69 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
70 main_window::report_status_message (QString statusMessage)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
71 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
72 _status_bar->showMessage (statusMessage, 1000);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
73 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
74
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
75 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
76 main_window::handle_save_workspace_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
77 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
78 QString selectedFile =
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
79 QFileDialog::getSaveFileName (this, tr ("Save Workspace"),
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
80 resource_manager::instance ()->get_home_path ());
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
81 _terminal->sendText (QString ("save \'%1\'\n").arg (selectedFile));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
82 _terminal->setFocus ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
83 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
84
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
85 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
86 main_window::handle_load_workspace_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
87 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
88 QString selectedFile =
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
89 QFileDialog::getOpenFileName (this, tr ("Load Workspace"),
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
90 resource_manager::instance ()->get_home_path ());
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
91 if (!selectedFile.isEmpty ())
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
92 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
93 _terminal->sendText (QString ("load \'%1\'\n").arg (selectedFile));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
94 _terminal->setFocus ();
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
95 }
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
96 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
97
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
98 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
99 main_window::handle_clear_workspace_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
100 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
101 _terminal->sendText ("clear\n");
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
102 _terminal->setFocus ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
103 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
104
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
105 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
106 main_window::handle_command_double_clicked (QString command)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
107 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
108 _terminal->sendText(command);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
109 _terminal->setFocus ();
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
110 }
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
111
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
112 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
113 main_window::open_bug_tracker_page ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
114 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
115 QDesktopServices::openUrl (QUrl ("http://savannah.gnu.org/bugs/?group=octave"));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
116 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
117
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
118 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
119 main_window::open_agora_page ()
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
120 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
121 QDesktopServices::openUrl (QUrl ("http://agora.panocha.org.mx/"));
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
122 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
123
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
124 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
125 main_window::open_octave_forge_page ()
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
126 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
127 QDesktopServices::openUrl (QUrl ("http://octave.sourceforge.net/"));
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
128 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
129
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
130 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
131 main_window::process_settings_dialog_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
132 {
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
133 settings_dialog *settingsDialog = new settings_dialog (this);
14586
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
134 settingsDialog->exec ();
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
135 delete settingsDialog;
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
136 emit settings_changed ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
137 resource_manager::instance ()->update_network_settings ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
138 notice_settings();
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
139 }
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
140
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
141 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
142 main_window::notice_settings ()
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
143 {
14695
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14694
diff changeset
144 // Set terminal font:
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
145 QSettings *settings = resource_manager::instance ()->get_settings ();
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
146 QFont font = QFont();
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
147 font.setFamily(settings->value("terminal/fontName").toString());
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
148 font.setPointSize(settings->value("terminal/fontSize").toInt ());
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
149 _terminal->setTerminalFont(font);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
150 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
151
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
152 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
153 main_window::prepare_for_quit ()
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
154 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
155 write_settings ();
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
156 }
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
157
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
158 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
159 main_window::reset_windows ()
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
160 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
161 // TODO: Implement.
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
162 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
163
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
164 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
165 main_window::update_current_working_directory (QString directory)
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
166 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
167 if (_current_directory_combo_box->count () > 31)
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
168 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
169 _current_directory_combo_box->removeItem (0);
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
170 }
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
171 _current_directory_combo_box->addItem (directory);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
172 int index = _current_directory_combo_box->findText (directory);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
173 _current_directory_combo_box->setCurrentIndex (index);
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
174 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
175
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
176 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
177 main_window::change_current_working_directory ()
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
178 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
179 QString selectedDirectory =
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
180 QFileDialog::getExistingDirectory(this, tr ("Set working direcotry"));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
181
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
182 if (!selectedDirectory.isEmpty ())
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
183 {
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
184 octave_link::instance ()
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
185 ->post_event (new octave_change_directory_event (*this,
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
186 selectedDirectory.toStdString ()));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
187 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
188 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
189
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
190 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
191 main_window::change_current_working_directory (QString directory)
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
192 {
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
193 octave_link::instance ()
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
194 ->post_event (new octave_change_directory_event (*this,
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
195 directory.toStdString ()));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
196 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
197
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
198 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
199 main_window::current_working_directory_up ()
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
200 {
14784
84d1d9c035c7 Changing the directory one step up now does not use the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
201 octave_link::instance ()
84d1d9c035c7 Changing the directory one step up now does not use the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
202 ->post_event (new octave_change_directory_event (*this, ".."));
84d1d9c035c7 Changing the directory one step up now does not use the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
203
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
204 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
205
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
206 void
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
207 main_window::handle_entered_debug_mode ()
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
208 {
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
209 setWindowTitle ("Octave (Debugging)");
14778
f43916137064 Added debug menu to file editor.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14757
diff changeset
210 _file_editor->handle_entered_debug_mode ();
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: 14727
diff changeset
211 _debug_menu->setEnabled (true);
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
212 }
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
213
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
214 void
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
215 main_window::handle_quit_debug_mode ()
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
216 {
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
217 setWindowTitle ("Octave");
14778
f43916137064 Added debug menu to file editor.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14757
diff changeset
218 _file_editor->handle_quit_debug_mode ();
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: 14727
diff changeset
219 _debug_menu->setEnabled (false);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
220 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
221
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
222 void
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
223 main_window::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: 14727
diff changeset
224 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
225 octave_link::instance ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
226 ->post_event (new octave_debug_continue_event (*this));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
227 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
228
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
229 void
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
230 main_window::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: 14727
diff changeset
231 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
232 octave_link::instance ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
233 ->post_event (new octave_debug_step_into_event (*this));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
234 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
235
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
236 void
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
237 main_window::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: 14727
diff changeset
238 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
239 octave_link::instance ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
240 ->post_event (new octave_debug_step_over_event (*this));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
241 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
242
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
243 void
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
244 main_window::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: 14727
diff changeset
245 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
246 octave_link::instance ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
247 ->post_event (new octave_debug_step_out_event (*this));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
248 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
249
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
250 void
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
251 main_window::debug_quit ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
252 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
253 octave_link::instance ()
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
254 ->post_event (new octave_debug_quit_event (*this));
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
255 }
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
256
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
257 void
14754
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
258 main_window::update_performance_information ()
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
259 {
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
260 octave_link::performance_information p
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
261 = octave_link::instance ()->get_performance_information ();
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
262
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
263 int generate_events_msec
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
264 = (p.generate_events_stop - p.generate_events_start) * 1000 / CLOCKS_PER_SEC;
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
265
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
266 int process_events_msec
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
267 = (p.process_events_stop - p.process_events_start) * 1000 / CLOCKS_PER_SEC;
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
268
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
269 _status_bar->showMessage
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
270 (QString ("CPU time of the GUI in octave thread - generating rx events: ~%1 ms - processing tx events: ~%2 ms (%3 events)")
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
271 .arg (generate_events_msec)
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
272 .arg (process_events_msec)
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
273 .arg (p.event_queue_size));
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
274 }
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
275
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
276 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
277 main_window::show_about_octave ()
13548
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
278 {
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
279 QString message =
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
280 "GNU Octave\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
281 "Copyright (C) 2009 John W. Eaton and others.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
282 "This is free software; see the source code for copying conditions."
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
283 "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
284 "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
285 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
286 "Octave was configured for \"x86_64-pc-linux-gnu\".\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
287 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
288 "Additional information about Octave is available at http://www.octave.org.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
289 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
290 "Please contribute if you find this software useful."
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
291 "For more information, visit http://www.octave.org/help-wanted.html\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
292 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
293 "Report bugs to <bug@octave.org> (but first, please read"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
294 "http://www.octave.org/bugs.html to learn how to write a helpful report).\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
295 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
296 "For information about changes from previous versions, type `news'.\n";
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
297
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
298 QMessageBox::about (this, tr ("About Octave"), message);
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
299 }
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
300
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
301 void
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
302 main_window::closeEvent (QCloseEvent * closeEvent)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
303 {
14714
4ff6c21c18c4 Solved crash on close by ignoring close event and instead executing exit in the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
304 closeEvent->ignore ();
14721
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
305 octave_link::instance ()->post_event (new octave_exit_event (*this));
14718
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
306 }
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
307
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
308 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
309 main_window::read_settings ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
310 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
311 QSettings *settings = resource_manager::instance ()->get_settings ();
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
312 restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
313 restoreState (settings->value ("MainWindow/windowState").toByteArray ());
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
314 emit settings_changed ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
315 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
316
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
317 void
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
318 main_window::write_settings ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
319 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
320 QSettings *settings = resource_manager::instance ()->get_settings ();
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
321 settings->setValue ("MainWindow/geometry", saveGeometry ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
322 settings->setValue ("MainWindow/windowState", saveState ());
14694
ea11c9d8aa47 Calling qApp->quit () via QMetaObject::invoke caused a segfault, now exits cleanly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14693
diff changeset
323 settings->sync ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
324 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
325
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
326 void
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
327 main_window::construct ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
328 {
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
329 _closing = false; // flag for editor files when closed
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
330 setWindowIcon (resource_manager::instance ()->get_icon (resource_manager::octave));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
331
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
332 // Setup dockable widgets and the status bar.
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
333 _workspace_view = new workspace_view (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
334 _workspace_view->setStatusTip (tr ("View the variables in the active workspace."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
335 _history_dock_widget = new history_dock_widget (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
336 _history_dock_widget->setStatusTip (tr ("Browse and search the command history."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
337 _files_dock_widget = new files_dock_widget (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
338 _files_dock_widget->setStatusTip (tr ("Browse your files."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
339 _status_bar = new QStatusBar (this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
340
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
341 _current_directory_combo_box = new QComboBox (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
342 _current_directory_combo_box->setFixedWidth (300);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
343 _current_directory_combo_box->setEditable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
344 _current_directory_combo_box->setInsertPolicy (QComboBox::InsertAtTop);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
345 _current_directory_combo_box->setMaxVisibleItems (14);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
346
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
347 _current_directory_tool_button = new QToolButton (this);
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
348 _current_directory_tool_button->setIcon (QIcon(":/actions/icons/search.png"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
349
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
350 _current_directory_up_tool_button = new QToolButton (this);
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
351 _current_directory_up_tool_button->setIcon (QIcon(":/actions/icons/up.png"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
352
13550
cd66481d55b0 Added close button to file editor, assorted subwindows after importance.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13549
diff changeset
353 // Octave Terminal subwindow.
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
354 _terminal = new QTerminal (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
355 _terminal->setObjectName ("OctaveTerminal");
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
356 _terminal_dock_widget = new terminal_dock_widget (_terminal, this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
357
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
358 QWidget *dummyWidget = new QWidget ();
14698
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
359 dummyWidget->setObjectName ("CentralDummyWidget");
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
360 dummyWidget->resize (10, 10);
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
361 dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
14698
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
362 dummyWidget->hide ();
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
363 setCentralWidget (dummyWidget);
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
364
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
365 _file_editor = new file_editor (_terminal, this);
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
366
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
367 QMenu *file_menu = menuBar ()->addMenu (tr ("&File"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
368 QAction *new_file_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
369 = file_menu->addAction (QIcon(":/actions/icons/filenew.png"), tr ("New File"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
370
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
371 QAction *open_file_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
372 = file_menu->addAction (QIcon(":/actions/icons/fileopen.png"), tr ("Open File"));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
373
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
374 QAction *settings_action
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
375 = file_menu->addAction (QIcon(":/actions/icons/configure.png"), tr ("Settings"));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
376 file_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
377 QAction *exit_action = file_menu->addAction (tr ("Exit"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
378
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
379 QMenu *edit_menu = menuBar ()->addMenu (tr ("&Edit"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
380 QAction *cut_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
381 = edit_menu->addAction (QIcon(":/actions/icons/editcut.png"), tr ("Cut"));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
382 cut_action->setShortcut (QKeySequence::Cut);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
383
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
384 QAction *copy_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
385 = edit_menu->addAction (QIcon(":/actions/icons/editcopy.png"), tr ("Copy"));
14757
ace446cda345 Changed copy-paste shortcuts from Ctrl-C/V to Ctrl-Shift-C/V, so that the Ctrl-C signal won't be catched by the terminal anymore.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
386 copy_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_C);
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
387
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
388 QAction *paste_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
389 = edit_menu->addAction (QIcon(":/actions/icons/editpaste.png"), tr ("Paste"));
14757
ace446cda345 Changed copy-paste shortcuts from Ctrl-C/V to Ctrl-Shift-C/V, so that the Ctrl-C signal won't be catched by the terminal anymore.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14754
diff changeset
390 paste_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_V);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
391
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
392 QAction *undo_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
393 = edit_menu->addAction (QIcon(":/actions/icons/undo.png"), tr ("Undo"));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
394 undo_action->setShortcut (QKeySequence::Undo);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
395
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
396 QAction *redo_action
14727
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
397 = edit_menu->addAction (QIcon(":/actions/icons/redo.png"), tr ("Redo"));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
398 redo_action->setShortcut (QKeySequence::Redo);
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
399
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: 14727
diff changeset
400 _debug_menu = menuBar ()->addMenu (tr ("De&bug"));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
401 QAction * debug_continue = _debug_menu->addAction (tr ("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: 14727
diff changeset
402 debug_continue->setShortcut (Qt::Key_F5);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
403 QAction * debug_step_into = _debug_menu->addAction (tr ("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: 14727
diff changeset
404 debug_step_into->setShortcut (Qt::Key_F9);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
405 QAction * debug_step_over = _debug_menu->addAction (tr ("Next"));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
406 debug_step_over->setShortcut (Qt::Key_F10);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
407 QAction * debug_step_out = _debug_menu->addAction (tr ("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: 14727
diff changeset
408 debug_step_out->setShortcut (Qt::Key_F11);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
409 _debug_menu->addSeparator ();
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
410 QAction * debug_quit = _debug_menu->addAction (tr ("Quit"));
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
411 debug_quit->setShortcut (Qt::Key_Escape);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
412 _debug_menu->setEnabled (false);
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
413
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
414
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
415 //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
416
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
417 QMenu * desktop_menu = menuBar ()->addMenu (tr ("&Desktop"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
418 QAction * load_workspace_action = desktop_menu->addAction (tr ("Load workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
419 QAction * save_workspace_action = desktop_menu->addAction (tr ("Save workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
420 QAction * clear_workspace_action = desktop_menu->addAction (tr ("Clear workspace"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
421
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
422 // Window menu
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
423 QMenu * window_menu = menuBar ()->addMenu (tr ("&Window"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
424 QAction * show_command_window_action = window_menu->addAction (tr ("Command Window"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
425 show_command_window_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
426 QAction * show_workspace_action = window_menu->addAction (tr ("Workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
427 show_workspace_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
428 QAction * show_history_action = window_menu->addAction (tr ("Command History"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
429 show_history_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
430 QAction * show_file_browser_action = window_menu->addAction (tr ("Current Directory"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
431 show_file_browser_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
432 QAction * show_editor_action = window_menu->addAction (tr ("Editor"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
433 show_editor_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
434 window_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
435 QAction * reset_windows_action = window_menu->addAction (tr ("Reset Windows"));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
436
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
437 // Help menu
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
438 QMenu * help_menu = menuBar ()->addMenu (tr ("&Help"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
439 QAction * report_bug_action = help_menu->addAction (tr ("Report Bug"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
440 QAction * agora_action = help_menu->addAction (tr ("Visit Agora"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
441 QAction * octave_forge_action = help_menu->addAction (tr ("Visit Octave Forge"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
442 help_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
443 QAction * about_octave_action = help_menu->addAction (tr ("About Octave"));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
444
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
445 // Toolbars
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
446 QToolBar *main_tool_bar = addToolBar ("Main");
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
447 main_tool_bar->addAction (new_file_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
448 main_tool_bar->addAction (open_file_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
449 main_tool_bar->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
450 main_tool_bar->addAction (cut_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
451 main_tool_bar->addAction (copy_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
452 main_tool_bar->addAction (paste_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
453 main_tool_bar->addAction (undo_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
454 main_tool_bar->addAction (redo_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
455 main_tool_bar->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
456 main_tool_bar->addWidget (new QLabel (tr ("Current Directory:")));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
457 main_tool_bar->addWidget (_current_directory_combo_box);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
458 main_tool_bar->addWidget (_current_directory_tool_button);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
459 main_tool_bar->addWidget (_current_directory_up_tool_button);
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
460
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
461 connect (qApp, SIGNAL (aboutToQuit ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
462 this, SLOT (prepare_for_quit ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
463 connect (settings_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
464 this, SLOT (process_settings_dialog_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
465 connect (exit_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
466 this, SLOT (close ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
467 connect (new_file_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
468 this, SLOT (new_file ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
469 connect (open_file_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
470 this, SLOT (open_file ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
471 connect (report_bug_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
472 this, SLOT (open_bug_tracker_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
473 connect (agora_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
474 this, SLOT (open_agora_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
475 connect (octave_forge_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
476 this, SLOT (open_octave_forge_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
477 connect (about_octave_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
478 this, SLOT (show_about_octave ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
479 connect (show_command_window_action, SIGNAL (toggled (bool)),
14716
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14714
diff changeset
480 _terminal_dock_widget, SLOT (setVisible (bool)));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
481 connect (_terminal_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
482 show_command_window_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
483 connect (show_workspace_action, SIGNAL (toggled (bool)),
14716
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14714
diff changeset
484 _workspace_view, SLOT (setVisible (bool)));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
485 connect (_workspace_view, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
486 show_workspace_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
487 connect (show_history_action, SIGNAL (toggled (bool)),
14716
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14714
diff changeset
488 _history_dock_widget, SLOT (setVisible (bool)));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
489 connect (_history_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
490 show_history_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
491 connect (show_file_browser_action, SIGNAL (toggled (bool)),
14716
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14714
diff changeset
492 _files_dock_widget, SLOT (setVisible (bool)));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
493 connect (_files_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
494 show_file_browser_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
495 connect (show_editor_action, SIGNAL (toggled (bool)),
14716
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14714
diff changeset
496 _file_editor, SLOT (setVisible (bool)));
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
497 connect (_file_editor, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
498 show_editor_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
499 connect (reset_windows_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
500 this, SLOT (reset_windows ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
501 connect (this, SIGNAL (settings_changed ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
502 _files_dock_widget, SLOT (notice_settings ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
503 connect (this, SIGNAL (settings_changed ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
504 this, SLOT (notice_settings ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
505 connect (_files_dock_widget, SIGNAL (open_file (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
506 _file_editor, SLOT (request_open_file (QString)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
507 connect (_history_dock_widget, SIGNAL (information (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
508 this, SLOT (report_status_message (QString)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
509 connect (_history_dock_widget, SIGNAL (command_double_clicked (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
510 this, SLOT (handle_command_double_clicked (QString)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
511 connect (save_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
512 this, SLOT (handle_save_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
513 connect (load_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
514 this, SLOT (handle_load_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
515 connect (clear_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
516 this, SLOT (handle_clear_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
517 connect (_current_directory_tool_button, SIGNAL (clicked ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
518 this, SLOT (change_current_working_directory ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
519 connect (_current_directory_up_tool_button, SIGNAL (clicked ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
520 this, SLOT (current_working_directory_up()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
521 connect (copy_action, SIGNAL (triggered()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
522 _terminal, SLOT (copyClipboard ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
523 connect (paste_action, SIGNAL (triggered()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
524 _terminal, SLOT (pasteClipboard ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
525 connect (_current_directory_combo_box, SIGNAL (activated (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
526 this, SLOT (change_current_working_directory (QString)));
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: 14727
diff changeset
527 connect (debug_continue, SIGNAL (triggered ()),
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
528 this, SLOT (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: 14727
diff changeset
529 connect (debug_step_into, SIGNAL (triggered ()),
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
530 this, SLOT (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: 14727
diff changeset
531 connect (debug_step_over, SIGNAL (triggered ()),
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
532 this, SLOT (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: 14727
diff changeset
533 connect (debug_step_out, SIGNAL (triggered ()),
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
534 this, SLOT (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: 14727
diff changeset
535 connect (debug_quit, SIGNAL (triggered ()),
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14727
diff changeset
536 this, SLOT (debug_quit ()));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
537
14601
772ce0204b3f Removed version number and "Octave GUI"-labelling.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14599
diff changeset
538 setWindowTitle ("Octave");
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
539 setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
14712
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
540 addDockWidget (Qt::LeftDockWidgetArea, _workspace_view);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
541 addDockWidget (Qt::LeftDockWidgetArea, _history_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
542 addDockWidget (Qt::RightDockWidgetArea, _files_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
543 addDockWidget (Qt::RightDockWidgetArea, _file_editor);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
544 addDockWidget (Qt::BottomDockWidgetArea, _terminal_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
545 setStatusBar (_status_bar);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
546 read_settings ();
14726
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
547
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
548 _octave_qt_event_listener = new octave_qt_event_listener ();
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
549 octave_link::instance ()->register_event_listener (_octave_qt_event_listener);
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
550
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
551 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
552 SIGNAL (current_directory_has_changed_signal (QString)),
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
553 this,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
554 SLOT (update_current_working_directory (QString)));
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
555
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
556 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
557 SIGNAL (entered_debug_mode_signal ()),
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
558 this,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
559 SLOT(handle_entered_debug_mode ()));
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
560
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
561 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
562 SIGNAL (quit_debug_mode_signal ()),
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
563 this,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14721
diff changeset
564 SLOT (handle_quit_debug_mode ()));
14754
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
565
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
566 _update_performance_information_timer.setInterval (500);
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
567 _update_performance_information_timer.setSingleShot (false);
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
568 connect (&_update_performance_information_timer, SIGNAL (timeout ()),
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
569 this, SLOT (update_performance_information ()));
626a8ff2fe8c The GUI now shows performance information in the status bar of the GUI (ie. how much overhead it causes in the octave thread compares to the terminal version).
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14752
diff changeset
570 _update_performance_information_timer.start ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
571 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
572