diff --git a/randomwallpaper@iflow.space/prefs.js b/randomwallpaper@iflow.space/prefs.js index 91d7e80..94829e1 100644 --- a/randomwallpaper@iflow.space/prefs.js +++ b/randomwallpaper@iflow.space/prefs.js @@ -14,7 +14,7 @@ const Gettext = imports.gettext.domain('space.iflow.randomwallpaper'); const RWG_SETTINGS_SCHEMA = 'org.gnome.shell.extensions.space.iflow.randomwallpaper'; const RWG_SETTINGS_SCHEMA_DESKTOPPER = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.desktopper'; const RWG_SETTINGS_SCHEMA_UNSPLASH = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.unsplash'; -const RWG_SETTINGS_SCHEMA_WALLHEAVEN = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.wallheaven'; +const RWG_SETTINGS_SCHEMA_WALLHAVEN = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.wallhaven'; const RWG_SETTINGS_SCHEMA_GENERIC_JSON = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.genericJSON'; const LoggerModule = Self.imports.logger; @@ -41,7 +41,7 @@ var RandomWallpaperSettings = new Lang.Class({ noSettings: null, desktopperSettings: null, unsplashSettings: null, - wallheavenSettings: null, + wallhavenSettings: null, genericJsonSettings: null, _init: function () { @@ -64,10 +64,10 @@ var RandomWallpaperSettings = new Lang.Class({ this.unsplashSettings = this._builder.get_object('unsplash-settings'); this.bindUnsplash(); - // Wallheaven Settings - this._wallheaven_settings = Convenience.getSettings(RWG_SETTINGS_SCHEMA_WALLHEAVEN); - this.wallheavenSettings = this._builder.get_object('wallheaven-settings'); - this.bindWallheaven(); + // Wallhaven Settings + this._wallhaven_settings = Convenience.getSettings(RWG_SETTINGS_SCHEMA_WALLHAVEN); + this.wallhavenSettings = this._builder.get_object('wallhaven-settings'); + this.bindWallhaven(); // Generic JSON Settings this._generic_json_settings = Convenience.getSettings(RWG_SETTINGS_SCHEMA_GENERIC_JSON); @@ -95,8 +95,8 @@ var RandomWallpaperSettings = new Lang.Class({ case 1: // desktopper this.currentSourceSettingsWidget = this.desktopperSettings; break; - case 2: // wallheaven - this.currentSourceSettingsWidget = this.wallheavenSettings; + case 2: // wallhaven + this.currentSourceSettingsWidget = this.wallhavenSettings; break; case 3: // generic JSON this.currentSourceSettingsWidget = this.genericJsonSettings; @@ -180,35 +180,35 @@ var RandomWallpaperSettings = new Lang.Class({ Gio.SettingsBindFlags.DEFAULT); }, - bindWallheaven: function () { - this._wallheaven_settings.bind('wallheaven-keyword', - this._builder.get_object('wallheaven-keyword'), + bindWallhaven: function () { + this._wallhaven_settings.bind('wallhaven-keyword', + this._builder.get_object('wallhaven-keyword'), 'text', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('resolutions', - this._builder.get_object('wallheaven-resolutions'), + this._wallhaven_settings.bind('resolutions', + this._builder.get_object('wallhaven-resolutions'), 'text', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('category-general', - this._builder.get_object('wallheaven-category-general'), + this._wallhaven_settings.bind('category-general', + this._builder.get_object('wallhaven-category-general'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('category-anime', - this._builder.get_object('wallheaven-category-anime'), + this._wallhaven_settings.bind('category-anime', + this._builder.get_object('wallhaven-category-anime'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('category-people', - this._builder.get_object('wallheaven-category-people'), + this._wallhaven_settings.bind('category-people', + this._builder.get_object('wallhaven-category-people'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('allow-sfw', - this._builder.get_object('wallheaven-allow-sfw'), + this._wallhaven_settings.bind('allow-sfw', + this._builder.get_object('wallhaven-allow-sfw'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._wallheaven_settings.bind('allow-sketchy', - this._builder.get_object('wallheaven-allow-sketchy'), + this._wallhaven_settings.bind('allow-sketchy', + this._builder.get_object('wallhaven-allow-sketchy'), 'active', Gio.SettingsBindFlags.DEFAULT); }, diff --git a/randomwallpaper@iflow.space/schemas/gschemas.compiled b/randomwallpaper@iflow.space/schemas/gschemas.compiled index 66a43b6..19ffc5b 100644 Binary files a/randomwallpaper@iflow.space/schemas/gschemas.compiled and b/randomwallpaper@iflow.space/schemas/gschemas.compiled differ diff --git a/randomwallpaper@iflow.space/schemas/org.gnome.shell.extensions.space.iflow.randomwallpaper.gschema.xml b/randomwallpaper@iflow.space/schemas/org.gnome.shell.extensions.space.iflow.randomwallpaper.gschema.xml index e3367a2..0b75de7 100644 --- a/randomwallpaper@iflow.space/schemas/org.gnome.shell.extensions.space.iflow.randomwallpaper.gschema.xml +++ b/randomwallpaper@iflow.space/schemas/org.gnome.shell.extensions.space.iflow.randomwallpaper.gschema.xml @@ -4,7 +4,7 @@ - + @@ -109,8 +109,8 @@ - + id='org.gnome.shell.extensions.space.iflow.randomwallpaper.wallhaven'> + "" Keyword The keyword will be used to search images. diff --git a/randomwallpaper@iflow.space/settings.ui b/randomwallpaper@iflow.space/settings.ui index 6a993b8..b4f0d43 100644 --- a/randomwallpaper@iflow.space/settings.ui +++ b/randomwallpaper@iflow.space/settings.ui @@ -278,7 +278,7 @@ You can also define a prefix that will be added to the image URL. True False True - The source that is used to fetch random wallpapers. You can select between unsplash.com, desktoppr.co, wallheaven.cc and a generic JSON source for experienced users. + The source that is used to fetch random wallpapers. You can select between unsplash.com, desktoppr.co, wallhaven.cc and a generic JSON source for experienced users. True 1 0 @@ -316,7 +316,7 @@ You can also define a prefix that will be added to the image URL. unsplash.com desktoppr.co - alpha.wallheaven.cc + alpha.wallhaven.cc Generic JSON @@ -1187,7 +1187,7 @@ You can also define a prefix that will be added to the image URL. - + True False 10 @@ -1209,7 +1209,7 @@ You can also define a prefix that will be added to the image URL. - + True True 10 @@ -1241,7 +1241,7 @@ You can also define a prefix that will be added to the image URL. 10 start - + SFW (Safe for work) True True @@ -1255,7 +1255,7 @@ You can also define a prefix that will be added to the image URL. - + Sketchy True True @@ -1295,7 +1295,7 @@ You can also define a prefix that will be added to the image URL. 10 start - + General True True @@ -1309,7 +1309,7 @@ You can also define a prefix that will be added to the image URL. - + Anime True True @@ -1323,7 +1323,7 @@ You can also define a prefix that will be added to the image URL. - + People True True @@ -1357,7 +1357,7 @@ You can also define a prefix that will be added to the image URL. - + True True 1920x1080, 1920x1200 diff --git a/randomwallpaper@iflow.space/sourceAdapter.js b/randomwallpaper@iflow.space/sourceAdapter.js index 0ce35d7..5c68c92 100644 --- a/randomwallpaper@iflow.space/sourceAdapter.js +++ b/randomwallpaper@iflow.space/sourceAdapter.js @@ -7,7 +7,7 @@ const Json = imports.gi.Json; const RWG_SETTINGS_SCHEMA_DESKTOPPER = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.desktopper'; const RWG_SETTINGS_SCHEMA_UNSPLASH = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.unsplash'; -const RWG_SETTINGS_SCHEMA_WALLHEAVEN = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.wallheaven'; +const RWG_SETTINGS_SCHEMA_WALLHAVEN = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.wallhaven'; const RWG_SETTINGS_SCHEMA_GENERIC_JSON = 'org.gnome.shell.extensions.space.iflow.randomwallpaper.genericJSON'; const SettingsModule = Self.imports.settings; @@ -177,8 +177,8 @@ var UnsplashAdapter = new Lang.Class({ } }); -var WallheavenAdapter = new Lang.Class({ - Name: "WallheavenAdapter", +var WallhavenAdapter = new Lang.Class({ + Name: "WallhavenAdapter", Extends: BaseAdapter, _settings: null, @@ -194,7 +194,7 @@ var WallheavenAdapter = new Lang.Class({ _init: function () { this.parent(); - this._settings = new SettingsModule.Settings(RWG_SETTINGS_SCHEMA_WALLHEAVEN); + this._settings = new SettingsModule.Settings(RWG_SETTINGS_SCHEMA_WALLHAVEN); }, requestRandomImage: function (callback) { @@ -231,6 +231,7 @@ var WallheavenAdapter = new Lang.Class({ if (callback) { let historyEntry = new HistoryModule.HistoryEntry(null, 'wallhaven.cc', imageDownloadUrl); historyEntry.source.sourceUrl = 'https://alpha.wallhaven.cc/'; + historyEntry.source.imageLinkUrl = url; callback(historyEntry); } }) @@ -259,7 +260,7 @@ var WallheavenAdapter = new Lang.Class({ }, _readOptionsFromSettings: function () { - this.options.q = this._settings.get('wallheaven-keyword', 'string'); + this.options.q = this._settings.get('wallhaven-keyword', 'string'); this.options.resolutions = this._settings.get('resolutions', 'string').split(','); this.options.resolutions = this.options.resolutions.map((elem) => { @@ -275,7 +276,7 @@ var WallheavenAdapter = new Lang.Class({ let purity = []; purity.push(+this._settings.get('allow-sfw', 'boolean')); purity.push(+this._settings.get('allow-sketchy', 'boolean')); - purity.push(0); // required by wallheaven + purity.push(0); // required by wallhaven this.options.purity = purity.join(''); } }); diff --git a/randomwallpaper@iflow.space/wallpaperController.js b/randomwallpaper@iflow.space/wallpaperController.js index 77067b6..8059206 100644 --- a/randomwallpaper@iflow.space/wallpaperController.js +++ b/randomwallpaper@iflow.space/wallpaperController.js @@ -59,7 +59,7 @@ var WallpaperController = new Lang.Class({ this._desktopperAdapter = new SourceAdapter.DesktopperAdapter(); this._unsplashAdapter = new SourceAdapter.UnsplashAdapter(); - this._wallheavenAdapter = new SourceAdapter.WallheavenAdapter(); + this._wallhavenAdapter = new SourceAdapter.WallhavenAdapter(); this._genericJsonAdapter = new SourceAdapter.GenericJsonAdapter(); this.logger = new LoggerModule.Logger('RWG3', 'WallpaperController'); @@ -97,7 +97,7 @@ var WallpaperController = new Lang.Class({ this.imageSourceAdapter = this._desktopperAdapter; break; case 2: - this.imageSourceAdapter = this._wallheavenAdapter; + this.imageSourceAdapter = this._wallhavenAdapter; break; case 3: this.imageSourceAdapter = this._genericJsonAdapter;