Vixen
02b45cc4
csharp
public sealed class LinuxDialogs

The Linux file pickers, through whichever of them the session has.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

KDE's first under KDE, GNOME's otherwise. A picker is where the user's places, recent files and remote mounts live, and those belong to their desktop rather than to their distribution — a KDE user given zenity's picker is shown somebody else's bookmarks. XDG_CURRENT_DESKTOP is what the session sets to say which it is, and it is what is read here. Where neither program is installed there is no picker, the platform does not report NativeDialogs, and the methods return nothing-chosen — which is the case every caller already handles for a user who pressed Cancel.

qarma and matedialog are zenity. Both are re-implementations of its command line, and both are what a distribution that does not ship GNOME's copy ships instead. Trying them costs one PATH lookup each.

There is no owner window. Neither program takes one — they are separate processes, and the window manager decides where their dialog goes. Under Wayland it could not be parented anyway, since a client is not told its own position and cannot address another client's surface. So owner is accepted and ignored, which is what the parameter's "where the platform has sheets" is there to allow.

Fields and properties (1)

  • public static bool IsAvailable

    Whether a picker program is installed at all.

Methods (6)

  • public LinuxDialogs(INativeDialogs fallback)

    The Linux file pickers, through whichever of them the session has.

  • public ValueTask<string?> OpenFileAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))

    Asks the user to pick one existing file.

  • public ValueTask<IReadOnlyList<string>> OpenFilesAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))

    Asks the user to pick one or more existing files.

  • public ValueTask<string?> SaveFileAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))

    Asks the user where to save.

  • public ValueTask<string?> OpenFolderAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))

    Asks the user to pick a folder.

  • public ValueTask<MessageBoxResult> ShowMessageAsync(MessageBoxOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))

    Shows the message box the portable implementation shows.

Used by (1)

  • LinuxPlatformSupplementVixen.Platform.Linux