qutebrowser icon indicating copy to clipboard operation
qutebrowser copied to clipboard

Add an option to use the native filepicker for downloads

Open The-Compiler opened this issue 8 years ago • 16 comments

Some users would prefer a native filepicker dialog to the current statusbar input (without completion), so there should be an option to use that.

edit: In addition, this should allow to switch from the default behavior of using the native file dialog for uploads to using the statusbar input as well.

The-Compiler avatar Mar 24 '16 19:03 The-Compiler

+1 this is helpful when you want to preview images before uploading

pkillnine avatar Aug 15 '16 16:08 pkillnine

Hi, I'm trying to get involved in the development of Qutebrowser and I figured this may be a good place for me to start, could you tell me what files I should look at and any other tips you have for me. Thanks!

BunnyApocalypse avatar Sep 15 '17 18:09 BunnyApocalypse

Hey @BunnyApocalypse!

Right now is a bit of a bad timing as I have a quite big backlog (as I was busy with exams and then holidays until this week), and because a new config system is soon going to be merged, which will make contributions against the master branch conflict once that's in.

I'll get back to you in a few days though - if you don't hear back within a week or so, feel free to ping me again!

In the meantime, you might want to take a look at the contribution docs and get the testsuite to run on your machine.

The-Compiler avatar Sep 15 '17 20:09 The-Compiler

@The-Compiler Isn't this done already? I have no idea what the "statusbar input" is.

user202729 avatar Dec 16 '18 14:12 user202729

@user202729 What's the file prompt thingy nowadays used to be an input in the statusbar. However, this isn't done yet -- there still isn't an option to use Qt's native file picker instead.

The-Compiler avatar Dec 16 '18 14:12 The-Compiler

I have currently the problem that when using qutebrowser under Gnome 3.34, the GTK-file-chooser comes up when trying to upload files, but is not usable because it is listing only directories.

I don't mind which file-chooser comes up, but a non-functional one does not help me. When I read „native“, does this mean it will be an upload dialog like it is already done for saving files?

poinck avatar May 04 '20 19:05 poinck

@poinck The GTK file picker is the native file picker (rather than qutebrowser's), so this issue is pretty much the opposite of what you describe. You're probably seeing #5231, which is a Qt bug fixed in Qt 5.14.2.

The-Compiler avatar May 04 '20 19:05 The-Compiler

@The-Compiler Unfortunatly I have only 5.14.1 available on my distro. /:

poinck avatar May 04 '20 19:05 poinck

For downloads, this is also useful for Flatpak, see #4879. Additionally, it'd be nice to have a shortcut in qutebrowser's prompt to open the native one instead.

The-Compiler avatar Apr 19 '21 11:04 The-Compiler

For what it's worth, you can kind of use an external file manager in place of the download prompt if your external file manager has decent commandline options and you're willing to create an alias and trigger a custom userscript.

Here's a proof-of-concept userscript that downloads the current page and lets you choose a destination with the help of ranger:

#!/usr/bin/env bash
set -o errexit
set -o pipefail

if [ -z "$QUTE_FIFO" ] ; then
    help
    exit
fi

tmp_file="/tmp/qute-ranger-chosen"

if test -f "$tmp_file"; then
    rm "$tmp_file"
fi

xterm -e "ranger --choosedir=\"$tmp_file\" --show-only-dirs"

if test -f "$tmp_file"; then
    chosen="$(cat "$tmp_file")"
    rm "$tmp_file"
    xterm -e "read -p \"File to save as? [d]efault/(o)verwrite/(n)ew: \" -N 1 choice; echo \"\$choice\" > \"$tmp_file\""
    choice="$(cat "$tmp_file")"
    rm "$tmp_file"
    case $choice in
        o)
            xterm -e "ranger --choosefile=\"$tmp_file\" --selectfile=\"$chosen\""
            if test -f "$tmp_file"; then
                chosen="$(cat "$tmp_file")"
                rm "$tmp_file"
            fi
            ;;
        n)
            xterm -e "read -p \"Name: \" name; echo \"\$name\" > \"$tmp_file\""
            if test -f "$tmp_file"; then
                chosen="$chosen/$(cat "$tmp_file")"
                rm "$tmp_file"
            fi
            ;;
    esac
    echo "download --dest \"$chosen\"" >> "$QUTE_FIFO"
fi

chaorace avatar May 21 '21 16:05 chaorace

Given that we already have some discussion about using external filepickers for downloads in here, let's use this issue for both the Qt and external file pickers.

@AckslD maybe this is something you might want to pick up?

The-Compiler avatar May 31 '21 15:05 The-Compiler

@The-Compiler That would indeed be great. I have less bandwidth at the moment so if someone wants to pick it up, go ahead. Otherwise I might try go get some time but might take a bit longer :)

AckslD avatar Jun 07 '21 15:06 AckslD

Sure thing - we're not in a rush 🙂

The-Compiler avatar Jun 07 '21 16:06 The-Compiler

@The-Compiler I thought of trying to look into this again. Some time ago I tried to look through the code to see where to change how download selection is handled but couldn't completely figure it out. Maybe you have some pointers for roughly where in the code you see this happening. Otherwise I'll try a bit more to figure it out :)

AckslD avatar Aug 08 '21 09:08 AckslD

I've easily changed the file picker to ranger by using the fileselect.handler option, but apparently the download selector is a different story. It'd be great to be able to replace it with ranger, and better still to improve the default interface to allow autocomplete and a more natural interaction, closer to selectrum, for example... <3

agenbite avatar Dec 09 '21 10:12 agenbite

Reopening this as we still don't have a way to use the native file picker, see e.g. #8058. While that discussion shows a workaround via yad, that's somewhat awkward and won't work on all platforms.

The-Compiler avatar Jan 10 '24 18:01 The-Compiler