bugGNU Octave - Bugs: bug #45844, Make double click in file explorer...

 
 

bug #45844: Make double click in file explorer open files with default app by default

Submitter:  Pantxo Diribarne <pantxo>
Submitted:  Sat 29 Aug 2015 03:20:33 PM UTC
   
 
Category:  GUI Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 19 Nov 2015 10:48:41 AM UTC, comment #16: 

Indeed:


>> load foo.jpg
error: load: unable to determine file format of 'foo.jpg'
>> load foo.png
error: load: foo.png: inconsistent number of columns near line 4



Avinoam Kalma <avinoam>
Group Member
Thu 19 Nov 2015 09:58:26 AM UTC, comment #15: 

In Octave 4.0 on linux the GUI tries to open your png in the editor so it means that "is_octave_data_file" returns false on linux while it returns true on windows.

Just to be sure the problem is in load-save.cc, what does those return on windows:


load foo.jpg
load foo.png


for me it returns the same for both: "error: load: unable to determine file format of 'foo.png'"

I expect that you'll get a different message for the png.

Pantxo Diribarne <pantxo>
Group Member
Thu 19 Nov 2015 08:27:27 AM UTC, comment #14: 

continue of comment #13:

but I do not think that it's a problem of this file.
It seems that Octave is trying to load it.
If I double click on this file with octave 4.0, I get
the same error message.

Avinoam Kalma <avinoam>
Group Member
Thu 19 Nov 2015 06:39:55 AM UTC, comment #13: 

attached problematic png file


Avinoam Kalma <avinoam>
Group Member
Thu 19 Nov 2015 06:22:17 AM UTC, comment #12: 

@Avinoam: can you attach th failing png?

Pantxo Diribarne <pantxo>
Group Member
Wed 18 Nov 2015 09:32:45 PM UTC, comment #11: 

Checking this under windows, the png wasn't open correctly:


sombrero
fmt = {"jpg", "png", "ps", "pdf"};
for ii = 1:numel (fmt)
  print (["foo." fmt{ii}])
endfor

### double click on foo.png:
>> error: load: C:/Octave/BUGS/foo.png: inconsistent number of columns near line 4


other files were open correctly.

Avinoam Kalma <avinoam>
Group Member
Wed 18 Nov 2015 08:46:20 PM UTC, comment #10: 

We indeed use a function "is_octave_data_file" which may be failing to distinguish some files from Octave data.

At least with files generated from Octave I don't see any failure:


sombrero
fmt = {"jpg", "png", "ps", "pdf"};
for ii = 1:numel (fmt)
  print (["foo." fmt{ii}])
endfor


All of those are open in the default application for me. Can you attached a failing file?

Pantxo Diribarne <pantxo>
Group Member
Wed 18 Nov 2015 08:23:46 PM UTC, comment #9: 

Checking this new feature on Windows I get for png and jpg files

+varbatim+
>> error: load: C:/Octave/bugs/a.png: inconsistent number of columns near line 4

>> error: load: C:/Octave/bugs/b.png: inconsistent number of columns near line 4

<<  error: load: C:/Octave/bugs/c.jpg: inconsistent number of columns near line 2
-verbatim-

For other jpeg file, the open was OK.
For pdf & ps files it works fine.

It seems to me that Octave is trying to load these files, and not
open them with external software.

Avinoam Kalma <avinoam>
Group Member
Sun 15 Nov 2015 08:43:15 PM UTC, comment #8: 

Thanks Torsten, I wrapped the changelog to 80 columns and pushed the patch to default:
http://hg.savannah.gnu.org/hgweb/octave/rev/fec7cc73507b

Closing report.

Pantxo Diribarne <pantxo>
Group Member
Sun 15 Nov 2015 08:06:00 PM UTC, comment #7: 

The patch works fine. Could you please wrap the comment lines to a max. width of 80 before pushing?

Torsten Lilge <ttl>
Group Member
Sat 14 Nov 2015 05:29:52 PM UTC, comment #6: 

I attached an updated patch in which I applied Torsten's suggestions. Can I push it to default?

(file #35463)

Pantxo Diribarne <pantxo>
Group Member
Tue 10 Nov 2015 12:29:50 PM UTC, comment #5: 

@Torsten: thanks for the review. I agree with both of your suggestions. I'll update your the patch (starting from your modified version) ASAP.

Pantxo Diribarne <pantxo>
Group Member
Sun 08 Nov 2015 02:48:29 PM UTC, comment #4: 

I have updated the patch to the newest changes in settings-dialog.ui (see attached file). Two questions/remarks:

  • Can we drop the menu entry "Open in default application"? I think it is the same as "Open" except for directories where we could add "Open in file explorer" instead of "Open in default application".
  • I suggest to put the default suffix list into the two settings->value () calls (settings-dialog and files-dock-widget) instead of adding it to the default settings file. This ensures that the default list is available after an update without generating a new settings file.



(file #35415)

Torsten Lilge <ttl>
Group Member
Tue 03 Nov 2015 06:37:37 PM UTC, comment #3: 

I attached a patch. The default files that opened in the editor would then be m,c,cc,cpp,h,txt. Other files are opened in the default application or loaded if they are data files (there is a function in place to detect that). One can also choose to open files in the editor using right click.


(file #35374)

Pantxo Diribarne <pantxo>
Group Member
Sat 29 Aug 2015 11:44:46 PM UTC, comment #2: 

+1, sounds like a good idea to me.

Rik <rik5>
Group administrator
Sat 29 Aug 2015 06:34:09 PM UTC, comment #1: 

Something for a user preference?

Philip Nienhuis <philipnienhuis>
Group Member
Sat 29 Aug 2015 03:20:33 PM UTC, original submission:  

Currently I often find my self closing png or pdf files I mistakingly opened in the editor due to a double click.

I know I can right-click on a file to be able to open it with the default application, but would like the inverse:

  • double-click: "open" files (default application), except for .m, .cc and a few other text based passed to "edit", .mat passed to "load". We could eventually make the list of file extensions that should be passed to "edit" modifiable in the preferences.
  • right-click: offer the possibility to "edit" or "load" a file.
Pantxo Diribarne <pantxo>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35497:  foo.png added by avinoam (276KiB - image/png)
file #35463:  default_open_v3.patch added by pantxo (13KiB - application/x-download)
file #35415:  default_open_v2.patch added by ttl (13KiB - text/x-diff)
file #35374:  default_open.patch added by pantxo (15KiB - application/x-download)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by ttl (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-19 avinoam Attached File- Added foo.png, #35497
    2015-11-15 pantxo StatusNone Fixed
        Open/ClosedOpen Closed
    2015-11-14 pantxo Attached File- Added default_open_v3.patch, #35463
    2015-11-08 ttl Attached File- Added default_open_v2.patch, #35415
    2015-11-03 pantxo Attached File- Added default_open.patch, #35374

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code