GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
dialog.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2013-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if defined (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include <QFileInfo>
31 #include <QListView>
32 #include <QString>
33 #include <QStringList>
34 #include <QStringListModel>
35 // Could replace most of these with #include <QtGui>
36 #include <QGridLayout>
37 #include <QGroupBox>
38 #include <QHBoxLayout>
39 #include <QLabel>
40 #include <QMessageBox>
41 #include <QPushButton>
42 #include <QVBoxLayout>
43 
44 #include "dialog.h"
45 #include "octave-qobject.h"
46 #include "gui-preferences-global.h"
47 
49 
51 : QObject (), m_octave_qobj (oct_qobj), m_dialog_result (-1),
52  m_dialog_button (), m_string_list (), m_list_index (), m_path_name ()
53 {
54  connect (this, &QUIWidgetCreator::create_dialog,
56 
57  connect (this, &QUIWidgetCreator::create_listview,
59 
62 
65 }
66 
67 QString QUIWidgetCreator::rm_amp (const QString& text)
68 {
69  QString text_wo_amp = text;
70  text_wo_amp.replace (QRegExp ("&(\\w)"), "\\1");
71  return text_wo_amp;
72 }
73 
74 QString QUIWidgetCreator::message_dialog (const QString& message,
75  const QString& title,
76  const QString& icon,
77  const QStringList& buttons,
78  const QString& defbutton,
79  const QStringList& role)
80 {
81  QMutexLocker autolock (&m_mutex);
82 
83  // Store button text before a window-manager adds accelerators.
84 
85  m_button_list = buttons;
86 
87  // Use the last button in the list as the reject result, i.e., when
88  // no button is pressed such as in the case of the upper right close
89  // tab.
90  if (! buttons.isEmpty ())
91  m_dialog_button = buttons.last ();
92 
93  QString xicon = icon;
94  if (xicon.isEmpty ())
95  xicon = "none";
96 
97  emit create_dialog (message, title, xicon, buttons, defbutton, role);
98 
99  // Wait while the user is responding to message box.
100  wait ();
101 
102  // The GUI has sent a signal and the thread has been awakened.
103  return m_dialog_button;
104 };
105 
106 QPair<QIntList, int>
107 QUIWidgetCreator::list_dialog (const QStringList& list, const QString& mode,
108  int wd, int ht, const QList<int>& initial,
109  const QString& name,
110  const QStringList& prompt,
111  const QString& ok_string,
112  const QString& cancel_string)
113 {
114  if (list.isEmpty ())
115  return QPair<QIntList, int> ();
116 
117  QMutexLocker autolock (&m_mutex);
118 
119  emit create_listview (list, mode, wd, ht, initial, name,
120  prompt, ok_string, cancel_string);
121 
122  // Wait while the user is responding to message box.
123  wait ();
124 
125  // The GUI has sent a signal and the thread has been awakened.
126  return QPair<QIntList, int> (m_list_index, m_dialog_result);
127 };
128 
129 // Create a message dialog with specified string, buttons and
130 // decorative text.
131 
132 QStringList QUIWidgetCreator::input_dialog (const QStringList& prompt,
133  const QString& title,
134  const QFloatList& nr,
135  const QFloatList& nc,
136  const QStringList& defaults)
137 {
138  if (prompt.isEmpty ())
139  return QStringList ();
140 
141  QMutexLocker autolock (&m_mutex);
142 
143  emit create_inputlayout (prompt, title, nr, nc, defaults);
144 
145  // Wait while the user is responding to message box.
146  wait ();
147 
148  // The GUI has sent a signal and the thread has been awakened.
149  return m_string_list;
150 };
151 
152 QStringList QUIWidgetCreator::file_dialog (const QStringList& filters,
153  const QString& title,
154  const QString& filename,
155  const QString& dirname,
156  const QString& multimode)
157 {
158  QMutexLocker autolock (&m_mutex);
159 
160  emit create_filedialog (filters, title, filename, dirname, multimode);
161 
162  // Wait while the user is responding to dialog.
163  wait ();
164 
165  // The GUI has sent a signal and the thread has been awakened.
166  // Add all the file dialog results to a string list.
167  QStringList retval;
168  retval << m_string_list
169  << m_path_name
170  << QString::number (m_dialog_result);
171 
172  return retval;
173 }
174 
176  const QString& title,
177  const QString& icon,
178  const QStringList& button,
179  const QString& defbutton,
180  const QStringList& role)
181 {
183  = new MessageDialog (m_octave_qobj, message, title, icon,
184  button, defbutton, role);
185 
186  connect (message_dialog, &MessageDialog::buttonClicked,
188 
189  message_dialog->setAttribute (Qt::WA_DeleteOnClose);
190  message_dialog->show ();
191 }
192 
193 void QUIWidgetCreator::dialog_button_clicked (QAbstractButton *button)
194 {
195  // button is NULL when dialog is closed.
196  if (button)
197  {
198  // Check for a matching button text while ignoring accelerators
199  // because the window manager may have added one in the passed
200  // button.
201 
202  QString text_clean = rm_amp (button->text ());
203 
204  for (int i = 0; i < m_button_list.count (); i++)
205  {
206  if (rm_amp (m_button_list.at (i)) == text_clean)
207  {
208  // Text w/o extra accelerator.
210  break;
211  }
212  }
213  }
214 
215  // The value should always be 1 for the Octave functions.
216  m_dialog_result = 1;
217 
218  // Wake up Octave process so that it continues.
219  wake_all ();
220 }
221 
222 // Create a list dialog with specified list, initially selected, mode,
223 // view size and decorative text.
224 
225 void QUIWidgetCreator::handle_create_listview (const QStringList& list,
226  const QString& mode,
227  int wd, int ht,
228  const QIntList& initial,
229  const QString& name,
230  const QStringList& prompt,
231  const QString& ok_string,
232  const QString& cancel_string)
233 {
235  = new ListDialog (m_octave_qobj, list, mode, wd, ht, initial,
236  name, prompt, ok_string, cancel_string);
237 
240 
241  list_dialog->setAttribute (Qt::WA_DeleteOnClose);
242  list_dialog->show ();
243 }
244 
246  int button_pressed)
247 {
248  // Store the value so that builtin functions can retrieve.
249 
250  m_list_index = selected;
251  m_dialog_result = button_pressed;
252 
253  // Wake up Octave process so that it continues.
254  wake_all ();
255 }
256 
257 // Create an input dialog with specified prompts and defaults, title
258 // and row/column size specifications.
259 
260 void QUIWidgetCreator::handle_create_inputlayout (const QStringList& prompt,
261  const QString& title,
262  const QFloatList& nr,
263  const QFloatList& nc,
264  const QStringList& defaults)
265 {
267  = new InputDialog (m_octave_qobj, prompt, title, nr, nc, defaults);
268 
271 
272  input_dialog->setAttribute (Qt::WA_DeleteOnClose);
273  input_dialog->show ();
274 }
275 
276 void QUIWidgetCreator::input_finished (const QStringList& input,
277  int button_pressed)
278 {
279  // Store the value so that builtin functions can retrieve.
280 
282  m_dialog_result = button_pressed;
283 
284  // Wake up Octave process so that it continues.
285  wake_all ();
286 }
287 
288 void QUIWidgetCreator::handle_create_filedialog (const QStringList& filters,
289  const QString& title,
290  const QString& filename,
291  const QString& dirname,
292  const QString& multimode)
293 {
295  = new FileDialog (m_octave_qobj, filters, title, filename,
296  dirname, multimode);
297 
300 
301  file_dialog->setAttribute (Qt::WA_DeleteOnClose);
302  file_dialog->show ();
303 }
304 
305 void QUIWidgetCreator::filedialog_finished (const QStringList& files,
306  const QString& path,
307  int filterindex)
308 {
309  // Store the value so that builtin functions can retrieve.
310 
311  m_string_list = files;
312  m_dialog_result = filterindex;
313  m_path_name = path;
314 
315  // Wake up Octave process so that it continues.
316  wake_all ();
317 }
318 
320  const QString& title, const QString& qsicon,
321  const QStringList& qsbutton,
322  const QString& defbutton,
323  const QStringList& role)
324  : QMessageBox (QMessageBox::NoIcon, title.isEmpty () ? " " : title,
325  message)
326 {
327  // Create a NonModal message.
328  setWindowModality (Qt::NonModal);
329 
330  // Interpret the icon string, because enumeration QMessageBox::Icon can't
331  // easily be made to pass through a signal.
332 
333  QMessageBox::Icon eicon = QMessageBox::NoIcon;
334 
335  if (qsicon == "error")
336  eicon = QMessageBox::Critical;
337  else if (qsicon == "warn")
338  eicon = QMessageBox::Warning;
339  else if (qsicon == "help")
340  eicon = QMessageBox::Information;
341  else if (qsicon == "quest")
342  eicon = QMessageBox::Question;
343 
344  setIcon (eicon);
345 
346  int N = (qsbutton.size () < role.size () ? qsbutton.size () : role.size ());
347 
348  if (N == 0)
349  addButton (QMessageBox::Ok);
350  else
351  {
352  for (int i = 0; i < N; i++)
353  {
354  // Interpret the button role string, because enumeration
355  // QMessageBox::ButtonRole can't be made to pass through a
356  // signal.
357 
358  QString srole = role.at (i);
359  QMessageBox::ButtonRole erole = QMessageBox::InvalidRole;
360  if (srole == "ResetRole")
361  erole = QMessageBox::ResetRole;
362  else if (srole == "YesRole")
363  erole = QMessageBox::YesRole;
364  else if (srole == "NoRole")
365  erole = QMessageBox::NoRole;
366  else if (srole == "RejectRole")
367  erole = QMessageBox::RejectRole;
368  else if (srole == "AcceptRole")
369  erole = QMessageBox::AcceptRole;
370 
371  QPushButton *pbutton = addButton (qsbutton.at (i), erole);
372  if (qsbutton.at (i) == defbutton)
373  setDefaultButton (pbutton);
374 
375  // Make the last button the button pressed when <esc> key activated.
376  if (i == N-1)
377  {
378  // FIXME: Why define and then immediately test value?
379 #define ACTIVE_ESCAPE 1
380 #if ACTIVE_ESCAPE
381  setEscapeButton (pbutton);
382 #else
383  setEscapeButton (0);
384 #endif
385 #undef ACTIVE_ESCAPE
386  }
387  }
388  }
389 }
390 
391 ListDialog::ListDialog (base_qobject&, const QStringList& list,
392  const QString& mode, int wd, int ht,
393  const QList<int>& initial, const QString& title,
394  const QStringList& prompt,
395  const QString& ok_string,
396  const QString& cancel_string)
397  : QDialog (), m_model (new QStringListModel (list, this))
398 {
399  QListView *view = new QListView;
400  view->setModel (m_model);
401 
402  if (mode == "single")
403  view->setSelectionMode (QAbstractItemView::SingleSelection);
404  else if (mode == "multiple")
405  view->setSelectionMode (QAbstractItemView::ExtendedSelection);
406  else
407  view->setSelectionMode (QAbstractItemView::NoSelection);
408 
409  selector = view->selectionModel ();
410  int i = 0;
411  for (auto it = initial.begin (); it != initial.end (); it++)
412  {
413  QModelIndex idx = m_model->index (initial.value (i++) - 1, 0,
414  QModelIndex ());
415  selector->select (idx, QItemSelectionModel::Select);
416  }
417 
418  bool fixed_layout = false;
419  if (wd > 0 && ht > 0)
420  {
421  view->setFixedSize (wd, ht);
422  fixed_layout = true;
423  }
424 
425  view->setEditTriggers (QAbstractItemView::NoEditTriggers);
426 
427  QVBoxLayout *listLayout = new QVBoxLayout;
428  if (! prompt.isEmpty ())
429  {
430  // For now, assume html-like Rich Text. May be incompatible
431  // with something down the road, but just testing capability.
432  QString prompt_string;
433  for (int j = 0; j < prompt.length (); j++)
434  {
435  if (j > 0)
436  // FIXME: Why define and then immediately test value?
437 #define RICH_TEXT 1
438 #if RICH_TEXT
439  prompt_string.append ("<br>");
440 #else
441  prompt_string.append ("\n");
442 #endif
443  prompt_string.append (prompt.at (j));
444  }
445  QLabel *plabel = new QLabel (prompt_string);
446 #if RICH_TEXT
447  plabel->setTextFormat (Qt::RichText);
448 #endif
449 #undef RICH_TEXT
450  listLayout->addWidget (plabel);
451  }
452  listLayout->addWidget (view);
453  QPushButton *select_all = new QPushButton (tr ("Select All"));
454  select_all->setVisible (mode == "multiple");
455  listLayout->addWidget (select_all);
456 
457  QPushButton *buttonOk = new QPushButton (ok_string);
458  QPushButton *buttonCancel = new QPushButton (cancel_string);
459  QHBoxLayout *buttonsLayout = new QHBoxLayout;
460  buttonsLayout->addStretch (1);
461  buttonsLayout->addWidget (buttonOk);
462  buttonsLayout->addWidget (buttonCancel);
463  buttonOk->setDefault (true);
464 
465  QVBoxLayout *mainLayout = new QVBoxLayout;
466  mainLayout->addLayout (listLayout);
467  mainLayout->addSpacing (12);
468  mainLayout->addLayout (buttonsLayout);
469  setLayout (mainLayout);
470  if (fixed_layout)
471  layout ()->setSizeConstraint (QLayout::SetFixedSize);
472 
473  // If empty, make blank rather than use default OS behavior.
474  setWindowTitle (title.isEmpty () ? " " : title);
475 
476  connect (select_all, &QPushButton::clicked,
477  view, &QListView::selectAll);
478 
479  connect (buttonOk, &QPushButton::clicked,
481 
482  connect (buttonCancel, &QPushButton::clicked,
484 
485  connect (view, &QListView::doubleClicked,
487 }
488 
490 {
491  // Store information about what button was pressed so that builtin
492  // functions can retrieve.
493 
494  QModelIndexList selected_index = selector->selectedIndexes ();
495  QIntList selected_int;
496 
497  for (int i = 0; i < selected_index.size (); i++)
498  selected_int << selected_index.at (i).row () + 1;
499 
500  emit finish_selection (selected_int, 1);
501 
502  done (QDialog::Accepted);
503 }
504 
506 {
507  // Store information about what button was pressed so that builtin
508  // functions can retrieve.
509 
510  QIntList empty;
511 
512  emit finish_selection (empty, 0);
513 
514  done (QDialog::Rejected);
515 }
516 
518 {
520 }
521 
522 void ListDialog::item_double_clicked (const QModelIndex&)
523 {
524  buttonOk_clicked ();
525 }
526 
527 InputDialog::InputDialog (base_qobject&, const QStringList& prompt,
528  const QString& title, const QFloatList& nr,
529  const QFloatList& nc, const QStringList& defaults)
530  : QDialog ()
531 {
532 
533 #define LINE_EDIT_FOLLOWS_PROMPT 0
534 
535 #if LINE_EDIT_FOLLOWS_PROMPT
536  // Prompt on left followed by input on right.
537  QGridLayout *promptInputLayout = new QGridLayout;
538 #else
539  // Prompt aligned above input.
540  QVBoxLayout *promptInputLayout = new QVBoxLayout;
541 #endif
542  int N_gridrows = prompt.size ();
543  for (int i = 0; i < N_gridrows; i++)
544  {
545  QLabel *label = new QLabel (prompt.at (i));
546  QLineEdit *line_edit = new QLineEdit ();
547  if (i < defaults.size ())
548  line_edit->setText (defaults.at (i));
549  if (i < nr.size () && nr.at (i) > 0)
550  {
551  QSize qsize = line_edit->sizeHint ();
552  int intval = qsize.height () * nr.at (i);
553  line_edit->setFixedHeight (intval);
554  if (i < nc.size () && nc.at (i) > 0)
555  {
556  intval = qsize.height () * nc.at (i) / 2;
557  line_edit->setFixedWidth (intval);
558  }
559  }
560  input_line << line_edit;
561 #if LINE_EDIT_FOLLOWS_PROMPT
562  promptInputLayout->addWidget (label, i + 1, 0);
563  promptInputLayout->addWidget (line_edit, i + 1, 1);
564 #else
565  promptInputLayout->addWidget (label);
566  promptInputLayout->addWidget (line_edit);
567 #endif
568  }
569 #undef LINE_EDIT_FOLLOWS_PROMPT
570 
571  QPushButton *buttonOk = new QPushButton ("OK");
572  QPushButton *buttonCancel = new QPushButton ("Cancel");
573  QHBoxLayout *buttonsLayout = new QHBoxLayout;
574  buttonsLayout->addStretch (1);
575  buttonsLayout->addWidget (buttonOk);
576  buttonsLayout->addWidget (buttonCancel);
577 
578  QVBoxLayout *mainLayout = new QVBoxLayout;
579  mainLayout->addLayout (promptInputLayout);
580  mainLayout->addSpacing (12);
581  mainLayout->addLayout (buttonsLayout);
582  setLayout (mainLayout);
583 
584  // If empty, make blank rather than use default OS behavior.
585  setWindowTitle (title.isEmpty () ? " " : title);
586 
587  connect (buttonOk, &QPushButton::clicked,
589 
590  connect (buttonCancel, &QPushButton::clicked,
592 }
593 
595 {
596  // Store information about what button was pressed so that builtin
597  // functions can retrieve.
598 
599  QStringList string_result;
600  for (int i = 0; i < input_line.size (); i++)
601  string_result << input_line.at (i)->text ();
602  emit finish_input (string_result, 1);
603  done (QDialog::Accepted);
604 }
605 
607 {
608  // Store information about what button was pressed so that builtin
609  // functions can retrieve.
610 
611  QStringList empty;
612  emit finish_input (empty, 0);
613  done (QDialog::Rejected);
614 }
615 
617 {
619 }
620 
622  const QStringList& name_filters,
623  const QString& title, const QString& filename,
624  const QString& dirname, const QString& multimode)
625  : QFileDialog ()
626 {
627  // Create a NonModal message.
628  setWindowModality (Qt::NonModal);
629 
630  setWindowTitle (title.isEmpty () ? " " : title);
631  setDirectory (dirname);
632 
633  // FIXME: Remove, if for all common KDE versions (bug #54607) is resolved.
634  resource_manager& rmgr = oct_qobj.get_resource_manager ();
636  if (! settings->value (global_use_native_dialogs).toBool ())
637  setOption(QFileDialog::DontUseNativeDialog);
638 
639  if (multimode == "on") // uigetfile multiselect=on
640  {
641  setFileMode (QFileDialog::ExistingFiles);
642  setAcceptMode (QFileDialog::AcceptOpen);
643  }
644  else if (multimode == "create") // uiputfile
645  {
646  setFileMode (QFileDialog::AnyFile);
647  setAcceptMode (QFileDialog::AcceptSave);
648  setOption (QFileDialog::DontConfirmOverwrite, false);
649  }
650  else if (multimode == "dir") // uigetdir
651  {
652  setFileMode (QFileDialog::Directory);
653  setOption (QFileDialog::ShowDirsOnly, true);
654  setOption (QFileDialog::HideNameFilterDetails, true);
655  setAcceptMode (QFileDialog::AcceptOpen);
656  }
657  else // uigetfile multiselect=off
658  {
659  setFileMode (QFileDialog::ExistingFile);
660  setAcceptMode (QFileDialog::AcceptOpen);
661  }
662 
663  setNameFilters (name_filters);
664 
665  selectFile (filename);
666 
667  connect (this, &FileDialog::accepted, this, &FileDialog::acceptSelection);
668 
669  connect (this, &FileDialog::rejected, this, &FileDialog::rejectSelection);
670 }
671 
673 {
674  QStringList empty;
675  emit finish_input (empty, "", 0);
676 }
677 
679 {
680  QStringList string_result;
681  QString path;
682  int idx = 1;
683 
684  string_result = selectedFiles ();
685 
686  if (testOption (QFileDialog::ShowDirsOnly) && string_result.size () > 0)
687  path = string_result[0];
688  else
689  path = directory ().absolutePath ();
690 
691  // Matlab expects just the filename, whereas the file dialog gave us
692  // full path names, so fix it.
693 
694  for (int i = 0; i < string_result.size (); i++)
695  string_result[i] = QFileInfo (string_result[i]).fileName ();
696 
697  // If not showing only dirs, add end slash for the path component.
698  if (testOption (QFileDialog::ShowDirsOnly) == false)
699  path += '/';
700 
701  // Convert to native slashes.
702  path = QDir::toNativeSeparators (path);
703 
704  QStringList name_filters = nameFilters ();
705  idx = name_filters.indexOf (selectedNameFilter ()) + 1;
706 
707  // Send the selected info.
708  emit finish_input (string_result, path, idx);
709 }
710 
OCTAVE_END_NAMESPACE(octave)
void acceptSelection(void)
Definition: dialog.cc:678
void rejectSelection(void)
Definition: dialog.cc:672
FileDialog(base_qobject &oct_qobj, const QStringList &filters, const QString &title, const QString &filename, const QString &dirname, const QString &multimode)
Definition: dialog.cc:621
void finish_input(const QStringList &, const QString &, int)
InputDialog(base_qobject &oct_qobj, const QStringList &prompt, const QString &title, const QFloatList &nr, const QFloatList &nc, const QStringList &defaults)
Definition: dialog.cc:527
void buttonCancel_clicked(void)
Definition: dialog.cc:606
void finish_input(const QStringList &, int)
void buttonOk_clicked(void)
Definition: dialog.cc:594
void reject(void)
Definition: dialog.cc:616
QList< QLineEdit * > input_line
Definition: dialog.h:235
void buttonCancel_clicked(void)
Definition: dialog.cc:505
QAbstractItemModel * m_model
Definition: dialog.h:228
QItemSelectionModel * selector
Definition: dialog.h:200
void finish_selection(const QIntList &, int)
void buttonOk_clicked(void)
Definition: dialog.cc:489
ListDialog(base_qobject &oct_qobj, const QStringList &list, const QString &mode, int width, int height, const QList< int > &initial, const QString &name, const QStringList &prompt, const QString &ok_string, const QString &cancel_string)
Definition: dialog.cc:391
void item_double_clicked(const QModelIndex &)
Definition: dialog.cc:522
void reject(void)
Definition: dialog.cc:517
MessageDialog(base_qobject &oct_qobj, const QString &message, const QString &title, const QString &icon, const QStringList &button, const QString &defbutton, const QStringList &role)
Definition: dialog.cc:319
base_qobject & m_octave_qobj
Definition: dialog.h:151
QString rm_amp(const QString &text)
Definition: dialog.cc:67
void handle_create_inputlayout(const QStringList &, const QString &, const QFloatList &, const QFloatList &, const QStringList &)
Definition: dialog.cc:260
QMutex m_mutex
Definition: dialog.h:169
void handle_create_listview(const QStringList &list, const QString &mode, int width, int height, const QIntList &initial, const QString &name, const QStringList &prompt, const QString &ok_string, const QString &cancel_string)
Definition: dialog.cc:225
void handle_create_dialog(const QString &message, const QString &title, const QString &icon, const QStringList &button, const QString &defbutton, const QStringList &role)
Definition: dialog.cc:175
QString m_path_name
Definition: dialog.h:164
QString message_dialog(const QString &message, const QString &title, const QString &icon, const QStringList &button, const QString &defbutton, const QStringList &role)
Definition: dialog.cc:74
void input_finished(const QStringList &input, int button_pressed)
Definition: dialog.cc:276
void wait(void)
Definition: dialog.h:95
QPair< QIntList, int > list_dialog(const QStringList &list, const QString &mode, int wd, int ht, const QList< int > &initial, const QString &name, const QStringList &prompt, const QString &ok_string, const QString &cancel_string)
Definition: dialog.cc:107
QStringList m_string_list
Definition: dialog.h:161
void dialog_button_clicked(QAbstractButton *button)
Definition: dialog.cc:193
void handle_create_filedialog(const QStringList &filters, const QString &title, const QString &filename, const QString &dirname, const QString &multimode)
Definition: dialog.cc:288
QStringList input_dialog(const QStringList &prompt, const QString &title, const QFloatList &nr, const QFloatList &nc, const QStringList &defaults)
Definition: dialog.cc:132
QStringList file_dialog(const QStringList &filters, const QString &title, const QString &filename, const QString &dirname, const QString &multimode)
Definition: dialog.cc:152
void create_dialog(const QString &, const QString &, const QString &, const QStringList &, const QString &, const QStringList &)
void create_filedialog(const QStringList &filters, const QString &title, const QString &filename, const QString &dirname, const QString &multimode)
void list_select_finished(const QIntList &selected, int button_pressed)
Definition: dialog.cc:245
QIntList m_list_index
Definition: dialog.h:162
int m_dialog_result
Definition: dialog.h:153
void filedialog_finished(const QStringList &files, const QString &path, int filterindex)
Definition: dialog.cc:305
QString m_dialog_button
Definition: dialog.h:154
void wake_all(void)
Definition: dialog.h:97
void create_inputlayout(const QStringList &, const QString &, const QFloatList &, const QFloatList &, const QStringList &)
QStringList m_button_list
Definition: dialog.h:157
void create_listview(const QStringList &, const QString &, int, int, const QIntList &, const QString &, const QStringList &, const QString &, const QString &)
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
gui_settings * get_settings(void) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
QList< int > QIntList
Definition: dialog.h:40
void message(const char *name, const char *fmt,...)
Definition: error.cc:947
std::string dirname(const std::string &path)
Definition: file-ops.cc:360
const gui_pref global_use_native_dialogs("use_native_file_dialogs", QVariant(true))
F77_RET_T const F77_INT & N
static int input(yyscan_t yyscanner)