Mercurial > hg > octave-nkf
annotate gui/src/MainWindow.h @ 14269:4a6867289e24 gui
Removed the old IRC Client code and replaced it by qirc.
* irc/*: Completely removed as it is not needed anymore.
* MainWindow.*: Exchanged IRCWidget for QIRCWidget.
* octave-gui.pro: Added library -lqirc and removed old include path irc/*.
author | Jacob Dawid <jacob.dawid@googlemail.com> |
---|---|
date | Sat, 28 Jan 2012 00:11:34 +0100 |
parents | 5dcfb705ce12 |
children | faece6b2ab90 |
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:
13657
diff
changeset
|
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com) |
13501 | 3 * |
4 * This program is free software: you can redistribute it and/or modify | |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13657
diff
changeset
|
5 * it under the terms of the GNU Affero General Public License as |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13657
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:
13657
diff
changeset
|
7 * License, or (at your option) any later version. |
13501 | 8 * |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13657
diff
changeset
|
12 * GNU Affero General Public License for more details. |
13501 | 13 * |
13674
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13657
diff
changeset
|
14 * You should have received a copy of the GNU Affero General Public License |
c0e66d6e3dc8
Updated license headers and moved to AGPLv3.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13657
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
13501 | 16 */ |
17 | |
18 #ifndef MAINWINDOW_H | |
19 #define MAINWINDOW_H | |
20 | |
21 #include <QtGui/QMainWindow> | |
22 #include <QThread> | |
23 #include <QTabWidget> | |
24 #include <QMdiArea> | |
25 #include <QStatusBar> | |
26 #include <QToolBar> | |
27 #include <QQueue> | |
13558
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
28 #include <Qsci/qsciapis.h> |
13626
cc90c62ada21
Removed terminal, instead now using QPlainTextEdit, which looks much nicer and is not that error-prone...
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13614
diff
changeset
|
29 #include <QMdiSubWindow> |
13537
a43ecce77eec
Introduced a central ResourceManager class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13536
diff
changeset
|
30 #include "ResourceManager.h" |
13501 | 31 #include "OctaveLink.h" |
13683
25dc40d24a44
Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13680
diff
changeset
|
32 #include "WorkspaceView.h" |
13501 | 33 #include "HistoryDockWidget.h" |
34 #include "FilesDockWidget.h" | |
35 #include "BrowserWidget.h" | |
13558
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
36 #include "lexer/lexeroctavegui.h" |
14255
5dcfb705ce12
GUI: Bundled the new qterminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13869
diff
changeset
|
37 #include "QTerminal.h" |
14269
4a6867289e24
Removed the old IRC Client code and replaced it by qirc.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14255
diff
changeset
|
38 #include "QIRCWidget.h" |
13501 | 39 |
13614
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
40 class NonClosableMdiSubWindow : public QMdiSubWindow |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
41 { |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
42 Q_OBJECT |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
43 public: |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
44 explicit NonClosableMdiSubWindow (QWidget *parent = 0) |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
45 : QMdiSubWindow (parent) { } |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
46 virtual ~NonClosableMdiSubWindow () { } |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
47 protected: |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
48 void closeEvent (QCloseEvent *closeEvent) |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
49 { |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
50 closeEvent->ignore (); |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
51 } |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
52 }; |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
53 |
13501 | 54 /** |
55 * \class MainWindow | |
56 * | |
57 * Represents the main window. | |
58 */ | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
59 class MainWindow:public QMainWindow |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
60 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
61 Q_OBJECT public: |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
62 MainWindow (QWidget * parent = 0); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
63 ~MainWindow (); |
13501 | 64 |
14255
5dcfb705ce12
GUI: Bundled the new qterminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13869
diff
changeset
|
65 QTerminal *terminalView () |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
66 { |
13648
da69cec2459f
Renamed OctaveTerminal to TerminalView.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13626
diff
changeset
|
67 return m_terminalView; |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
68 } |
13683
25dc40d24a44
Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13680
diff
changeset
|
69 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
70 HistoryDockWidget *historyDockWidget () |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
71 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
72 return m_historyDockWidget; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
73 } |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
74 FilesDockWidget *filesDockWidget () |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
75 { |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
76 return m_filesDockWidget; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
77 } |
13657
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
78 bool isCloseApplication () |
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
79 { |
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
80 return m_closeApplication; |
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
81 } |
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
82 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13533
diff
changeset
|
83 signals: |
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13533
diff
changeset
|
84 void settingsChanged (); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
85 |
13536
869c62c15e95
Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13533
diff
changeset
|
86 public slots: |
13532
fd87d6f7e185
Dock windows are now selectable form the menus.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13530
diff
changeset
|
87 void handleOpenFileRequest (QString fileName); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
88 void reportStatusMessage (QString statusMessage); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
89 void openWebPage (QString url); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
90 void handleSaveWorkspaceRequest (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
91 void handleLoadWorkspaceRequest (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
92 void handleClearWorkspaceRequest (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
93 void handleCommandDoubleClicked (QString command); |
13611
7f6f339761f9
Chat Window changes logo on new messages.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13562
diff
changeset
|
94 void handleUnreadMessages (bool yes); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
95 void alignMdiWindows (); |
13530
8c7390b78911
gui-editor: open new editor window via interface menu
ttl <ttl@justmail.de>
parents:
13528
diff
changeset
|
96 void openEditor (); |
13558
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
97 void openEditorFile (QString fileName); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
98 void openBugTrackerPage (); |
13533
edaf8e72070e
Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13532
diff
changeset
|
99 void openAgoraPage (); |
edaf8e72070e
Added urls for Agora and Octave Forge in Community Window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13532
diff
changeset
|
100 void openOctaveForgePage (); |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
101 void processSettingsDialogRequest (); |
13548
5c2ea445e100
Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13541
diff
changeset
|
102 void showAboutOctave (); |
5c2ea445e100
Added about boxes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13541
diff
changeset
|
103 void showAboutQt (); |
13501 | 104 |
105 protected: | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
106 void closeEvent (QCloseEvent * closeEvent); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
107 void readSettings (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
108 void writeSettings (); |
13501 | 109 |
110 private: | |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
111 void construct (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
112 void establishOctaveLink (); |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
113 QMdiArea *m_centralMdiArea; |
13501 | 114 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
115 // Mdi sub windows. |
14255
5dcfb705ce12
GUI: Bundled the new qterminal.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13869
diff
changeset
|
116 QTerminal *m_terminalView; |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
117 BrowserWidget *m_documentationWidget; |
14269
4a6867289e24
Removed the old IRC Client code and replaced it by qirc.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14255
diff
changeset
|
118 QIRCWidget *m_ircWidget; |
13501 | 119 |
13648
da69cec2459f
Renamed OctaveTerminal to TerminalView.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13626
diff
changeset
|
120 NonClosableMdiSubWindow *m_terminalViewSubWindow; |
13614
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
121 NonClosableMdiSubWindow *m_documentationWidgetSubWindow; |
5cb93c6d8aab
Important subwindows are not closable now. A close button is still displayed, which seems to be q Qt bug.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13611
diff
changeset
|
122 NonClosableMdiSubWindow *m_ircWidgetSubWindow; |
13501 | 123 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
124 // Dock widgets. |
13683
25dc40d24a44
Renamed VariablesDockWidget to WorkspaceView and optimized memory footprint for 30%.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13680
diff
changeset
|
125 WorkspaceView *m_workspaceView; |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
126 HistoryDockWidget *m_historyDockWidget; |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
127 FilesDockWidget *m_filesDockWidget; |
13501 | 128 |
13558
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
129 // Editor's lexer |
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
130 LexerOctaveGui *m_lexer; |
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
131 QsciAPIs *m_lexerAPI; |
248b897d9f36
editor: custom lexer, syntax highlighting, auto completion
ttl <ttl@justmail.de>
parents:
13548
diff
changeset
|
132 |
13506
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
133 // Toolbars. |
c70511cf64ee
Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13504
diff
changeset
|
134 QStatusBar *m_statusBar; |
13562
a89aa9e05e19
editor: menu bar, run editor file in octave
ttl <ttl@justmail.de>
parents:
13558
diff
changeset
|
135 |
13657
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
136 // Flag for closing whole application |
347dfbea2c8a
modified editor files can be saved when main window is closed
ttl <ttl@justmail.de>
parents:
13648
diff
changeset
|
137 bool m_closeApplication; |
13501 | 138 }; |
139 | |
140 #endif // MAINWINDOW_H |