annotate gui/src/mainwindow.cc @ 14703:f86884be20fc gui

Renamed all source files of the gui to lowercase and .cc to be conform with the octave sources.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 31 May 2012 20:53:56 +0200
parents gui/src/MainWindow.cpp@06abf71d9083
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13504
13e3d60aff2d Replaced Quint with OctaveGUI.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13501
diff changeset
1 /* OctaveGUI - A graphical user interface for Octave
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3 *
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4 * This program is free software: you can redistribute it and/or modify
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
5 * it under the terms of the GNU General Public License as
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
6 * published by the Free Software Foundation, either version 3 of the
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
7 * License, or (at your option) any later version.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
8 *
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 * This program is distributed in the hope that it will be useful,
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
12 * GNU General Public License for more details.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
13 *
14290
faece6b2ab90 Corrected license headers in all files to GPL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14289
diff changeset
14 * You should have received a copy of the GNU General Public License
13674
c0e66d6e3dc8 Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13666
diff changeset
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16 */
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
18 #include <QMenuBar>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
19 #include <QMenu>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20 #include <QAction>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 #include <QSettings>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
22 #include <QStyle>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
23 #include <QToolBar>
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #include <QDesktopServices>
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25 #include <QFileDialog>
13626
cc90c62ada21 Removed terminal, instead now using QPlainTextEdit, which looks much nicer and is not that error-prone...
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13620
diff changeset
26 #include <QMessageBox>
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
27 #include <QIcon>
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
28
14703
f86884be20fc Renamed all source files of the gui to lowercase and .cc to be conform with the octave sources.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
29 #include "mainwindow.h"
f86884be20fc Renamed all source files of the gui to lowercase and .cc to be conform with the octave sources.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
30 #include "fileeditor.h"
f86884be20fc Renamed all source files of the gui to lowercase and .cc to be conform with the octave sources.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14701
diff changeset
31 #include "settingsdialog.h"
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32
13541
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13540
diff changeset
33 MainWindow::MainWindow (QWidget * parent):QMainWindow (parent)
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
34 {
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
35 // 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
36 construct ();
13541
b48ac9ad8de0 Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13540
diff changeset
37 OctaveLink::instance ()->launchOctave();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
40 MainWindow::~MainWindow ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
41 {
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
44 void
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
45 MainWindow::newFile ()
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
46 {
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
47 m_fileEditor->requestNewFile ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
49
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
50 void
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
51 MainWindow::openFile ()
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
52 {
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
53 m_fileEditor->requestOpenFile ();
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
54 }
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
55
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
56 void
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
57 MainWindow::reportStatusMessage (QString statusMessage)
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
58 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
59 m_statusBar->showMessage (statusMessage, 1000);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
60 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
61
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
62 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
63 MainWindow::handleSaveWorkspaceRequest ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
64 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
65 QString selectedFile =
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
66 QFileDialog::getSaveFileName (this, tr ("Save Workspace"),
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
67 ResourceManager::instance ()->homePath ());
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
68 m_terminal->sendText (QString ("save \'%1\'\n").arg (selectedFile));
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
69 m_terminal->setFocus ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
70 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
71
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
72 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
73 MainWindow::handleLoadWorkspaceRequest ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
74 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
75 QString selectedFile =
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
76 QFileDialog::getOpenFileName (this, tr ("Load Workspace"),
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
77 ResourceManager::instance ()->homePath ());
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
78 if (!selectedFile.isEmpty ())
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
79 {
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
80 m_terminal->sendText (QString ("load \'%1\'\n").arg (selectedFile));
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
81 m_terminal->setFocus ();
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
82 }
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
83 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
84
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
85 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
86 MainWindow::handleClearWorkspaceRequest ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
87 {
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
88 m_terminal->sendText ("clear\n");
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
89 m_terminal->setFocus ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
90 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
91
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
92 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
93 MainWindow::handleCommandDoubleClicked (QString command)
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
94 {
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
95 m_terminal->sendText(command);
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
96 m_terminal->setFocus ();
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
97 }
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
98
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
99 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
100 MainWindow::openBugTrackerPage ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
101 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
102 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
103 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
104
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
105 void
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
106 MainWindow::openAgoraPage ()
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
107 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
108 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
109 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
110
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
111 void
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
112 MainWindow::openOctaveForgePage ()
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
113 {
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
114 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
115 }
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
116
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
117 void
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
118 MainWindow::processSettingsDialogRequest ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
119 {
14586
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
120 SettingsDialog *settingsDialog = new SettingsDialog (this);
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
121 settingsDialog->exec ();
8e9823066dad Fixed bug with not correctly syncing settings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14308
diff changeset
122 delete settingsDialog;
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
123 emit settingsChanged ();
13607
fd31226d4c3a Proxy settings can now be configured.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13604
diff changeset
124 ResourceManager::instance ()->updateNetworkSettings ();
14695
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14694
diff changeset
125 noticeSettings();
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
126 }
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
127
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
128 void
14695
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14694
diff changeset
129 MainWindow::noticeSettings ()
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
130 {
14695
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14694
diff changeset
131 // Set terminal font:
14588
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
132 QSettings *settings = ResourceManager::instance ()->settings ();
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
133 QFont font = QFont();
fa52c6e84ae0 Added controls and settings for changing the terminal font.
"Israel Herraiz <israel.herraiz@upm.es>"
parents: 14586
diff changeset
134 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
135 font.setPointSize(settings->value("terminal/fontSize").toInt ());
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
136 m_terminal->setTerminalFont(font);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
137 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
138
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
139 void
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
140 MainWindow::prepareForQuit ()
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
141 {
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
142 writeSettings ();
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
143 }
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
144
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
145 void
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
146 MainWindow::resetWindows ()
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
147 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
148 // TODO: Implement.
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
149 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
150
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
151 void
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
152 MainWindow::updateCurrentWorkingDirectory (QString directory)
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
153 {
14701
06abf71d9083 Fixed bug with current directory.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14700
diff changeset
154 if (m_currentDirectoryComboBox->count () > 31)
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
155 {
14701
06abf71d9083 Fixed bug with current directory.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14700
diff changeset
156 m_currentDirectoryComboBox->removeItem (0);
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
157 }
14701
06abf71d9083 Fixed bug with current directory.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14700
diff changeset
158 m_currentDirectoryComboBox->addItem (directory);
06abf71d9083 Fixed bug with current directory.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14700
diff changeset
159 int index = m_currentDirectoryComboBox->findText (directory);
06abf71d9083 Fixed bug with current directory.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14700
diff changeset
160 m_currentDirectoryComboBox->setCurrentIndex (index);
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
161 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
162
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
163 void
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
164 MainWindow::changeCurrentWorkingDirectory ()
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
165 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
166 QString selectedDirectory =
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
167 QFileDialog::getExistingDirectory(this, tr ("Set working direcotry"));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
168
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
169 if (!selectedDirectory.isEmpty ())
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
170 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
171 m_terminal->sendText (QString ("cd \'%1\'\n").arg (selectedDirectory));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
172 m_terminal->setFocus ();
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
173 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
174 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
175
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
176 void
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
177 MainWindow::changeCurrentWorkingDirectory (QString directory)
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
178 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
179 m_terminal->sendText (QString ("cd \'%1\'\n").arg (directory));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
180 m_terminal->setFocus ();
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
181 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
182
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
183 void
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
184 MainWindow::currentWorkingDirectoryUp ()
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
185 {
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
186 m_terminal->sendText ("cd ..\n");
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
187 m_terminal->setFocus ();
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
188 }
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
189
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
190 void
13548
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
191 MainWindow::showAboutOctave ()
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
192 {
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
193 QString message =
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
194 "GNU Octave\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
195 "Copyright (C) 2009 John W. Eaton and others.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
196 "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
197 "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
198 "FITNESS FOR A PARTICULAR PURPOSE. For details, type `warranty'.\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
199 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
200 "Octave was configured for \"x86_64-pc-linux-gnu\".\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
201 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
202 "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
203 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
204 "Please contribute if you find this software useful."
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
205 "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
206 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
207 "Report bugs to <bug@octave.org> (but first, please read"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
208 "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
209 "\n"
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
210 "For information about changes from previous versions, type `news'.\n";
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
211
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
212 QMessageBox::about (this, tr ("About Octave"), message);
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
213 }
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
214
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
215 void
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
216 MainWindow::closeEvent (QCloseEvent * closeEvent)
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
217 {
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
218 reportStatusMessage (tr ("Saving data and shutting down."));
14602
c8453a013000 Cleaned up code. Fixed bug that causes the GUI to freeze when launching another editor.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14601
diff changeset
219 m_closing = true; // inform editor window that whole application is closed
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
220 OctaveLink::instance ()->terminateOctave ();
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
221
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
222 QMainWindow::closeEvent (closeEvent);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
223 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
224
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
225 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
226 MainWindow::readSettings ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
227 {
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
228 QSettings *settings = ResourceManager::instance ()->settings ();
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
229 restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
230 restoreState (settings->value ("MainWindow/windowState").toByteArray ());
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
231 emit settingsChanged ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
232 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
233
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
234 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
235 MainWindow::writeSettings ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
236 {
13537
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
237 QSettings *settings = ResourceManager::instance ()->settings ();
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
238 settings->setValue ("MainWindow/geometry", saveGeometry ());
a43ecce77eec Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13536
diff changeset
239 settings->setValue ("MainWindow/windowState", saveState ());
14694
ea11c9d8aa47 Calling qApp->quit () via QMetaObject::invoke caused a segfault, now exits cleanly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14693
diff changeset
240 settings->sync ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
241 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
242
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
243 void
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
244 MainWindow::construct ()
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
245 {
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
246 QStyle *style = QApplication::style ();
14599
97cb9286919c Cleaned up code.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14588
diff changeset
247 // TODO: Check this.
14602
c8453a013000 Cleaned up code. Fixed bug that causes the GUI to freeze when launching another editor.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14601
diff changeset
248 m_closing = false; // flag for editor files when closed
13613
8728061cd0ec Icons are now maintained by the ResourceManager.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13611
diff changeset
249 setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Octave));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
250
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
251 // Setup dockable widgets and the status bar.
13683
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
252 m_workspaceView = new WorkspaceView (this);
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
253 m_workspaceView->setStatusTip (tr ("View the variables in the active workspace."));
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
254 m_historyDockWidget = new HistoryDockWidget (this);
13549
807e5e9b7591 Added lots of status tips.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13548
diff changeset
255 m_historyDockWidget->setStatusTip (tr ("Browse and search the command history."));
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
256 m_filesDockWidget = new FilesDockWidget (this);
13549
807e5e9b7591 Added lots of status tips.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13548
diff changeset
257 m_filesDockWidget->setStatusTip (tr ("Browse your files."));
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
258 m_statusBar = new QStatusBar (this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
259
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
260 m_currentDirectoryComboBox = new QComboBox (this);
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
261 m_currentDirectoryComboBox->setFixedWidth (300);
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
262 m_currentDirectoryComboBox->setEditable (true);
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
263 m_currentDirectoryComboBox->setInsertPolicy (QComboBox::InsertAtTop);
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
264 m_currentDirectoryComboBox->setMaxVisibleItems (14);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
265
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
266 m_currentDirectoryToolButton = new QToolButton (this);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
267 m_currentDirectoryToolButton->setIcon (style->standardIcon (QStyle::SP_DirOpenIcon));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
268
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
269 m_currentDirectoryUpToolButton = new QToolButton (this);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
270 m_currentDirectoryUpToolButton->setIcon (style->standardIcon (QStyle::SP_FileDialogToParent));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
271
13550
cd66481d55b0 Added close button to file editor, assorted subwindows after importance.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13549
diff changeset
272 // Octave Terminal subwindow.
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
273 m_terminal = new QTerminal (this);
14694
ea11c9d8aa47 Calling qApp->quit () via QMetaObject::invoke caused a segfault, now exits cleanly.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14693
diff changeset
274 m_terminal->setObjectName ("OctaveTerminal");
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
275 m_terminalDockWidget = new TerminalDockWidget (m_terminal, this);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
276
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
277 QWidget *dummyWidget = new QWidget ();
14698
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
278 dummyWidget->setObjectName ("CentralDummyWidget");
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
279 dummyWidget->resize (10, 10);
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
280 dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
14698
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
281 dummyWidget->hide ();
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
282 setCentralWidget (dummyWidget);
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
283
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
284 m_fileEditor = new FileEditor (m_terminal, this);
13558
248b897d9f36 editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents: 13550
diff changeset
285
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
286 QMenu *fileMenu = menuBar ()->addMenu (tr ("&File"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
287 QAction *newFileAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
288 = fileMenu->addAction (QIcon::fromTheme ("document-new",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
289 style->standardIcon (QStyle::SP_FileIcon)), tr ("New File"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
290
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
291 QAction *openFileAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
292 = fileMenu->addAction (QIcon::fromTheme ("document-open",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
293 style->standardIcon (QStyle::SP_FileIcon)), tr ("Open File"));
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
294
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
295 QAction *settingsAction = fileMenu->addAction (tr ("Settings"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
296 fileMenu->addSeparator ();
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
297 QAction *exitAction = fileMenu->addAction (tr ("Exit"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
298
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
299 QMenu *editMenu = menuBar ()->addMenu (tr ("&Edit"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
300 QAction *cutAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
301 = editMenu->addAction (QIcon::fromTheme ("edit-cut",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
302 style->standardIcon (QStyle::SP_FileIcon)), tr ("Cut"));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
303 cutAction->setShortcut (QKeySequence::Cut);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
304
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
305 QAction *copyAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
306 = editMenu->addAction (QIcon::fromTheme ("edit-copy",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
307 style->standardIcon (QStyle::SP_FileIcon)), tr ("Copy"));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
308 copyAction->setShortcut (QKeySequence::Copy);
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
309
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
310 QAction *pasteAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
311 = editMenu->addAction (QIcon::fromTheme ("edit-paste",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
312 style->standardIcon (QStyle::SP_FileIcon)), tr ("Paste"));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
313 pasteAction->setShortcut (QKeySequence::Paste);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
314
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
315 QAction *undoAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
316 = editMenu->addAction (QIcon::fromTheme ("edit-undo",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
317 style->standardIcon (QStyle::SP_FileIcon)), tr ("Undo"));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
318 undoAction->setShortcut (QKeySequence::Undo);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
319
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
320 QAction *redoAction
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
321 = editMenu->addAction (QIcon::fromTheme ("edit-redo",
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
322 style->standardIcon (QStyle::SP_FileIcon)), tr ("Redo"));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
323 redoAction->setShortcut (QKeySequence::Redo);
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
324
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
325 //QMenu *debugMenu = menuBar ()->addMenu (tr ("De&bug"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
326 //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
327
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
328 QMenu *desktopMenu = menuBar ()->addMenu (tr ("&Desktop"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
329 QAction *loadWorkspaceAction = desktopMenu->addAction (tr ("Load workspace"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
330 QAction *saveWorkspaceAction = desktopMenu->addAction (tr ("Save workspace"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
331 QAction *clearWorkspaceAction = desktopMenu->addAction (tr ("Clear workspace"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
332
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
333 // Window menu
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
334 QMenu *windowMenu = menuBar ()->addMenu (tr ("&Window"));
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
335 QAction *showCommandWindowAction = windowMenu->addAction (tr ("Command Window"));
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
336 showCommandWindowAction->setCheckable (true);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
337 QAction *showWorkspaceAction = windowMenu->addAction (tr ("Workspace"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
338 showWorkspaceAction->setCheckable (true);
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
339 QAction *showHistoryAction = windowMenu->addAction (tr ("Command History"));
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
340 showHistoryAction->setCheckable (true);
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
341 QAction *showFileBrowserAction = windowMenu->addAction (tr ("Current Directory"));
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
342 showFileBrowserAction->setCheckable (true);
14681
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
343 QAction *showEditorAction = windowMenu->addAction (tr ("Editor"));
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
344 showEditorAction->setCheckable (true);
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
345
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
346 windowMenu->addSeparator ();
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
347 QAction *resetWindowsAction = windowMenu->addAction (tr ("Reset Windows"));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
348
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
349 // Help menu
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
350 QMenu *helpMenu = menuBar ()->addMenu (tr ("&Help"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
351 QAction *reportBugAction = helpMenu->addAction (tr ("Report Bug"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
352 QAction *agoraAction = helpMenu->addAction (tr ("Visit Agora"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
353 QAction *octaveForgeAction = helpMenu->addAction (tr ("Visit Octave Forge"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
354 helpMenu->addSeparator ();
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
355 QAction *aboutOctaveAction = helpMenu->addAction (tr ("About Octave"));
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
356
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
357 // Toolbars
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
358 QToolBar *mainToolBar = addToolBar ("Main");
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
359 mainToolBar->addAction (newFileAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
360 mainToolBar->addAction (openFileAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
361 mainToolBar->addSeparator ();
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
362 mainToolBar->addAction (cutAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
363 mainToolBar->addAction (copyAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
364 mainToolBar->addAction (pasteAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
365 mainToolBar->addAction (undoAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
366 mainToolBar->addAction (redoAction);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
367 mainToolBar->addSeparator ();
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
368 mainToolBar->addWidget (new QLabel (tr ("Current Directory:")));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
369 mainToolBar->addWidget (m_currentDirectoryComboBox);
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
370 mainToolBar->addWidget (m_currentDirectoryToolButton);
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
371 mainToolBar->addWidget (m_currentDirectoryUpToolButton);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
372
14693
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
373 connect (qApp, SIGNAL(aboutToQuit ()), this, SLOT (prepareForQuit ()));
c952f1e35e50 Added patch from Marco Atzeri for QTerminal to build with cygwin. Removed some compiler warnings.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14692
diff changeset
374
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
375 connect (settingsAction, SIGNAL (triggered ()), this, SLOT (processSettingsDialogRequest ()));
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
376 connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ()));
14670
7fbea449737d Restructured menus, added toolbar and current directory line edit.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14669
diff changeset
377 connect (newFileAction, SIGNAL (triggered ()), this, SLOT (newFile ()));
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
378 connect (openFileAction, SIGNAL (triggered ()), this, SLOT (openFile ()));
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
379 connect (reportBugAction, SIGNAL (triggered ()), this, SLOT (openBugTrackerPage ()));
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
380 connect (agoraAction, SIGNAL (triggered ()), this, SLOT (openAgoraPage ()));
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
381 connect (octaveForgeAction, SIGNAL (triggered ()), this, SLOT (openOctaveForgePage ()));
13548
5c2ea445e100 Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13546
diff changeset
382 connect (aboutOctaveAction, SIGNAL (triggered ()), this, SLOT (showAboutOctave ()));
13533
edaf8e72070e Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13532
diff changeset
383
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
384 connect (showCommandWindowAction, SIGNAL (toggled (bool)), m_terminalDockWidget, SLOT (setShown (bool)));
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
385 connect (m_terminalDockWidget, SIGNAL (activeChanged (bool)), showCommandWindowAction, SLOT (setChecked (bool)));
13683
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
386 connect (showWorkspaceAction, SIGNAL (toggled (bool)), m_workspaceView, SLOT (setShown (bool)));
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
387 connect (m_workspaceView, SIGNAL (activeChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool)));
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
388 connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool)));
13577
e440b3f32f02 Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13570
diff changeset
389 connect (m_historyDockWidget, SIGNAL (activeChanged (bool)), showHistoryAction, SLOT (setChecked (bool)));
13532
fd87d6f7e185 Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13531
diff changeset
390 connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool)));
13577
e440b3f32f02 Fixed bug with closing subwindows.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13570
diff changeset
391 connect (m_filesDockWidget, SIGNAL (activeChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool)));
14681
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
392 connect (showEditorAction, SIGNAL (toggled (bool)), m_fileEditor, SLOT (setShown (bool)));
66ff321cb62e Integrated the editor to be docked with the other widgets.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
393 connect (m_fileEditor, SIGNAL (activeChanged (bool)), showEditorAction, SLOT (setChecked (bool)));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
394 connect (resetWindowsAction, SIGNAL (triggered ()), this, SLOT (resetWindows ()));
14286
728c8929385f Commented out some functionality that has not been implemented correctly until now.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14283
diff changeset
395 //connect (this, SIGNAL (settingsChanged ()), m_workspaceView, SLOT (noticeSettings ()));
728c8929385f Commented out some functionality that has not been implemented correctly until now.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14283
diff changeset
396 //connect (this, SIGNAL (settingsChanged ()), m_historyDockWidget, SLOT (noticeSettings ()));
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
397 connect (this, SIGNAL (settingsChanged ()), m_filesDockWidget, SLOT (noticeSettings ()));
14695
55f88d2236b6 Added copy and paste context menu for the terminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14694
diff changeset
398 connect (this, SIGNAL (settingsChanged ()), this, SLOT (noticeSettings ()));
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
399
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14673
diff changeset
400 connect (m_filesDockWidget, SIGNAL (openFile (QString)), m_fileEditor, SLOT (requestOpenFile (QString)));
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
401 connect (m_historyDockWidget, SIGNAL (information (QString)), this, SLOT (reportStatusMessage (QString)));
13546
5ef33f99a078 Command get inserted by double clicking in the command history again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13542
diff changeset
402 connect (m_historyDockWidget, SIGNAL (commandDoubleClicked (QString)), this, SLOT (handleCommandDoubleClicked (QString)));
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
403 connect (saveWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleSaveWorkspaceRequest ()));
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
404 connect (loadWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleLoadWorkspaceRequest ()));
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
405 connect (clearWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleClearWorkspaceRequest ()));
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13534
diff changeset
406
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
407 connect (m_currentDirectoryToolButton, SIGNAL (clicked ()),
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
408 this, SLOT (changeCurrentWorkingDirectory ()));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
409 connect (m_currentDirectoryUpToolButton, SIGNAL (clicked ()),
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
410 this, SLOT(currentWorkingDirectoryUp()));
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
411 connect (copyAction, SIGNAL (triggered()), m_terminal, SLOT(copyClipboard ()));
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
412 connect (pasteAction, SIGNAL (triggered()), m_terminal, SLOT(pasteClipboard ()));
14700
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
413
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
414 connect (OctaveLink::instance (), SIGNAL (workingDirectoryChanged (QString)),
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
415 this, SLOT (updateCurrentWorkingDirectory (QString)));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
416 connect (m_currentDirectoryComboBox, SIGNAL (activated (QString)),
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
417 this, SLOT (changeCurrentWorkingDirectory (QString)));
7623bece76df Implemented logic for current directory bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14698
diff changeset
418
14601
772ce0204b3f Removed version number and "Octave GUI"-labelling.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14599
diff changeset
419 setWindowTitle ("Octave");
13514
9accc22fd9b0 Added a version number.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
420
14682
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
421 setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
9ea75ea686b5 Allowing nested dock widgets and fixed small bug in loading a workspace.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14681
diff changeset
422
13683
25dc40d24a44 Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13674
diff changeset
423 addDockWidget (Qt::LeftDockWidgetArea, m_workspaceView);
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
424 addDockWidget (Qt::LeftDockWidgetArea, m_historyDockWidget);
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
425 addDockWidget (Qt::RightDockWidgetArea, m_filesDockWidget);
14698
79c9a6d06590 Wrote SymbolInformation struct and refactored code that updates the symbol table.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14695
diff changeset
426 addDockWidget (Qt::RightDockWidgetArea, m_fileEditor);
14692
d6d250812c01 Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14690
diff changeset
427 addDockWidget (Qt::BottomDockWidgetArea, m_terminalDockWidget);
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
428 setStatusBar (m_statusBar);
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
429
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
430 readSettings ();
13501
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
431 }
86d6c3b90ad7 Added new gui files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
432