annotate libgui/src/set-path-dialog.h @ 27305:d20c31be3160

add a reload button to the gui path dialog * set-path-dialog.cc (set_path_dialog): add new button for reloading path * set-path-dialog.h: new reload button * set-path-model.cc (set_path_model): initialize new flag whether last change is revertible or not, rename method for loading path; (construct): rename into path_to_model, set new revertible flag to false; (update_data): update backup string list if revertible flag is false and set this flag to true again * set-path-model.h: renamed private method contruct into public slot path_to_model, new flag whehter last change is revertible or not
author Torsten Lilge <ttl-octave@mailbox.org>
date Wed, 31 Jul 2019 16:45:56 +0200
parents 1805f8586179
children 82ace1225a9c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27298
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
1 /*
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
2
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
3 Copyright (C) 2019 JunWang
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
4
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
5 This file is part of Octave.
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
6
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
7 Octave is free software: you can redistribute it and/or modify it
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
10 (at your option) any later version.
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
11
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
15 GNU General Public License for more details.
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
16
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
19 <https://www.gnu.org/licenses/>.
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
20
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
21 */
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
22 #if ! defined (octave_set_path_dialog_h)
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
23 #define octave_set_path_dialog_h 1
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
24
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
25 #include <QDialog>
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
26 #include <QModelIndex>
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
27 #include <QFileInfo>
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
28
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
29 class QLabel;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
30 class QPushButton;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
31 class QListView;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
32 class QVBoxLayout;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
33 class QHBoxLayout;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
34
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
35 namespace octave
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
36 {
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
37 class set_path_dialog : public QDialog
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
38 {
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
39 Q_OBJECT
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
40
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
41 public:
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
42
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
43 set_path_dialog (QWidget *parent = nullptr);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
44
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
45 virtual ~set_path_dialog (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
46
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
47 private slots:
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
48
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
49 void add_dir(void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
50
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
51 void rm_dir (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
52
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
53 void move_dir_up (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
54
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
55 void move_dir_down (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
56
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
57 void move_dir_top (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
58
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
59 void move_dir_bottom (void);
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
60
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
61 private:
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
62
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
63 QLabel *m_info_label;
27305
d20c31be3160 add a reload button to the gui path dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27298
diff changeset
64 QPushButton *m_reload_button;
27298
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
65 QPushButton *m_save_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
66 QPushButton *m_close_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
67 QPushButton *m_revert_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
68 QPushButton *m_revert_last_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
69
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
70 QListView *m_path_list;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
71
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
72 QPushButton *m_add_folder_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
73 QPushButton *m_move_to_top_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
74 QPushButton *m_move_to_bottom_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
75 QPushButton *m_move_up_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
76 QPushButton *m_move_down_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
77 QPushButton *m_remove_button;
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
78 };
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
79 }
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
80
1805f8586179 new gui dialog for modifying octaves load path (bug #43549)
JunWang <jstzwj@aliyun.com>
parents:
diff changeset
81 #endif