fthx / dock-from-dash

GNU General Public License v3.0
97 stars 20 forks source link

Add configuration #30

Closed rastersoft closed 2 years ago

rastersoft commented 2 years ago

Add support for settings (and translation)

fthx commented 2 years ago

Ok thanks a lot for that! Could you rebase on latest code? What are the commands to add a language, I don't know anything about meson-or-else?

Here: var settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dock_from_dash'); should not be rather 'dock-from-dash' ?

I think we have to deal first with:

JS ERROR: Invalid work id 3: Error: Invalid work id 3
queueDeferredWork@resource:///org/gnome/shell/ui/main.js:857:18
_queueRedisplay@resource:///org/gnome/shell/ui/dash.js:477:14

I asked Florian about that and he told me it was a signals not cleaned properly bug in GS. But maybe there's a way to deal with it inside the extension?

fthx commented 2 years ago

Maybe for autohide (now defaulted to 300, because it was high for this popup menu issue) we could range from 0 to 1000 with 50 increment?

fthx commented 2 years ago

And could you add the background opacity? I think it will be asked for.

fthx commented 2 years ago

Maybe we could just propose dconf keys but not a pref UI ? I still think this extension has to keep simple. And UI will make users ask for more and more prefs.

rastersoft commented 2 years ago

Did all the changes. About the language, just create a folder (usually 'build'), type 'meson' to generate the compilation files, and then 'ninja dock-from-dash-update-po', which will re-read all the source files and add the extra sentences. To add a new language, just add the code to the po/LINGUAS file and run again 'ninja dock-from-dash-update-po'. Then just open the new .po file with any editor (or better, with a translation editor like gtranslate) and translate the missing sentences.

I added a shell script to quickly install the extension in the local folder (local_install.sh). It is quite handy.

rastersoft commented 2 years ago

About adding preferences, as you can see in the prefs.js file, it is extremely easy to add them, because I created some time ago several functions for each type of settings.

fthx commented 2 years ago

Ok I'll have a look about that tomorrow. Thanks for all this work!

fthx commented 2 years ago

Ok, I'm reworking this at the moment (FR, add options, etc.).

rastersoft commented 2 years ago

If you need a function for a Gtk.Combo, I use one in Desktop Icons NG, very easy.

fthx commented 2 years ago

I've almost finished. I don't need anythnig else that you did push.

fthx commented 2 years ago

Ok that's ok now. What's the command I can execute to import all the folder to github? I did that by hand in the past but I know that's there is a better way...

rastersoft commented 2 years ago

I don't understand... what do you mean?

You mean "to update your local 'main' folder with the contents in here, the remote one"?

In that case, you just go to main and do a pull

git checkout main
git pull
rastersoft commented 2 years ago

(in older projects, instead of 'main' it would be 'master', of course... but that's a discussion for another day 🤣 )

fthx commented 2 years ago

Ok i've uploaded by hand, atm. You have to add some ES translation.

I've got a last problem (not a big one, though): I'd like that when the "always show" setting is ON, that the user enter the gnome session with the dock shown. But that's not so easy. When the setting is changed, it's ok, i've done that.

fthx commented 2 years ago

I know almost nothing about git. What means 'go to main' ? I want to upload what is in my laptop to the remote github repo.

fthx commented 2 years ago

Oh, and there is a problem with dconf. I see this: image I don't see all what we pushed.

fthx commented 2 years ago

Ok, I modified readme.md (not yet uploaded) since it's no good. My fault.

rastersoft commented 2 years ago

Mmm... Do you have the code in your laptop in a local GIT repository?

rastersoft commented 2 years ago

Anyway, if you know almost nothing about GIT, I strongly recommend you to, at least, read a little tutorial that explains you the basic concepts, like what is a branch, what is a commit and what is a repository.

rastersoft commented 2 years ago

You don't need the fancy things like rebasing, bisecting or reflog... those are "advanced" contents. But it is important to understand the basic things.

fthx commented 2 years ago

I've got this review from JP: You cannot create objects in global scope which is the same as init (line 20 extension.js): https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-init-for-initialization

rastersoft commented 2 years ago

BTW: I checked the README... you don't need to do all that to install the extension, only to run "./local_install.sh".

The other commands are only if you are a translator and want to update a translation.

fthx commented 2 years ago

yes that's what I removed

rastersoft commented 2 years ago

I've got this review from JP: You cannot create objects in global scope which is the same as init (line 20 extension.js): https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-init-for-initialization

I think that (s)he got confused because you have init() methods in other classes. Just answer that the extension class is called "Extension" and there is no init() method; that the other classes are created inside the enable() method.

fthx commented 2 years ago

Ok, let's plan:

  1. dconf incomplete schema and description
rastersoft commented 2 years ago

Or, maybe, the error is that I created the "settings" object outside, when it should have been created in the "enable()" method.

rastersoft commented 2 years ago

The ES translation is already there...

rastersoft commented 2 years ago

Oh, you updated the sentences! Ok

fthx commented 2 years ago

That's not easy to make a short and accurate sentence

rastersoft commented 2 years ago

I sent a MR with the updated translations.

fthx commented 2 years ago

Do you have an idea why dconf keys are buggy ?

rastersoft commented 2 years ago

I'm not sure... I'll check it after lunch

El jue., 31 mar. 2022 14:18, fthx @.***> escribió:

Do you have an idea why dconf keys are buggy ?

— Reply to this email directly, view it on GitHub https://github.com/fthx/dock-from-dash/pull/30#issuecomment-1084505559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMK577SXAE6J2E2SYCWLDVCWJYFANCNFSM5SCLKINQ . You are receiving this because you authored the thread.Message ID: @.***>

fthx commented 2 years ago

v41 (in GS ext website) is an error, I'll revert this later, that works as it.

rastersoft commented 2 years ago

V41 is because you uploaded 41 times it. The value in the metadata is overwritten whenever you upload a version. It is better to remove it from the metadata and let gnome shell page set the value.

fthx commented 2 years ago

That, I know! :-) But it avoids to get an update from website, no?

fthx commented 2 years ago

I got it for initial showing. It's coming very soon.

rastersoft commented 2 years ago

But it avoids to get an update from website, no?

What do you mean?

fthx commented 2 years ago

I can die now, the extension has reached a decent state now, I think. https://github.com/fthx/dock-from-dash/commit/a8e7fa12b87f074faad168d9010b9feee38a1ff1 ;-) Could you try this one? It's active in GS website.

When I get a version 40 compiled on my laptop, it could have an uploaded version > 40, thus proposing me an update?

rastersoft commented 2 years ago

Yes. Since the version in Gnome Extensions is 43 and you have 40 in your system, the page thinks that you have an old version.

Just change the number to 44 and push it into the repository.