Mercurial > octave
annotate libgui/src/qt-interpreter-events.h @ 27588:f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
* interpreter-qobject.h, interpreter-qobject.cc
(interpreter_qobject::m_qt_link): Delete data member and all uses.
(interpreter_qobject::execute): Don't connect
confirm_shutdown_signal and copy_image_to_clipboard_signal here.
(interpreter_qobject::confirm_shutdown): Delete.
* octave-qobject.h, octave-qobject.cc (base_qobject::octave_qobject):
Connect copy_image_to_clipboard_signal here.
(base_qobject::m_qt_interpreter_events): New data member.
(base_qobject::confirm_shutdown): New function.
(base_qobject::confirm_shutdown_octave): Delete.
(bool gui_qobject::confirm_shutdown): New function.
(base_qobject::get_qt_interpreter_events, base_qobject::qt_link):
New functions.
* interpreter.h, interpreter.cc (interpreter::quit): New arg, confirm.
* main-window.h, main-window.cc (main_window::confirm_shutdown):
Rename from confirm_shutdown_octave. Change all uses.
(main_window::closeEvent): Check confirm_shutdown first, then if exit
is confirmed, call interpreter::quit with extra argument to skip
confirmation.
* qt-interpreter-events.h, qt-interpreter-events.cc
(qt_interpreter_events::m_octave_qobject): New data member.
(qt_interpreter_events::qt_interpreter_events): Connect
confirm_shutdown_signal to confirm_shutdown_octave slot here.
(qt_interpreter_events::confirm_shutdown_octave): New function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 26 Oct 2019 12:20:29 -0400 |
parents | 9b72eb111b7e |
children | f6b729077ebd |
rev | line source |
---|---|
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26117
diff
changeset
|
3 Copyright (C) 2013-2019 John W. Eaton |
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26117
diff
changeset
|
4 Copyright (C) 2011-2019 Jacob Dawid |
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26117
diff
changeset
|
5 Copyright (C) 2011-2019 John P. Swensen |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 This file is part of Octave. |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24082
diff
changeset
|
9 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
10 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24082
diff
changeset
|
11 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
12 (at your option) any later version. |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
14 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
15 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22411
diff
changeset
|
17 GNU General Public License for more details. |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 You should have received a copy of the GNU General Public License |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24082
diff
changeset
|
21 <https://www.gnu.org/licenses/>. |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 */ |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
25 #if ! defined (octave_qt_interpreter_events_h) |
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
26 #define octave_qt_interpreter_events_h 1 |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
28 #include <list> |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include <string> |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
31 #include <QList> |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27409
diff
changeset
|
32 #include <QMutex> |
16423
04c4dd7fd3ce
use signal for octave_link::update_dbstop_marker
John W. Eaton <jwe@octave.org>
parents:
16422
diff
changeset
|
33 #include <QObject> |
04c4dd7fd3ce
use signal for octave_link::update_dbstop_marker
John W. Eaton <jwe@octave.org>
parents:
16422
diff
changeset
|
34 #include <QString> |
19714
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
35 #include <QWaitCondition> |
16423
04c4dd7fd3ce
use signal for octave_link::update_dbstop_marker
John W. Eaton <jwe@octave.org>
parents:
16422
diff
changeset
|
36 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
37 #include "event-manager.h" |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
27553
9b72eb111b7e
eliminate global uiwidget_creator variable
John W. Eaton <jwe@octave.org>
parents:
27442
diff
changeset
|
39 #include "dialog.h" |
9b72eb111b7e
eliminate global uiwidget_creator variable
John W. Eaton <jwe@octave.org>
parents:
27442
diff
changeset
|
40 |
17824
86e8dbccf7c7
show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents:
17790
diff
changeset
|
41 // Defined for purposes of sending QList<int> as part of signal. |
86e8dbccf7c7
show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents:
17790
diff
changeset
|
42 typedef QList<int> QIntList; |
86e8dbccf7c7
show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents:
17790
diff
changeset
|
43 |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24632
diff
changeset
|
44 class octave_value; |
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24632
diff
changeset
|
45 |
24645
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
46 namespace octave |
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
47 { |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
48 class base_qobject; |
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
49 |
27285
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
50 // The functions in this class are not normally called directly, but |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
51 // are invoked from the Octave interpreter thead by methods in the |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
52 // event_manager class. In most cases, they should only translate |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
53 // data from the types typically used in the interpreter to whatever |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
54 // is required by the GUI (for example, std::string to QString) and |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
55 // emit a Qt signal. |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
56 // |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
57 // The use of Qt signals provides a thread-safe way for the Octave |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
58 // interpreter to notify the GUI of events (directory or workspace has |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
59 // changed, for example) or to request that the GUI perform actions |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
60 // (display a dialog, for example). |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
61 // |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
62 // By using this class as a wrapper around the Qt signals, we maintain |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
63 // a separation between the Octave interpreter and any specific GUI |
6c438195f4e0
internal documentation for interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27284
diff
changeset
|
64 // toolkit (no Qt headers are used in the Octave interpreter sources). |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
65 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
66 class qt_interpreter_events : public QObject, public interpreter_events |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
67 { |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
68 Q_OBJECT |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
69 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
70 public: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
71 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
72 qt_interpreter_events (base_qobject& oct_qobj); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
73 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
74 // No copying! |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
75 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
76 qt_interpreter_events (const qt_interpreter_events&) = delete; |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
77 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
78 qt_interpreter_events& operator = (const qt_interpreter_events&) = delete; |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
79 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
80 ~qt_interpreter_events (void) = default; |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
81 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
82 std::list<std::string> |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
83 file_dialog (const filter_list& filter, const std::string& title, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
84 const std::string& filename, const std::string& pathname, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
85 const std::string& multimode); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
86 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
87 std::list<std::string> |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
88 input_dialog (const std::list<std::string>& prompt, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
89 const std::string& title, const std::list<float>& nr, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
90 const std::list<float>& nc, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
91 const std::list<std::string>& defaults); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
92 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
93 std::pair<std::list<int>, int> |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
94 list_dialog (const std::list<std::string>& list, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
95 const std::string& mode, int width, int height, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
96 const std::list<int>& initial_value, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
97 const std::string& name, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
98 const std::list<std::string>& prompt, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
99 const std::string& ok_string, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
100 const std::string& cancel_string); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
101 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
102 std::string |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
103 question_dialog (const std::string& msg, const std::string& title, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
104 const std::string& btn1, const std::string& btn2, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
105 const std::string& btn3, const std::string& btndef); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
106 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
107 void update_path_dialog (void); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
108 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
109 void show_preferences (void); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
110 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
111 void show_doc (const std::string& file); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
112 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
113 bool edit_file (const std::string& file); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
114 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
115 void edit_variable (const std::string& name, const octave_value& val); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
116 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
117 bool confirm_shutdown (void); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
118 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
119 bool prompt_new_edit_file (const std::string& file); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
120 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
121 int debug_cd_or_addpath_error (const std::string& file, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
122 const std::string& dir, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
123 bool addpath_option); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
124 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
125 uint8NDArray get_named_icon (const std::string& icon_name); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
126 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
127 std::string gui_preference (const std::string& key, |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
128 const std::string& value); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
129 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
130 bool copy_image_to_clipboard (const std::string& file); |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
131 |
27442
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
132 void execute_command_in_terminal (const std::string& command); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
133 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
134 void register_doc (const std::string& file); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
135 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
136 void unregister_doc (const std::string& file); |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
137 |
6e4519df0be2
group functions by category in interpreter_events and event_manager classes
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
138 void directory_changed (const std::string& dir); |
27311
0040b7668518
update load path dialog when path is modified via console
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27285
diff
changeset
|
139 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
140 void file_remove (const std::string& old_name, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
141 const std::string& new_name); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
142 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
143 void file_renamed (bool load_new = true); |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25678
diff
changeset
|
144 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
145 void set_workspace (bool top_level, bool debug, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
146 const symbol_info_list& syminfo, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
147 bool update_variable_editor); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
148 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
149 void clear_workspace (void); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
150 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
151 void set_history (const string_vector& hist); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
152 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
153 void append_history (const std::string& hist_entry); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
154 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
155 void clear_history (void); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
156 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
157 void pre_input_event (void); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
158 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
159 void post_input_event (void); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
160 |
27392
820a87b87c01
clean up use of interpreter in qt_interpreter_events::enter_debugger_event
John W. Eaton <jwe@octave.org>
parents:
27311
diff
changeset
|
161 void enter_debugger_event (const std::string& fcn_name, |
820a87b87c01
clean up use of interpreter in qt_interpreter_events::enter_debugger_event
John W. Eaton <jwe@octave.org>
parents:
27311
diff
changeset
|
162 const std::string& fcn_file_name, int line); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
163 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
164 void execute_in_debugger_event (const std::string& file, int line); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
165 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
166 void exit_debugger_event (void); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
167 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
168 void update_breakpoint (bool insert, const std::string& file, int line, |
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
169 const std::string& cond); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
170 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
171 void lock (void) { m_mutex.lock (); } |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
172 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
173 void wait (void) { m_waitcondition.wait (&m_mutex); } |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
174 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
175 void unlock (void) { m_mutex.unlock (); } |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
176 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
177 void wake_all (void) { m_waitcondition.wakeAll (); } |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
178 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
179 public slots: |
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
180 |
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
181 void confirm_shutdown_octave (void); |
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
182 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
183 private: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
184 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
185 void insert_debugger_pointer (const std::string& file, int line); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
186 |
27284
1a8762e5662b
remove "do_" prefix from interpreter_events class methods
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
187 void delete_debugger_pointer (const std::string& file, int line); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
188 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
189 base_qobject& m_octave_qobj; |
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27553
diff
changeset
|
190 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
191 bool m_shutdown_confirm_result; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
192 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
193 QMutex m_mutex; |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
194 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
195 QWaitCondition m_waitcondition; |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
196 |
27553
9b72eb111b7e
eliminate global uiwidget_creator variable
John W. Eaton <jwe@octave.org>
parents:
27442
diff
changeset
|
197 QUIWidgetCreator m_uiwidget_creator; |
9b72eb111b7e
eliminate global uiwidget_creator variable
John W. Eaton <jwe@octave.org>
parents:
27442
diff
changeset
|
198 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
199 signals: |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
200 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
201 void copy_image_to_clipboard_signal (const QString& file, bool remove_file); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
202 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
203 void edit_file_signal (const QString& file); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
204 |
27409
a0d49e55acae
rename change_directory to directory_changed in event manager
John W. Eaton <jwe@octave.org>
parents:
27396
diff
changeset
|
205 void directory_changed_signal (const QString& dir); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
206 |
27311
0040b7668518
update load path dialog when path is modified via console
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27285
diff
changeset
|
207 void update_path_dialog_signal (void); |
0040b7668518
update load path dialog when path is modified via console
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27285
diff
changeset
|
208 |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25678
diff
changeset
|
209 void file_remove_signal (const QString& old_name, const QString& new_name); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
210 |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25678
diff
changeset
|
211 void file_renamed_signal (bool load_new); |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25678
diff
changeset
|
212 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
213 void execute_command_in_terminal_signal (const QString& command); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
214 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
215 void set_workspace_signal (bool top_level, bool debug, |
26117
a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
John W. Eaton <jwe@octave.org>
parents:
25940
diff
changeset
|
216 const symbol_info_list& syminfo); |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
217 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
218 void clear_workspace_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
219 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
220 void set_history_signal (const QStringList& hist); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
221 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
222 void append_history_signal (const QString& hist_entry); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
223 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
224 void clear_history_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
225 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
226 void enter_debugger_signal (void); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
227 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
228 void exit_debugger_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
229 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
230 void update_breakpoint_marker_signal (bool insert, const QString& file, |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
231 int line, const QString& cond); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
232 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
233 void insert_debugger_pointer_signal (const QString&, int); |
27260
5ac60319575b
separate octave_link event queue from events and actions
John W. Eaton <jwe@octave.org>
parents:
27217
diff
changeset
|
234 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
235 void delete_debugger_pointer_signal (const QString&, int); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
236 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
237 void show_preferences_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
238 |
25678
3418d3729a51
use exisitng mutex in octave_qt_link for changing gui preferences (bug #54369)
Torsten <mttl@mailbox.org>
parents:
25639
diff
changeset
|
239 void gui_preference_signal (const QString&, const QString&, QString*); |
25639
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
240 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
241 void show_doc_signal (const QString& file); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
242 |
25060
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
243 void register_doc_signal (const QString& file); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
244 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
245 void unregister_doc_signal (const QString& file); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
246 |
24718
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
247 void edit_variable_signal (const QString& name, const octave_value& val); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
248 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
249 void refresh_variable_editor_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
250 |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
251 void confirm_shutdown_signal (void); |
ea1c88bd4430
move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24645
diff
changeset
|
252 }; |
24645
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
253 } |
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
254 |
16422
436f6e0e4268
include file cleanup for octave-qt-link files
John W. Eaton <jwe@octave.org>
parents:
16420
diff
changeset
|
255 #endif |