annotate libgui/src/files-dock-widget.h @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents d4d83344d653
children 00ff0dfb4d27
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: 30398
diff changeset
3 // Copyright (C) 2011-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 ////////////////////////////////////////////////////////////////////////
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
26 #if ! defined (octave_files_dock_widget_h)
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 20945
diff changeset
27 #define octave_files_dock_widget_h 1
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
29 #include <QAction>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
30 #include <QComboBox>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
31 #include <QDate>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
32 #include <QFileSystemModel>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
33 #include <QList>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 #include <QListView>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
35 #include <QListWidget>
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
36 #include <QMouseEvent>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
37 #include <QObject>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
38 #include <QSignalMapper>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 #include <QToolBar>
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 #include <QToolButton>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
41 #include <QTreeView>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42 #include <QVBoxLayout>
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
43 #include <QWidget>
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
44
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
45 #include "octave-dock-widget.h"
27412
da1f59fe04b3 try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents: 27308
diff changeset
46
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47 namespace octave
13506
c70511cf64ee Reformatted to GNU Style.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13504
diff changeset
48 {
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
49 class base_qobject;
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27611
diff changeset
50
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
51 //! Dock widget to display files in the current directory.
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
52
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
53 class files_dock_widget : public octave_dock_widget
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
54 {
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
55 Q_OBJECT
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
56
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
57 public:
16450
3207f1d62e74 improve encapsulation of file browser window object
John W. Eaton <jwe@octave.org>
parents: 16437
diff changeset
58
27629
8b6e928e0705 in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents: 27620
diff changeset
59 files_dock_widget (QWidget *parent, base_qobject& oct_qobj);
13536
869c62c15e95 Few minor improvements, added advanced settings for file browser.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13506
diff changeset
60
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
61 ~files_dock_widget (void) = default;
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15552
diff changeset
62
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
63 signals:
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
64
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
65 //! Emitted, whenever the user requested to open a file.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
66
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
67 void open_file (const QString& fileName);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
68
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
69 //! Emitted, whenever the currently displayed directory changed.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
70
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
71 void displayed_directory_changed (const QString& dir);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
72
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
73 //! Emitted, whenever the user requested to load a file in the text editor.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
74
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
75 void load_file_signal (const QString& fileName);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
76
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
77 //! Emitted, whenever the user requested to open an unknown type file.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
78
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
79 void open_any_signal (const QString& fileName);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
80
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
81 //! Emitted, whenever the user requested to run a file.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
82
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
83 void run_file_signal (const QFileInfo& info);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
84
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
85 //! Emitted, whenever wants to search for a file .
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
86
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
87 void find_files_signal (const QString& startdir);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
88
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
89 //! Emitted, whenever the user removes or renames a file.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
90
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
91 void file_remove_signal (const QString& old_name, const QString& new_name);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
92
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
93 //! Emitted, when a file or directory is renamed.
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
94
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
95 void file_renamed_signal (bool);
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
96
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
97 //! Emitted, when the path has to be modified
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
98
29782
02461b0ccc00 reduce dependence of files_dock_widget on Octave interpreter
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
99 void modify_path_signal (const QStringList& dir_list, bool rm,
02461b0ccc00 reduce dependence of files_dock_widget on Octave interpreter
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
100 bool subdirs);
27590
f6b729077ebd use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
101
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
102 public slots:
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
103
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
104 //! Slot for handling a change in directory via double click.
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
105
30398
d4d83344d653 maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents: 29782
diff changeset
106 void item_double_clicked (const QModelIndex& index);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
107
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
108 //! Slot for handling the up-directory button in the toolbar.
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
109
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
110 void change_directory_up (void);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
111
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
112 //! Slot for handling the sync octave directory button in the toolbar.
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
113
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
114 void do_sync_octave_directory (void);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
115
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
116 //! Slot for handling the sync browser directory button in the toolbar.
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
117
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
118 void do_sync_browser_directory (void);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
119
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
120 //! Sets the current directory being displayed.
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
121
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
122 void set_current_directory (const QString& dir);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
123
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
124 //! Accepts user input a the line edit for the current directory.
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
125
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
126 void accept_directory_line_edit (void);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
127
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
128 //! Set the internal variable that holds the actual octave variable.
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
129
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
130 void update_octave_directory (const QString& dir);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
131
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
132 //! Tells the widget to react on changed settings.
14863
3ff18e21c742 Added a few comments.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14803
diff changeset
133
27611
0495b64288f7 use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents: 27590
diff changeset
134 void notice_settings (const gui_settings *settings);
22177
6e9f5408c0db Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 21203
diff changeset
135
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
136 void save_settings (void);
20642
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
137
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
138 private slots:
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
139
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
140 void headercontextmenu_requested (const QPoint& pos);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
141 void toggle_header (int col);
20642
3e449f43e708 revised code for header context menu in file browser
Torsten <ttl@justmail.de>
parents: 19697
diff changeset
142
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
143 //! Context menu wanted.
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
144
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
145 void contextmenu_requested (const QPoint& pos);
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
146
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
147 //! Context menu actions.
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
148 //!@{
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
149 void contextmenu_open (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
150 void contextmenu_open_in_editor (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
151 void contextmenu_open_in_app (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
152 void contextmenu_copy_selection (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
153 void contextmenu_run (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
154 void contextmenu_load (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
155 void contextmenu_rename (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
156 void contextmenu_delete (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
157 void contextmenu_newfile (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
158 void contextmenu_newdir (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
159 void contextmenu_setcurrentdir (bool);
27273
aaf788e496a3 add file browser context menu for removing dirs from path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27269
diff changeset
160 void contextmenu_add_to_path (bool, bool rm=false, bool subdirs=false);
27269
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
161 void contextmenu_add_to_path_subdirs (bool);
27273
aaf788e496a3 add file browser context menu for removing dirs from path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27269
diff changeset
162 void contextmenu_rm_from_path (bool);
aaf788e496a3 add file browser context menu for removing dirs from path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 27269
diff changeset
163 void contextmenu_rm_from_path_subdirs (bool);
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
164 void contextmenu_findfiles (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
165 //!@}
16503
c1ff738d606d allow files to be renamed or deleted using the file browser
John Donoghue <john.donoghue@ieee.org>
parents: 16499
diff changeset
166
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
167 //! Popdown menu options.
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
168 //!@{
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
169 void popdownmenu_newfile (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
170 void popdownmenu_newdir (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
171 void popdownmenu_search_dir (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
172 void popdownmenu_findfiles (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
173 void popdownmenu_home (bool);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
174 //!@}
16542
016073c0cb94 Add popdown toolbutton to files-dock-window toolbar.
John Donoghue <john.donoghue@ieee.org>
parents: 16525
diff changeset
175
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
176 //! Inherited from octave_doc_widget.
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
177 //!@{
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
178 void copyClipboard ();
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
179 void pasteClipboard ();
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
180 void selectAll ();
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
181 //!@}
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16762
diff changeset
182
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
183 private:
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
184
27269
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
185 //! Get currently selected QFileInfo object.
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
186
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
187 QList<QFileInfo> get_selected_items_info (bool);
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
188
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
189 //! Process new file/directory actions
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
190
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
191 void process_new_file (const QString& parent_name);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
192 void process_new_dir (const QString& parent_name);
27269
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
193
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
194 //! Process setting current dir or find in files
6a6b5ae3d58d add file browser context menu for adding dirs to the path (bug #55623)
Torsten Lilge <ttl-octave@mailbox.org>
parents: 26376
diff changeset
195
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
196 void process_set_current_dir (const QString& parent_name);
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
197 void process_find_files (const QString& dir_name);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
198
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
199 //! set a new directory or open a file
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
200
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
201 void display_directory (const QString& dir, bool set_octave_dir = true);
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
202
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
203 void open_item_in_app (const QModelIndex& index);
16594
3ce0c312a40b contextmenu for opening files in default applications
John W. Eaton <jwe@octave.org>
parents: 16542
diff changeset
204
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
205 //! Variables for the actions
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
206
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
207 QToolBar *m_navigation_tool_bar;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
208 QAction *m_sync_octave_directory_action;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
209 QAction *m_sync_browser_directory_action;
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
210
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
211 //! The file system model.
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
212
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
213 QFileSystemModel *m_file_system_model;
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
214
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
215 //! The file system view.
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
216 //!@{
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
217 QTreeView *m_file_tree_view;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
218 QComboBox *m_current_directory;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
219 //!@}
16498
605d7f0ee0d8 Added Filesdockwidget recently viewed directory pulldownlist
John Donoghue <john.donoghue@ieee.org>
parents: 16461
diff changeset
220
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
221 //! Flag if syncing with Octave.
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
222
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
223 bool m_sync_octave_dir;
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23920
diff changeset
224
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
225 //! The actual Octave directory.
24014
bffd7d826887 style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents: 23920
diff changeset
226
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
227 QString m_octave_dir;
24109
1d6c940a1b37 doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 24014
diff changeset
228
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
229 enum { MaxMRUDirs = 10 };
16499
facf00ce97d3 gui: configurable synchronization between file browser and octave directory
Torsten <ttl@justmail.de>
parents: 16498
diff changeset
230
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
231 QStringList m_columns_shown;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
232 QStringList m_columns_shown_keys;
25851
507cee1b684e removed all initial preferences for file browser from pref file (bug #54606)
Torsten <mttl@mailbox.org>
parents: 25408
diff changeset
233 QList <QVariant> m_columns_shown_defs;
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
234 QSignalMapper *m_sig_mapper;
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
235 };
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
236 }
13495
11e03a76d8c0 Added source files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
237
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20706
diff changeset
238 #endif