small utility to create L&F packages
ClosedPublic

Authored by mart on Aug 15 2016, 1:16 PM.

Details

Summary

small utility that can browse look and feel packages,
edit the metadata of those installed in ~/.local and create new ones
with defaults files and layout.js taken from the current plasma setup

this uses the javascript export functions introduced in plasmashell

Diff Detail

Repository
R118 Plasma SDK
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 5930.Aug 15 2016, 1:16 PM
mart retitled this revision from to small utility to create L&F packages.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
Restricted Application added a project: Plasma. · View Herald TranscriptAug 15 2016, 1:16 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
This revision was automatically updated to reflect the committed changes.
mart reopened this revision.Aug 15 2016, 1:33 PM
davidedmundson requested changes to this revision.Aug 15 2016, 2:53 PM
davidedmundson added a reviewer: davidedmundson.
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
lookandfeelexplorer/package/contents/ui/main.qml
43

If you're going to poke me on IRC to review something, I don't expect to see FIXMEs that you haven't investigated.

This revision now requires changes to proceed.Aug 15 2016, 2:53 PM
mart updated this revision to Diff 5953.Aug 15 2016, 4:23 PM
mart edited edge metadata.
  • prototype of basic editor for lookandfeel packages
  • correctly list look and feel packages
  • make the theme list a simple list
  • load theme name in textbox
  • complete metadata editor
  • sic creation (of an empty theme)
  • start with layout file generator
  • function to set a screenshot
  • open file dialog to update screenshots
  • fix layout
  • possibility to update default layout
  • async dbus call
  • start port to kirigami
  • actions in GlobalDrawer
  • remove the timer hack
mart added inline comments.Aug 15 2016, 4:24 PM
lookandfeelexplorer/package/contents/ui/main.qml
43

ouch, that was actually coming from copy and paste of another application (which i'll have to investigate then) but on this one all is fine, no crash, I removed the timer hack now

davidedmundson requested changes to this revision.Aug 16 2016, 9:54 AM
davidedmundson edited edge metadata.
davidedmundson added inline comments.
lookandfeelexplorer/src/lnflogic.cpp
86

leaks

156

That's the wrong group name.
It should be TabBox.

(and if this is copy pastad from somewhere, then fix that too.)

lookandfeelexplorer/src/main.cpp
63

leaks

71

UncreatableType * 2

73

leaks

This revision now requires changes to proceed.Aug 16 2016, 9:54 AM
mart added inline comments.Aug 16 2016, 10:45 AM
lookandfeelexplorer/src/main.cpp
71

I think in this case it's betterthis form, as i don't want to give an url to it, i just want properties of those instances to be readable

mart updated this revision to Diff 5974.Aug 16 2016, 11:11 AM
mart edited edge metadata.
  • remove some leaks
This revision was automatically updated to reflect the committed changes.
mart reopened this revision.Aug 16 2016, 11:11 AM
mart updated this revision to Diff 5976.Aug 16 2016, 11:20 AM
mart edited edge metadata.
  • prototype of basic editor for lookandfeel packages
  • correctly list look and feel packages
  • make the theme list a simple list
  • load theme name in textbox
  • complete metadata editor
  • sic creation (of an empty theme)
  • start with layout file generator
  • function to set a screenshot
  • open file dialog to update screenshots
  • fix layout
  • possibility to update default layout
  • async dbus call
  • start port to kirigami
  • actions in GlobalDrawer
  • remove the timer hack
  • remove some leaks
  • lnf just themes tabbox
davidedmundson requested changes to this revision.Aug 16 2016, 12:59 PM
davidedmundson edited edge metadata.
davidedmundson added inline comments.
lookandfeelexplorer/src/lnflogic.cpp
92

watcher->deleteLater();

because:

  1. you should never delete a QObject in a slot. You crash if something else is connected to the same signal
  1. you only need one line then at the top. Otherwise you crash if used after free.
This revision now requires changes to proceed.Aug 16 2016, 12:59 PM
mart updated this revision to Diff 5978.Aug 16 2016, 1:02 PM
mart edited edge metadata.
  • use deleteLater
davidedmundson accepted this revision.Aug 16 2016, 2:47 PM
davidedmundson edited edge metadata.
This revision is now accepted and ready to land.Aug 16 2016, 2:47 PM
davidedmundson requested changes to this revision.Aug 16 2016, 5:03 PM
davidedmundson edited edge metadata.
davidedmundson added inline comments.
lookandfeelexplorer/src/lnflogic.cpp
156

Edit: This kwin saving stuff is *still* wrong.

In systemCG (kwinrc) it is "TabBox".
However, in the LnF it is "WindowSwitcher."

You "fixed" the wrong one.

You are also missing DesktopSwitcher.

I'll just write the code for you:

systemCG = KConfigGroup(KSharedConfig::openConfig(QStringLiteral("kwinrc")), "TabBox");
defaultsConfigGroup = KConfigGroup(&defaultsConfigGroup, "WindowSwitcher");
defaultsConfigGroup.writeEntry("LayoutName", systemCG.readEntry("LayoutName", QStringLiteral("org.kde.breeze.desktop")));

defaultsConfigGroup = KConfigGroup(&defaultsConfigGroup, "DesktopSwitcher");
defaultsConfigGroup.writeEntry("LayoutName", systemCG.readEntry("DesktopLayout", QStringLiteral("org.kde.breeze.desktop")))
This revision now requires changes to proceed.Aug 16 2016, 5:03 PM
mart added inline comments.Aug 16 2016, 5:34 PM
lookandfeelexplorer/src/lnflogic.cpp
156

gah, that's what i forgotten,
that the config key is different between kwinrc and the defaults file :/

meh, meh, meh

mart updated this revision to Diff 5983.Aug 16 2016, 5:37 PM
mart edited edge metadata.
  • take into account different config key
This revision was automatically updated to reflect the committed changes.

Can you please provide screenshots of the tool? Yes, even developer-centric tools should get a UI review ;)

