Drag and Drop to open files, OSX

edited November 2015 in KLayout Support
Hello,

On OSX, in the previous versions of KLayout, e.g., 0.23.2, one could drag one or more GDS files from the Finder into the KLayout window. KLayout would then open them.

In the new version, 0.24.2, this no longer works. Instead, I get an error message, such as

Unable to open file: /.file/id=6571367.28392452 (errno=20)

Unable to open file: /.file/id=6571367.28350353 (errno=20)

Comments

  • edited November -1

    Hello,

    I could reproduce the problem.

    I've also confirmed that "klayout.0.23.2.pkg" can accept drag & drop on Yosemite as you pointed out.

    If fact, I have not noticed this issue at all since I seldom use Finder as a filer.

    For other filers (I mainly use) listed below, drag & drop works as expected.

    1) ForkLift 2.6.6
    2) PathFinder 7.2.1
    3) double commander 0.6.6 beta
    4) Alpha Commander 1.0
    5) Krusader 2.4.0 beta3 (MacPorts)
    

    No need to say, Finder is the official filer for Mac.

    I think I need to study the event handling mechanism between Finder and Mac Qt4.

    Kazzz

  • edited November -1

    Hello,

    A little progress of tonight :-)

    I have inserted some debug statements in "src/layMainWindow.cc" and tested how

    MainWindow::dropEvent(QDropEvent *event)
    

    works.

    It is obvious that except for Mac Finder, the full path to a dropped file is normally retrieved.

    I'll study how to handle Mac Finder's case.

    Kazzz

    @@@ Double Commander @@@
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/inv.gds2
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/sample.lyp
    
    @@@ Fork Lift @@@
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/inv.gds2
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/sample.lyp
    
    @@@ Alpha Commander @@@
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/Abacus.gds
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/sample.lyp
    
    @@@ Path Finder @@@
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/nand2.gds2
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/sample.lyp
    
    @@@ Krusader @@@
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/xor.gds2
    ### The value of <path> = ${HOME}/Downloads/KLayout/source/sample.lyp
    
    @@@ Mac Finder @@@
    ### The value of <path> = /.file/id=6571367.1783076
    *** ERROR: Unable to open file: /.file/id=6571367.1783076 (errno=20)
    2015-11-09 21:40:29.166 klayout[25981:3735487] modalSession has been exited prematurely
       - check for a reentrant call to endModalSession:
    ### The value of <path> = /.file/id=6571367.3614123
    *** ERROR: Unable to open file: /.file/id=6571367.3614123 (errno=20)
    2015-11-09 21:40:40.466 klayout[25981:3735487] modalSession has been exited prematurely
       - check for a reentrant call to endModalSession:
    
  • edited November -1

    Hello,

    Basically this is a bug of Qt-4.8.x (the Mac binary packages use 4.8.7 from Mac Ports)

    and has been fixed in Qt-5.4.1.

    More precisely, such a URL (file:///.file/id=......) is called "File Reference URL" in OSX and iOS terminology.

    This has to be converted back to its ordinary full path. This step fails.

    Since KLayout uses "Qt Version 4.5.x or later (4.5.2, 4.6.3, 4.7.4 and 4.8.2)"

    we need to find out a workaround for this issue.

    The URL below gives a good suggestion, which I've taken into "layMainWindow.cc".

    https://bugreports.qt.io/browse/QTBUG-40449
    

    A new binary package "klayout-0.24.3-MacOSX-Yosemite-2-Qt487mp.dmg.bz2"

    (to be uploaded by Matthias shortly) has resolved this issue including "DRC crashing" issue started by lukasc.

    Thanks to lukasc for posting these two OSX-related issues.

    Regards,

    Kazzz

  • edited November -1

    Thanks Kazzz!

    Here's another minor "bug".

    The Key Bindings don't seem to work for the toolbar objects. For example, edit_mode.mode_menu.instance, Instance – setting this to "i", and pressing "i" doesn't do anything. Same for "m" for move.

    I recall noticing this issue several years ago.

    Escape works – returning you to the "Select" mode.

    While discussing the Key Bindings, it would be nice if the dialog showed command instead of ctrl (or perhaps a conversion table under the on-screen instructions).

    thank you.

  • edited November -1

    Hi lukasc,

    Using the forth coming new binary package "klayout-0.24.3-MacOSX-Yosemite-2-Qt487mp.dmg.bz2"

    I've tested the key binding issue you mentioned above.

    To support my explanation, I've uploaded an image file and a movie file to Dropbox.

    (1) KLayout-KeyBind-OSX.png :: my key bindings (KLayout default)
        https://www.dropbox.com/s/hfm230207i8eniz/KLayout-KeyBind-OSX.png?dl=0
    
    (2) KLayout-KeyBind-OSX.mov
        https://www.dropbox.com/s/6j3kb7t0qff38kj/KLayout-KeyBind-OSX.mov?dl=0
    
        where I'm typing keys in the following sequence.
              M --> R --> G --> B --> X --> P --> I --> L --> S
    

    As you can see, everything is fine.

    I think the issue has already been fixed.

    Please try the new one!

    Regards,

    Kazzz

  • edited November 2015

    Thank you.

    The latest version on klayout.de is 0.24.2, and your Dropbox link is 5 days old:

    https://www.dropbox.com/s/73v7uelklbcjvr8/klayout-0.24.3-MacOSX-Yosemite-1-Qt487mp.dmg.bz2?dl=0

    I downloaded this, and confirm that the DRC is fixed!

    However, I am still having the key binding problem.

    Do you have a new one you could share?

    thanks

  • edited November -1

    Hi,

    Here it is.

    https://www.dropbox.com/s/sjqvvztw2193ztw/klayout-0.24.3-MacOSX-Yosemite-2-Qt487mp.dmg.bz2?dl=0
    

    Kazzz

  • edited November -1

    Got it, but still experiencing the key binding problem.

    My key bindings:

    https://www.dropbox.com/s/vebf3k0vxvzoods/Screenshot 2015-11-13 03.38.01.png?dl=0

    Same problem. When I push "x" or Shift "x", nothing happens. Same for "I", "L", etc.

  • edited November -1

    Hi,

    Where do you have your "klayoutrc" file?

    In my case, it is ${HOME}/.klayout/klayoutrc

    I've saved (renamed) the existing one and started KLayout-0.24.3 afresh then

    set up the 9 key bindings below from scratch. By default they are not set.

    edit_menu.mode_menu.box:B;
    edit_menu.mode_menu.instance:I;
    edit_menu.mode_menu.move:M;
    edit_menu.mode_menu.partial:L;
    edit_menu.mode_menu.path:P;
    edit_menu.mode_menu.polygon:G;
    edit_menu.mode_menu.ruler:R;
    edit_menu.mode_menu.select:S;
    edit_menu.mode_menu.text:X;
    

    The newly created "klayoutrc" file is here:

    https://www.dropbox.com/s/msq3txrpb25ci9h/klayoutrc-Kazzz?dl=0
    

    Backup your "klayoutrc" file and save above in the name of "klayoutrc"

    then try to see what happens.

    Regards,

    Kazzz

  • edited November -1

    Hi Kazzz,

    You're right, it works. I guess I'll start from scratch and re-enter my preferences...

Sign In or Register to comment.