Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

qTox uses Qt's file picker #3494

Closed
TheNain38 opened this issue Jul 7, 2016 · 44 comments
Closed

qTox uses Qt's file picker #3494

TheNain38 opened this issue Jul 7, 2016 · 44 comments
Labels
D-easy We estimate that the issue is easy to fix M-ui Affected Module: User Interface proposal-accepted

Comments

@TheNain38
Copy link
Contributor

Brief Description

OS: Windows
qTox version: v1.4.0-252-g34fb127
Commit hash: 34fb127
toxcore: 0.0.0
Qt: 5.5.1

Reproducible: Always

Steps to reproduce
  1. Use the button to send a file to someone
  2. See the file picker not being Windows' native one
Observed Behavior

A non pratical and weird file picker is used, and qTox is the only application to use that weird one, instead of the system one

Expected Behavior

qTox uses the system file picker on Windows

@antis81
Copy link
Contributor

antis81 commented Jul 7, 2016

Probably the only unweird file dialog on a weird system… :)

@zetok
Copy link
Contributor

zetok commented Jul 7, 2016

It's a regression due to #3447

@zetok zetok added C-bug The issue contains a bug report M-ui Affected Module: User Interface labels Jul 7, 2016
@antis81
Copy link
Contributor

antis81 commented Jul 7, 2016

@zetok

#ifdef Q_OS_WIN32
     Jada Windows bullshit blabla…
#else
    Everyone else…
#endif

It's not a regression, it's the way Windows likes to be "special"! 😄

@antis81
Copy link
Contributor

antis81 commented Jul 7, 2016

IOW: We decided for Qt's consistent rendering, which is totally fine and not weird (whatever that means…)!

@zetok
Copy link
Contributor

zetok commented Jul 7, 2016

@antis81 eh. The problem was that GTK decided to break things, and arch obviously had to use broken stuff, which resulted in qTox crashing when it tried to use (allegedly native, according to broken system info) file picker.

@zetok
Copy link
Contributor

zetok commented Jul 7, 2016

As for the PR, it made experience for anyone who was able to use native file picker simply horrible. Qt has a shitty file picker – while I didn't have support for native file picker on my system, there are systems where shitty Qt file picker is replaced with a nice native one that integrates well with users' system.

@antis81
Copy link
Contributor

antis81 commented Jul 8, 2016

Qt has a shitty file picker…

Does it? Interesting, to me it looks like - well, like a quite usual file-open-dialog, and a nice one as well:

qt-file-picker

Plus, it avoids unexpected crashes by incompatible or broken 3rd party libs. However, we can enhance that solution and introduce a settings flag, where users can chose to use a platform-independent, working solution or the system's "native" file-dialog. no problem.

Yet I'd like to know:
@TheNain38 What is weird? Is it weird, that you can chose a file? I suggest you post a screenshot of what it looks like on windows and probably someone with interest for this system will fix it for you.

@antis81 antis81 added proposal and removed C-bug The issue contains a bug report labels Jul 8, 2016
@zetok
Copy link
Contributor

zetok commented Jul 8, 2016

@antis81 yep, this one is crappy when compared to capabilities provided by a well-integrated, native file picker.

@antis81
Copy link
Contributor

antis81 commented Jul 8, 2016

@TheNain38 Pleas show your crappy explorer manager (aka screenshot), which will help greatly to get an experience about what your actual problem is. :)

I guess I'll add a settings flag and make it selectable by user.

@TheNain38
Copy link
Contributor Author

@antis81 Well, with the native file picker, you can go to the usual places, like, downloads etc... super easly, and it's much more convenient than Qt's file picker, which is pure shit, compared to what the system one can do, Qt's one work, but it's really, really... well, non convenient :)

@antis81
Copy link
Contributor

antis81 commented Jul 8, 2016

@TheNain38 Windows file picker is pure shit… :)

@TheNain38
Copy link
Contributor Author

@antis81 It's still muccch better than Qt's one, because it's well integrated into the system

@ElLamparto
Copy link

It is very nice file picker! Most of people will drag-and-drop files without using picker at all.

@antis81
Copy link
Contributor

antis81 commented Jul 8, 2016

