diff libgui/src/main-window.h @ 27298:1805f8586179

new gui dialog for modifying octaves load path (bug #43549) Originally submitted by JunWang, Edited by Rik, jwe, and Torsten. * main-window.cc (main_window): initialize new m_settings_dlg class variable; (~main_window): delete set path dialog; (handle_set_path_dialog_request): new slot for opening the path dialog; (set_global_shortcuts): set shortcut for opening new path dialog; (construct_edit_menu): add and connect related action to the edit menu; (configure_shortcuts): read the shortcut from the preferences file * main-window.h: include path dialog header, new path variable and new action for dialog * module.mk: add new files * set-path-dialog.cc: new file (set_path_dialog): constructing the dialog with widgets and buttons, connecting all action signals, adding model object; (add_dir): open file dailog to select directory to be added to the path; (rm_dir): call rm_dir method in model object for removing selected dirs; (move_dir_up, move_dir_bottom, move_dir_top, move_dir_bottom): call related model object for moving selected dirs and update selection and view accordingly; * set-path-dialog.h: new header for path dialog * set-path-model.cc: new file for path dialog model (set_path_model): data signal connections and calling construct method; (to_string): make a string from the current list of directories; (model_to_path): set the octave path to the current model data; (clear): clear the current model data; (save): save current model data using savepath; (revert) reset the model data to the state from dialog start; (revert_last): Reset the model data to the state before the latest change; (add_dir): add a directory to the current model data and path; (rm_dir): remoce a directory from current model data and path; (move_dir_up, move_dir_down, move_dir_top, move_dir_bottom): move one ore more directory entries wihtin the path; (rowCount): retiurn the size if the current model data; (data): reimplemeneted method for returning data from the model; (construct): loading the current path into the model; (update_data): slot for update data signal * set-path-model.h: model header file * shortcut-manager.cc (do_init_data): initialize shortcut for path dialog with empty key sequence
author JunWang <jstzwj@aliyun.com>
date Mon, 22 Jul 2019 23:51:01 -0400
parents 871313d4b948
children 5f170ea12fa1
line wrap: on
line diff
--- a/libgui/src/main-window.h	Sun Jul 28 21:51:26 2019 -0700
+++ b/libgui/src/main-window.h	Mon Jul 22 23:51:01 2019 -0400
@@ -49,6 +49,7 @@
 #include "documentation-dock-widget.h"
 #include "files-dock-widget.h"
 #include "find-files-dialog.h"
+#include "set-path-dialog.h"
 #include "history-dock-widget.h"
 #include "octave-dock-widget.h"
 #include "qt-interpreter-events.h"
@@ -198,6 +199,8 @@
 
     void handle_octave_ready ();
 
+    void handle_set_path_dialog_request (void);
+
     //! Find files dialog.
     //!@{
     void find_files (const QString& startdir = QDir::currentPath ());
@@ -330,6 +333,7 @@
     QAction *m_new_figure_action;
     QAction *m_load_workspace_action;
     QAction *m_save_workspace_action;
+    QAction *m_set_path_action;
     QAction *m_preferences_action;
     QAction *m_exit_action;
 
@@ -386,6 +390,9 @@
 
     find_files_dialog *m_find_files_dlg;
 
+    //! Set path dialog
+    QPointer<set_path_dialog> m_set_path_dlg;
+
     //! Release notes window.
 
     QWidget *m_release_notes_window;