octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening unknown file types in external applications


From: Torsten
Subject: Re: opening unknown file types in external applications
Date: Wed, 24 Apr 2013 20:08:34 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 23.04.2013 23:51, John W. Eaton wrote:
> On 04/23/2013 05:27 PM, Michael Goffioul wrote:
>> On Tue, Apr 23, 2013 at 5:06 PM, John W. Eaton <address@hidden
>> <mailto:address@hidden>> wrote:
>>
>>     On 04/23/2013 02:58 PM, Torsten wrote:
>>
>>         This one should do the job:
>>
>>         QDesktopServices::openUrl (
>>              QUrl::fromLocalFile ( const QString&  localFile )
>>         );
>>
>>
>>     OK, that works great to open files with their default applications,
>>     but what's the best way to recognize the files that should be opened
>>     in the Octave GUI's built-in editor?
>>
>>     I don't see a general way to override the default editor or disable
>>     editing of text files so that openURL will return some kind of
>> "sorry,
>>     I don't know how to open that file" status so that we can handle them
>>     internally in Octave.  So it seems that we need to recognize the
>> files
>>     we want to handle first, then call openURL.  But nothing that I can
>>     think of (lists of filename patterns, binary vs. ASCII text, the Unix
>>     file program) really seems like a complete or reliable solution.
>>
>>
>> I suppose one "integrated" way to do it could be:
>> 1) support running octave as "octave -edit file.m": this would either
>> connect to an existing instance of octave and open the file in that
>> instance, or start a new octave instance
>> 2) define a .desktop file to handle m-files
> 
> Maybe.  But really, I was sort of looking for a bit simpler solution
> than "connecting to an existing instance of Octave".  That sounds like
> it would require some fairly significant changes that I'm not terribly
> excited about trying to implement at the moment.

Is it intended that *.m files are opened via the os and not in the built
in editor after changeset 16558:5fc1ce2947bd?

Torsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]