@TheNain38 Ok, it's a neat game to play and I just love bashing Windows wherever possible. Sorry, can't help… :) Yet I respect you and you for sure have good arguments why using Windows works for you… If you read my comment above, you'll find, that I tried making a "conciliable offer", which is by making it selectable by the user, if he/she likes the "green" or the "blue" dialog better. This is quite simple to implement and unlike the native dialog, doesn't introduce a real regression. Agree'd?

@anoadragon453 Would you mind extending your recent PR #3447 and implement something like this:

namespace qTox {

class FileDialog {
    static inline QFileDialog::Options fileDialogOptions() {
        // read options from settings
        return Settings::getInstance().getFileDialogOptions();
    }

    static inline QString getOpenFileName(…) { 
        // set options depending on qTox settings
        QFileDialog::Options opts = fileDialogOptions();
        return QFileDialog::getOpenFileName(…, opts); 
    }

    // TODO: wrap all static public function from QFileDialog
};

}

@ElLamparto It is very nice file picker!…

Which one do you mean?

@TheNain38
Copy link
Contributor Author

TheNain38 commented Jul 8, 2016

@antis81 Yes, I saw that ^^ Else, I agree with adding a setting, to choose between Qt's file picker, and the native one, I suggest that using the native one as the default, it is better, since only some systems have problems, what is your opinion, on what I said?

@antis81
Copy link
Contributor

antis81 commented Jul 8, 2016

I suggest that first using the native one, is better…

Will become default, yep.

@anoadragon453
Copy link
Contributor

@antis81 Yep I can do that.

@Diadlo
Copy link
Member

Diadlo commented Jul 9, 2016

@antis81 I don't know how it seen on windows. But for me it's little bit ugly :(
spectacle jh1190

@antis81
Copy link
Contributor

antis81 commented Jul 9, 2016

@Diadlo Whoohoo, dark style. :) Looks like you are using a dark system theme, are you?

If so, qTox may set the "black" font in it's theming - which is wrong here. I'll have a look into that.

@Diadlo
Copy link
Member

Diadlo commented Jul 9, 2016

Yes, I use dark system theme

@antis81
Copy link
Contributor

antis81 commented Jul 9, 2016

@Diadlo I found the problem! Have a look into mainContent.css, which styles almost each and every widget in qTox and therefore creates a mixed up system/qTox style! This is basically not what we want, especially when "system dialogs appear".

@TheNain38 Please provide a screenshot of how it looks on windows. Probably also one for your native dialog.

@zetok CC

@TheNain38
Copy link
Contributor Author

TheNain38 commented Jul 9, 2016

@antis81 Also, there's one thing, Qt's file picker is in English, even if my system is set to French.
Qt:
qt
Native:
native

@antis81
Copy link
Contributor

antis81 commented Jul 9, 2016

@TheNain38 Probably your qTox is set to English??

@TheNain38
Copy link
Contributor Author

@antis81 No, it's set to French

@ovalseven8
Copy link
Contributor

=> #2499

@antis81 antis81 changed the title Windows, qTox uses a weird file picker qTox uses Qt's file picker Jul 10, 2016
@antis81
Copy link
Contributor

antis81 commented Jul 10, 2016

@ovalseven8 Thanks - so this one is actually (well, kind of) a duplicate. Please leave both open until PR is ready.

@TheNain38

No, it's set to French

You're right. I tried with German language on Lubuntu system. All of the UI elements (button, label, etc.) are translated, but the folders in the "left area" (favorites, places, or whatever you want to call it) are not. So translation is ~99%, but not like I'd expect it to be as a user.

@zetok
Copy link
Contributor

zetok commented Jul 10, 2016

@antis81 no, this isn't a duplicate. The other issue is a packaging problem, while this one is about regression in qTox code.

@ElLamparto
Copy link

@ALL, you spent time and energy on details like the file picker while under Linux audio hardly works (#3478) and video is practically inutilisable (I've opened a ticket a few months ago, but I cannot find it back).

@zetok
Copy link
Contributor

zetok commented Jul 15, 2016

@ElLamparto Both audio & video problems are largely there due to insufficient testing of merged audio & video stuff.

Have you tried to test PRs? If not, you might want to :)

