annotate libgui/src/dialog.h @ 16579:7f8db1942dc0

Add Qt link uigetfile dialog implementation. * libgui/src/octave-qt-link.cc, libgui/src/octave-qt-link.h, (octave_qt_link::do_file_dialog): New function. (make_filter_list): New function. * libinterp/interpfcn/octave-link.cc (__octave_link_file_dialog__): New function. * libinterp/interpfcn/octave-link.h: (octave_link::file_dialog): New function. (octave_link::do_file_dialog): New virtual function. * scripts/plot/uigetfile.m: update to call octave_link file dialog if octave link is present. * libgui/src/dialog.cc, libgui/src/dialog.h (class FileDialog): New class. (QUIWidgetCreator::QUIWidgetCreator): added initialization of new var path_name. (QUIWidgetCreator::signal_filedialog): New function. (QUIWidgetCreator::create_filedialog): New function. (QUIWidgetCreator::filedialog_finished): New function. (QUIWidgetCreator::get_dialog_path): New function. * libgui/src/main-window.cc, libgui/src/main-window.h (main_window::connect_uiwidget_links): Added connect for handle_file_dialog. (main_window::handle_create_filedialog): New function.
author John Donoghue <john.donoghue@ieee.org>
date Sun, 28 Apr 2013 09:45:19 -0400
parents e4b94abfeb96
children adc150db1809
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 /*
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 Copyright (C) 2013 John W. Eaton
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 Copyright (C) 2013 Daniel J. Sebald
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
5
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 This file is part of Octave.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
7
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 option) any later version.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
12
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 for more details.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
17
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, see
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 <http://www.gnu.org/licenses/>.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
21
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 */
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
23
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 #if !defined (octave_guifcn_dialog_h)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 #define octave_guifcn_dialog_h 1
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
26
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 #include <QMutex>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 #include <QWaitCondition>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 #include <QAbstractButton>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 #include <QList>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 #include <QItemSelectionModel>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 #include <QDialog>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 #include <QMessageBox>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 #include <QLineEdit>
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
35 #include <QFileDialog>
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
36
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 // Defined for purposes of sending QList<int> as part of signal.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 typedef QList<int> QIntList;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
39
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 // Defined for purposes of sending QList<float> as part of signal.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 typedef QList<float> QFloatList;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
42
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 class QUIWidgetCreator : public QObject
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 Q_OBJECT
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
47
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 public:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 QUIWidgetCreator (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
51
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 ~QUIWidgetCreator (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 public:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 void signal_dialog (const QString& message, const QString& title,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 const QString& icon, const QStringList& button,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 const QString& defbutton, const QStringList& role)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 // Use the last button in the list as the reject result, i.e., when no
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
62 // button is pressed such as in the case of the upper right close tab.
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 if (!button.isEmpty ())
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 dialog_button = button.last ();
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
65
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 QString xicon = icon;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 if (xicon.isEmpty ())
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 xicon = "none";
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
69
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 emit create_dialog (message, title, xicon, button, defbutton, role);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
72
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 int get_dialog_result (void) { return dialog_result; }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
74
16565
e4b94abfeb96 use generic dialog for cd or addpath question
John W. Eaton <jwe@octave.org>
parents: 16551
diff changeset
75 QString get_dialog_button (void) { return dialog_button; }
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
76
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 bool signal_listview (const QStringList& list, const QString& mode,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 int wd, int ht, const QList<int>& initial,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
79 const QString& name, const QStringList& prompt,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 const QString& ok_string, const QString& cancel_string)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 if (list.isEmpty ())
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 return false;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
84
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 emit create_listview (list, mode, wd, ht, initial, name,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
86 prompt, ok_string, cancel_string);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
87
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 return true;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
90
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 const QIntList *get_list_index (void) { return list_index; }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
92
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 bool signal_inputlayout (const QStringList& prompt, const QString& title,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
94 const QFloatList& nr, const QFloatList& nc,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 const QStringList& defaults)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 if (prompt.isEmpty ())
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 return false;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
99
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 emit create_inputlayout (prompt, title, nr, nc, defaults);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
101
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 return true;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
104
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 const QStringList *get_string_list (void) { return string_list; }
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
106
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
107 bool signal_filedialog (const QStringList &filters, const QString &title,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
108 const QString &filename, const QString &dirname,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
109 bool multiselect)
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
110 {
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
111 emit create_filedialog (filters, title, filename, dirname, multiselect);
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
112 return true;
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
113 }
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
114
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
115 const QString * get_dialog_path(void) { return path_name; }
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
116
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
117 void wait (void)
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 // 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:
diff changeset
120 waitcondition.wait (&mutex);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 }
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
122
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 signals:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
124
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 void create_dialog (const QString&, const QString&, const QString&,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 const QStringList&, const QString&, const QStringList&);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
127
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 void create_listview (const QStringList&, const QString&, int, int,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
129 const QIntList&, const QString&, const QStringList&,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
130 const QString&, const QString&);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
131
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
132 void create_inputlayout (const QStringList&, const QString&,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
133 const QFloatList&, const QFloatList&,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
134 const QStringList&);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
135
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
136 void create_filedialog (const QStringList &filters,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
137 const QString &title,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
138 const QString &filename,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
139 const QString &dirname,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
140 bool multiselect);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
141 public slots:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
142
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
143 void dialog_button_clicked (QAbstractButton *button);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
144
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
145 void list_select_finished (const QIntList& selected,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
146 const int button_pressed);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
147
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
148 void input_finished (const QStringList& input, const int button_pressed);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
149
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
150 void filedialog_finished (const QStringList& files, const QString &path, const int filterindex);
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
151
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
152 private:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
153
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
154 int dialog_result;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
155 QString dialog_button;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
156
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
157 // The list could conceivably be big. Not sure how things are
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
158 // stored internally, so keep off of the stack.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
159 QStringList *string_list;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
160 QIntList *list_index;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
161
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
162 QString * path_name;
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
163
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
164 // GUI objects cannot be accessed in the non-GUI thread. However,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
165 // signals can be sent to slots across threads with proper
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
166 // synchronization. Hence, the use of QWaitCondition.
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
167
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
168 QMutex mutex;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
169
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
170 QWaitCondition waitcondition;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
171 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
172
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
173 extern QUIWidgetCreator uiwidget_creator;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
174
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
175
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
176 class MessageDialog : public QMessageBox
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
177 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
178 Q_OBJECT
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
179
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
180 public:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
181
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
182 explicit MessageDialog (const QString& message, const QString& title,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
183 const QString& icon, const QStringList& button,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
184 const QString& defbutton,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
185 const QStringList& role);
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
186
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
187 private:
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
188
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
189 void closeEvent (QCloseEvent *)
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
190 {
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
191 // Reroute the close tab to a button click so there is only a single
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
192 // route to waking the wait condition.
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
193 emit buttonClicked (0);
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
194 }
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
195 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
196
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
197
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
198 class ListDialog : public QDialog
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
199 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
200 Q_OBJECT
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
201
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
202 QItemSelectionModel *selector;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
203
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
204 public:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
205
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
206 explicit ListDialog (const QStringList& list, const QString& mode,
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
207 int width, int height, const QList<int>& initial,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
208 const QString& name, const QStringList& prompt,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
209 const QString& ok_string, const QString& cancel_string);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
210
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
211 signals:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
212
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
213 void finish_selection (const QIntList&, const int);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
214
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
215 public slots:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
216
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
217 void buttonOk_clicked (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
218
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
219 void buttonCancel_clicked (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
220
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
221 void reject (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
222 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
223
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
224
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
225 class InputDialog : public QDialog
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
226 {
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
227 Q_OBJECT
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
228
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
229 QList<QLineEdit *> input_line;
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
230
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
231 public:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
232
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
233 explicit InputDialog (const QStringList& prompt, const QString& title,
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
234 const QFloatList& nr, const QFloatList& nc,
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
235 const QStringList& defaults);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
236
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
237 signals:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
238
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
239 void finish_input (const QStringList&, const int);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
240
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
241 public slots:
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
242
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
243 void buttonOk_clicked (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
244
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
245 void buttonCancel_clicked (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
246
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
247 void reject (void);
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
248 };
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
249
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
250 class FileDialog : public QFileDialog
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
251 {
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
252 Q_OBJECT
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
253
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
254 public:
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
255
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
256 explicit FileDialog (const QStringList &filters,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
257 const QString& title, const QString& filename,
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
258 const QString& dirname, bool multiselect);
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
259
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
260 signals:
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
261
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
262 void finish_input (const QStringList&, const QString &, const int);
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
263
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
264 private slots:
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
265 void reject();
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
266 void accept();
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
267
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
268 };
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
269
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
270 #endif