comparison libgui/src/files-dock-widget.h @ 31648:29d734430e5f stable

maint: Re-indent code after switch to using namespace macros. * 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, module.mk, 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: Re-indent code after switch to using namespace macros.
author John W. Eaton <jwe@octave.org>
date Tue, 06 Dec 2022 14:53:00 -0500
parents c6d54dd31a7e
children deb553ac2c54 597f3ee61a48
comparison
equal deleted inserted replaced
31646:c6d54dd31a7e 31648:29d734430e5f
44 44
45 #include "octave-dock-widget.h" 45 #include "octave-dock-widget.h"
46 46
47 OCTAVE_BEGIN_NAMESPACE(octave) 47 OCTAVE_BEGIN_NAMESPACE(octave)
48 48
49 class base_qobject; 49 class base_qobject;
50 50
51 //! Dock widget to display files in the current directory. 51 //! Dock widget to display files in the current directory.
52 52
53 class files_dock_widget : public octave_dock_widget 53 class files_dock_widget : public octave_dock_widget
54 { 54 {
55 Q_OBJECT 55 Q_OBJECT
56 56
57 public: 57 public:
58 58
59 files_dock_widget (QWidget *parent, base_qobject& oct_qobj); 59 files_dock_widget (QWidget *parent, base_qobject& oct_qobj);
60 60
61 ~files_dock_widget (void) = default; 61 ~files_dock_widget (void) = default;
62 62
63 signals: 63 signals:
64 64
65 //! Emitted, whenever the user requested to open a file. 65 //! Emitted, whenever the user requested to open a file.
66 66
67 void open_file (const QString& fileName); 67 void open_file (const QString& fileName);
68 68
69 //! Emitted, whenever the currently displayed directory changed. 69 //! Emitted, whenever the currently displayed directory changed.
70 70
71 void displayed_directory_changed (const QString& dir); 71 void displayed_directory_changed (const QString& dir);
72 72
73 //! Emitted, whenever the user requested to load a file in the text editor. 73 //! Emitted, whenever the user requested to load a file in the text editor.
74 74
75 void load_file_signal (const QString& fileName); 75 void load_file_signal (const QString& fileName);
76 76
77 //! Emitted, whenever the user requested to open an unknown type file. 77 //! Emitted, whenever the user requested to open an unknown type file.
78 78
79 void open_any_signal (const QString& fileName); 79 void open_any_signal (const QString& fileName);
80 80
81 //! Emitted, whenever the user requested to run a file. 81 //! Emitted, whenever the user requested to run a file.
82 82
83 void run_file_signal (const QFileInfo& info); 83 void run_file_signal (const QFileInfo& info);
84 84
85 //! Emitted, whenever wants to search for a file . 85 //! Emitted, whenever wants to search for a file .
86 86
87 void find_files_signal (const QString& startdir); 87 void find_files_signal (const QString& startdir);
88 88
89 //! Emitted, whenever the user removes or renames a file. 89 //! Emitted, whenever the user removes or renames a file.
90 90
91 void file_remove_signal (const QString& old_name, const QString& new_name); 91 void file_remove_signal (const QString& old_name, const QString& new_name);
92 92
93 //! Emitted, when a file or directory is renamed. 93 //! Emitted, when a file or directory is renamed.
94 94
95 void file_renamed_signal (bool); 95 void file_renamed_signal (bool);
96 96
97 //! Emitted, when the path has to be modified 97 //! Emitted, when the path has to be modified
98 98
99 void modify_path_signal (const QStringList& dir_list, bool rm, 99 void modify_path_signal (const QStringList& dir_list, bool rm,
100 bool subdirs); 100 bool subdirs);
101 101
102 public slots: 102 public slots:
103 103
104 //! Slot for handling a change in directory via double click. 104 //! Slot for handling a change in directory via double click.
105 105
106 void item_double_clicked (const QModelIndex& index); 106 void item_double_clicked (const QModelIndex& index);
107 107
108 //! Slot for handling the up-directory button in the toolbar. 108 //! Slot for handling the up-directory button in the toolbar.
109 109
110 void change_directory_up (void); 110 void change_directory_up (void);
111 111
112 //! Slot for handling the sync octave directory button in the toolbar. 112 //! Slot for handling the sync octave directory button in the toolbar.
113 113
114 void do_sync_octave_directory (void); 114 void do_sync_octave_directory (void);
115 115
116 //! Slot for handling the sync browser directory button in the toolbar. 116 //! Slot for handling the sync browser directory button in the toolbar.
117 117
118 void do_sync_browser_directory (void); 118 void do_sync_browser_directory (void);
119 119
120 //! Sets the current directory being displayed. 120 //! Sets the current directory being displayed.
121 121
122 void set_current_directory (const QString& dir); 122 void set_current_directory (const QString& dir);
123 123
124 //! Accepts user input a the line edit for the current directory. 124 //! Accepts user input a the line edit for the current directory.
125 125
126 void accept_directory_line_edit (void); 126 void accept_directory_line_edit (void);
127 127
128 //! Set the internal variable that holds the actual octave variable. 128 //! Set the internal variable that holds the actual octave variable.
129 129
130 void update_octave_directory (const QString& dir); 130 void update_octave_directory (const QString& dir);
131 131
132 //! Tells the widget to react on changed settings. 132 //! Tells the widget to react on changed settings.
133 133
134 void notice_settings (const gui_settings *settings); 134 void notice_settings (const gui_settings *settings);
135 135
136 void save_settings (void); 136 void save_settings (void);
137 137
138 private slots: 138 private slots:
139 139
140 void headercontextmenu_requested (const QPoint& pos); 140 void headercontextmenu_requested (const QPoint& pos);
141 void toggle_header (int col); 141 void toggle_header (int col);
142 142
143 //! Context menu wanted. 143 //! Context menu wanted.
144 144
145 void contextmenu_requested (const QPoint& pos); 145 void contextmenu_requested (const QPoint& pos);
146 146
147 //! Context menu actions. 147 //! Context menu actions.
148 //!@{ 148 //!@{
149 void contextmenu_open (bool); 149 void contextmenu_open (bool);
150 void contextmenu_open_in_editor (bool); 150 void contextmenu_open_in_editor (bool);
151 void contextmenu_open_in_app (bool); 151 void contextmenu_open_in_app (bool);
152 void contextmenu_copy_selection (bool); 152 void contextmenu_copy_selection (bool);
153 void contextmenu_run (bool); 153 void contextmenu_run (bool);
154 void contextmenu_load (bool); 154 void contextmenu_load (bool);
155 void contextmenu_rename (bool); 155 void contextmenu_rename (bool);
156 void contextmenu_delete (bool); 156 void contextmenu_delete (bool);
157 void contextmenu_newfile (bool); 157 void contextmenu_newfile (bool);
158 void contextmenu_newdir (bool); 158 void contextmenu_newdir (bool);
159 void contextmenu_setcurrentdir (bool); 159 void contextmenu_setcurrentdir (bool);
160 void contextmenu_add_to_path (bool, bool rm=false, bool subdirs=false); 160 void contextmenu_add_to_path (bool, bool rm=false, bool subdirs=false);
161 void contextmenu_add_to_path_subdirs (bool); 161 void contextmenu_add_to_path_subdirs (bool);
162 void contextmenu_rm_from_path (bool); 162 void contextmenu_rm_from_path (bool);
163 void contextmenu_rm_from_path_subdirs (bool); 163 void contextmenu_rm_from_path_subdirs (bool);
164 void contextmenu_findfiles (bool); 164 void contextmenu_findfiles (bool);
165 //!@} 165 //!@}
166 166
167 //! Popdown menu options. 167 //! Popdown menu options.
168 //!@{ 168 //!@{
169 void popdownmenu_newfile (bool); 169 void popdownmenu_newfile (bool);
170 void popdownmenu_newdir (bool); 170 void popdownmenu_newdir (bool);
171 void popdownmenu_search_dir (bool); 171 void popdownmenu_search_dir (bool);
172 void popdownmenu_findfiles (bool); 172 void popdownmenu_findfiles (bool);
173 void popdownmenu_home (bool); 173 void popdownmenu_home (bool);
174 //!@} 174 //!@}
175 175
176 //! Inherited from octave_doc_widget. 176 //! Inherited from octave_doc_widget.
177 //!@{ 177 //!@{
178 void copyClipboard (); 178 void copyClipboard ();
179 void pasteClipboard (); 179 void pasteClipboard ();
180 void selectAll (); 180 void selectAll ();
181 //!@} 181 //!@}
182 182
183 private: 183 private:
184 184
185 //! Get currently selected QFileInfo object. 185 //! Get currently selected QFileInfo object.
186 186
187 QList<QFileInfo> get_selected_items_info (bool); 187 QList<QFileInfo> get_selected_items_info (bool);
188 188
189 //! Process new file/directory actions 189 //! Process new file/directory actions
190 190
191 void process_new_file (const QString& parent_name); 191 void process_new_file (const QString& parent_name);
192 void process_new_dir (const QString& parent_name); 192 void process_new_dir (const QString& parent_name);
193 193
194 //! Process setting current dir or find in files 194 //! Process setting current dir or find in files
195 195
196 void process_set_current_dir (const QString& parent_name); 196 void process_set_current_dir (const QString& parent_name);
197 void process_find_files (const QString& dir_name); 197 void process_find_files (const QString& dir_name);
198 198
199 //! set a new directory or open a file 199 //! set a new directory or open a file
200 200
201 void display_directory (const QString& dir, bool set_octave_dir = true); 201 void display_directory (const QString& dir, bool set_octave_dir = true);
202 202
203 void open_item_in_app (const QModelIndex& index); 203 void open_item_in_app (const QModelIndex& index);
204 204
205 //! Variables for the actions 205 //! Variables for the actions
206 206
207 QToolBar *m_navigation_tool_bar; 207 QToolBar *m_navigation_tool_bar;
208 QAction *m_sync_octave_directory_action; 208 QAction *m_sync_octave_directory_action;
209 QAction *m_sync_browser_directory_action; 209 QAction *m_sync_browser_directory_action;
210 QAction *m_rename_action; 210 QAction *m_rename_action;
211 211
212 //! The file system model. 212 //! The file system model.
213 213
214 QFileSystemModel *m_file_system_model; 214 QFileSystemModel *m_file_system_model;
215 215
216 //! The file system view. 216 //! The file system view.
217 //!@{ 217 //!@{
218 QTreeView *m_file_tree_view; 218 QTreeView *m_file_tree_view;
219 QComboBox *m_current_directory; 219 QComboBox *m_current_directory;
220 //!@} 220 //!@}
221 221
222 //! Flag if syncing with Octave. 222 //! Flag if syncing with Octave.
223 223
224 bool m_sync_octave_dir; 224 bool m_sync_octave_dir;
225 225
226 //! The actual Octave directory. 226 //! The actual Octave directory.
227 227
228 QString m_octave_dir; 228 QString m_octave_dir;
229 229
230 enum { MaxMRUDirs = 10 }; 230 enum { MaxMRUDirs = 10 };
231 231
232 QStringList m_columns_shown; 232 QStringList m_columns_shown;
233 QStringList m_columns_shown_keys; 233 QStringList m_columns_shown_keys;
234 QList <QVariant> m_columns_shown_defs; 234 QList <QVariant> m_columns_shown_defs;
235 QSignalMapper *m_sig_mapper; 235 QSignalMapper *m_sig_mapper;
236 }; 236 };
237 237
238 OCTAVE_END_NAMESPACE(octave) 238 OCTAVE_END_NAMESPACE(octave)
239 239
240 #endif 240 #endif