annotate libgui/src/octave-qt-link.cc @ 16551:6ae555fc8c43

Add questdlg dialog function and fix variety of dialog bugs. * octave-qt-link.cc (octave_qt_link::do_message_dialog): Change initializer from QString to QString::fromStdString(dlg). (octave_qt_link::do_question_dialog): New function. Make all buttons AcceptRole. Signal dialog creation. Go to wait state. Get dialog button result when awakened. (octave_qt_link::do_list_dialog): Change std string 'prompt_string' to std list of std string 'prompt'. Use make_qstring_list(prompt). (octave_qt_link::do_input_dialog): Change 'nr' and 'nc' to std list of float. Use QFloatList::fromStdList(nc). * octave-qt-link.h (octave_qt_link : QObject, public octave_link): Add member do_question_dialog. (octave_qt_link::do_list_dialog): Use std list of std string for prompt. (octave_qt_link::do_input_dialog): Change 'nr' and 'nc' to std list of float. * octave-link.cc (__octave_link_question_dialog__): New builtin. Translate args to inputs of octave_link::question_dialog function. (__octave_link_list_dialog__): Retain prompt string cell list as a std list of std string. (__octave_link_input_dialog__): Make 'nr' and 'nc' std list of float. * octave-link.h (octave_link::question_dialog, octave_link::do_question_dialog): Add. (octave_link::list_dialog, octave_link::do_list_dialog): Change prompt to std list of std string. (octave_link::input_dialog, octave_link::do_input_dialog): Change 'nr' and 'nc' to std list of float. * errordlg.m (errordlg): Make retval return variable. Add "error" icon as message_dialog input. * helpdlg.m (helpdlg): Make retval return variable. Add "help" icon as message_dialog input. * warndlg.m (warndlg): Add "warn" icon as message_dialog input. * message_dialog.m (message_dialog): Define default icon "none". Use dlg variable with icon variable as input to __octave_link_message_dialog__. Use __octave_link_enabled__ rather than return value. * inputdlg.m (inputdlg): Round up rowscols to integer. Replace iscell(cstr) with __octave_link_enabled__. * listdlg.m (listdlg): Correct indentation. Change default selmode from "multiple" to "Multiple". Make default prompt {}. Check valid selmode entry. Use __octave_link_enabled__ rather than ok return value. Remove FIXME note. Use Rich Text in prompt of demo. Add demo using ListSize. * questdlg.m (questdlg): Add case 0 to switch. Add error message for default button not matching options. In all cases, check that default button matches an button option. Add __octave_link_question_dialog__ call conditioned under __octave_link_enabled__. Add three demos. * dialog.cc (QUIWidgetCreator::dialog_finished): Remove. (QUIWidgetCreator::dialog_button_clicked): Test that button pointer is nonzero. Move dialog_result assignment and waitcondition.wakeAll here. (MessageDialog::MessageDialog): If title "", change to " ". Reverse order that buttons are installed. Remove signal 'finished' connection. (ListDialog::ListDialog): Change prompt from QString to QStringList. Make list items noneditable. Add Rich Text support to prompt, place RT <br> between prompt list lines. Use label for prompt. Disable select_all button if not "Multiple". Remove horizontal group box. If title "", change to " ". (InputDialog::InputDialog): Change 'nr' and 'nc' to QFloatList. Define pre-processor variables, then undefine. If title "", change to " ". * dialog.h (QUIWidgetCreator::signal_listviewQUI, WidgetCreator::create_listview): Change QString 'prompt_string' to QStringList 'prompt'. (QUIWidgetCreator::signal_inputlayout, QUIWidgetCreator::create_inputlayout): Use QFloatList for 'nr' and 'nc'. (QUIWidgetCreator::dialog_finished): Remove. (MessageDialog::closeEvent): New override, emitting buttonClicked(0). (ListDialog::ListDialog): Change QString 'prompt_string' to QStringList 'prompt'. (InputDialog::InputDialog): Use QFloatList for 'nr' and 'nc'. * main_window.cc, main_window.h: Make function call changes that match dialog.h changes. (main_window::find_files_finished): Remove unused 'button' variable.
author Daniel J Sebald <daniel.sebald@ieee.org>
date Mon, 22 Apr 2013 15:07:13 -0400
parents 3cd80afc3509
children e4b94abfeb96
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
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 2013 John W. Eaton
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 Copyright (C) 2011-2012 Jacob Dawid
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 Copyright (C) 2011-2012 John P. Swensen
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
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 Octave is free software; you can redistribute it and/or modify it
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 Free Software Foundation; either version 3 of the License, or (at your
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 option) any later version.
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 Octave is distributed in the hope that it will be useful, but WITHOUT
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See 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
17 for more details.
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
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 <http://www.gnu.org/licenses/>.
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
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #ifdef HAVE_CONFIG_H
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 #include <config.h>
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #endif
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
29 #include <QStringList>
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
30
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
31 #include "str-vec.h"
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
32
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
33 #include "dialog.h"
16547
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
34 #include "error.h"
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
35 #include "workspace-element.h"
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
36
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include "octave-qt-link.h"
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
16485
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
39 octave_qt_link::octave_qt_link (octave_main_thread *mt)
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
40 : octave_link (), main_thread (mt)
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
41 { }
16479
7a71ea0b7ae9 eliminate event listener class
John W. Eaton <jwe@octave.org>
parents: 16468
diff changeset
42
16485
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
43 octave_qt_link::~octave_qt_link (void) { }
16432
fe4cd846c3e7 separate octave interpreter thread creation from execution
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
44
fe4cd846c3e7 separate octave interpreter thread creation from execution
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
45 void
fe4cd846c3e7 separate octave interpreter thread creation from execution
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
46 octave_qt_link::execute_interpreter (void)
fe4cd846c3e7 separate octave interpreter thread creation from execution
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
47 {
fe4cd846c3e7 separate octave interpreter thread creation from execution
John W. Eaton <jwe@octave.org>
parents: 16431
diff changeset
48 main_thread->execute_interpreter ();
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50
16443
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
51 bool
16485
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
52 octave_qt_link::do_exit (int status)
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
53 {
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
54 emit exit_signal (status);
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
55
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
56 return true;
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
57 }
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
58
8b783661e03f improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents: 16479
diff changeset
59 bool
16443
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
60 octave_qt_link::do_edit_file (const std::string& file)
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
61 {
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
62 emit edit_file_signal (QString::fromStdString (file));
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
63
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
64 return true;
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
65 }
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
66
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
67 int
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
68 octave_qt_link::do_message_dialog (const std::string& dlg,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
69 const std::string& msg,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
70 const std::string& title)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
71 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
72 uiwidget_creator.signal_dialog (QString::fromStdString (msg),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
73 QString::fromStdString (title),
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
74 QString::fromStdString (dlg),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
75 QStringList (), QString (),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
76 QStringList ());
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
77
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
78 // Wait while the user is responding to message box.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
79 uiwidget_creator.wait ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
80
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
81 // The GUI has sent a signal and the process has been awakened.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
82 return uiwidget_creator.get_dialog_result ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
83 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
84
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
85 std::string
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
86 octave_qt_link::do_question_dialog (const std::string& msg,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
87 const std::string& title,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
88 const std::string& btn1,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
89 const std::string& btn2,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
90 const std::string& btn3,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
91 const std::string& btndef)
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
92 {
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
93 QStringList btn;
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
94 QStringList role;
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
95 role << "AcceptRole" << "AcceptRole" << "AcceptRole";
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
96 btn << QString::fromStdString (btn1);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
97 if (btn2 == "")
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
98 role.removeAt (0);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
99 else
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
100 btn << QString::fromStdString (btn2);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
101 btn << QString::fromStdString (btn3);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
102
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
103 uiwidget_creator.signal_dialog (QString::fromStdString (msg),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
104 QString::fromStdString (title),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
105 "quest",
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
106 btn,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
107 QString::fromStdString (btndef),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
108 role);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
109
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
110 // Wait while the user is responding to message box.
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
111 uiwidget_creator.wait ();
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
112
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
113 // The GUI has sent a signal and the process has been awakened.
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
114 return uiwidget_creator.get_dialog_button ()->toStdString ();
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
115 }
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
116
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
117 static QStringList
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
118 make_qstring_list (const std::list<std::string>& lst)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
119 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
120 QStringList retval;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
121
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
122 for (std::list<std::string>::const_iterator it = lst.begin ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
123 it != lst.end (); it++)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
124 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
125 retval.append (QString::fromStdString (*it));
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
126 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
127
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
128 return retval;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
129 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
130
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
131
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
132 std::pair<std::list<int>, int>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
133 octave_qt_link::do_list_dialog (const std::list<std::string>& list,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
134 const std::string& mode,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
135 int width, int height,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
136 const std::list<int>& initial,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
137 const std::string& name,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
138 const std::list<std::string>& prompt,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
139 const std::string& ok_string,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
140 const std::string& cancel_string)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
141 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
142 uiwidget_creator.signal_listview (make_qstring_list (list),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
143 QString::fromStdString (mode),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
144 width, height,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
145 QList<int>::fromStdList (initial),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
146 QString::fromStdString (name),
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
147 make_qstring_list (prompt),
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
148 QString::fromStdString (ok_string),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
149 QString::fromStdString (cancel_string));
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
150
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
151 // Wait while the user is responding to message box.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
152 uiwidget_creator.wait ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
153
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
154 // The GUI has sent a signal and the process has been awakened.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
155 const QIntList *selected = uiwidget_creator.get_list_index ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
156 int ok = uiwidget_creator.get_dialog_result ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
157
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
158 return std::pair<std::list<int>, int> (selected->toStdList (), ok);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
159 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
160
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
161 std::list<std::string>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
162 octave_qt_link::do_input_dialog (const std::list<std::string>& prompt,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
163 const std::string& title,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
164 const std::list<float>& nr,
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
165 const std::list<float>& nc,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
166 const std::list<std::string>& defaults)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
167 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
168 std::list<std::string> retval;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
169
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
170 uiwidget_creator.signal_inputlayout (make_qstring_list (prompt),
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
171 QString::fromStdString (title),
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
172 QFloatList::fromStdList (nr),
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
173 QFloatList::fromStdList (nc),
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
174 make_qstring_list (defaults));
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
175
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
176 // Wait while the user is responding to message box.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
177 uiwidget_creator.wait ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
178
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
179 // The GUI has sent a signal and the process has been awakened.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
180 const QStringList *inputLine = uiwidget_creator.get_string_list ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
181
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
182 for (QStringList::const_iterator it = inputLine->begin ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
183 it != inputLine->end (); it++)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
184 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
185 retval.push_back (it->toStdString ());
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
186 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
187
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
188 return retval;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
189 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents: 16502
diff changeset
190
16547
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
191 int
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
192 octave_qt_link::do_debug_cd_or_addpath_error (const std::string& file,
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
193 const std::string& dir,
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
194 bool addpath_option)
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
195 {
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
196 uiwidget_creator.signal_debug_cd_or_addpath (QString::fromStdString (file),
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
197 QString::fromStdString (dir),
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
198 addpath_option);
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
199
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
200 uiwidget_creator.wait ();
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
201
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
202 return uiwidget_creator.get_dialog_result ();
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
203 }
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16528
diff changeset
204
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
205 void
16437
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
206 octave_qt_link::do_change_directory (const std::string& dir)
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
207 {
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
208 emit change_directory_signal (QString::fromStdString (dir));
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
209 }
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
210
919796a440c6 use signal for changing directory
John W. Eaton <jwe@octave.org>
parents: 16432
diff changeset
211 void
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
212 octave_qt_link::do_set_workspace (bool top_level,
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
213 const std::list<workspace_element>& ws)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
214 {
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
215 QString scopes;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
216 QStringList symbols;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
217 QStringList class_names;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
218 QStringList dimensions;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
219 QStringList values;
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
220
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
221 for (std::list<workspace_element>::const_iterator it = ws.begin ();
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
222 it != ws.end (); it++)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
223 {
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
224 scopes.append (it->scope ());
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
225 symbols.append (QString::fromStdString (it->symbol ()));
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
226 class_names.append (QString::fromStdString (it->class_name ()));
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
227 dimensions.append (QString::fromStdString (it->dimension ()));
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
228 values.append (QString::fromStdString (it->value ()));
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
229 }
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
230
16502
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
231 emit set_workspace_signal (top_level, scopes, symbols, class_names,
45ae1038ee89 allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents: 16485
diff changeset
232 dimensions, values);
16468
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
233 }
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
234
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
235 void
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
236 octave_qt_link::do_clear_workspace (void)
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
237 {
0f143f68078d use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents: 16443
diff changeset
238 emit clear_workspace_signal ();
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
239 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
240
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
241 void
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
242 octave_qt_link::do_set_history (const string_vector& hist)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
243 {
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
244 QStringList qt_hist;
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
245
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
246 for (octave_idx_type i = 0; i < hist.length (); i++)
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
247 qt_hist.append (QString::fromStdString (hist[i]));
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
248
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
249 emit set_history_signal (qt_hist);
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
250 }
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
251
16431
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
252 void
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
253 octave_qt_link::do_append_history (const std::string& hist_entry)
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
254 {
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
255 emit append_history_signal (QString::fromStdString (hist_entry));
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
256 }
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
257
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
258 void
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
259 octave_qt_link::do_clear_history (void)
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
260 {
5982d469f79b use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents: 16426
diff changeset
261 emit clear_history_signal ();
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
262 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
263
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
264 void
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
265 octave_qt_link::do_pre_input_event (void)
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
266 {
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
267 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
268
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
269 void
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
270 octave_qt_link::do_post_input_event (void)
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
271 {
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
272 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
273
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
274 void
16419
16bfbf9136d3 avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents: 16415
diff changeset
275 octave_qt_link::do_enter_debugger_event (const std::string& file, int line)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
276 {
16419
16bfbf9136d3 avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents: 16415
diff changeset
277 do_insert_debugger_pointer (file, line);
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
278
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
279 emit enter_debugger_signal ();
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
280 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
281
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
282 void
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
283 octave_qt_link::do_execute_in_debugger_event (const std::string& file, int line)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
284 {
16419
16bfbf9136d3 avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents: 16415
diff changeset
285 do_delete_debugger_pointer (file, line);
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
286 }
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
287
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
288 void
16438
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
289 octave_qt_link::do_exit_debugger_event (void)
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
290 {
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
291 emit exit_debugger_signal ();
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
292 }
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
293
a971d8bdaadc use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
294 void
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
295 octave_qt_link::do_update_breakpoint (bool insert,
16419
16bfbf9136d3 avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents: 16415
diff changeset
296 const std::string& file, int line)
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
297 {
16443
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16438
diff changeset
298 emit update_breakpoint_marker_signal (insert, QString::fromStdString (file), line);
16415
70032fc70bee move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
diff changeset
299 }
16426
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
300
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
301 void
16528
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
302 octave_qt_link::do_set_default_prompts (std::string& ps1, std::string& ps2,
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
303 std::string& ps4)
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
304 {
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
305 ps1 = ">> ";
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
306 ps2 = "";
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
307 ps4 = "";
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
308 }
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
309
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
310
9bc1f8278966 allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents: 16512
diff changeset
311 void
16426
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
312 octave_qt_link::do_insert_debugger_pointer (const std::string& file, int line)
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
313 {
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
314 emit insert_debugger_pointer_signal (QString::fromStdString (file), line);
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
315 }
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
316
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
317 void
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
318 octave_qt_link::do_delete_debugger_pointer (const std::string& file, int line)
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
319 {
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
320 emit delete_debugger_pointer_signal (QString::fromStdString (file), line);
203976ae18d1 use signals for octave_link::enter_debugger_event and octave_link::exit_debugger_event
John W. Eaton <jwe@octave.org>
parents: 16424
diff changeset
321 }