annotate libgui/qterminal/libqterminal/QTerminal.h @ 19303:c6615ca0a11d gui-release

horizontal scrollbar for GUI terminal on Windows systems * QTerminal.h (QTerminal::init_terminal_size): New public virtual slot. (QTerminal::QTerminal): Connect main_window::init_terminal_size_signal to QTerminal::init_terminal_size slot. * QWinTerminalImpl.h, QWinTerminalImpl.cc (QConsolePrivate::updateConsoleSize): New parameter allow_smaller_width. Call updateHorizontalScrollBar and updateVerticalScrollBar instead of updateScrollBar. (QConsolePrivate::updateVerticalScrollBar): Rename from QConsolePrivate::updateScrollBar. Change all uses. (QConsolePrivate::setVerticalScrollValue): Rename from QConsolePrivate::setScrollValue. Change all uses. (QConsolePrivate::m_verticalScrollBar): Rename from QConsolePrivate::m_scrollBar. Change all uses. (QConsolePrivate::m_horizontalScrollBar): New data member. (QConsolePrivate::updateHorizontalScrollBar, QConsolePrivate::setHorizontalScrollValue): New functions. (QConsolePrivate::QConsolePrivate): Create horizontal scroll bar. Call updateHorizontalScrollBar and updateVerticalScrollBar instead of updateScrollBar. Connect signal for horizontal scrolling. (QConsolePrivate::selectWord, QConsolePrivate::drawSelection): Handle horizontal offset. (QWinTerminalImpl::init_terminal_size): New slot. (QWinTerminalImpl::verticalScrollValueChanged): Rename from QWinTerminalImpl::scrollValueChanged. (QWinTerminalImpl::horizontalScrollValueChanged): New slot. * main-window.h, main-window.cc (main_window::init_terminal_size): New slot. (main_window::init_terminal_size_signal): New signal.
author John W. Eaton <jwe@octave.org>
date Thu, 30 Oct 2014 13:38:02 -0400
parents 6e81b59d657c
children bd1369a2a651
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
1 /*
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16794
diff changeset
3 Copyright (C) 2012-2013 Michael Goffioul.
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 16794
diff changeset
4 Copyright (C) 2012-2013 Jacob Dawid.
15647
a044a259c423 Renamed SessionModel in TerminalModel.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15646
diff changeset
5
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
6 This file is part of QTerminal.
15631
9712f29c97de Compiles again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
7
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17790
diff changeset
8 This program is free software; you can redistribute it and/or modify
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
9 it under the terms of the GNU General Public License as published by
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
11 (at your option) any later version.
15631
9712f29c97de Compiles again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
12
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17790
diff changeset
13 This program is distributed in the hope that it will be useful,
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
16 GNU General Public License for more details.
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
17
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
18 You should have received a copy of the GNU General Public License
17795
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17790
diff changeset
19 along with this program. If not,
0a8c35ae5ce1 maint: Fix various problems with GPL copyright statements.
Rik <rik@octave.org>
parents: 17790
diff changeset
20 see <http://www.gnu.org/licenses/>.
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
21
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
22 */
15631
9712f29c97de Compiles again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
24 #ifndef QTERMINAL_H
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
25 #define QTERMINAL_H
15649
c22fa57226b2 Fixed bug with ECHOCTL.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15648
diff changeset
26
16469
c89699ca005a ensure QSettings is declared for QTerminal.h
John W. Eaton <jwe@octave.org>
parents: 16413
diff changeset
27 #include <QSettings>
16648
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
28 #include <QKeySequence>
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
29 #include <QWidget>
16641
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
30 #include <QStringList>
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
31 #include <QColor>
16641
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
32 #include <QList>
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
33 #include <QMenu>
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
34 #include <QClipboard>
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
35 #include <QApplication>
15662
5758e0013246 Enable compilation on Win32-native platform.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 15658
diff changeset
36
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
37 class QTerminal : public QWidget
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
38 {
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
39 Q_OBJECT
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
40
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
41 public:
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
42
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
43 static QTerminal *create (QWidget *xparent = 0);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
44
16641
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
45 static QList<QColor> default_colors (void);
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
46
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
47 static QStringList color_names (void);
64f9a3e301d3 don't store default values in resource manager class
John W. Eaton <jwe@octave.org>
parents: 16639
diff changeset
48
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
49 virtual ~QTerminal (void) { }
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
50
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
51 virtual void setTerminalFont (const QFont& font) = 0;
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
52
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
53 virtual void setSize (int h, int v) = 0;
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
54
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
55 virtual void sendText (const QString& text) = 0;
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
56
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
57 virtual QString selectedText () = 0;
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
58
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
59 enum CursorType
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
60 {
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
61 UnderlineCursor,
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
62 BlockCursor,
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
63 IBeamCursor
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
64 };
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
65
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
66 virtual void setCursorType (CursorType type, bool blinking)
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
67 {
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
68 // Provide empty default impl in order to avoid conflicts with the
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
69 // win impl.
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
70
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
71 Q_UNUSED (type);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
72 Q_UNUSED (blinking);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
73 }
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
74
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
75 virtual void setBackgroundColor (const QColor& color) = 0;
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
76
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
77 virtual void setForegroundColor (const QColor& color) = 0;
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
78
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
79 virtual void setSelectionColor (const QColor& color) = 0;
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
80
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
81 virtual void setCursorColor (bool useForegroundColor,
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
82 const QColor& color) = 0;
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
83
18610
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18555
diff changeset
84 virtual void setScrollBufferSize(int value=1000) = 0;
6e81b59d657c Add preference for terminal windows buffer size (bug #41474)
Ahsan Ali Shahid <ahsan.ali.shahid@gmail.com>
parents: 18555
diff changeset
85
16648
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
86 signals:
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
87
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
88 void report_status_message (const QString&);
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
89
17920
5c3f22dd0bbb raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents: 17795
diff changeset
90 void interrupt_signal (void);
5c3f22dd0bbb raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents: 17795
diff changeset
91
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
92 public slots:
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
93
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
94 virtual void copyClipboard (void) = 0;
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
95
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
96 virtual void pasteClipboard (void) = 0;
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15894
diff changeset
97
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
98 virtual void selectAll (void) = 0;
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
99
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
100 virtual void handleCustomContextMenuRequested (const QPoint& at)
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
101 {
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
102 QClipboard * cb = QApplication::clipboard ();
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
103
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
104 _paste_action->setEnabled (cb->text().length() > 0);
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
105 _copy_action->setEnabled (selectedText().length() > 0);
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
106
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
107 _contextMenu->move (mapToGlobal (at));
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
108 _contextMenu->show ();
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
109 }
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
110
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
111 void notice_settings (const QSettings *settings);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
112
19303
c6615ca0a11d horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents: 18610
diff changeset
113 virtual void init_terminal_size (void) { }
c6615ca0a11d horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents: 18610
diff changeset
114
17920
5c3f22dd0bbb raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents: 17795
diff changeset
115 void terminal_interrupt (void) { emit interrupt_signal (); }
5c3f22dd0bbb raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents: 17795
diff changeset
116
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
117 protected:
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
118
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
119 QTerminal (QWidget *xparent = 0) : QWidget (xparent)
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
120 {
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
121 setContextMenuPolicy (Qt::CustomContextMenu);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
122
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
123 _contextMenu = new QMenu (this);
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
124
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
125 _copy_action = _contextMenu->addAction (
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
126 QIcon (":/actions/icons/editcopy.png"),
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
127 tr ("Copy"), this, SLOT (copyClipboard ()));
16649
de1f8e4b6b9b more copy/paste tweaks
John W. Eaton <jwe@octave.org>
parents: 16648
diff changeset
128
16794
1d1f02e0f6b4 GUI: enable clipboard content detection for terminal window context menu
John Donoghue <john.donoghue@ieee.org>
parents: 16718
diff changeset
129 _paste_action = _contextMenu->addAction (
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
130 QIcon (":/actions/icons/editpaste.png"),
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
131 tr ("Paste"), this, SLOT (pasteClipboard ()));
16718
0495339998f8 context menu of terminal widget: add icons and an entry to clear the console
Torsten <ttl@justmail.de>
parents: 16658
diff changeset
132
0495339998f8 context menu of terminal widget: add icons and an entry to clear the console
Torsten <ttl@justmail.de>
parents: 16658
diff changeset
133 _contextMenu->addSeparator ();
0495339998f8 context menu of terminal widget: add icons and an entry to clear the console
Torsten <ttl@justmail.de>
parents: 16658
diff changeset
134
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
135 _selectall_action = _contextMenu->addAction (
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
136 tr ("Select All"), this, SLOT (selectAll ()));
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
137
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
138
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
139 _contextMenu->addSeparator ();
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
140
16718
0495339998f8 context menu of terminal widget: add icons and an entry to clear the console
Torsten <ttl@justmail.de>
parents: 16658
diff changeset
141 _contextMenu->addAction (tr ("Clear All"), parent (),
0495339998f8 context menu of terminal widget: add icons and an entry to clear the console
Torsten <ttl@justmail.de>
parents: 16658
diff changeset
142 SLOT (handle_clear_command_window_request ()));
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
143
16648
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
144 connect (this, SIGNAL (customContextMenuRequested (QPoint)),
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
145 this, SLOT (handleCustomContextMenuRequested (QPoint)));
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
146
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
147 connect (this, SIGNAL (report_status_message (const QString&)),
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
148 xparent, SLOT (report_status_message (const QString&)));
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
149
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
150 connect (xparent, SIGNAL (settings_changed (const QSettings *)),
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
151 this, SLOT (notice_settings (const QSettings *)));
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
152
19303
c6615ca0a11d horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents: 18610
diff changeset
153 connect (xparent, SIGNAL (init_terminal_size_signal ()),
c6615ca0a11d horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents: 18610
diff changeset
154 this, SLOT (init_terminal_size ()));
c6615ca0a11d horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents: 18610
diff changeset
155
16648
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
156 connect (xparent, SIGNAL (copyClipboard_signal ()),
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
157 this, SLOT (copyClipboard ()));
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
158
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
159 connect (xparent, SIGNAL (pasteClipboard_signal ()),
b04413e5a811 improve handling of interrupts, copy and paste shortcuts
John W. Eaton <jwe@octave.org>
parents: 16641
diff changeset
160 this, SLOT (pasteClipboard ()));
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
161
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
162 connect (xparent, SIGNAL (selectAll_signal ()),
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
163 this, SLOT (selectAll ()));
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
164 }
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
165
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
166 private:
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
167
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
168 QMenu *_contextMenu;
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
169 QAction * _copy_action;
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
170 QAction * _paste_action;
18555
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17920
diff changeset
171 QAction * _selectall_action;
16639
ba808cd9d86c simplify QTerminal inheritance scheme
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
172 };
15631
9712f29c97de Compiles again.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
173
15651
845cebf281aa Added files of QConsole.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 15650
diff changeset
174 #endif // QTERMINAL_H