Mercurial > octave
annotate libgui/src/octave-gui.cc @ 22088:c3823cb0ea02
eliminate unused class definition
* octave-gui.cc (octave_cli_thread): Delete unused class.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 11 Jul 2016 13:45:12 -0400 |
parents | d04da18a407a |
children | c2c668b3051b |
rev | line source |
---|---|
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
1 /* |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
2 |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19686
diff
changeset
|
3 Copyright (C) 2011-2015 Jacob Dawid |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
6 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
7 Octave is free software; you can redistribute it and/or modify it |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
8 under the terms of the GNU General Public License as published by the |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
9 Free Software Foundation; either version 3 of the License, or (at your |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
10 option) any later version. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
11 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
15 for more details. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
16 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
20 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
21 */ |
13501 | 22 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21482
diff
changeset
|
23 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
24 # include "config.h" |
15155
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
25 #endif |
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
26 |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
27 #include <QApplication> |
17647
7ec70c575ad6
* octave-gui.cc: set the encoding of qt strings to utf8
Torsten <ttl@justmail.de>
parents:
17569
diff
changeset
|
28 #include <QTextCodec> |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
29 #include <QThread> |
13501 | 30 #include <QTranslator> |
15155
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
31 |
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
32 #include <iostream> |
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
33 |
16597
49832f60282e
if available, use ioctl to give up controlling terminal
Ben Abbott <bpabbott@mac.com>
parents:
16486
diff
changeset
|
34 #if defined (HAVE_SYS_IOCTL_H) |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20671
diff
changeset
|
35 # include <sys/ioctl.h> |
16597
49832f60282e
if available, use ioctl to give up controlling terminal
Ben Abbott <bpabbott@mac.com>
parents:
16486
diff
changeset
|
36 #endif |
49832f60282e
if available, use ioctl to give up controlling terminal
Ben Abbott <bpabbott@mac.com>
parents:
16486
diff
changeset
|
37 |
15368
36ececf69385
avoid some GCC warnings in the libgui code
John W. Eaton <jwe@octave.org>
parents:
15209
diff
changeset
|
38 #include "lo-utils.h" |
15597
9046ee786fe1
Use octave_env instead of setenv.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
15425
diff
changeset
|
39 #include "oct-env.h" |
17569
9d0992c6df30
arrange to pass signals to the GUI subprocess
John W. Eaton <jwe@octave.org>
parents:
17568
diff
changeset
|
40 #include "oct-syscalls.h" |
15155
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15139
diff
changeset
|
41 |
19868
c7c50030e76c
allow qt graphics toolkit to be used in --no-gui mode (bug #44116)
Stefan Mahr <dac922@gmx.de>
parents:
19861
diff
changeset
|
42 #include "builtin-defun-decls.h" |
21374
1487a68a496a
untangle configuration of OpenGL, FLTK, and Qt (bug #47263)
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
43 #if defined (HAVE_QT_GRAPHICS) |
1487a68a496a
untangle configuration of OpenGL, FLTK, and Qt (bug #47263)
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
44 # include "__init_qt__.h" |
1487a68a496a
untangle configuration of OpenGL, FLTK, and Qt (bug #47263)
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
45 #endif |
22088
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
46 #include "octave.h" |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
47 |
22088
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
48 #include "main-window.h" |
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
49 #include "octave-gui.h" |
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
50 #include "resource-manager.h" |
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
51 #include "shortcut-manager.h" |
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
52 #include "thread-manager.h" |
c3823cb0ea02
eliminate unused class definition
John W. Eaton <jwe@octave.org>
parents:
21979
diff
changeset
|
53 #include "welcome-wizard.h" |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
54 |
18618
c644cfa9cb3b
suppress all X11 and Qt error messages by default
John W. Eaton <jwe@octave.org>
parents:
18569
diff
changeset
|
55 // Disable all Qt messages by default. |
17737
d3bb7f1e3971
prevent the editor's file watcher from signaling fasle alarms (bug #40312)
Torsten <ttl@justmail.de>
parents:
17647
diff
changeset
|
56 |
18618
c644cfa9cb3b
suppress all X11 and Qt error messages by default
John W. Eaton <jwe@octave.org>
parents:
18569
diff
changeset
|
57 static void |
19614
4c3ea57905fd
eliminate unused variable warnings in libgui
John W. Eaton <jwe@octave.org>
parents:
19594
diff
changeset
|
58 message_handler (QtMsgType, const char *) |
17790
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17778
diff
changeset
|
59 { |
86c6ae5f969e
Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents:
17778
diff
changeset
|
60 } |
17737
d3bb7f1e3971
prevent the editor's file watcher from signaling fasle alarms (bug #40312)
Torsten <ttl@justmail.de>
parents:
17647
diff
changeset
|
61 |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
62 // If START_GUI is false, we still set up the QApplication so that we |
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
63 // can use Qt widgets for plot windows. |
15137
16a6b0a6855d
GUI: support for octave arguments and integrate with run-octave.
John W. Eaton <jwe@octave.org>
parents:
15081
diff
changeset
|
64 |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
65 int |
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
66 octave_start_gui (int argc, char *argv[], bool start_gui) |
13501 | 67 { |
17922
b5bf26a054bd
interrupt interpreter thread in GUI instead of calling "raise (SIGINT)"
John W. Eaton <jwe@octave.org>
parents:
17804
diff
changeset
|
68 octave_thread_manager::block_interrupt_signal (); |
b5bf26a054bd
interrupt interpreter thread in GUI instead of calling "raise (SIGINT)"
John W. Eaton <jwe@octave.org>
parents:
17804
diff
changeset
|
69 |
21732
6a1eded90355
use namespace for system env class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
70 std::string show_gui_msgs = octave::sys::env::getenv ("OCTAVE_SHOW_GUI_MESSAGES"); |
18569
90dbbafb0502
prevent X11 errors from appearing in GUI command window
John W. Eaton <jwe@octave.org>
parents:
18027
diff
changeset
|
71 |
18618
c644cfa9cb3b
suppress all X11 and Qt error messages by default
John W. Eaton <jwe@octave.org>
parents:
18569
diff
changeset
|
72 // Installing our handler suppresses the messages. |
c644cfa9cb3b
suppress all X11 and Qt error messages by default
John W. Eaton <jwe@octave.org>
parents:
18569
diff
changeset
|
73 if (show_gui_msgs.empty ()) |
c644cfa9cb3b
suppress all X11 and Qt error messages by default
John W. Eaton <jwe@octave.org>
parents:
18569
diff
changeset
|
74 qInstallMsgHandler (message_handler); |
14878
a6c44c28dabe
Added patch from jwe that forks the GUI process in order to have less work.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
75 |
21374
1487a68a496a
untangle configuration of OpenGL, FLTK, and Qt (bug #47263)
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
76 #if defined (HAVE_QT_GRAPHICS) |
19868
c7c50030e76c
allow qt graphics toolkit to be used in --no-gui mode (bug #44116)
Stefan Mahr <dac922@gmx.de>
parents:
19861
diff
changeset
|
77 install___init_qt___functions (); |
c7c50030e76c
allow qt graphics toolkit to be used in --no-gui mode (bug #44116)
Stefan Mahr <dac922@gmx.de>
parents:
19861
diff
changeset
|
78 |
c7c50030e76c
allow qt graphics toolkit to be used in --no-gui mode (bug #44116)
Stefan Mahr <dac922@gmx.de>
parents:
19861
diff
changeset
|
79 Fregister_graphics_toolkit (ovl ("qt")); |
21374
1487a68a496a
untangle configuration of OpenGL, FLTK, and Qt (bug #47263)
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
80 #endif |
19868
c7c50030e76c
allow qt graphics toolkit to be used in --no-gui mode (bug #44116)
Stefan Mahr <dac922@gmx.de>
parents:
19861
diff
changeset
|
81 |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
82 QApplication application (argc, argv); |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
83 QTranslator gui_tr, qt_tr, qsci_tr; |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
84 |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
85 // Set the codec for all strings (before wizard) |
19973 | 86 #if ! defined (Q_OS_WIN32) |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
87 QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("UTF-8")); |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
88 #endif |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
89 |
20246
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
90 // show wizard if this is the first run |
20259
36b32c07c045
Don't run wizard in --no-gui mode (see http://octave.1599824.n4.nabble.com/Octave-wants-to-run-startup-configuration-wizard-in-no-gui-mode-tp4670884.html)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20246
diff
changeset
|
91 if (resource_manager::is_first_run () && start_gui) |
20246
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
92 { |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
93 // before wizard |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
94 resource_manager::config_translators (&qt_tr, &qsci_tr, &gui_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
95 application.installTranslator (&qt_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
96 application.installTranslator (&gui_tr); |
20259
36b32c07c045
Don't run wizard in --no-gui mode (see http://octave.1599824.n4.nabble.com/Octave-wants-to-run-startup-configuration-wizard-in-no-gui-mode-tp4670884.html)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20246
diff
changeset
|
97 application.installTranslator (&qsci_tr); |
20246
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
98 |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
99 welcome_wizard welcomeWizard; |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
100 |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
101 if (welcomeWizard.exec () == QDialog::Rejected) |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
102 exit (1); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
103 |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
104 resource_manager::reload_settings (); // install settings file |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
105 } |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
106 else |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
107 { |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
108 resource_manager::reload_settings (); // get settings file |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
109 |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
110 // after settings |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
111 resource_manager::config_translators (&qt_tr, &qsci_tr, &gui_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
112 application.installTranslator (&qt_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
113 application.installTranslator (&gui_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
114 if (start_gui) |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
115 application.installTranslator (&qsci_tr); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
116 } |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
117 |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
118 if (start_gui) |
14878
a6c44c28dabe
Added patch from jwe that forks the GUI process in order to have less work.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
119 { |
17930
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
120 // update network-settings |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
121 resource_manager::update_network_settings (); |
14878
a6c44c28dabe
Added patch from jwe that forks the GUI process in order to have less work.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
122 |
21482
c64e57319f08
octave-gui: Set TERM unconditionally to Octave's expected terminal type (bug #47449)
Mike Miller <mtmiller@octave.org>
parents:
21374
diff
changeset
|
123 // We provide specific terminal capabilities, so ensure that TERM is |
c64e57319f08
octave-gui: Set TERM unconditionally to Octave's expected terminal type (bug #47449)
Mike Miller <mtmiller@octave.org>
parents:
21374
diff
changeset
|
124 // always set appropriately |
21979
d04da18a407a
use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents:
21941
diff
changeset
|
125 #if defined (OCTAVE_USE_WINDOWS_API) |
21732
6a1eded90355
use namespace for system env class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
126 octave::sys::env::putenv ("TERM", "cygwin"); |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
127 #else |
21732
6a1eded90355
use namespace for system env class
John W. Eaton <jwe@octave.org>
parents:
21724
diff
changeset
|
128 octave::sys::env::putenv ("TERM", "xterm"); |
17778
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
129 #endif |
b5d58667d32d
new main program wrapper to handle giving up controlling tty
John W. Eaton <jwe@octave.org>
parents:
17748
diff
changeset
|
130 |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18575
diff
changeset
|
131 // shortcut manager |
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18575
diff
changeset
|
132 shortcut_manager::init_data (); |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
133 } |
18611
086093fbdc1a
first implementation of a shortcut manager (bug #41217)
Torsten <ttl@justmail.de>
parents:
18575
diff
changeset
|
134 |
20671
d29614aed16f
Force left-to-right alignment for the whole GUI (bug #46204)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20259
diff
changeset
|
135 // Force left-to-right alignment (see bug #46204) |
d29614aed16f
Force left-to-right alignment for the whole GUI (bug #46204)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20259
diff
changeset
|
136 application.setLayoutDirection (Qt::LeftToRight); |
d29614aed16f
Force left-to-right alignment for the whole GUI (bug #46204)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
20259
diff
changeset
|
137 |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
138 // Create and show main window. |
17930
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
139 |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
140 main_window w (0, start_gui); |
17930
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
141 |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
142 if (start_gui) |
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
143 { |
20246
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
144 w.read_settings (); |
6fe746def1aa
Also load settings and translations in --no-gui mode (bugs #44222 and #45199)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
19973
diff
changeset
|
145 |
19303
c6615ca0a11d
horizontal scrollbar for GUI terminal on Windows systems
John W. Eaton <jwe@octave.org>
parents:
18619
diff
changeset
|
146 w.init_terminal_size (); |
17930
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
147 |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
148 // Connect signals for changes in visibility not before w |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
149 // is shown. |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
150 |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
151 w.connect_visibility_changed (); |
ffdbb82a0c78
allow welcome wizard dialog to be canceled
John W. Eaton <jwe@octave.org>
parents:
17925
diff
changeset
|
152 |
18561
6b4f9cab88d6
*octave-gui.cc: focus terminal after all other actions at startup (bug #41814)
Torsten <ttl@justmail.de>
parents:
18027
diff
changeset
|
153 w.focus_command_window (); |
14878
a6c44c28dabe
Added patch from jwe that forks the GUI process in order to have less work.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
154 } |
a6c44c28dabe
Added patch from jwe that forks the GUI process in order to have less work.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
14804
diff
changeset
|
155 else |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
156 application.setQuitOnLastWindowClosed (false); |
19593
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
18618
diff
changeset
|
157 |
19949
857a8f018f53
set up octave_link when running with --no-gui option (bug #44116)
John W. Eaton <jwe@octave.org>
parents:
19868
diff
changeset
|
158 return application.exec (); |
13501 | 159 } |