Git Product home page Git Product logo

Comments (6)

marvin1099 avatar marvin1099 commented on June 2, 2024 1

Thank you.
Hopefully it gets implemented at some point, I have my fingers crossed.

from xournalpp.

rolandlo avatar rolandlo commented on June 2, 2024

I don't think we can change that behaviour with the GtkFileChooser. So I'm closing the issue.

from xournalpp.

marvin1099 avatar marvin1099 commented on June 2, 2024

Im currius, why are you using the gdk filepicker, is it not possible to use system defaut (i have seen something about "xdg-desktop-portal", might not be correct).
Im not shure if it is hard to use the sytem default, i know it is somewath simple on windows, but not shure about linux.

from xournalpp.

rolandlo avatar rolandlo commented on June 2, 2024

Hmm, maybe I closed the issue prematurely. We could use the Gtk.FileChooserNative instead. It does offer less features and we may need some of those (not sure). One would have to check if that one supports single click when it's the system's default.
The plugin API (via app.getFilePath or app.saveAs) uses the native dialog. You could check there if single click is supported.

from xournalpp.

marvin1099 avatar marvin1099 commented on June 2, 2024

So i have tested a python script that uses Gtk.FileChooserNative and it works single click (it just runs the default filechooser as expected, so works perfectly).
Here is the code i used for testing (It probably wont be much use, but it can't hurt):

#!/usr/bin/env python3

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

class FileChooserExample(Gtk.Window):

    def __init__(self):
        Gtk.Window.__init__(self, title="FileChooser Example")
        self.set_border_width(10)

        button = Gtk.Button(label="Select a file")
        button.connect("clicked", self.on_file_clicked)

        self.add(button)

    def on_file_clicked(self, widget):
        dialog = Gtk.FileChooserNative(title="Select a file",
                                       action=Gtk.FileChooserAction.OPEN)
        dialog.set_transient_for(self)

        response = dialog.run()
        if response == Gtk.ResponseType.ACCEPT:
            print("File selected: " + dialog.get_filename())
        elif response == Gtk.ResponseType.CANCEL:
            print("Canceled file selecttion")

        dialog.destroy()

win = FileChooserExample()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

So when i run the app like this

python ./Test.py

it reports

File selected: /home/marvin/Downloads/pras-first-h.png

Expected behavior overall.
I'm not sure what of GtkFileChooser you are using, but if the app is just grabbing the path then this should work.

It would be great if it was implemented.
For saving and loading of course, that would make the file selection so much easyer.

from xournalpp.

marvin1099 avatar marvin1099 commented on June 2, 2024

Hmm, maybe I closed the issue prematurely. We could use the Gtk.FileChooserNative instead. It does offer less features and we may need some of those (not sure). One would have to check if that one supports single click when it's the system's default. The plugin API (via app.getFilePath or app.saveAs) uses the native dialog. You could check there if single click is supported.

Please consider reopening the issue,
as a alternative title it could also say "Request to change GtkFileChooser to GtkFileChooserNative".
If you still don't think this should be something that is part of the project, than say so and i put a pin on it.
If you don't answer in like a weak, i will just open a new issue, to get this reconsidered.
Thanks for all comments and input.

from xournalpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.