ifl0w / RandomWallpaperGnome3

Random Wallpapers for Gnome 3
MIT License
176 stars 40 forks source link

Support Gnome45 #176

Closed Lucki closed 7 months ago

Lucki commented 8 months ago

This implements the remaining bits and pieces needed for Gnome45+. In turn, it will make this extension incompatible with Gnome < 45.

Luckily in my previous road to v3 I separated both contexts (background shell/foreground preference window) which is way more implied than before. Both contexts use separate import statements which fail for the other context. The only module left we're using by both contexts is the settings module. For this to work I had to drag the current contexts' extension import to the settings module.

I'm not sure about the deduplication of both prefs classes. It's making us drag all variables as function parameter because we can't use the constructor anymore. (ec5b0c7b5fc9c8bdafd8de43fe119d9abd7061c0)

fix #172 fix #177

bjornharrtell commented 8 months ago

@Lucki thanks for working on this, I love this extension. :) For whatever it's worth though it doesn't seem to want to work here but not sure how to debug. I'll be happy to test more and try to debug it.

Lucki commented 8 months ago

This is because the PR this builds upon still has an issue. It'll resolve once this PR will be marked as ready.

If you can't wait and know what you're doing:

diff --git a/src/logger.ts b/src/logger.ts
index 31126e5..16ee0f7 100644
--- a/src/logger.ts
+++ b/src/logger.ts
@@ -1,6 +1,6 @@
 // https://gitlab.gnome.org/GNOME/gjs/-/blob/master/doc/Logging.md

-import {Settings} from './settings.js';
+// import {Settings} from './settings.js';

 // Generated code produces a no-shadow rule error
 /* eslint-disable */
@@ -14,7 +14,7 @@ enum LogLevel {
 /* eslint-enable */

 const LOG_PREFIX = 'RandomWallpaper';
-const SETTINGS = new Settings();
+// const SETTINGS = new Settings();

 /**
  * A convenience logger class.
@@ -55,7 +55,8 @@ class Logger {
      * @returns {LogLevel} Log level
      */
     private static _selectedLogLevel(): LogLevel {
-        return SETTINGS.getEnum('log-level');
+        // return SETTINGS.getEnum('log-level');
+        return LogLevel.DEBUG;
     }

     /**
bjornharrtell commented 8 months ago

Thanks again, works fine now!

Iznogood1 commented 6 months ago

Thanks, great job! Works fine. Why isn't it "published" ?

ifl0w commented 6 months ago

@Iznogood1 I wanted to add some smaller additions/changes before releasing this new major version. But you have a point and I probably should put it on the extensions.gnome.org site for now. Will try to do so over the upcoming holidays :).