Mercurial > octave
diff libgui/src/files-dock-widget.h @ 24733:e15d53d2de1e
move more GUI classse inside octave namespace
* documentation-dock-widget.h, documentation-dock-widget.cc,
files-dock-widget.h, files-dock-widget.cc, find-files-dialog.h,
find-files-dialog.cc, find-files-model.h, find-files-model.cc,
history-dock-widget.h, history-dock-widget.cc, terminal-dock-widget.h,
terminal-dock-widget.cc: Move classes inside octave namespace.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 11 Feb 2018 09:20:36 -0500 |
parents | 194eb4bd202b |
children | 6652d3823428 |
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.h Sat Feb 10 23:32:04 2018 -0500 +++ b/libgui/src/files-dock-widget.h Sun Feb 11 09:20:36 2018 -0500 @@ -40,167 +40,170 @@ #include <QComboBox> #include "octave-dock-widget.h" -//! Dock widget to display files in the current directory. - -class files_dock_widget : public octave_dock_widget +namespace octave { - Q_OBJECT + //! Dock widget to display files in the current directory. -public: + class files_dock_widget : public octave_dock_widget + { + Q_OBJECT - files_dock_widget (QWidget *parent = nullptr); + public: - ~files_dock_widget (void) = default; + files_dock_widget (QWidget *parent = nullptr); -public slots: + ~files_dock_widget (void) = default; - //! Slot for handling a change in directory via double click. + public slots: - void item_double_clicked (const QModelIndex & index); + //! Slot for handling a change in directory via double click. - //! Slot for handling the up-directory button in the toolbar. + void item_double_clicked (const QModelIndex & index); - void change_directory_up (void); + //! Slot for handling the up-directory button in the toolbar. - //! Slot for handling the sync octave directory button in the toolbar. + void change_directory_up (void); - void do_sync_octave_directory (void); + //! Slot for handling the sync octave directory button in the toolbar. - //! Slot for handling the sync browser directory button in the toolbar. + void do_sync_octave_directory (void); - void do_sync_browser_directory (void); + //! Slot for handling the sync browser directory button in the toolbar. - //! Sets the current directory being displayed. + void do_sync_browser_directory (void); - void set_current_directory (const QString& dir); + //! Sets the current directory being displayed. - //! Accepts user input a the line edit for the current directory. + void set_current_directory (const QString& dir); - void accept_directory_line_edit (void); + //! Accepts user input a the line edit for the current directory. - //! Set the internal variable that holds the actual octave variable. + void accept_directory_line_edit (void); - void update_octave_directory (const QString& dir); + //! Set the internal variable that holds the actual octave variable. - //! Tells the widget to react on changed settings. + void update_octave_directory (const QString& dir); - void notice_settings (const QSettings *settings); + //! Tells the widget to react on changed settings. - void save_settings (void); + void notice_settings (const QSettings *settings); -private slots: + void save_settings (void); - void headercontextmenu_requested (const QPoint& pos); - void toggle_header (int col); + private slots: + + void headercontextmenu_requested (const QPoint& pos); + void toggle_header (int col); - //! Context menu wanted. + //! Context menu wanted. - void contextmenu_requested (const QPoint& pos); + void contextmenu_requested (const QPoint& pos); - //! Context menu actions. - //!@{ - void contextmenu_open (bool); - void contextmenu_open_in_editor (bool); - void contextmenu_open_in_app (bool); - void contextmenu_copy_selection (bool); - void contextmenu_run (bool); - void contextmenu_load (bool); - void contextmenu_rename (bool); - void contextmenu_delete (bool); - void contextmenu_newfile (bool); - void contextmenu_newdir (bool); - void contextmenu_setcurrentdir (bool); - void contextmenu_findfiles (bool); - //!@} + //! Context menu actions. + //!@{ + void contextmenu_open (bool); + void contextmenu_open_in_editor (bool); + void contextmenu_open_in_app (bool); + void contextmenu_copy_selection (bool); + void contextmenu_run (bool); + void contextmenu_load (bool); + void contextmenu_rename (bool); + void contextmenu_delete (bool); + void contextmenu_newfile (bool); + void contextmenu_newdir (bool); + void contextmenu_setcurrentdir (bool); + void contextmenu_findfiles (bool); + //!@} - //! Popdown menu options. - //!@{ - void popdownmenu_newfile (bool); - void popdownmenu_newdir (bool); - void popdownmenu_search_dir (bool); - void popdownmenu_findfiles (bool); - void popdownmenu_home (bool); - //!@} + //! Popdown menu options. + //!@{ + void popdownmenu_newfile (bool); + void popdownmenu_newdir (bool); + void popdownmenu_search_dir (bool); + void popdownmenu_findfiles (bool); + void popdownmenu_home (bool); + //!@} - //! Inherited from octave_doc_widget. - //!@{ - void copyClipboard (); - void pasteClipboard (); - void selectAll (); - //!@} + //! Inherited from octave_doc_widget. + //!@{ + void copyClipboard (); + void pasteClipboard (); + void selectAll (); + //!@} -signals: + signals: - //! Emitted, whenever the user requested to open a file. + //! Emitted, whenever the user requested to open a file. - void open_file (const QString& fileName); + void open_file (const QString& fileName); - //! Emitted, whenever the currently displayed directory changed. + //! Emitted, whenever the currently displayed directory changed. - void displayed_directory_changed (const QString& dir); + void displayed_directory_changed (const QString& dir); - //! Emitted, whenever the user requested to load a file. + //! Emitted, whenever the user requested to load a file. - void load_file_signal (const QString& fileName); + void load_file_signal (const QString& fileName); - //! Emitted, whenever the user requested to run a file. + //! Emitted, whenever the user requested to run a file. - void run_file_signal (const QFileInfo& info); + void run_file_signal (const QFileInfo& info); - //! Emitted, whenever wants to search for a file . + //! Emitted, whenever wants to search for a file . - void find_files_signal (const QString& startdir); + void find_files_signal (const QString& startdir); - //! Emitted, whenever the user removes or renames a file. + //! Emitted, whenever the user removes or renames a file. - void file_remove_signal (const QString& old_name, const QString& new_name); + void file_remove_signal (const QString& old_name, const QString& new_name); - //! Emitted, when a file or directory is renamed. + //! Emitted, when a file or directory is renamed. - void file_renamed_signal (bool); + void file_renamed_signal (bool); -private: + private: - void process_new_file (const QString& parent_name); - void process_new_dir (const QString& parent_name); - void process_set_current_dir (const QString& parent_name); - void process_find_files (const QString& dir_name); + void process_new_file (const QString& parent_name); + void process_new_dir (const QString& parent_name); + void process_set_current_dir (const QString& parent_name); + void process_find_files (const QString& dir_name); - //! set a new directory or open a file + //! set a new directory or open a file - void display_directory (const QString& dir, bool set_octave_dir = true); + void display_directory (const QString& dir, bool set_octave_dir = true); - void open_item_in_app (const QModelIndex& index); + void open_item_in_app (const QModelIndex& index); - //! Variables for the actions + //! Variables for the actions - QToolBar *m_navigation_tool_bar; - QAction *m_sync_octave_directory_action; - QAction *m_sync_browser_directory_action; + QToolBar *m_navigation_tool_bar; + QAction *m_sync_octave_directory_action; + QAction *m_sync_browser_directory_action; - //! The file system model. + //! The file system model. - QFileSystemModel *m_file_system_model; + QFileSystemModel *m_file_system_model; - //! The file system view. - //!@{ - QTreeView *m_file_tree_view; - QComboBox *m_current_directory; - //!@} + //! The file system view. + //!@{ + QTreeView *m_file_tree_view; + QComboBox *m_current_directory; + //!@} - //! Flag if syncing with Octave. + //! Flag if syncing with Octave. + + bool m_sync_octave_dir; - bool m_sync_octave_dir; + //! The actual Octave directory. - //! The actual Octave directory. + QString m_octave_dir; - QString m_octave_dir; + enum { MaxMRUDirs = 10 }; - enum { MaxMRUDirs = 10 }; - - QStringList m_columns_shown; - QStringList m_columns_shown_keys; - QSignalMapper *m_sig_mapper; -}; + QStringList m_columns_shown; + QStringList m_columns_shown_keys; + QSignalMapper *m_sig_mapper; + }; +} #endif