bugGNU Octave - Bugs: bug #50543, Loading of figures (and other...

 
 

bug #50543: Loading of figures (and other objects) from Octave IDE

Submitted by:  Georg Wiora <gwiora>
Submitted on:  Tue 14 Mar 2017 01:22:59 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Feature Request
Status: In ProgressAssigned to: None
Originator Name: gwioraOpen/Closed: Open
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 16 Mar 2017 08:07:32 AM UTC, comment #5:

Thank you for your quick implementation pantxo!

To answer your question: Yes, Matlab allows overriding built in open functions.

Georg Wiora <gwiora>
Wed 15 Mar 2017 09:07:20 PM UTC, comment #4:

I attached a preliminary cset in which I implemented the modification of "open":

  • ".ofig" files are open using hgload
  • first check custom openxxx functions. This allows overiding the default behavior for known extension. Does Matlab allow users to override the default behavior for e.g. .mat files (defining a "openmat" function)?

I also modified the file browser to fallback to make use of "open".

(file #40009)

Pantxo Diribarne <pantxo>
Project Member
Wed 15 Mar 2017 10:37:05 AM UTC, comment #3:

This solution would be preferable in my opinion. It would allow a free configuration for various file types.

Therefore it would be nice if a central "openAny.m" octave function would be called that could be used to handle the file recognition.

This kind of interface is limited to load functions returning a single argument. Therefore using varargout as for results may be more suitable.

Georg Wiora <gwiora>
Wed 15 Mar 2017 10:14:45 AM UTC, comment #2:

What about using the same mechanism than Matlab by using "open" and its extension "openxxx" when double-clicking on a file?

https://www.mathworks.com/help/matlab/ref/open.html#description

Guillaume <gyom>
Tue 14 Mar 2017 06:27:59 PM UTC, comment #1:

Hi,

>> So .mat files could be restored with "load()" ...

This is already the case: double clicking on a data file will load variables in the base workspace

>> ... and saved figures with hgload()

Since .ofig files are data files, the structure they contain is also loaded as a variable in the base workspace, but it would be easy to implement this. The function to modify is files_dock_widget::display_directory (in files-dock-widget.cc).

Pantxo Diribarne <pantxo>
Project Member
Tue 14 Mar 2017 01:22:59 PM UTC, original submission:

I whish to open other file types than .m files from octave gui file browser. Especially .mat and .ofig files would be useful.

The current standard behavior for unknown file types is calling the operating systems standard open method.

Preferably calling a configurable octave method could be usefull.

So .mat files could be restored with "load()" and saved figures with hgload().

Georg Wiora <gwiora>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #40009:  opencustom.patch added by pantxo (6KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gyom (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by gwiora (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 15 Mar 2017 09:07:20 PM UTCpantxoAttached File-=>Added opencustom.patch, #40009
      StatusConfirmed=>In Progress
    Tue 14 Mar 2017 06:27:59 PM UTCpantxoStatusNone=>Confirmed
      Release4.2.1=>dev

    Back to the top


    Powered by Savane 3.1-cleanup1