GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
terminal-dock-widget.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013 John W. Eaton
4 Copyright (C) 2011-2013 Jacob Dawid
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27 
28 #include "terminal-dock-widget.h"
29 
31  : octave_dock_widget (p), terminal (QTerminal::create (p))
32 {
33  terminal->setObjectName ("OctaveTerminal");
34  terminal->setFocusPolicy (Qt::StrongFocus);
35 
36  setObjectName ("TerminalDockWidget");
37  setWindowIcon (QIcon (":/actions/icons/logo.png"));
38  set_title (tr ("Command Window"));
39 
40  setWidget (terminal);
41 
42  connect (terminal, SIGNAL (interrupt_signal (void)),
43  this, SLOT (terminal_interrupt ()));
44 }
45 
46 bool
48 {
49  QWidget *w = widget ();
50 
51  return w->hasFocus ();
52 }
53 
54 void
56 {
58 
59  QWidget *w = widget ();
60 
61  w->setFocus ();
62  w->activateWindow ();
63  w->raise ();
64 }
65 
66 void
68 {
69  emit interrupt_signal ();
70 }