diff libgui/src/files-dock-widget.cc @ 25408:ce725103ebf1

Fallback to open.m for opening files in the gui file browser (bug #50543) * files-dock-widget.h/cc (files_dock_widget::files_dock_widget): Update tree view tooltip. (files_dock_widget::open_any_signal): New signal. (files_dock_widget::display_directory): If the activated file is not a text file with specified extension, emit open_any_signal * main-window.cc (main_window::handle_open_any_request, main_window::handle_open_any_request): New slot and corresponding interpreter thread callback that calls the "open" function. (main_window::construct): Connect file browser open_any_signal to handle_open_any_request slot. * open.m: allow user defined openxxx functions to be called when specific "xxx" file extensions are met. Let ".ofig" files be open using hgload and "octave-workspace" files be loaded in the base workspace like ".mat" files
author Pantxo Diribarne <pantxo.diribarne@gmail.com>
date Wed, 15 Mar 2017 22:00:17 +0100
parents 5bb07f6e3707
children 3edae6ba1fcd
line wrap: on
line diff
--- a/libgui/src/files-dock-widget.cc	Wed May 23 17:12:57 2018 -0400
+++ b/libgui/src/files-dock-widget.cc	Wed Mar 15 22:00:17 2017 +0100
@@ -212,8 +212,7 @@
     m_file_tree_view->setSortingEnabled (true);
     m_file_tree_view->setAlternatingRowColors (true);
     m_file_tree_view->setAnimated (true);
-    m_file_tree_view->setToolTip (
-                                  tr ("Activate to open in editor, right click for alternatives"));
+    m_file_tree_view->setToolTip (tr ("Double click to open file/folder, right click for alternatives"));
 
     // get sort column and order as well as cloumn state (order and width)
 
@@ -388,13 +387,10 @@
 
             if (QFile::exists (abs_fname))
               {
-                if (is_octave_data_file (abs_fname.toStdString ()))
-                  emit load_file_signal (abs_fname);
-                else if (extensions.contains (suffix))
+                if (extensions.contains (suffix))
                   emit open_file (fileInfo.absoluteFilePath ());
                 else
-                  open_item_in_app (m_file_tree_view->selectionModel ()
-                                    ->currentIndex ());
+                  emit open_any_signal (abs_fname);
               }
           }
       }