annotate libgui/src/octave-qt-link.h @ 25742:d3c6de326bae

close/reload editor tab when file is (re)moved in gui terminal (bug #43922) * file-editor.cc (handle_file_remove): new code structure * main-window.cc (construct): connect new signals from octave_qt_link to the slot handle_file_renamed and the new proxy slot file_remove_proxy; (file_remove_proxy): proxy calling handle_file_remove but protected by the mutex of octave_qt_link synchronizing worker and gui thread * main-window.h: new slot file_remove_proxy * octave-qt-link.cc (do_file_remove): new method for renaming or removing files which signals the editor (gui thread) for closing the files before removing is carried out; (do_file_renamed): new method for re-loading renamed files into editor; * octave-qt-link.h: new methods do_file_remove and do_file_renamed, new signals used in the new methods for signaling the editor slots * dirfns.cc (rmdir): call the new static octave_link method for removing a file, which might be opened in the editor before removing a dir; (rename): call the new static octave_link method for renaming a file, which might be opened in the editor before renaming it and call the method for reloading the new renamed file; * octave-link.h (file_remove): new static method calling purely virtual method do_file_remove, which is implemented in octave_qt_link; (file_renamed): new static method calling purely virtual method do_file_renamed, which is implemented in octave_qt_link * syscalls.cc (unlink): call the new static octave_link method for removing a file, which might be opened in the editor before removing it
author Torsten <mttl@mailbox.org>
date Sun, 17 Sep 2017 05:52:33 +0200
parents 3418d3729a51
children 9c47eedc44e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
25054
6652d3823428 maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents: 24766
diff changeset
3 Copyright (C) 2013-2018 John W. Eaton
6652d3823428 maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents: 24766
diff changeset
4 Copyright (C) 2011-2018 Jacob Dawid
6652d3823428 maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents: 24766
diff changeset
5 Copyright (C) 2011-2018 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
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
25 #if ! defined (octave_qt_link_h)
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
26 #define octave_qt_link_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>
16423
04c4dd7fd3ce use signal for octave_link::update_dbstop_marker
John W. Eaton <jwe@octave.org>
parents: 16422
diff changeset
32 #include <QObject>
04c4dd7fd3ce use signal for octave_link::update_dbstop_marker
John W. Eaton <jwe@octave.org>
parents: 16422
diff changeset
33 #include <QString>
19714
21015ca26566 Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 19697
diff changeset
34 #include <QMutex>
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
22089
c2c668b3051b use classes for octave application and interpreter
John W. Eaton <jwe@octave.org>
parents: 21310
diff changeset
37 #include "octave-gui.h"
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 #include "octave-link.h"
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39
17824
86e8dbccf7c7 show when variables are complex in workspace view (bug #40445)
John W. Eaton <jwe@octave.org>
parents: 17790
diff changeset
40 // 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
41 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
42
24641
7d177be54c37 pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents: 24632
diff changeset
43 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
44
24645
f61502510d08 restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents: 24641
diff changeset
45 namespace octave
f61502510d08 restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents: 24641
diff changeset
46 {
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
47
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
48 //! Provides threadsafe access to octave.
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
49 //! @author Jacob Dawid
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
50 //!
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
51 //! This class is a wrapper around octave and provides thread safety by
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
52 //! buffering access operations to octave and executing them in the
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
53 //! readline event hook, which lives in the octave thread.
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
54
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
55 class octave_qt_link : public QObject, public octave_link
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
56 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
57 Q_OBJECT
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
58
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
59 public:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
60
24766
08c92c9d48e3 move workspace view and model classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24718
diff changeset
61 octave_qt_link (QWidget *p, gui_application *app_context);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
62
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
63 // No copying!
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
64
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
65 octave_qt_link (const octave_qt_link&) = delete;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
66
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
67 octave_qt_link& operator = (const octave_qt_link&) = delete;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
68
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
69 ~octave_qt_link (void) = default;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
70
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
71 bool do_confirm_shutdown (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
72
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
73 bool do_copy_image_to_clipboard (const std::string& file);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
74
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
75 bool do_edit_file (const std::string& file);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
76 bool do_prompt_new_edit_file (const std::string& file);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
77
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
78 int do_message_dialog (const std::string& dlg, const std::string& msg,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
79 const std::string& title);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
80
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
81 std::string
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
82 do_question_dialog (const std::string& msg, const std::string& title,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
83 const std::string& btn1, const std::string& btn2,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
84 const std::string& btn3, const std::string& btndef);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
85
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
86 std::pair<std::list<int>, int>
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
87 do_list_dialog (const std::list<std::string>& list,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
88 const std::string& mode,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
89 int width, int height,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
90 const std::list<int>& initial_value,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
91 const std::string& name,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
92 const std::list<std::string>& prompt,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
93 const std::string& ok_string,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
94 const std::string& cancel_string);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
95
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
96 std::list<std::string>
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
97 do_input_dialog (const std::list<std::string>& prompt,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
98 const std::string& title,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
99 const std::list<float>& nr,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
100 const std::list<float>& nc,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
101 const std::list<std::string>& defaults);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
102
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
103 std::list<std::string>
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
104 do_file_dialog (const filter_list& filter, const std::string& title,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
105 const std::string& filename, const std::string& pathname,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
106 const std::string& multimode);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
107
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
108 int
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
109 do_debug_cd_or_addpath_error (const std::string& file,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
110 const std::string& dir,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
111 bool addpath_option);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
112
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
113 void do_change_directory (const std::string& dir);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
114
25742
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
115 void do_file_remove (const std::string& old_name,
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
116 const std::string& new_name);
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
117 void do_file_renamed (bool load_new = true);
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
118
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
119 void do_execute_command_in_terminal (const std::string& command);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
120
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
121 void do_set_workspace (bool top_level, bool debug,
24766
08c92c9d48e3 move workspace view and model classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24718
diff changeset
122 const symbol_scope& scope,
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
123 bool update_variable_editor);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
124
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
125 void do_clear_workspace (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
126
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
127 void do_set_history (const string_vector& hist);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
128 void do_append_history (const std::string& hist_entry);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
129 void do_clear_history (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
130
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
131 void do_pre_input_event (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
132 void do_post_input_event (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
133
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
134 void do_enter_debugger_event (const std::string& file, int line);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
135 void do_execute_in_debugger_event (const std::string& file, int line);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
136 void do_exit_debugger_event (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
137
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
138 void do_update_breakpoint (bool insert, const std::string& file, int line,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
139 const std::string& cond);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
140
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
141 static bool file_in_path (const std::string& file, const std::string& dir);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
142
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
143 void do_show_preferences (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
144
25639
7644e7f1721f change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents: 25407
diff changeset
145 std::string do_gui_preference (const std::string& key,
7644e7f1721f change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents: 25407
diff changeset
146 const std::string& value);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
147 void do_show_doc (const std::string& file);
25060
1cd3aeda7598 Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25054
diff changeset
148 void do_register_doc (const std::string& file);
1cd3aeda7598 Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25054
diff changeset
149 void do_unregister_doc (const std::string& file);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
150
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
151 void do_edit_variable (const std::string& name, const octave_value& val);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
152
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
153 void shutdown_confirmation (bool sd) { m_shutdown_confirm_result = sd; }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
154
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
155 void lock (void) { m_mutex.lock (); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
156 void wait (void) { m_waitcondition.wait (&m_mutex); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
157 void unlock (void) { m_mutex.unlock (); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
158 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
159
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
160 private:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
161
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
162 void do_insert_debugger_pointer (const std::string& file, int line);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
163 void do_delete_debugger_pointer (const std::string& file, int line);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
164
24766
08c92c9d48e3 move workspace view and model classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24718
diff changeset
165 gui_application *m_app_context;
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
166
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
167 bool m_shutdown_confirm_result;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
168
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
169 QMutex m_mutex;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
170 QWaitCondition m_waitcondition;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
171
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
172 signals:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
173
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
174 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
175
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
176 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
177
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
178 void change_directory_signal (const QString& dir);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
179
25742
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
180 void file_remove_signal (const QString& old_name, const QString& new_name);
d3c6de326bae close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents: 25678
diff changeset
181 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
182
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
183 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
184
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
185 void set_workspace_signal (bool top_level, bool debug,
24766
08c92c9d48e3 move workspace view and model classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24718
diff changeset
186 const symbol_scope& scope);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
187
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
188 void clear_workspace_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
189
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
190 void set_history_signal (const QStringList& hist);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
191 void append_history_signal (const QString& hist_entry);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
192 void clear_history_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
193
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
194 void enter_debugger_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
195 void exit_debugger_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
196
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
197 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
198 int line, const QString& cond);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
199
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
200 void insert_debugger_pointer_signal (const QString&, int);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
201 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
202
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
203 void show_preferences_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
204
25678
3418d3729a51 use exisitng mutex in octave_qt_link for changing gui preferences (bug #54369)
Torsten <mttl@mailbox.org>
parents: 25639
diff changeset
205 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
206
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
207 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
208
25060
1cd3aeda7598 Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25054
diff changeset
209 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
210
1cd3aeda7598 Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents: 25054
diff changeset
211 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
212
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
213 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
214
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
215 void refresh_variable_editor_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
216
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
217 void confirm_shutdown_signal (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24645
diff changeset
218 };
24645
f61502510d08 restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents: 24641
diff changeset
219 }
f61502510d08 restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents: 24641
diff changeset
220
16422
436f6e0e4268 include file cleanup for octave-qt-link files
John W. Eaton <jwe@octave.org>
parents: 16420
diff changeset
221 #endif