annotate libgui/src/dialog.h @ 31646:c6d54dd31a7e stable

maint: Use macros to begin/end C++ namespaces. * BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h, ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, Object.cc, Object.h, ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc, SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, annotation-dialog.cc, annotation-dialog.h, gl-select.cc, gl-select.h, qopengl-functions.h, qt-graphics-toolkit.cc, qt-graphics-toolkit.h, QTerminal.h, color-picker.cc, color-picker.h, command-widget.cc, command-widget.h, community-news.cc, community-news.h, dialog.cc, dialog.h, documentation-bookmarks.cc, documentation-bookmarks.h, documentation-dock-widget.cc, documentation-dock-widget.h, documentation.cc, documentation.h, dw-main-window.cc, dw-main-window.h, external-editor-interface.cc, external-editor-interface.h, files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc, find-files-dialog.h, find-files-model.cc, find-files-model.h, graphics-init.cc, graphics-init.h, gui-settings.cc, gui-settings.h, gui-utils.cc, gui-utils.h, history-dock-widget.cc, history-dock-widget.h, interpreter-qobject.cc, interpreter-qobject.h, led-indicator.cc, led-indicator.h, file-editor-interface.h, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h, news-reader.cc, news-reader.h, octave-dock-widget.cc, octave-dock-widget.h, octave-qobject.cc, octave-qobject.h, qt-application.cc, qt-application.h, qt-interpreter-events.cc, qt-interpreter-events.h, qt-utils.h, release-notes.cc, release-notes.h, resource-manager.cc, resource-manager.h, set-path-dialog.cc, set-path-dialog.h, set-path-model.cc, set-path-model.h, settings-dialog.cc, settings-dialog.h, shortcut-manager.cc, shortcut-manager.h, tab-bar.cc, tab-bar.h, terminal-dock-widget.cc, terminal-dock-widget.h, variable-editor-model.cc, variable-editor-model.h, variable-editor.cc, variable-editor.h, welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h, workspace-view.cc, workspace-view.h: Use new macros to begin/end C++ namespaces.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2022 14:37:51 -0500
parents 796f54d4ddbf
children 431f80aba37a 29d734430e5f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29550
diff changeset
3 // Copyright (C) 2013-2022 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 20505
diff changeset
26 #if ! defined (octave_dialog_h)
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17790
diff changeset
27 #define octave_dialog_h 1
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
28
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
29 #include <QAbstractButton>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
30 #include <QDialog>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
31 #include <QFileDialog>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
32 #include <QItemSelectionModel>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
33 #include <QLineEdit>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
34 #include <QList>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
35 #include <QMessageBox>
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 #include <QMutex>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 #include <QWaitCondition>
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
38
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 // 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
40 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
41
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 // 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
43 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
44
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
45 OCTAVE_BEGIN_NAMESPACE(octave)
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
46
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
47 class base_qobject;
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
48
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
49 class QUIWidgetCreator : public QObject
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
50 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
51 Q_OBJECT
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
52
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
53 public:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
54
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
55 QUIWidgetCreator (base_qobject& oct_qobj);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
56
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
57 ~QUIWidgetCreator (void) = default;
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
58
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
59 public:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
60
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
61 QString rm_amp (const QString& text);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
62
27552
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
63 QString message_dialog (const QString& message, const QString& title,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
64 const QString& icon, const QStringList& button,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
65 const QString& defbutton, const QStringList& role);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
66
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
67 int get_dialog_result (void) { return m_dialog_result; }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
68
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
69 QString get_dialog_button (void) { return m_dialog_button; }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
70
27552
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
71 QPair<QIntList, int> list_dialog (const QStringList& list,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
72 const QString& mode,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
73 int wd, int ht,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
74 const QList<int>& initial,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
75 const QString& name,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
76 const QStringList& prompt,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
77 const QString& ok_string,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
78 const QString& cancel_string);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
79
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
80 QIntList get_list_index (void) const { return m_list_index; }
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
81
27552
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
82 QStringList input_dialog (const QStringList& prompt, const QString& title,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
83 const QFloatList& nr, const QFloatList& nc,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
84 const QStringList& defaults);
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
85
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
86 QStringList get_string_list (void) const { return m_string_list; }
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
87
27552
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
88 QStringList file_dialog (const QStringList& filters, const QString& title,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
89 const QString& filename, const QString& dirname,
de5129cb0796 refactor dialog functions
John W. Eaton <jwe@octave.org>
parents: 27551
diff changeset
90 const QString& multimode);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
91
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
92 QString get_dialog_path (void) const { return m_path_name; }
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
93
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
94 void lock (void) { m_mutex.lock (); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
95 void wait (void) { m_waitcondition.wait (&m_mutex); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
96 void unlock (void) { m_mutex.unlock (); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
97 void wake_all (void) { m_waitcondition.wakeAll (); }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
98
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
99 signals:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
100
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
101 void create_dialog (const QString&, const QString&, const QString&,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
102 const QStringList&, const QString&, const QStringList&);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
103
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
104 void create_listview (const QStringList&, const QString&, int, int,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
105 const QIntList&, const QString&, const QStringList&,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
106 const QString&, const QString&);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
107
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
108 void create_inputlayout (const QStringList&, const QString&,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
109 const QFloatList&, const QFloatList&,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
110 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
111
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
112 void create_filedialog (const QStringList& filters, const QString& title,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
113 const QString& filename, const QString& dirname,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
114 const QString& multimode);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
115 public slots:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
116
27551
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
117 void handle_create_dialog (const QString& message, const QString& title,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
118 const QString& icon, const QStringList& button,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
119 const QString& defbutton,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
120 const QStringList& role);
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
121
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
122 void dialog_button_clicked (QAbstractButton *button);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
123
27551
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
124 void handle_create_listview (const QStringList& list, const QString& mode,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
125 int width, int height,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
126 const QIntList& initial,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
127 const QString& name,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
128 const QStringList& prompt,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
129 const QString& ok_string,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
130 const QString& cancel_string);
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
131
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
132 void list_select_finished (const QIntList& selected, int button_pressed);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
133
27551
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
134 void handle_create_inputlayout (const QStringList&, const QString&,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
135 const QFloatList&, const QFloatList&,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
136 const QStringList&);
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
137
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
138 void input_finished (const QStringList& input, int button_pressed);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
139
27551
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
140 void handle_create_filedialog (const QStringList& filters,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
141 const QString& title,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
142 const QString& filename,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
143 const QString& dirname,
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
144 const QString& multimode);
564bba235594 move some dialog slot functions from octave-qobject.cc to dialog.cc
John W. Eaton <jwe@octave.org>
parents: 27549
diff changeset
145
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
146 void filedialog_finished (const QStringList& files, const QString& path,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
147 int filterindex);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
148
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
149 private:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
150
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
151 base_qobject& m_octave_qobj;
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
152
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
153 int m_dialog_result;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
154 QString m_dialog_button;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
155
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
156 // A copy of the dialogs button texts
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
157 QStringList m_button_list;
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
158
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
159 // The list could conceivably be big. Not sure how things are
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
160 // stored internally, so keep off of the stack.
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
161 QStringList m_string_list;
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
162 QIntList m_list_index;
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
163
27549
5189bfa8ad2a eliminate unnecessary use of pointers
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
164 QString m_path_name;
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
165
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
166 // GUI objects cannot be accessed in the non-GUI thread. However,
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
167 // signals can be sent to slots across threads with proper
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
168 // synchronization. Hence, the use of QWaitCondition.
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
169 QMutex m_mutex;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
170 QWaitCondition m_waitcondition;
16512
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
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
173 class MessageDialog : public QMessageBox
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
174 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
175 Q_OBJECT
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
176
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
177 public:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
178
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
179 MessageDialog (base_qobject& oct_qobj, const QString& message,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
180 const QString& title, const QString& icon,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
181 const QStringList& button, const QString& defbutton,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
182 const QStringList& role);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
183
29550
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
184 ~MessageDialog (void) = default;
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
185
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
186 private:
24016
e327adeae7a0 hide mutex and wait condition data members in GUI objects
John W. Eaton <jwe@octave.org>
parents: 24015
diff changeset
187
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
188 void closeEvent (QCloseEvent *)
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
189 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
190 // Reroute the close tab to a button click so there is only a single
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
191 // route to waking the wait condition.
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
192 emit buttonClicked (nullptr);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
193 }
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
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
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
196 class ListDialog : public QDialog
16551
6ae555fc8c43 Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16547
diff changeset
197 {
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
198 Q_OBJECT
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
199
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
200 QItemSelectionModel *selector;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
201
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
202 public:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
203
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
204 ListDialog (base_qobject& oct_qobj, const QStringList& list,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
205 const QString& mode, int width, int height,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
206 const QList<int>& initial, const QString& name,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
207 const QStringList& prompt, const QString& ok_string,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
208 const QString& 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
209
29550
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
210 ~ListDialog (void) = default;
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
211
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
212 signals:
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
213
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
214 void finish_selection (const QIntList&, int);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
215
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
216 public slots:
21613
e15d3387fc59 eliminate leak in ListDialog class (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20955
diff changeset
217
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
218 void buttonOk_clicked (void);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
219
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
220 void buttonCancel_clicked (void);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
221
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
222 void reject (void);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
223
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
224 void item_double_clicked (const QModelIndex&);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
225
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
226 private:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
227
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
228 QAbstractItemModel *m_model;
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
229 };
20505
dd327c0909b0 listdlg: Make appearance and behavior more Matlab compatible (bug #46026)
Mike Miller <mtmiller@octave.org>
parents: 20091
diff changeset
230
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
231 class InputDialog : public QDialog
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
232 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
233 Q_OBJECT
21613
e15d3387fc59 eliminate leak in ListDialog class (bug #47372)
John W. Eaton <jwe@octave.org>
parents: 20955
diff changeset
234
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
235 QList<QLineEdit *> input_line;
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
236
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
237 public:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
238
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
239 InputDialog (base_qobject& oct_qobj, const QStringList& prompt,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
240 const QString& title, const QFloatList& nr,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
241 const QFloatList& nc, const QStringList& defaults);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
242
29550
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
243 ~InputDialog (void) = default;
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
244
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
245 signals:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
246
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
247 void finish_input (const QStringList&, int);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
248
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
249 public slots:
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
250
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
251 void buttonOk_clicked (void);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
252
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
253 void buttonCancel_clicked (void);
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
254
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
255 void reject (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
256 };
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
257
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
258 class FileDialog : public QFileDialog
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
259 {
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
260 Q_OBJECT
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
261
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
262 public:
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
263
27643
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
264 FileDialog (base_qobject& oct_qobj, const QStringList& filters,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
265 const QString& title, const QString& filename,
337132e66ec2 eliminate need for global access to resource manager in uiwidget objects
John W. Eaton <jwe@octave.org>
parents: 27553
diff changeset
266 const QString& dirname, const QString& multimode);
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
267
29550
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
268 ~FileDialog (void) = default;
8dd0fca2a3d9 where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
269
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
270 signals:
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
271
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
272 void finish_input (const QStringList&, const QString&, int);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
273
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
274 private slots:
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
275
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
276 void acceptSelection (void);
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
277
24718
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
278 void rejectSelection (void);
ea1c88bd4430 move more GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24586
diff changeset
279 };
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
280
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 30564
diff changeset
281 OCTAVE_END_NAMESPACE(octave)
16579
7f8db1942dc0 Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents: 16565
diff changeset
282
16512
7f2395651a1c dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
diff changeset
283 #endif