File dialogs and KDE

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

File dialogs and KDE

D. Michael McIntyre-3
14977 brought us full circle, except without the hideous stylesheet[1].

I had set the option to use native file dialogs, experimentally, because
Qt file dialogs in a KDE5 environment are seriously broken.  No icons of
any kind, no way to distinguish files from folders.  They are similarly
broken again, just not awash in black.

I feel like going with native dialogs was probably a step in the right
direction.  The native KDE dialogs were better in every way than the Qt
dialogs, which were never that good on their best day.  However, we do
need some other way to provide functionality similar to the sidebar.

Upon further experimentation, I discovered I could add those paths to my
KDE file dialog manually.  Those extra paths only appear from
Rosegarden.  It must be some bit of configuration in some dotfile somewhere.

How do you feel about having Rosegarden just write that configuration
quietly, to establish these extra sidebar directories for KDE users?  If
that would bother you, how do you feel about "Rosegarden would like
permission to add useful directories to your file dialog sidebar?" as a
runtime question?

Do you have an even better idea?

I definitely want to work this one out before doing the long overdue
release.  We're getting there, but it hasn't finished cooking yet.

1. I still can't believe the stylesheet monster is gone, and your new
implementation got as close as it did to working on the first go.  It
needs delicate tweaking here and there, and I'm more than willing to go
deal with that trivia and not trouble you with it.  I need to go study
what you did in any case, because I'm sure it will be highly instructive.

On 02/06/2017 04:27 PM, Rosegarden SVN repository wrote:

> Restore support for sidebar urls (indeed missing from the KDE file dialog)
>
> By dfaure_kde on 02/06/2017 21:27
> *View Changes* <https://sourceforge.net/p/rosegarden/code/14977/>
>
> ------------------------------------------------------------------------
>
> Fix styling of the Transport Dialog
>
> By dfaure_kde on 02/06/2017 09:03
> *View Changes* <https://sourceforge.net/p/rosegarden/code/14976/>
>
> ------------------------------------------------------------------------
>
> Sent from sourceforge.net because you indicated interest in
> https://sourceforge.net/p/rosegarden/code/
>
> To unsubscribe from further messages, please visit
> https://sourceforge.net/auth/subscriptions/
>

--
D. Michael McIntyre

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: File dialogs and KDE

David Faure
On mardi 7 février 2017 01:05:31 CET D. Michael McIntyre wrote:
> 14977 brought us full circle, except without the hideous stylesheet[1].

Yes and without the ugly old "Windows" style being applied to the file dialog
:-)

> I had set the option to use native file dialogs, experimentally, because
> Qt file dialogs in a KDE5 environment are seriously broken.  No icons of
> any kind, no way to distinguish files from folders.  They are similarly
> broken again, just not awash in black.

Oh, I thought you had fixed your mimetype issues on your setup.
What you describe here is again some XDG_DATA_DIRS issue,
or oxygen/breeze not installed. In the same environment, dolphin-qt5 shows
everything fine?

> I feel like going with native dialogs was probably a step in the right
> direction.  The native KDE dialogs were better in every way than the Qt
> dialogs, which were never that good on their best day.  

Yeah, I'd much rather use the native KDE dialog, for sure.

> However, we do
> need some other way to provide functionality similar to the sidebar.
>
> Upon further experimentation, I discovered I could add those paths to my
> KDE file dialog manually.  Those extra paths only appear from
> Rosegarden.  It must be some bit of configuration in some dotfile somewhere.

Indeed. These "bookmarks" are added to ~/.local/share/user-places.xbel.
"<OnlyInApp>Rosegarden</OnlyInApp>" can be used so they only show up in
rosegarden.

> How do you feel about having Rosegarden just write that configuration
> quietly, to establish these extra sidebar directories for KDE users?  

That sounds like a good solution. I suppose the real solution is to implement
support for sidebarUrls() in the kde file dialog, but I'm not that motivated
and that wouldn't help you with Qt4 or current KF5 versions anyway.

> If that would bother you, how do you feel about "Rosegarden would like
> permission to add useful directories to your file dialog sidebar?" as a
> runtime question?

That would bother me as a user. It's less intrusive to pollute my rosegarden
filedialog with useless entries that I can ignore, than to ask me a question I
can't ignore ;)

I'll let you implement the addition of the sidebar entries into user-
places.xbel. I recommend an entry in rosegarden's QSettings to remember that
it happened, to save time on subsequent runs and so that the user can delete
stuff without it reappearing. Make it a version number rather than a bool,
just in case you want to add more entries later.

