diff libinterp/corefcn/octave-link.h @ 17884:766ad9be2966

Prompt for non-existent new file when using edit.m from GUI (bug #40450) * libgui/src/octave-qt-link.cc(do_prompt_new_edit_file): New function to display question dialog. * libgui/src/octave-qt-link.h(do_prompt_new_edit_file): Add function to header file. * libinterp/corefcn/octave-link.cc(__octave_link_edit_file__): If 2nd argument present, display prompt dialog. * libinterp/corefcn/octave-link.h(prompt_new_edit_file): If octave-link enabled, use prompt dialog box. * scripts/miscellaneous/edit.m: Modify to use new prompt routine. CLI behavior is unchanged.
author Torsten <ttl@justmail.de>
date Fri, 08 Nov 2013 07:40:36 -0800
parents ebb3ef964372
children 09f5f95e5fcc
line wrap: on
line diff
--- a/libinterp/corefcn/octave-link.h	Thu Nov 07 10:39:30 2013 -0500
+++ b/libinterp/corefcn/octave-link.h	Fri Nov 08 07:40:36 2013 -0800
@@ -136,6 +136,12 @@
     return enabled () ? instance->do_edit_file (file) : false;
   }
 
+  static bool
+  prompt_new_edit_file (const std::string& file)
+  {
+    return enabled () ? instance->do_prompt_new_edit_file (file) : false;
+  }
+
   static int
   message_dialog (const std::string& dlg, const std::string& msg,
                   const std::string& title)
@@ -385,6 +391,7 @@
   virtual bool do_exit (int status) = 0;
 
   virtual bool do_edit_file (const std::string& file) = 0;
+  virtual bool do_prompt_new_edit_file (const std::string& file) = 0;
 
   virtual int
   do_message_dialog (const std::string& dlg, const std::string& msg,