changeset 27306:82ace1225a9c

update path dialog if path is changed from withtin the file browser * files-dock-widget.cc (contextmenu_add_to_path): emit signal for changed path after having chnged the path * files-dock-widget.h: new signal path_changed_signal; * main-window.cc (handle_set_path_dialog_request): connect path update signal with the new slot in the path dialog * set-path-dialog.cc (update_model): new slot for signals indicating an external path update * set-path-dialog.h: new public slot update_model
author Torsten Lilge <ttl-octave@mailbox.org>
date Wed, 31 Jul 2019 16:46:02 +0200
parents d20c31be3160
children 7a7709bfb5af
files libgui/src/files-dock-widget.cc libgui/src/files-dock-widget.h libgui/src/main-window.cc libgui/src/set-path-dialog.cc libgui/src/set-path-dialog.h
diffstat 5 files changed, 20 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.cc	Wed Jul 31 16:45:56 2019 +0200
+++ b/libgui/src/files-dock-widget.cc	Wed Jul 31 16:46:02 2019 +0200
@@ -819,7 +819,7 @@
     if (infos.length () > 0)
       {
         emit interpreter_event
-          ([dir_list, rm, subdirs] (interpreter& interp)
+          ([dir_list, rm, subdirs, this] (interpreter& interp)
           {
             // INTERPRETER THREAD
 
@@ -838,6 +838,8 @@
               Frmpath (interp, paths);
             else
               Faddpath (interp, paths);
+
+            emit path_changed_signal ();
           });
       }
   }
--- a/libgui/src/files-dock-widget.h	Wed Jul 31 16:45:56 2019 +0200
+++ b/libgui/src/files-dock-widget.h	Wed Jul 31 16:46:02 2019 +0200
@@ -170,6 +170,10 @@
 
     void file_renamed_signal (bool);
 
+    //! Emitted, when the load path was changed.
+
+    void path_changed_signal (void);
+
   private:
 
     //! Get currently selected QFileInfo object.
--- a/libgui/src/main-window.cc	Wed Jul 31 16:45:56 2019 +0200
+++ b/libgui/src/main-window.cc	Wed Jul 31 16:46:02 2019 +0200
@@ -1630,6 +1630,9 @@
     m_set_path_dlg->setModal (false);
     m_set_path_dlg->setAttribute (Qt::WA_DeleteOnClose);
     m_set_path_dlg->show ();
+
+    connect (m_file_browser_window, SIGNAL (path_changed_signal (void)),
+             m_set_path_dlg, SLOT (update_model (void)));
   }
 
   void main_window::find_files (const QString& start_dir)
--- a/libgui/src/set-path-dialog.cc	Wed Jul 31 16:45:56 2019 +0200
+++ b/libgui/src/set-path-dialog.cc	Wed Jul 31 16:46:02 2019 +0200
@@ -150,6 +150,12 @@
   {
   }
 
+  void set_path_dialog::update_model (void)
+  {
+    set_path_model *m = static_cast<set_path_model *> (m_path_list->model ());
+    m->path_to_model ();
+  }
+
   void set_path_dialog::add_dir(void)
   {
     QString dir
--- a/libgui/src/set-path-dialog.h	Wed Jul 31 16:45:56 2019 +0200
+++ b/libgui/src/set-path-dialog.h	Wed Jul 31 16:46:02 2019 +0200
@@ -44,6 +44,10 @@
 
     virtual ~set_path_dialog (void);
 
+  public slots:
+
+    void update_model (void);
+
   private slots:
 
     void add_dir(void);