GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
set-path-dialog.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2019-2021 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 #if ! defined (octave_set_path_dialog_h)
26 #define octave_set_path_dialog_h 1
27 
28 #include <QDialog>
29 #include <QFileInfo>
30 #include <QModelIndex>
31 
32 #include "qt-interpreter-events.h"
33 
34 class octave_value_list;
35 
36 class QLabel;
37 class QPushButton;
38 class QListView;
39 class QVBoxLayout;
40 class QHBoxLayout;
41 
42 namespace octave
43 {
44  class base_qobject;
45 
46  class set_path_dialog : public QDialog
47  {
48  Q_OBJECT
49 
50  public:
51 
52  // You must call update_model to fully initialize the path displayed
53  // in the dialog. That may only be done after the intepreter_event
54  // signal connections are made to the Octave interpreter.
55 
56  set_path_dialog (QWidget *parent, base_qobject& oct_qobj);
57 
58  virtual ~set_path_dialog (void);
59 
60  void save_settings (void);
61 
62  signals:
63 
64  //! Emitted, when the path has to be modified
65 
66  void modify_path_signal (const octave_value_list& dir_list,
67  bool rm, bool subdirs);
68 
69  void interpreter_event (const fcn_callback& fcn);
70  void interpreter_event (const meth_callback& meth);
71 
72  public slots:
73 
74  void update_model (void);
75 
76  protected:
77 
78  void closeEvent (QCloseEvent *e);
79 
80  private slots:
81 
82  void add_dir (void);
83  void add_dir_subdirs (void);
84 
85  void rm_dir (void);
86 
87  void move_dir_up (void);
88 
89  void move_dir_down (void);
90 
91  void move_dir_top (void);
92 
93  void move_dir_bottom (void);
94 
95  private:
96 
97  void add_dir_common (bool subdirs);
98 
100 
101  QLabel *m_info_label;
107 
108  QListView *m_path_list;
109 
116  };
117 }
118 
119 #endif
Base class for Octave interfaces that use Qt.
virtual ~set_path_dialog(void)
void interpreter_event(const fcn_callback &fcn)
QPushButton * m_remove_button
set_path_dialog(QWidget *parent, base_qobject &oct_qobj)
QPushButton * m_move_to_top_button
QPushButton * m_revert_last_button
void add_dir_common(bool subdirs)
base_qobject & m_octave_qobj
void interpreter_event(const meth_callback &meth)
QPushButton * m_move_up_button
QPushButton * m_revert_button
QPushButton * m_add_folder_button
QPushButton * m_close_button
void modify_path_signal(const octave_value_list &dir_list, bool rm, bool subdirs)
Emitted, when the path has to be modified.
QPushButton * m_move_to_bottom_button
QPushButton * m_reload_button
QPushButton * m_move_down_button
void closeEvent(QCloseEvent *e)
std::function< void(octave::interpreter &)> meth_callback
Definition: event-manager.h:47
std::function< void(void)> fcn_callback
Definition: event-manager.h:46