@TheNain38
Copy link
Contributor Author

Is there any news on this?

@zetok
Copy link
Contributor

zetok commented Dec 1, 2016

No.

@ElLamparto
Copy link

@TheNain38, personally I like the Qt picker. Anyway, like most people, I use drag and drop to transfer files. Rarely the picker. For me it is a very, very low priority issue.

@Diadlo
Copy link
Member

Diadlo commented Feb 24, 2017

@antis81 suggest good solution: add file manager type selection to settings

@Diadlo Diadlo added the D-easy We estimate that the issue is easy to fix label Feb 24, 2017
@TheNain38
Copy link
Contributor Author

Is there anyone willing to take on this issue?

@Diadlo
Copy link
Member

Diadlo commented Jul 3, 2017

As I can see -- no one

@anoadragon453
Copy link
Contributor

Would this not just be a simple #ifdef Q_OS_WIN32 around the code file manager code block? I can take a look into this in a couple days.

@sudden6
Copy link
Member

sudden6 commented Jul 4, 2017

maybe we can even find a proper solution so we can use the native file dialog where possible and only use the Qt one where it's needed.

@anoadragon453
Copy link
Contributor

anoadragon453 commented Jul 4, 2017 via email

@sudden6
Copy link
Member

sudden6 commented Jul 4, 2017

Maybe we can use a system similar to https://github.com/qTox/qTox/blob/master/src/widget/systemtrayicon.cpp

And use a whitelist of working DE's for the native dialog?

@anoadragon453
Copy link
Contributor

That looks fine, as long as KDE having Qt's native one is fine.

...does KDE have it's own file picker?

@sudden6
Copy link
Member

sudden6 commented Jul 4, 2017

Yes, the KDE one is slightly different to the Qt one

@anoadragon453
Copy link
Contributor

Alright, well now one just has to figure out how to launch each of those from Qt pointing to a specific folder and we should be good. As I said I can take a crack at this, though possibly in a couple days, after July 4th and all that.

@sudden6
Copy link
Member

sudden6 commented Jul 4, 2017

IIRC switching to the native file picker is just changing a parameter to QFileDialog::getOpenFileName

Take your time and enjoy your holidays :)

@anoadragon453
Copy link
Contributor

Oh yeah, I forgot how nice Qt is.

Thanks :)

anoadragon453 added a commit to anoadragon453/qTox that referenced this issue Jul 5, 2017
The original reason that the Qt picker was used instead of the native
picker was that the native option would cause Nautilus/GNOME-based
pickers to hang.

The Qt picker has reduced functionality and does not integrate well
into themes, thus the native picker has been restored for all
distros/DEs besides GNOME.

Fixes qTox#3494
anoadragon453 added a commit to anoadragon453/qTox that referenced this issue Jul 6, 2017
The original reason that the Qt picker was used instead of the native
picker was that the native option would cause Nautilus/GNOME-based
pickers to hang.

The Qt picker has reduced functionality and does not integrate well
into themes, thus the native picker has been restored for all
distros/DEs besides GNOME.

Fixes qTox#3494
anoadragon453 added a commit to anoadragon453/qTox that referenced this issue Jul 6, 2017
The original reason that the Qt picker was used instead of the native
picker was that the native option would cause Nautilus/GNOME-based
pickers to hang.

This turned out to be due with a Qt bug with parenting Gtk windows. As a
result the parent of each file dialog window has been set to NULL,
eliminating the crash. As far as tests have shown, this produces no
adverse effects on either floating or tiling wms.

Fixes qTox#3494
anoadragon453 added a commit to anoadragon453/qTox that referenced this issue Jul 6, 2017
The original reason that the Qt picker was used instead of the native
picker was that the native option would cause Nautilus/GNOME-based
pickers to hang.

This turned out to be due with a Qt bug with parenting Gtk windows. As a
result the parent of each file dialog window has been set to NULL,
eliminating the crash. As far as tests have shown, this produces no
adverse effects on either floating or tiling wms.

Fixes qTox#3494
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
D-easy We estimate that the issue is easy to fix M-ui Affected Module: User Interface proposal-accepted
Projects
None yet
Development

No branches or pull requests

8 participants