Thanks!
Feedback:

  • The lineedits should be made long enough to actually hold the whole content (for the comment, maybe a textbox would be better?), because editing in a field which is too small for the content is really annoying.
  • How does one save changes?
  • Is it possible to change the thumbnail in there as well?
mart added a comment.Aug 19 2016, 10:38 AM

Thanks!
Feedback:

  • The lineedits should be made long enough to actually hold the whole content (for the comment, maybe a textbox would be better?), because editing in a field which is too small for the content is really annoying.

ok

  • How does one save changes?

it's instant save, some pieces couldn't be done differently at the moment

  • Is it possible to change the thumbnail in there as well?

yes, click on it or drag and drop (when is empty it shows a label telling this)

In D2449#46736, @mart wrote:

it's instant save, some pieces couldn't be done differently at the moment

Hm, I think that's a problem.

  1. Instant apply is not a common pattern in KDE software at all and therefore unexpected
  2. Instant save in an edit field cannot really be done predictably, as the user can never tell exactly when it's saved (certainly not with any character typed, right?)

Why not just use a save button?

  • Is it possible to change the thumbnail in there as well?

yes, click on it or drag and drop (when is empty it shows a label telling this)

Ah, perfect!

mart added a comment.Aug 19 2016, 11:29 AM
In D2449#46736, @mart wrote:
  1. Instant save in an edit field cannot really be done predictably, as the user can never tell exactly when it's saved (certainly not with any character typed, right?)

    Why not just use a save button?

bacause the two buttons to take the defaults file and the desktop layout copy files the instant they are clicked.
i can try to give it a logic of keeping things in memory until saved, will see how much i have to change

aspotashev added inline comments.
lookandfeelexplorer/src/lnflogic.cpp
66

Double space here in "Plasma Look And Feel".

mart added inline comments.Sep 26 2016, 9:10 AM
lookandfeelexplorer/src/lnflogic.cpp
66

fixed