Skip to content

Changes to dialog api #10

Closed
Closed

Description

@probablycorey

In Atom, the open dialog is used to open a new window, or open a file in an existing window. So the api we need is a combination of dialog.openFile and dialog.openFolder where it doesn't matter if the user opens a file or a folder. We also could allow the user to open multiple files/folders.

So I propose we remove dialog.openMultiFiles dialog.openFile and dialog.openFolder with dialog.open

Activity

  1. zcbenz commented on May 17, 2013

    @zcbenz
    Contributor

    As with #9, current API follows Chromium's ui library, I'll reimplement the API along with changing the interface.

  2. zcbenz commented on Aug 1, 2013

    @zcbenz
    Contributor

    I'm now implementing the file dialog API for Windows, but the problem is: the standard Windows file dialog does not support selecting both files and directories, and there is no way to select multiple directories too. The same limitation exists in GTK+, so we would face the same problem when porting atom-shell on Linux.

    The only solution is to create custom file dialogs, but the work would be quite large, and it's very hard to make them behave similar to the standard ones. So I think maybe we should just separate the open of files from directories in Atom?

    /cc @probablycorey @kevinsawicki @nathansobo

  3. reopened this on Aug 1, 2013
  4. nathansobo commented on Aug 2, 2013

    @nathansobo

    @xpaulbettsx any advice on this? I'd love to keep the current behavior if we can.

  5. anaisbetts commented on Aug 2, 2013

    @anaisbetts
    Contributor

    @nathansobo As @zcbenz says, Windows and GTK+ aren't down with a file chooser picking both files and folders, it's either one or the other. What scenario do you need to pick both? Windows >= Vista does allow you to pick multiple directories afaik

  6. probablycorey commented on Aug 5, 2013

    @probablycorey
    Author

    Does this mean you can't open multiple files and directories at the same
    time in Windows and GTK+. Or does this mean there is no dialog that lets
    you open a file or a directory (one dialog only opens directories, and
    another only opens files).

    In OS X it is very common to use the same dialog to open either a single
    file or a single directory. So I think we need that functionality.

    On Fri, Aug 2, 2013 at 10:59 AM, Paul Betts [email protected]:

    @nathansobo https://github.com/nathansobo As @zcbenzhttps://github.com/zcbenzsays, Windows and GTK+ aren't down with a file chooser picking both files
    and folders, it's either one or the other. What scenario do you need to
    pick both? Windows >= Vista does allow you to pick multiple directories
    afaik

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-22022617
    .

  7. anaisbetts commented on Aug 5, 2013

    @anaisbetts
    Contributor

    Does this mean you can't open multiple files and directories at the same time in Windows and GTK+

    Exactly

    In OS X it is very common to use the same dialog to open either a single file or a single directory

    That part's fine

  8. probablycorey commented on Aug 5, 2013

    @probablycorey
    Author

    Ok, cool. I think it's fine if we can't open multiple files and directories
    at the same time in OS X.

    On Mon, Aug 5, 2013 at 11:03 AM, Paul Betts [email protected]:

    Does this mean you can't open multiple files and directories at the same
    time in Windows and GTK+

    Exactly

    In OS X it is very common to use the same dialog to open either a single
    file or a single directory

    That part's fine

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-22124534
    .

  9. zcbenz commented on Aug 6, 2013

    @zcbenz
    Contributor

    @xpaulbettsx do you mean that it's possible to use the same dialog to select either file or folder on Windows with Win32 API? Where can I find the related documentation or example?

  10. anaisbetts commented on Aug 6, 2013

    @anaisbetts
    Contributor

    @zcbenz Sure, check out http://msdn.microsoft.com/en-us/library/windows/desktop/bb776913(v=vs.85).aspx - afaik it's simply a matter of including / not including FOS_PICKFOLDERS

    Also, this code is not nearly as ugly as it looks, the Explorer team bans more than one return statement in a method, because they love code that looks like this:

                        }
                    }
    
                    delete bar;
                }
            }
        }
    }
  11. zcbenz commented on Aug 6, 2013

    @zcbenz
    Contributor

    @xpaulbettsx Thanks for the link!

    So on Windows we could support following dialogs:

    1. dialog to open single/multiple files
    2. dialog to open single folder
    3. dialog to open multiple folders (only on Windows >= Vista)
    4. dialog to open single file or folder (only on Windows >= Vista)

    @nathansobo @probablycorey Is it OK to discard Windows XP for Atom?

  12. anaisbetts commented on Aug 6, 2013

    @anaisbetts
    Contributor

    Is it OK to discard Windows XP for Atom?

    Please don't launch with XP support, it's a twelve-year old operating system. We don't support OS X 10.1 either, despite it actually being a month younger than Windows XP.

  13. probablycorey commented on Aug 6, 2013

    @probablycorey
    Author

    @zcbenz I'd be happy to support Windows >= Vista.

    On Tue, Aug 6, 2013 at 5:18 AM, Paul Betts [email protected] wrote:

    Is it OK to discard Windows XP for Atom?

    Please don't launch with XP support, it's a twelve-year old operating
    system. We don't support OS X 10.1http://en.wikipedia.org/wiki/Mac_OS_X_v10.1despite it actually being a month younger than Windows XP.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-22174685
    .

  14. zcbenz commented on Sep 5, 2013

    @zcbenz
    Contributor

    Close this for favor of #76.

  15. added a commit that references this issue on Jan 11, 2016
  16. added a commit that references this issue on Jun 26, 2016
  17. added a commit that references this issue on May 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions