Opened 8 years ago

Last modified 3 years ago

#4164 new defect

OMEdit / OMNotebook do not open files at start on OS X

Reported by: Henning Kiel Owned by: Adeel Asghar
Priority: high Milestone:
Component: OMEdit Version: v1.11.0
Keywords: Cc: Martin Sjölund

Description

On Linux and Windows, when dragging a .mo (.onb) file onto OMEdit (OMNotebook) the corresponding program is started and that file is opened (via argc/argv).

On OS X this is not the case (argc is always 1). Instead an event is generated which shall handle opening of that file.
See http://doc.qt.io/qt-5/qfileopenevent.html

Attachments (2)

error.png (39.0 KB ) - added by Henning Kiel 8 years ago.
libbrowser.png (21.9 KB ) - added by Henning Kiel 8 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by Adeel Asghar, 8 years ago

I don't have OSX so can't test it.
Can you try 7c09963/OMEdit?

There could be so many reasons if the above code doesn't work.

From the documentation you need to have Info.plist. If that is the case then we might need to ask Martin to include it with OSX installation. But I guess is only needed if you double click on mo file from Finder. Dragging should work.

I wonder if QFileOpenEvent is sent before I install the event filter.

comment:2 by Henning Kiel, 8 years ago

I compiled and tested it locally and it does not work. I cannot even drop a file on the OMEDit icon.

When I drop a file in OMEdit it does not work either.
I drop to library browser, no error box, but model is not loaded -> see libbrowser.png
I drop to central view (with the OM news) I get an error box -> see error.png

by Henning Kiel, 8 years ago

Attachment: error.png added

by Henning Kiel, 8 years ago

Attachment: libbrowser.png added

comment:3 by Henning Kiel, 8 years ago

OMNotebook is now fixed OMNotebook#15.

I added a custom Info.plist for OMEdit, but event handling is not fixed.
Also, drag and drop does not open the .mo file, but adds trash text to the library browser as shown in the above attachments.

comment:4 by Adeel Asghar, 8 years ago

The dragging is related to this Qt bug. We need to use Qt 5 since in latest version of OSX the dragged file is NSURL.

I will see if I can fix the double click issue.

comment:5 by Adeel Asghar, 8 years ago

Now you should be able to open the file using double click.
Fixed in d2a0ff4/OMEdit.

comment:6 by Henning Kiel, 8 years ago

Double click is indeed fixed.

Do you need to change anything for the dragging, or is it just using Qt5 libs?
You can close this ticket if nothing has to be changed.

comment:7 by Adeel Asghar, 8 years ago

We should keep this ticket open. Once we move to qt5 then we need to fix dragging.

comment:8 by Adeel Asghar, 8 years ago

Milestone: 1.11.01.12.0

Milestone changed to 1.12.0 since 1.11.0 was released.

comment:9 by Adeel Asghar, 7 years ago

Milestone: 1.12.0Future

comment:10 by Henning Kiel, 6 years ago

I tried to compile with qt5 on mac, and I succeeded for OMPlot, OMNotebook and OMShell. OMEdit failed with qjson telling me

Qt5 found
-- Qt5 doesn't set std=c++11 in CMAKE_CXX_FLAGS / CMAKE_C_FLAGS / CMAKE_CXX_FLAGS_RELEASE: [-O2 -fno-stack-protector -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII / -O2 -fno-stack-protector / -O3 -DNDEBUG]
-- Configuring done
CMake Error in src/CMakeLists.txt:
  No known features for CXX compiler

  "Clang"

  version 8.0.0.

comment:11 by Francesco Casella, 6 years ago

Milestone: Future1.14.0

comment:12 by Martin Sjölund, 6 years ago

My guess is that's because qjson uses cmake instead of qmake like all other Qt projects. We've had some problems with it in the past...

comment:13 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:14 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:15 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:16 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.