annotate gui/src/main-window.cc @ 14884:a565c560e654 gui

Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate. * default-settings: New file containing the default settings. * file-editor-tab: Subclassed event observer and added code to send a run event. * main-window: Sending workspace events instead of using the terminal. * octave-event: Added new event types. * octave-link: Added getter for the current working directory. * octave-gui: Adjusted code, so the default settings can be loaded. * resource-manager: Added code to handle the logic with a default settings file.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Tue, 26 Jun 2012 15:27:10 +0200
parents 625be3eb27c5
children 9d9eb9bac65e
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>
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
22 #include <QStyle>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
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>
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
27 #include <QIcon>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
28
14737
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14733
diff changeset
29 #include "main-window.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14733
diff changeset
30 #include "file-editor.h"
674740c44c09 Changed various files to matche file naming conventions.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14733
diff changeset
31 #include "settings-dialog.h"
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32
14769
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
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: 14767
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 ();
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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
14739
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14737
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
14769
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
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: 14767
diff changeset
47 {
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
48 delete e;
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
49 }
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
50
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
51 void
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
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: 14767
diff changeset
53 {
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
54 delete e;
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
55 }
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
56
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
57 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
58 main_window::new_file ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
59 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
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 =
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
79 QFileDialog::getSaveFileName (this, tr ("Save Workspace"),
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
80 resource_manager::instance ()->get_home_path ());
14884
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
81 octave_link::instance ()
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
82 ->post_event (new octave_save_workspace_event (*this,
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
83 selectedFile.toStdString()));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
84 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
85
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
86 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
87 main_window::handle_load_workspace_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
88 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
89 QString selectedFile =
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
90 QFileDialog::getOpenFileName (this, tr ("Load Workspace"),
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
91 resource_manager::instance ()->get_home_path ());
14702
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
92 if (!selectedFile.isEmpty ())
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
93 {
14884
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
94 octave_link::instance ()
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
95 ->post_event (new octave_load_workspace_event (*this,
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
96 selectedFile.toStdString()));
14702
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
97 }
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
98 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
99
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
100 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
101 main_window::handle_clear_workspace_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
102 {
14884
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
103 octave_link::instance ()
a565c560e654 Replaced a lot of terminal interaction with events: Clearing, loading and saving workspace, running a file. Default location for saving a new file is now the current working directory. Fixed bad settings with a fresh installation of the GUI by providing a file with default settings and installing it when appropriate.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14883
diff changeset
104 ->post_event (new octave_clear_workspace_event (*this));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
105 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
106
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
107 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
108 main_window::handle_command_double_clicked (QString command)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
109 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
110 _terminal->sendText(command);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
111 _terminal->setFocus ();
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
112 }
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
113
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
114 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
115 main_window::open_bug_tracker_page ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
116 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
117 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
118 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
119
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
120 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
121 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
122 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
123 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
124 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
125
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
126 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
127 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
128 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
129 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
130 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
131
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
132 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
133 main_window::process_settings_dialog_request ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
134 {
14739
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14737
diff changeset
135 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
136 settingsDialog->exec ();
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
137 delete settingsDialog;
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
138 emit settings_changed ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
139 resource_manager::instance ()->update_network_settings ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
140 notice_settings();
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
141 }
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
142
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
143 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
144 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
145 {
14719
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14718
diff changeset
146 // Set terminal font:
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
147 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
148 QFont font = QFont();
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
149 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
150 font.setPointSize(settings->value("terminal/fontSize").toInt ());
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
151 _terminal->setTerminalFont(font);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
152 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
153
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
154 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
155 main_window::prepare_for_quit ()
14717
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
156 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
157 write_settings ();
14717
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
158 }
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
159
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
160 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
161 main_window::reset_windows ()
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
162 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
163 // TODO: Implement.
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
164 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
165
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
166 void
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
167 main_window::current_working_directory_has_changed (QString directory)
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
168 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
169 if (_current_directory_combo_box->count () > 31)
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
170 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
171 _current_directory_combo_box->removeItem (0);
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
172 }
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
173 _current_directory_combo_box->addItem (directory);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
174 int index = _current_directory_combo_box->findText (directory);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
175 _current_directory_combo_box->setCurrentIndex (index);
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
176
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
177 _files_dock_widget->set_current_directory (directory);
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
178 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
179
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
180 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
181 main_window::change_current_working_directory ()
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
182 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
183 QString selectedDirectory =
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
184 QFileDialog::getExistingDirectory(this, tr ("Set working direcotry"));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
185
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
186 if (!selectedDirectory.isEmpty ())
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
187 {
14767
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14766
diff changeset
188 octave_link::instance ()
14769
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
189 ->post_event (new octave_change_directory_event (*this,
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
190 selectedDirectory.toStdString ()));
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
191 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
192 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
193
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
194 void
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
195 main_window::set_current_working_directory (QString directory)
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
196 {
14769
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
197 octave_link::instance ()
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
198 ->post_event (new octave_change_directory_event (*this,
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
199 directory.toStdString ()));
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
200 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
201
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
202 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
203 main_window::current_working_directory_up ()
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
204 {
14855
84d1d9c035c7 Changing the directory one step up now does not use the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14835
diff changeset
205 octave_link::instance ()
84d1d9c035c7 Changing the directory one step up now does not use the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14835
diff changeset
206 ->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: 14835
diff changeset
207
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
208 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
209
14774
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
210 void
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
211 main_window::handle_entered_debug_mode ()
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
212 {
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
213 setWindowTitle ("Octave (Debugging)");
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
214 _debug_continue->setEnabled (true);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
215 _debug_step_into->setEnabled (true);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
216 _debug_step_over->setEnabled (true);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
217 _debug_step_out->setEnabled (true);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
218 _debug_quit->setEnabled (true);
14774
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
219 }
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
220
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
221 void
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
222 main_window::handle_quit_debug_mode ()
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
223 {
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
224 setWindowTitle ("Octave");
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
225 _debug_continue->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
226 _debug_step_into->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
227 _debug_step_over->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
228 _debug_step_out->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
229 _debug_quit->setEnabled (false);
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
230 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
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: 14775
diff changeset
232 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: 14775
diff changeset
233 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: 14775
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: 14775
diff changeset
235 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: 14775
diff changeset
236 ->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: 14775
diff changeset
237 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
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: 14775
diff changeset
239 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: 14775
diff changeset
240 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: 14775
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: 14775
diff changeset
242 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: 14775
diff changeset
243 ->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: 14775
diff changeset
244 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
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: 14775
diff changeset
246 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: 14775
diff changeset
247 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: 14775
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: 14775
diff changeset
249 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: 14775
diff changeset
250 ->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: 14775
diff changeset
251 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
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: 14775
diff changeset
253 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: 14775
diff changeset
254 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: 14775
diff changeset
255 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
256 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: 14775
diff changeset
257 ->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: 14775
diff changeset
258 }
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
259
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
260 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: 14775
diff changeset
261 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: 14775
diff changeset
262 {
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
263 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: 14775
diff changeset
264 ->post_event (new octave_debug_quit_event (*this));
14774
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
265 }
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
266
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
267 void
14802
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: 14800
diff changeset
268 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: 14800
diff changeset
269 {
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: 14800
diff changeset
270 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: 14800
diff changeset
271 = 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: 14800
diff changeset
272
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: 14800
diff changeset
273 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: 14800
diff changeset
274 = (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: 14800
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: 14800
diff changeset
276 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: 14800
diff changeset
277 = (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: 14800
diff changeset
278
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: 14800
diff changeset
279 _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: 14800
diff changeset
280 (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: 14800
diff changeset
281 .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: 14800
diff changeset
282 .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: 14800
diff changeset
283 .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: 14800
diff changeset
284 }
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: 14800
diff changeset
285
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: 14800
diff changeset
286 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
287 main_window::show_about_octave ()
13548
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
288 {
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
289 QString message =
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
290 "GNU Octave\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
291 "Copyright (C) 2009 John W. Eaton and others.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
292 "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
293 "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
294 "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\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 "Octave was configured for \"x86_64-pc-linux-gnu\".\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
297 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
298 "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
299 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
300 "Please contribute if you find this software useful."
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
301 "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
302 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
303 "Report bugs to <bug@octave.org> (but first, please read"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
304 "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
305 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
306 "For information about changes from previous versions, type `news'.\n";
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
307
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
308 QMessageBox::about (this, tr ("About Octave"), message);
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
309 }
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
310
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
311 void
14739
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14737
diff changeset
312 main_window::closeEvent (QCloseEvent * closeEvent)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
313 {
14749
4ff6c21c18c4 Solved crash on close by ignoring close event and instead executing exit in the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14742
diff changeset
314 closeEvent->ignore ();
14769
ec76264adca9 Removed last bits of Qt from octave_link.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14767
diff changeset
315 octave_link::instance ()->post_event (new octave_exit_event (*this));
14766
3df7ef0080c7 Added event based processing and implement exit and change directory event.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14751
diff changeset
316 }
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
317
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
318 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
319 main_window::read_settings ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
320 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
321 QSettings *settings = resource_manager::instance ()->get_settings ();
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
322 restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
323 restoreState (settings->value ("MainWindow/windowState").toByteArray ());
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
324 emit settings_changed ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
325 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
326
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
327 void
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
328 main_window::write_settings ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
329 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
330 QSettings *settings = resource_manager::instance ()->get_settings ();
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
331 settings->setValue ("MainWindow/geometry", saveGeometry ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
332 settings->setValue ("MainWindow/windowState", saveState ());
14718
ea11c9d8aa47 Calling qApp->quit () via QMetaObject::invoke caused a segfault, now exits cleanly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14717
diff changeset
333 settings->sync ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
334 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
335
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
336 void
14739
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14737
diff changeset
337 main_window::construct ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
338 {
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
339 _closing = false; // flag for editor files when closed
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
340 setWindowIcon (resource_manager::instance ()->get_icon (resource_manager::octave));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
341
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
342 // Setup dockable widgets and the status bar.
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
343 _workspace_view = new workspace_view (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
344 _workspace_view->setStatusTip (tr ("View the variables in the active workspace."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
345 _history_dock_widget = new history_dock_widget (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
346 _history_dock_widget->setStatusTip (tr ("Browse and search the command history."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
347 _files_dock_widget = new files_dock_widget (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
348 _files_dock_widget->setStatusTip (tr ("Browse your files."));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
349 _status_bar = new QStatusBar (this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
350
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
351 _current_directory_combo_box = new QComboBox (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
352 _current_directory_combo_box->setFixedWidth (300);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
353 _current_directory_combo_box->setEditable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
354 _current_directory_combo_box->setInsertPolicy (QComboBox::InsertAtTop);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
355 _current_directory_combo_box->setMaxVisibleItems (14);
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
356
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
357 _current_directory_tool_button = new QToolButton (this);
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
358 _current_directory_tool_button->setIcon (QIcon(":/actions/icons/search.png"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
359
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
360 _current_directory_up_tool_button = new QToolButton (this);
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
361 _current_directory_up_tool_button->setIcon (QIcon(":/actions/icons/up.png"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
362
13550
cd66481d55b0 Added close button to file editor, assorted subwindows after importance.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13549
diff changeset
363 // Octave Terminal subwindow.
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
364 _terminal = new QTerminal (this);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
365 _terminal->setObjectName ("OctaveTerminal");
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
366 _terminal_dock_widget = new terminal_dock_widget (_terminal, this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
367
14717
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
368 QWidget *dummyWidget = new QWidget ();
14726
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
369 dummyWidget->setObjectName ("CentralDummyWidget");
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
370 dummyWidget->resize (10, 10);
14717
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14716
diff changeset
371 dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
14726
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
372 dummyWidget->hide ();
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14719
diff changeset
373 setCentralWidget (dummyWidget);
14716
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14712
diff changeset
374
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
375 _file_editor = new file_editor (_terminal, this);
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
376
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
377 QMenu *file_menu = menuBar ()->addMenu (tr ("&File"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
378 QAction *new_file_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
379 = file_menu->addAction (QIcon(":/actions/icons/filenew.png"), tr ("New File"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
380
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
381 QAction *open_file_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
382 = 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
383
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
384 QAction *settings_action
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
385 = file_menu->addAction (QIcon(":/actions/icons/configure.png"), tr ("Settings"));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
386 file_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
387 QAction *exit_action = file_menu->addAction (tr ("Exit"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
388
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
389 QMenu *edit_menu = menuBar ()->addMenu (tr ("&Edit"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
390 QAction *cut_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
391 = edit_menu->addAction (QIcon(":/actions/icons/editcut.png"), tr ("Cut"));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
392 cut_action->setShortcut (QKeySequence::Cut);
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
393
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
394 QAction *copy_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
395 = edit_menu->addAction (QIcon(":/actions/icons/editcopy.png"), tr ("Copy"));
14814
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: 14802
diff changeset
396 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
397
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
398 QAction *paste_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
399 = edit_menu->addAction (QIcon(":/actions/icons/editpaste.png"), tr ("Paste"));
14814
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: 14802
diff changeset
400 paste_action->setShortcut (Qt::ControlModifier + Qt::ShiftModifier + Qt::Key_V);
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
401
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
402 QAction *undo_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
403 = edit_menu->addAction (QIcon(":/actions/icons/undo.png"), tr ("Undo"));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
404 undo_action->setShortcut (QKeySequence::Undo);
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
405
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
406 QAction *redo_action
14775
f34984656658 Added crystal project icons.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14774
diff changeset
407 = edit_menu->addAction (QIcon(":/actions/icons/redo.png"), tr ("Redo"));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
408 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
409
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
410 _debug_menu = menuBar ()->addMenu (tr ("De&bug"));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
411
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
412 _debug_continue = _debug_menu->addAction (tr ("Continue"));
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
413 _debug_continue->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
414 _file_editor->debug_menu ()->addAction (_debug_continue);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
415 _debug_continue->setShortcut (Qt::Key_F5);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
416
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
417 _debug_step_into = _debug_menu->addAction (tr ("Step into"));
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
418 _debug_step_into->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
419 _file_editor->debug_menu ()->addAction (_debug_step_into);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
420 _debug_step_into->setShortcut (Qt::Key_F9);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
421
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
422 _debug_step_over = _debug_menu->addAction (tr ("Next"));
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
423 _debug_step_over->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
424 _file_editor->debug_menu ()->addAction (_debug_step_over);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
425 _debug_step_over->setShortcut (Qt::Key_F10);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
426
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
427 _debug_step_out = _debug_menu->addAction (tr ("Step out"));
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
428 _debug_step_out->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
429 _file_editor->debug_menu ()->addAction (_debug_step_over);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
430 _debug_step_out->setShortcut (Qt::Key_F11);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
431
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
432 _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: 14775
diff changeset
433
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
434 _debug_quit = _debug_menu->addAction (tr ("Quit"));
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
435 _debug_quit->setEnabled (false);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
436 _file_editor->debug_menu ()->addAction (_debug_quit);
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
437 _debug_quit->setShortcut (Qt::Key_Escape);
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
438
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
439 //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
440
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
441 QMenu * desktop_menu = menuBar ()->addMenu (tr ("&Desktop"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
442 QAction * load_workspace_action = desktop_menu->addAction (tr ("Load workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
443 QAction * save_workspace_action = desktop_menu->addAction (tr ("Save workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
444 QAction * clear_workspace_action = desktop_menu->addAction (tr ("Clear workspace"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
445
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
446 // Window menu
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
447 QMenu * window_menu = menuBar ()->addMenu (tr ("&Window"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
448 QAction * show_command_window_action = window_menu->addAction (tr ("Command Window"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
449 show_command_window_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
450 QAction * show_workspace_action = window_menu->addAction (tr ("Workspace"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
451 show_workspace_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
452 QAction * show_history_action = window_menu->addAction (tr ("Command History"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
453 show_history_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
454 QAction * show_file_browser_action = window_menu->addAction (tr ("Current Directory"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
455 show_file_browser_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
456 QAction * show_editor_action = window_menu->addAction (tr ("Editor"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
457 show_editor_action->setCheckable (true);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
458 window_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
459 QAction * reset_windows_action = window_menu->addAction (tr ("Reset Windows"));
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
460
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
461 // Help menu
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
462 QMenu * help_menu = menuBar ()->addMenu (tr ("&Help"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
463 QAction * report_bug_action = help_menu->addAction (tr ("Report Bug"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
464 QAction * agora_action = help_menu->addAction (tr ("Visit Agora"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
465 QAction * octave_forge_action = help_menu->addAction (tr ("Visit Octave Forge"));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
466 help_menu->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
467 QAction * about_octave_action = help_menu->addAction (tr ("About Octave"));
14687
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
468
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14686
diff changeset
469 // Toolbars
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
470 QToolBar *main_tool_bar = addToolBar ("Main");
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
471 main_tool_bar->addAction (new_file_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
472 main_tool_bar->addAction (open_file_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
473 main_tool_bar->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
474 main_tool_bar->addAction (cut_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
475 main_tool_bar->addAction (copy_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
476 main_tool_bar->addAction (paste_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
477 main_tool_bar->addAction (undo_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
478 main_tool_bar->addAction (redo_action);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
479 main_tool_bar->addSeparator ();
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
480 main_tool_bar->addWidget (new QLabel (tr ("Current Directory:")));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
481 main_tool_bar->addWidget (_current_directory_combo_box);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
482 main_tool_bar->addWidget (_current_directory_tool_button);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
483 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
484
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
485 connect (qApp, SIGNAL (aboutToQuit ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
486 this, SLOT (prepare_for_quit ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
487 connect (settings_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
488 this, SLOT (process_settings_dialog_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
489 connect (exit_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
490 this, SLOT (close ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
491 connect (new_file_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
492 this, SLOT (new_file ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
493 connect (open_file_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
494 this, SLOT (open_file ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
495 connect (report_bug_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
496 this, SLOT (open_bug_tracker_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
497 connect (agora_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
498 this, SLOT (open_agora_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
499 connect (octave_forge_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
500 this, SLOT (open_octave_forge_page ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
501 connect (about_octave_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
502 this, SLOT (show_about_octave ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
503 connect (show_command_window_action, SIGNAL (toggled (bool)),
14751
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14749
diff changeset
504 _terminal_dock_widget, SLOT (setVisible (bool)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
505 connect (_terminal_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
506 show_command_window_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
507 connect (show_workspace_action, SIGNAL (toggled (bool)),
14751
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14749
diff changeset
508 _workspace_view, SLOT (setVisible (bool)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
509 connect (_workspace_view, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
510 show_workspace_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
511 connect (show_history_action, SIGNAL (toggled (bool)),
14751
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14749
diff changeset
512 _history_dock_widget, SLOT (setVisible (bool)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
513 connect (_history_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
514 show_history_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
515 connect (show_file_browser_action, SIGNAL (toggled (bool)),
14751
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14749
diff changeset
516 _files_dock_widget, SLOT (setVisible (bool)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
517 connect (_files_dock_widget, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
518 show_file_browser_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
519 connect (show_editor_action, SIGNAL (toggled (bool)),
14751
572a707408b2 Patched qterminal for MacOS. Changed Qt3 compatibility slot to Qt4 slot.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14749
diff changeset
520 _file_editor, SLOT (setVisible (bool)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
521 connect (_file_editor, SIGNAL (active_changed (bool)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
522 show_editor_action, SLOT (setChecked (bool)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
523 connect (reset_windows_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
524 this, SLOT (reset_windows ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
525 connect (this, SIGNAL (settings_changed ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
526 _files_dock_widget, SLOT (notice_settings ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
527 connect (this, SIGNAL (settings_changed ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
528 this, SLOT (notice_settings ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
529 connect (_files_dock_widget, SIGNAL (open_file (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
530 _file_editor, SLOT (request_open_file (QString)));
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
531 connect (_files_dock_widget, SIGNAL (displayed_directory_changed(QString)),
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
532 this, SLOT (set_current_working_directory(QString)));
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
533 connect (_history_dock_widget, SIGNAL (information (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
534 this, SLOT (report_status_message (QString)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
535 connect (_history_dock_widget, SIGNAL (command_double_clicked (QString)),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
536 this, SLOT (handle_command_double_clicked (QString)));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
537 connect (save_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
538 this, SLOT (handle_save_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
539 connect (load_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
540 this, SLOT (handle_load_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
541 connect (clear_workspace_action, SIGNAL (triggered ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
542 this, SLOT (handle_clear_workspace_request ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
543 connect (_current_directory_tool_button, SIGNAL (clicked ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
544 this, SLOT (change_current_working_directory ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
545 connect (_current_directory_up_tool_button, SIGNAL (clicked ()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
546 this, SLOT (current_working_directory_up()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
547 connect (copy_action, SIGNAL (triggered()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
548 _terminal, SLOT (copyClipboard ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
549 connect (paste_action, SIGNAL (triggered()),
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
550 _terminal, SLOT (pasteClipboard ()));
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
551 connect (_current_directory_combo_box, SIGNAL (activated (QString)),
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
552 this, SLOT (set_current_working_directory (QString)));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
553 connect (_debug_continue, SIGNAL (triggered ()),
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
554 this, SLOT (debug_continue ()));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
555 connect (_debug_step_into, SIGNAL (triggered ()),
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
556 this, SLOT (debug_step_into ()));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
557 connect (_debug_step_over, SIGNAL (triggered ()),
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
558 this, SLOT (debug_step_over ()));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
559 connect (_debug_step_out, SIGNAL (triggered ()),
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
560 this, SLOT (debug_step_out ()));
14866
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14855
diff changeset
561 connect (_debug_quit, SIGNAL (triggered ()),
14800
564cc673bcc5 Added menu for debugging. Now sending debug control events, but these seem to not work flawlessly
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14775
diff changeset
562 this, SLOT (debug_quit ()));
14728
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14726
diff changeset
563
14601
772ce0204b3f Removed version number and "Octave GUI"-labelling.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14599
diff changeset
564 setWindowTitle ("Octave");
14702
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
565 setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
14742
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
566 addDockWidget (Qt::LeftDockWidgetArea, _workspace_view);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
567 addDockWidget (Qt::LeftDockWidgetArea, _history_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
568 addDockWidget (Qt::RightDockWidgetArea, _files_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
569 addDockWidget (Qt::RightDockWidgetArea, _file_editor);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
570 addDockWidget (Qt::BottomDockWidgetArea, _terminal_dock_widget);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
571 setStatusBar (_status_bar);
5cb54cca8a06 Completion of code reformatting.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14739
diff changeset
572 read_settings ();
14774
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
573
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
574 _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: 14769
diff changeset
575 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: 14769
diff changeset
576
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
577 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
578 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: 14769
diff changeset
579 this,
14883
625be3eb27c5 Current directories now synchronize on top, in the file browser and the cwd in octave.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14866
diff changeset
580 SLOT (current_working_directory_has_changed (QString)));
14774
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
581
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
582 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
583 SIGNAL (entered_debug_mode_signal ()),
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
584 this,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
585 SLOT(handle_entered_debug_mode ()));
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
586
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
587 connect (_octave_qt_event_listener,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
588 SIGNAL (quit_debug_mode_signal ()),
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
589 this,
e94a54ee0f46 Added debug events, debug mode detection and fixed compiling error.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14769
diff changeset
590 SLOT (handle_quit_debug_mode ()));
14802
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: 14800
diff changeset
591
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: 14800
diff changeset
592 _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: 14800
diff changeset
593 _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: 14800
diff changeset
594 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: 14800
diff changeset
595 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: 14800
diff changeset
596 _update_performance_information_timer.start ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
597 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
598