To find the xbel file, don't hardcode ~/.local/share, but use
QStandardPaths::writableLocation(GenericDataLocation)   (requires Qt5)

If you really want to still support qt4, use qgetenv("XDG_DATA_HOME")
defaulting to ~/.local/share, but maybe it's time to ditch qt4...

And of course use XML API to edit the file. It's shared with other desktop
environments, so you can't assume newlines will be where they are in yours,
for instance.

> 1. I still can't believe the stylesheet monster is gone, and your new
> implementation got as close as it did to working on the first go.  

Heh, "first go"... I must have spent more than 30 hours on this overall ;)

> It needs delicate tweaking here and there, and I'm more than willing to go
> deal with that trivia and not trouble you with it.  I need to go study
> what you did in any case, because I'm sure it will be highly instructive.

OK. Feel free to ask if anything is unclear.

One thing about widget styles: the API docs only tell 10% of the story.
The code of the widgets and widget styles is where the truth is.

If anyone is looking for small tasks: the remaining uses of setStyleSheet in
individual widgets should be ported to QPalette (I already did many of these,
but there are some left).

About the "Special Parameters" dockwidget, do we agree on turning that into a
simple splitter then? (with the menuitem that allows to hide it or show it).
Or maybe even just a layouted widget, no splitter? (i.e. never bothering the
user to have to manually resize it if it shows up too small, as is sometimes
does).

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel
Reply | Threaded
Open this post in threaded view
|

Re: File dialogs and KDE

D. Michael McIntyre-3
On 02/08/2017 04:06 AM, David Faure wrote:

> Yes and without the ugly old "Windows" style being applied to the file dialog
> :-)

Ah, indeed.

> Oh, I thought you had fixed your mimetype issues on your setup.
> What you describe here is again some XDG_DATA_DIRS issue,
> or oxygen/breeze not installed. In the same environment, dolphin-qt5 shows
> everything fine?

Dolphin shows everything fine.  KDE file dialogs show everything fine.
Qt5 file dialogs look like the attachment.

> Yeah, I'd much rather use the native KDE dialog, for sure.

Now that I use other platforms, I'm used to seeing platform-native file
dialogs in Qt applications.  It seems the more natural way to go.

> That would bother me as a user. It's less intrusive to pollute my rosegarden
> filedialog with useless entries that I can ignore, than to ask me a question I
> can't ignore ;)

I like the way you put that.

> I'll let you implement the addition of the sidebar entries into user-
> places.xbel.

That will be fine.  Thanks for the notes on points to take into
consideration.

> Heh, "first go"... I must have spent more than 30 hours on this overall ;)

I expect so.  That was a huge job, and words fail me trying to express
my gratitude and my sense of amazement.

> If anyone is looking for small tasks: the remaining uses of setStyleSheet in
> individual widgets should be ported to QPalette (I already did many of these,
> but there are some left).

That sounds like my kind of project for sure.

> About the "Special Parameters" dockwidget, do we agree on turning that into a
> simple splitter then? (with the menuitem that allows to hide it or show it).
> Or maybe even just a layouted widget, no splitter? (i.e. never bothering the
> user to have to manually resize it if it shows up too small, as is sometimes
> does).

I think everything we meant to achieve with the original layout has been
rendered obsolete by the age of big screens.  It's conceivable that
someone might want to show/hide the whole thing to gain extra room, but
I can't see a splitter ever being used for anything.  Pointless complexity.

--
D. Michael McIntyre

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

qt5-native-file-dialog.jpg (84K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: File dialogs and KDE

David Faure
On jeudi 9 février 2017 00:23:10 CET D. Michael McIntyre wrote:
> Qt5 file dialogs look like the attachment.

Ah. Is it only .rg files that QFileDialog doesn't show, or any file?
(e.g. when filtering for "*" and navigating other directories, do icons show
up?)

Looking at the Qt 5 code, it seems to use QStyle::standardIcon(SP_FileIcon),
for all files. Which, in QCommonStyle, either:

1) loads the icon from the icon theme using
    QIcon::fromTheme("text-x-generic")
but only if QApplication::desktopSettingsAware() is true

2) uses the builtin icon ":/qt-project.org/styles/commonstyle/images/
file-16.png" from qt itself.

Can you check what `kiconfinder5 text-x-generic` returns?
(for me it returns a SVG, but Qt has its own lookup code which won't use SVGs,
maybe that is a problem...)

Can you check the value of QApplication::desktopSettingsAware() in main.cpp
(after creating the qapp) ?

If  you have a self-compiled Qt you could even just step into
QFileIconProviderPrivate::getIcon and see what happens from there.

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rosegarden-devel mailing list
[hidden email] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel