From bf2170d117ebdd2c393dbf1bdf429a8de69c2c52 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sat, 1 Apr 2023 18:40:31 +1000 Subject: [PATCH 01/21] use shuffle timer when shuffling, click image fix --- extension.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extension.js b/extension.js index ba0c2068..e81d3a94 100644 --- a/extension.js +++ b/extension.js @@ -257,6 +257,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { // link menu items to functions this.thumbnailItem.connect('activate', this._setBackgroundDesktop.bind(this)); this.openImageItem.connect('activate', this._openInSystemViewer.bind(this)); + this.thumbnailItem.connect('activate', this._openInSystemViewer.bind(this)); //this.titleItem.connect('activate', this._setBackgroundDesktop.bind(this)); this.openImageInfoLinkItem.connect('activate', this._openImageInfoLink.bind(this)); this.dwallpaperItem.connect('activate', this._setBackgroundDesktop.bind(this)); @@ -784,7 +785,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { } this.imageIndex = Utils.getRandomInt(imageList.length); image = imageList[this.imageIndex]; - this._restartShuffleTimeout(); + if (this.selected_image == 'random') + this._restartShuffleTimeout(); } else if (this.selected_image == 'current') { image = Utils.getCurrentImage(imageList); this.imageIndex = Utils.getCurrentImageIndex(imageList); From be23b339168a2c1a6269c28c785f8014d5ac29f3 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 3 Apr 2023 23:41:34 +1000 Subject: [PATCH 02/21] fetch all new unfetched images --- extension.js | 31 ++++++++++++++++++++++--------- utils.js | 15 +++++++++++++++ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/extension.js b/extension.js index e81d3a94..754dcd6b 100644 --- a/extension.js +++ b/extension.js @@ -721,6 +721,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { Utils.purgeImages(this._settings); // delete older images if enabled Utils.cleanupImageList(this._settings); + this._downloadAllImages(); // fetch missing images that are still available if (newImages.length > 0 && this._settings.get_boolean('revert-to-current-image')) { // user wants to switch to the new image when it arrives @@ -826,10 +827,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { let file_info = file_exists ? file.query_info ('*', Gio.FileQueryInfoFlags.NONE, null) : 0; if (!file_exists || file_info.get_size () == 0) { // file doesn't exist or is empty (probably due to a network error) - let dir = Gio.file_new_for_path(BingWallpaperDir); - if (!dir.query_exists(null)) { - dir.make_directory_with_parents(null); - } this._downloadImage(this.imageURL, file); } else { @@ -848,6 +845,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._storeState(); } + _imageURL(urlbase, resolution) { + return BingURL + image.urlbase + '_' + resolution + '.jpg'; + } + _storeState() { if (this.filename) { let maxLongDate = Utils.getMaxLongDate(this._settings); // refresh date from most recent Bing image @@ -910,9 +911,26 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._restartTimeout(60); } + _downloadAllImages() { + // fetch recent undownloaded images + let imageList = Utils.getFetchableImageList(this._settings); + let BingWallpaperDir = Utils.getWallpaperDir(this._settings); + imageList.forEach( image => { + let resolution = Utils.getResolution(this._settings, image); + let filename = toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); + let url = this._imageURL(image.urlbase, resolution); + this._downloadImage(url, filename); + }); + } + // download and process new image // FIXME: improve error handling _downloadImage(url, file) { + let BingWallpaperDir = Utils.getWallpaperDir(this._settings); + let dir = Gio.file_new_for_path(BingWallpaperDir); + if (!dir.query_exists(null)) { + dir.make_directory_with_parents(null); + } log("Downloading " + url + " to " + file.get_uri()); let request = Soup.Message.new('GET', url); @@ -920,19 +938,14 @@ class BingWallpaperIndicator extends PanelMenu.Button { try { if (Soup.MAJOR_VERSION >= 3) { this.httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => { - // request completed - this._updatePending = false; this._processFileDownload(message, file); }); } else { this.httpSession.queue_message(request, (httpSession, message) => { - // request completed - this._updatePending = false; this._processFileDownload(message, file); }); } - } catch (error) { log('error sending libsoup message '+error); diff --git a/utils.js b/utils.js index 7f926bf4..2df84fd6 100644 --- a/utils.js +++ b/utils.js @@ -288,6 +288,21 @@ function getImageByIndex(imageList, index) { return imageList[index]; } +function getFetchableImageList(settings) { + let imageList = getImageList(settings); + let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago + let dlList = []; + imageList.forEach( function (x, i) { + let diff = dateFromLongDate(x.fullstartdate, 0).difference(cutOff); + let filename = imageToFilename(settings, x); + // image is still downloadable (< 8 days old) but not on disk + if (diff > 0 && !Gio.file_new_for_path(filename).query_exists(null)) { + dlList.push(x); + } + }); + return dlList; +} + function cleanupImageList(settings) { let curList = imageListSortByDate(getImageList(settings)); let cutOff = GLib.DateTime.new_now_utc().add_days(-8); // 8 days ago From 6619c4a79a7ee3a4017bc174dee3c213d10113e1 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 7 Apr 2023 15:06:12 +1000 Subject: [PATCH 03/21] initial functional version of _downloadAllImages --- extension.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extension.js b/extension.js index 754dcd6b..6a747487 100644 --- a/extension.js +++ b/extension.js @@ -731,7 +731,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (this._settings.get_boolean('notify')) { if (!this._settings.get_boolean('notify-only-latest')) { // notify all new images - newImages.forEach((image, index) => { + newImages.forEach(image => { log('New image to notify: ' + Utils.getImageTitle(image)); this._createNotification(image); }); @@ -750,7 +750,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._updatePending = false; } catch (error) { - log('_parseData() failed with error ' + error); + log('_parseData() failed with error ' + error + ' @ '+error.lineNumber); + log(error.stack); } } @@ -846,7 +847,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { } _imageURL(urlbase, resolution) { - return BingURL + image.urlbase + '_' + resolution + '.jpg'; + return BingURL + urlbase + '_' + resolution + '.jpg'; } _storeState() { @@ -915,11 +916,12 @@ class BingWallpaperIndicator extends PanelMenu.Button { // fetch recent undownloaded images let imageList = Utils.getFetchableImageList(this._settings); let BingWallpaperDir = Utils.getWallpaperDir(this._settings); - imageList.forEach( image => { + imageList.forEach( (image) => { let resolution = Utils.getResolution(this._settings, image); let filename = toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); let url = this._imageURL(image.urlbase, resolution); - this._downloadImage(url, filename); + let file = Gio.file_new_for_path(filename); + this._downloadImage(url, file); }); } From 48295035f4c6c1db81071a00bbab44a3a63ce5f3 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sun, 9 Apr 2023 19:50:40 +1000 Subject: [PATCH 04/21] add image dimensions, new filters, uhd checks #202 --- carousel.js | 6 +- extension.js | 111 +++++++++++++----- icons/trash-empty-symbolic.svg | 28 +++++ icons/trash-full-symbolic.svg | 62 ++++++++++ locale/BingWallpaper.pot | 58 +++++---- schemas/gschemas.compiled | Bin 2027 -> 2241 bytes ...shell.extensions.bingwallpaper.gschema.xml | 19 +++ utils.js | 74 +++++++++++- 8 files changed, 298 insertions(+), 60 deletions(-) create mode 100644 icons/trash-empty-symbolic.svg create mode 100644 icons/trash-full-symbolic.svg diff --git a/carousel.js b/carousel.js index 97c36b93..d665e0d3 100644 --- a/carousel.js +++ b/carousel.js @@ -156,7 +156,8 @@ var Carousel = class Carousel { deleteButton.connect('clicked', (widget) => { this.log('Delete requested for '+filename); Utils.deleteImage(filename); - Utils.cleanupImageList(this.settings); + //Utils.cleanupImageList(this.settings); + Utils.hideImage(this.settings, [image]); widget.get_parent().get_parent().set_visible(false); // bit of a hack if (this.callbackfunc) this.callbackfunc(); @@ -223,9 +224,10 @@ var Carousel = class Carousel { let loadButton = buildable.get_object('loadButton'); loadButton.connect('clicked', (widget) => { - this.flowBox.remove(widget.get_parent()); + widget.set_label(_("Loading...")); this.flowBox.set_max_children_per_line(2); this._create_gallery(); + this.flowBox.remove(widget.get_parent()); }); let item = buildable.get_object('flowBoxPlaceholder'); diff --git a/extension.js b/extension.js index 6a747487..059b9af1 100644 --- a/extension.js +++ b/extension.js @@ -42,6 +42,8 @@ const ICON_REFRESH = 'view-refresh-symbolic'; const ICON_RANDOM = Me.dir.get_child('icons').get_path() + '/'+'game-die-symbolic.svg'; const ICON_FAVE_BUTTON = Me.dir.get_child('icons').get_path() + '/'+'fav-symbolic.svg'; const ICON_UNFAVE_BUTTON = Me.dir.get_child('icons').get_path() + '/'+'unfav-symbolic.svg'; +const ICON_TRASH_BUTTON = Me.dir.get_child('icons').get_path() + '/'+'trash-empty-symbolic.svg'; +const ICON_UNTRASH_BUTTON = Me.dir.get_child('icons').get_path() + '/'+'trash-full-symbolic.svg'; let bingWallpaperIndicator = null; let blur = null; @@ -114,6 +116,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.imageIndex = null; this.logger = null; this.favourite_status = false; + this.hidden_status = false; + this.dimensions = { 'width': null, 'height': null}; if (!blur) // as Blur isn't disabled on screen lock (like the rest of the extension is) blur = new Blur.Blur(); @@ -160,11 +164,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.toggleSelectNew = newMenuSwitchItem(_("Always show new images"), this._settings.get_boolean('revert-to-current-image')); this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), true); this.toggleShuffleOnlyFaves = newMenuSwitchItem(_("Image shuffle only favourites"), this._settings.get_boolean('random-mode-include-only-favourites')); + this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); + this.toggleShuffleOnlyUHD = newMenuSwitchItem(_("Image shuffle only UHD resolutions"), this._settings.get_boolean('random-mode-include-only-uhd')); this.toggleNotifications = newMenuSwitchItem(_("Enable desktop notifications"), this._settings.get_boolean('notify')); this.toggleImageCount = newMenuSwitchItem(_("Show image count"), this._settings.get_boolean('show-count-in-image-title')); [this.toggleNotifications, this.toggleImageCount, this.toggleSetBackground, this.toggleSelectNew, - this.toggleShuffle, this.toggleShuffleOnlyFaves] + this.toggleShuffle, this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUnhidden, this.toggleShuffleOnlyUHD] .forEach(e => this.settingsSubMenu.menu.addMenuItem(e)); // these items are a bit unique, we'll populate them in _setControls() @@ -279,6 +285,15 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.toggleImageCount.setToggleState(this._settings.get_boolean('show-count-in-image-title')); this._setMenuText(); }); + this._settings.connect('changed::random-mode-include-only-favourites', () => { + this.toggleShuffleOnlyFaves.setToggleState(this._settings.get_boolean('random-mode-include-only-favourites')); + }); + this._settings.connect('changed::random-mode-include-only-unhidden', () => { + this.toggleShuffleOnlyUnhidden.setToggleState(this._settings.get_boolean('random-mode-include-only-unhidden')); + }); + this._settings.connect('changed::random-mode-include-only-uhd', () => { + this.toggleShuffleOnlyUHD.setToggleState(this._settings.get_boolean('random-mode-include-only-uhd')); + }); // & then, link settings to toggle state (the other way) this.toggleSetBackground.connect('toggled', (item, state) => { @@ -297,6 +312,12 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.toggleShuffleOnlyFaves.connect('toggled', (item, state) => { this._settings.set_boolean('random-mode-include-only-favourites', state); }); + this.toggleShuffleOnlyUnhidden.connect('toggled', (item, state) => { + this._settings.set_boolean('random-mode-include-only-unhidden', state); + }); + this.toggleShuffleOnlyUHD.connect('toggled', (item, state) => { + this._settings.set_boolean('random-mode-include-only-uhd', state); + }); // shuffle is a special case this._setShuffleToggleState(); @@ -375,6 +396,9 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (this.filename == '') return; this.thumbnail = new Thumbnail.Thumbnail(this.filename); // historically thumbnails were a bit unsafe on Wayland, but now fixed + if (!this.dimensions.width || !this.dimensions.height) // if dimensions aren't in image database yet + [this.dimensions.width, this.dimensions.height] = Utils.getFileDimensions(this.filename); + log('image set to : '+this.filename); this._setThumbnailImage(); if (this._settings.get_boolean('set-background')) this._setBackgroundDesktop(); @@ -429,15 +453,16 @@ class BingWallpaperIndicator extends PanelMenu.Button { _setMenuText() { this.titleItem.label.set_text(this.title ? this.title : ''); this.copyrightItem.label.set_text(this.copyright ? this.copyright : ''); + let explainaItemText = this.explanation + ' ['+this.dimensions.height+'p] '; if (this._settings.get_boolean('show-count-in-image-title') && this.explanation) { let imageList = JSON.parse(this._settings.get_string('bing-json')); if (imageList.length > 0) - this.explainItem.label.set_text( this.explanation + ' [' + (this.imageIndex + 1) + '/' + imageList.length + ']'); - } - else { - this.explainItem.label.set_text(this.explanation ? this.explanation : ''); + explainaItemText = explainaItemText + ' [' + (this.imageIndex + 1) + '/' + imageList.length + ']'; } + this.explainItem.label.set_text(explainaItemText); this._setFavouriteIcon(this.favourite_status?ICON_FAVE_BUTTON:ICON_UNFAVE_BUTTON); + this._setTrashIcon(this.hidden_status?ICON_UNTRASH_BUTTON:ICON_TRASH_BUTTON); + //this.imageFileInfo.label.set_text(this.dimensions.height && this.dimensions.width ? this.dimensions.width+' x '+this.dimensions.height: '-'); } _wrapLabelItem(menuItem) { @@ -453,6 +478,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.favourite_status?ICON_FAVE_BUTTON:ICON_UNFAVE_BUTTON, this.controlItem, this._favouriteImage); + this.trashBtn = this._newMenuIcon( + this.hidden_status?ICON_UNTRASH_BUTTON:ICON_TRASH_BUTTON, + this.controlItem, + this._trashImage); this.prevBtn = this._newMenuIcon( ICON_PREVIOUS_BUTTON, this.controlItem, @@ -559,10 +588,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.toggleShuffle.setToggleState(this._settings.get_string('selected-image') == 'random'); } - _toggleShuffleOnlyFaves() { - - } - _toggleShuffle() { if (this._settings.get_string('selected-image') == 'random') { this._settings.set_string('selected-image', 'current'); @@ -581,6 +606,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._setFavouriteIcon(this.favourite_status?ICON_FAVE_BUTTON:ICON_UNFAVE_BUTTON); } + _trashImage() { + log('trash image '+this.imageURL+' status was '+this.hidden_status); + this.hidden_status = !this.hidden_status; + Utils.setImageHiddenStatus(this._settings, [this.imageURL], this.hidden_status); + this._setTrashIcon(this.hidden_status?ICON_UNTRASH_BUTTON:ICON_TRASH_BUTTON); + } + _setFavouriteIcon(icon_name) { let gicon = Gio.icon_new_for_string(icon_name); this.favouriteBtn.get_children().forEach( (x, i) => { @@ -588,6 +620,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { }); } + _setTrashIcon(icon_name) { + let gicon = Gio.icon_new_for_string(icon_name); + this.trashBtn.get_children().forEach( (x, i) => { + x.set_gicon(gicon); + }); + } + _gotoImage(relativePos) { let imageList = Utils.getImageList(this._settings); let curIndex = 0; @@ -720,8 +759,9 @@ class BingWallpaperIndicator extends PanelMenu.Button { log('WARNING: Bing returning market data for ' + datamarket + ' rather than selected ' + prefmarket); Utils.purgeImages(this._settings); // delete older images if enabled - Utils.cleanupImageList(this._settings); + //Utils.cleanupImageList(this._settings); // disabled, as old images should still be downloadble in theory this._downloadAllImages(); // fetch missing images that are still available + Utils.populateImageListResolutions(this._settings); if (newImages.length > 0 && this._settings.get_boolean('revert-to-current-image')) { // user wants to switch to the new image when it arrives @@ -778,13 +818,16 @@ class BingWallpaperIndicator extends PanelMenu.Button { // special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename if (this.selected_image == 'random' || force_shuffle) { - if (this._settings.get_boolean('random-mode-include-only-favourites')) { - let favImageList = imageList.filter(Utils.isFavourite); - if (favImageList.length > 0) - imageList = favImageList; - else - log('not enough favourites available to shuffle'); - } + let filter = { 'faves': this._settings.get_boolean('random-mode-include-only-favourites'), + 'hidden': this._settings.get_boolean('random-mode-include-only-unhidden'), + 'min_height': this._settings.get_boolean('random-mode-include-only-uhd')?this._settings.get_int('min-uhd-height'):false + }; + + let favImageList = Utils.getImageList(this._settings, filter); + if (favImageList.length > 0) + imageList = favImageList; + else + log('not enough favourites available to shuffle'); this.imageIndex = Utils.getRandomInt(imageList.length); image = imageList[this.imageIndex]; if (this.selected_image == 'random') @@ -813,8 +856,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.copyright = image.copyright.match(/[\(\(]([^)]+)[\)\)]/)[1].replace('\*\*', ''); // Japan locale uses () rather than () this.longstartdate = image.fullstartdate; this.imageinfolink = image.copyrightlink.replace(/^http:\/\//i, 'https://'); - this.imageURL = BingURL + image.urlbase + '_' + resolution + '.jpg'; // generate image url for user's resolution - this.filename = toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); + this.imageURL = BingURL + image.urlbase + '_' + resolution + '.jpg'+'&qlt=100'; // generate image url for user's resolution + this.filename = Utils.toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); + this.dimensions.width = image.width?image.width:null; + this.dimensions.height = image.height?image.height:null; if (("favourite" in image) && image.favourite === true ) { this.favourite_status = true; @@ -822,13 +867,20 @@ class BingWallpaperIndicator extends PanelMenu.Button { else { this.favourite_status = false; } + + if (("hidden" in image) && image.hidden === true ) { + this.hidden_status = true; + } + else { + this.hidden_status = false; + } let file = Gio.file_new_for_path(this.filename); let file_exists = file.query_exists(null); let file_info = file_exists ? file.query_info ('*', Gio.FileQueryInfoFlags.NONE, null) : 0; if (!file_exists || file_info.get_size () == 0) { // file doesn't exist or is empty (probably due to a network error) - this._downloadImage(this.imageURL, file); + this._downloadImage(this.imageURL, file, true); } else { this._setBackground(); @@ -918,16 +970,16 @@ class BingWallpaperIndicator extends PanelMenu.Button { let BingWallpaperDir = Utils.getWallpaperDir(this._settings); imageList.forEach( (image) => { let resolution = Utils.getResolution(this._settings, image); - let filename = toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); + let filename = Utils.toFilename(BingWallpaperDir, image.startdate, image.urlbase, resolution); let url = this._imageURL(image.urlbase, resolution); let file = Gio.file_new_for_path(filename); - this._downloadImage(url, file); + this._downloadImage(url, file, false); }); } // download and process new image // FIXME: improve error handling - _downloadImage(url, file) { + _downloadImage(url, file, set_background) { let BingWallpaperDir = Utils.getWallpaperDir(this._settings); let dir = Gio.file_new_for_path(BingWallpaperDir); if (!dir.query_exists(null)) { @@ -940,12 +992,12 @@ class BingWallpaperIndicator extends PanelMenu.Button { try { if (Soup.MAJOR_VERSION >= 3) { this.httpSession.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null, (httpSession, message) => { - this._processFileDownload(message, file); + this._processFileDownload(message, file, set_background); }); } else { this.httpSession.queue_message(request, (httpSession, message) => { - this._processFileDownload(message, file); + this._processFileDownload(message, file, set_background); }); } } @@ -954,7 +1006,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { } } - _processFileDownload(message, file) { + _processFileDownload(message, file, set_background) { try { let data = (Soup.MAJOR_VERSION >= 3) ? this.httpSession.send_and_read_finish(message).get_data(): @@ -969,7 +1021,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { (file, res) => { try { file.replace_contents_finish(res); - this._setBackground(); + if (set_background) + this._setBackground(); log('Download successful'); } catch(e) { @@ -1030,7 +1083,5 @@ function disable() { } } -function toFilename(wallpaperDir, startdate, imageURL, resolution) { - return wallpaperDir + startdate + '-' + imageURL.replace(/^.*[\\\/]/, '').replace('th?id=OHR.', '') + '_' + resolution + '.jpg'; -} + diff --git a/icons/trash-empty-symbolic.svg b/icons/trash-empty-symbolic.svg new file mode 100644 index 00000000..cea9587c --- /dev/null +++ b/icons/trash-empty-symbolic.svg @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/icons/trash-full-symbolic.svg b/icons/trash-full-symbolic.svg new file mode 100644 index 00000000..df732d85 --- /dev/null +++ b/icons/trash-full-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 3c273c4e..bcda3bd8 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -6,11 +6,11 @@ msgstr "" msgid "Indicator icon" msgstr "" -#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:163 +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:169 msgid "Enable desktop notifications" msgstr "" -#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:145 extension.js:159 +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:149 extension.js:163 msgid "Set background image" msgstr "" @@ -46,7 +46,7 @@ msgstr "" msgid "Bing locale" msgstr "" -#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:148 +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:152 msgid "Settings" msgstr "" @@ -106,7 +106,7 @@ msgstr "" msgid "Enable logging to system journal" msgstr "" -#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:160 +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:164 msgid "Always show new images" msgstr "" @@ -252,75 +252,83 @@ msgstr "" msgid "Load image gallery" msgstr "" -#: extension.js:138 +#: extension.js:142 msgid "" msgstr "" -#: extension.js:139 extension.js:140 extension.js:141 +#: extension.js:143 extension.js:144 extension.js:145 msgid "Awaiting refresh..." msgstr "" -#: extension.js:142 +#: extension.js:146 msgid "Copy image to clipboard" msgstr "" -#: extension.js:143 +#: extension.js:147 msgid "Copy image URL to clipboard" msgstr "" -#: extension.js:144 +#: extension.js:148 msgid "Open image folder" msgstr "" -#: extension.js:146 +#: extension.js:150 msgid "Set lock screen image" msgstr "" -#: extension.js:147 +#: extension.js:151 msgid "Refresh Now" msgstr "" -#: extension.js:149 +#: extension.js:153 msgid "Open in image viewer" msgstr "" -#: extension.js:150 +#: extension.js:154 msgid "Open Bing image information page" msgstr "" -#: extension.js:157 +#: extension.js:161 msgid "Quick settings" msgstr "" -#: extension.js:161 +#: extension.js:165 msgid "Image shuffle mode" msgstr "" -#: extension.js:162 +#: extension.js:166 msgid "Image shuffle only favourites" msgstr "" -#: extension.js:164 +#: extension.js:167 +msgid "Image shuffle only unhidden" +msgstr "" + +#: extension.js:168 +msgid "Image shuffle only UHD resolutions" +msgstr "" + +#: extension.js:170 msgid "Show image count" msgstr "" -#: extension.js:333 +#: extension.js:355 msgid "Next refresh" msgstr "" -#: extension.js:334 +#: extension.js:356 msgid "Last refresh" msgstr "" -#: extension.js:765 extension.js:808 +#: extension.js:808 extension.js:855 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:839 +#: extension.js:891 msgid "No wallpaper available" msgstr "" -#: extension.js:840 +#: extension.js:892 msgid "No picture for today." msgstr "" @@ -340,14 +348,14 @@ msgstr "" msgid "Error fetching change log: " msgstr "" -#: utils.js:370 utils.js:373 +#: utils.js:436 utils.js:439 msgid "minutes" msgstr "" -#: utils.js:376 +#: utils.js:442 msgid "days" msgstr "" -#: utils.js:379 +#: utils.js:445 msgid "hours" msgstr "" diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 8d343d6aad81e7afd24ce147689dbef4fc9d51fe..0055ba0dc1019332dd5ad18d4f391cd1d9255428 100644 GIT binary patch literal 2241 zcmZ`*U1%It7@cSn`(xT9R-448CiZ0)d$YBz5-?Ikt)ZqwAJh~Z%@z`32waCasI=V{x)c1PQd^D$mTN)qs}-3&KuyTHaSiM zSVw-ZAL^3qjf+yLUO8!G7za9xd-Fl)S6rpaZdpcr^g-Ns-3j1vrx9oZ?gBOg+km@) zW?(ze0<;46)PVFH;=WtZ0o_@{Zg5u(d%#4`Ixq*D$H8-w@8LXJoC#+bJOX_4@J~bZ zskg%~gHHmF&YydWK6NMj8St0DmOuNO=~FkszXbjsxG=QzEPd)8_}9SKf!UYN?xjz? z1wI#{5jefPa-Kf*4*2chF5s2H{;%j$cfjuhKMpj>Lx0exX8d#D7w8{#Tj*0a!XE|u zK;OkD+vrm>eiHmXaQTT(&eEse3x6KG037)&-$|c(H~cH$C7@m-)Q&Ug{0c5&6Z^Xl zU1L0TE8?fYZvx#{cD_rWx*7fqcow*PVEH0_>Ro&p7 zc^e|$Uk1R(fD3c|c7Lh44x?ZREPws^6vv@% zgFgwL0=kYLUZPLU_s)Q4fy&XP75dbS{{s92aAK(Yb^6rI=V$P5z()-|i}a~kS2w}` z0;4znxk{g!>(hdR&Ci8y#o+I?hxTjM5wuDoIQWQnWgUykhGG4&^`%pOZETXmiU4@s#LQa-7 XHvP8M=93sNlCf5a!G93W>bd_PFIUX` literal 2027 zcmZ`)U1(fI7@cSnla{netTw5pM*6aW&Tegs1WZv8HIzv4MN@1sv%8bK*Ua8o?##`0 ztu3Jl+CE5MiWty0MUeU=Qlu5Z7atm_An1!Ig_1(41cOvT&~xVQCT+nBXV2Ml=jWSm zzWw&aS5z9S#EbSb44%n#;l7Ru?tVy!fAQq+ro)({@Nd4*dzQnf3t~#V4PL!ph%T^A zqhgfUx-Pn!Hm0bLd!4x0CazeHlc=eTX{d%yIrTAo@Zmh}izUP+pa*yW=mWL@{cUUo zZ);-+yd6M@>v$NN*l`DVwh>?_@Ms&mz}$QJ*-y@MK4af47Q`?%9|gXC;)lcZskg%4 z3!Vgaojx}}pSlPB6!<0Jiwl!sJoPsCvtSJz`M&EE$5U^H-vGCO=Ar9r^r?s7p96me zj2?OVI(_P4_}_t-fe&9jzneaFAN-%ezW^&=eSVTYHP=}M{|SiwOPW6Q0Q}x=K*V4UqPtEmjfNue_ zxBt0DpE|^Y;_L-J>U#VNeQMUpFnAQ`Iiy0JP&01@a0&Q(=BW!DPtA3n0Y48sd2#6- z`qVq&&w@_?M-Pvkpij-by$fCf2G7K2=~MH(7r~c-iA&E7(WhqoSHU-dR3%kgmvvj! zGEOQc1KY&3hLSFRGhcrUlh_ajfW3ey#D!KNj>pHx z?Sf9z81Zt8dnk-Ia?YrzGhdmeYB{No zH*D%9dz5^`A?VKg8g|dW;1lZ<8_L&mql9Kx3eBz*nq6t5*_G~Ub|oQPU8VCnZ@KIF zxaUyPdE`0jEFXGe=cH9`xsjK<;(YBGUO8mEVN^xSCQhAlyWm!JIg60KD8kY5xWhTB zwwV~Ks&dYnYUsz@fU6+oUV1Cr*S=8*A&;(Ro3diF#G{t-chbk+gd`z9SY + + false + Only pick from UHD in random mode + + + + + true + Only pick from unhidden in random mode + + + true Override safe defaults for Wayland desktop @@ -162,6 +174,13 @@ Speeds up subsequent loads, but requires some additional disk space + + + 2160 + Minimum image height to be considered UHD + + + false Save backup copy of Bing JSON to wallpaper directory diff --git a/utils.js b/utils.js index 2df84fd6..d9857072 100644 --- a/utils.js +++ b/utils.js @@ -187,8 +187,27 @@ function dateFromShortDate(shortdate) { 0, 0, 0 ); } -function getImageList(settings) { - return JSON.parse(settings.get_string('bing-json')); +function getImageList(settings, filter = null) { + let image_list = JSON.parse(settings.get_string('bing-json')); + if (!filter) { + return image_list; + } + else { + let filtered = []; + image_list.forEach(function(x, i) { + let ignore = false; + if (filter.faves && !x.favourite) + ignore = true; + if (filter.min_height && x.height < filter.min_height) + ignore = true; + if (filter.hidden && x.hidden) + ignore = true; + + if (!ignore) + filtered.push(x); + }); + return filtered; + } } function setImageList(settings, imageList) { @@ -233,6 +252,22 @@ function setImageFavouriteStatus(settings, imageURL, newState) { setImageList(settings, imageList); // save back to settings } +function setImageHiddenStatus(settings, hide_image_list, hide_status) { + // stub + // get current image list + let image_list = getImageList(settings); + image_list.forEach( (x, i) => { + hide_image_list.forEach(u => { + if (u.includes(x.urlbase)) { + // mark as hidden + x.hidden = hide_status; + } + }); + }); + // export image list back to settings + setImageList(settings, image_list); +} + function getCurrentImage(imageList) { if (!imageList || imageList.length == 0) return null; @@ -321,6 +356,22 @@ function cleanupImageList(settings) { setImageList(settings, newList); } +function populateImageListResolutions(settings) { + let curList = imageListSortByDate(getImageList(settings)); + let newList = []; + curList.forEach( function (x, i) { + let filename = imageToFilename(settings, x); + let width, height; + if (!x.width || !x.height) { + [width, height] = getFileDimensions(filename); + x.width = width; + x.height = height; + } + newList.push(x); + }); + setImageList(settings, newList); +} + function getWallpaperDir(settings) { let homeDir = GLib.get_home_dir(); let BingWallpaperDir = settings.get_string('download-folder').replace('~', homeDir); @@ -555,4 +606,21 @@ function importBingJSON(settings) { log('JSON import file not found'); } } - \ No newline at end of file + +function getFileDimensions(filepath) { + let format, width, height; + try { + [format, width, height] = GdkPixbuf.Pixbuf.get_file_info(filepath); + return [width, height]; + } + catch (e) { + log('unable to getFileDimensions('+filepath+') '+e); + return [null, null]; + } + +} + +function toFilename(wallpaperDir, startdate, imageURL, resolution) { + return wallpaperDir + startdate + '-' + imageURL.replace(/^.*[\\\/]/, '').replace('th?id=OHR.', '') + '_' + resolution + '.jpg'; +} + From 99858aa7724c7063f1160efff12916d30fd81266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Tue, 23 May 2023 16:33:15 +0300 Subject: [PATCH 05/21] Update Turkish translation (#204) Fix completely broken Turkish translation --- locale/tr/LC_MESSAGES/BingWallpaper.mo | Bin 439 -> 7537 bytes locale/tr/LC_MESSAGES/BingWallpaper.po | 284 +++++++++---------------- 2 files changed, 100 insertions(+), 184 deletions(-) diff --git a/locale/tr/LC_MESSAGES/BingWallpaper.mo b/locale/tr/LC_MESSAGES/BingWallpaper.mo index 45c643e88a1550c9684e1edf7c0244eeb92365af..24378ca893f49ade8356334d412ec5350df84159 100644 GIT binary patch literal 7537 zcmb7|TWloRS;r4#A>hDnHg^(8PG*zLEIZwv8SlcxV>{a(dp)zh&AL6i86+Z3cb)F8 z>FTPcF7~#CV3A-~h=)L=U3dVj1Vtl)5{*%^d9e~g_v9gogc1P~0s%rO2=ahXq#z^| z_A>-pC!^)_$- zJ`DaAcn|ypC`&p&qSV{L5R`Qt~4dGM{^*FjnT&)^mCzrmjZul%S| z?*?yyZvdYM&x5}Pz7ISC-wFN|DEs_7_%87EGx>gxfIrUsN`cqGA7=g>cozH!_z?Ia zDCfKaioTx%HTVrs_WL#{?>&SN9{}G5%DIc+68K?I&iNfs_W2};Db%Q#e+_&S^KTXS zT~PLW_{Z{n-T^K$p93ERe-V5Dd;#P~{W`zo{f~jXsy+#deU89K!9NGZ5B~{@UT;7c z{#0|I*!xLP?6V7sKW>8>{8do)`vfTOe+GOD_@~A5zXWB!?|`DuyAe+0`vAXW|0h7P z-!drs?0~Y*M?hXteNg=T%OF4Mcljmz-vLFQV^H4z28hemKZ0)rzXiSw{ud~`_!x_- z;HN<0$6teD=eM$0?DTkn9|VPGOQ6WR0v`Q)!kaTFcMkjzD0b+8SHT1DaqtVEobzq) zJ>WYrg6umF%KJYL%DxAn@a|>sb>I;w`hN}-9{dw{0sIe8_B)4=GT#R0z!yOA&u2k7 z_e{UQie)K@{#_isQs=ifltM>atu^&lv6p9SUo$3a>D z3@G-opzz`)5Z9?sgTk*r1BHiQ0Y47@OELdVHo3z5Q{W2tP4F!E7{-)y>Y(uU7YekX z*#9;NUDacZ@r9_9YpwX}>B*fu|AD%Dwo(Db=@Vt5PL{0ir>UW z;)gAU*k3sO6hpYP!4O-@MOiv=T`kRoS7K8r^P1Oo>FzFn3$HIRgr{;X=HUFS`Fnx! zB;z9E21Bk7F(fWG85bB8hFm+0%Z#6q372r45~7x6!bRA++WH{4&X8D|W2l9#NXNDn z+oYqDX2*J2V7(=^;P*`1>d^G8?%3FJC+V9|C;ow5Jd^ZH5S&@s?f8lA$5A^rJ>86Y zHqrZj+R?S;`u4`n-PMg-dTU!hSKHaCZSCHw&eW~dX~*gXqdT0rc&3x4{bYW2c7K1r z+77d76t`ysziGq7CbR8+P?@VEY^OQBD|jtPCSYIb|(#Ol9cZz z=^(H=>ZeG~{lt126}D>iny%g0UeRkI2GvQ&1_6S)ZF$}p=+(eCx)!%>nEE#Ml@tFt z9MU&^8|$d$Y`kIyVt~_6`+hUca5m2Z&lZn^sA&SLmPLamPWF2^b2D@eE4}U#Y86uNQ^EKxd+PACYXDaJN6m zt*&qGZ0I!7&A{(BA`^S%XD9Bj*hbbC;gGJa@>y=ygjrxyTY#Lh=SNw>sa~`n29fbN zdw*;?mKS%&)>#cr11GUSx2(wxhZCMNgTREIDjs__>84R%hf(Uc{H76)CgX>NT%t-c zNK)I=x1%f$O`ule7=pHJ+Uy9cn$A|D$Gldnj+q7I1bw=`y`}d%ga9UVbS+-ts1lE- zL~x8Q9=Vt0hR88dSbIJKAVdQiXMKqtx2ES4(TbU2IdPz_j}O;A^kv$L)P@kWh;Fq3I|?ec3&l2~W>?pnv9+PvG{icC(}>AUANScn zUo|*22zVN1yfo0pyPe6V&;>yxJ;Zxtuycv!R4;i{ZAR`)a$cIBrnX2tQy1kaNQ=`4 zp2V~$Bq7hb=cm$=#U%lq*GVAB2G8~s_lj_LPEI4&SYeH-Rx&NIJ{ zLE@fcf$mcZ@&!fKaEtSGC+8Q6ed z_8!OicqX>ZH5j`*e}a?UZC*=VuoO9edQ+66ehM{8OAEIyl?v&EZh?vbt+w`Gf}s^>(yk5zRkOB6?v&?G1JAZEkrEKE|DFiSbIPDjw}NZOee zRF}r|gnRm276w#DQM6>SN7c>5>L%fXS6p?)-MTR?rq9AM1*a3$!FY-4`C*pYMBRv^ z+YqO6-K#vCcLwu%X2*(UE1OB%_bSU-JE`nO+`h40*`X*%`%qb-bC}ncE?kjasG+9$1ZTqNNT9;B3*)&qj+A|4U*{L?~%#%Lf|*3mA85NWV=U1iItalCv0a> zv$AVVZ(i?aao4BIS{Qdd9YWuF)qUHLp2amk6ju>FnQcJu$|O!JZD|H7lQ!V{Jx=4< z>GAVAjb}EmZ>~ zSq+Gw&Zjg3NP&D@VlwiZ5#CLL3O4!h(||Z zIywprjok1Kz0Q3>^#5p71HEo~8BJ<}-9|@b=HW4_^ypIe?7-+G3h9|fM-pvkLql5W za{Q!Gy=J;H_l$D=9hnrNV?Xqz9na0AG043`qfIw8vAQ<7J;0cHYB+gKrjRXGHwW!3 zFlu7&hV2F{A4IXVv$eQua2u^%gH_?^s2ec!AQ~MKq8YzSOZp}bj4T)(j*d$Ala!8; zBt5)CuQEFH)v1Q{Y=~t`eXeUU@}?p?Fya8Lf$V^J_YSo${Te0@b=1vh z1`EUEng4&(?wwr(R;mlBtA!lP<5GL62dEjGJ% z=yzc!!mC?m(8eCRn+47#;+^5Ep%Wjbs)6rNZW_X-PKER4{s`D^9 zpIBCRt}81O66m>V$ltSrQ!lKPtUg{SHlX)+3dCL1?1-u8P7o!dNngpsujay!N+SX4 zqO)*e>ZpQFE`p^eJ)513S@+;HZA+nkBEVf!TY5Oa^iG#NpU4xPLgLX8Zp`yn*%$0Z zS9la&-QcP%>y~PXv{8Nh?bV z;R{y2vV%6PCuSwR3Wdtr&@N&V7kh*lUQz4v*{oN)R85l1sqX{)6q^>r@(5aQd{#3tBDBaB(1>k{a{Gi_EEkvrI5hbahXKWuzgmPmpUPocLJXX zOR>`QjXa#C8g>1ta+9=}7l7`0*x&Nyp8)p`$(e5BoMbM|QX{%mwLZyFF2&t1*e~(mw3)^%6EtC;=Vn)&KoxOhD#Nq zwUkLIQ~dYnKvQi4wQfmKd5U-ZxkDzxgm{OXC|@451yT`Czegt2HRl=%@#yFPpG^|< z#FtZ(pZ0H8-TMQ-=lMFX%gWJ44^N!#GIC)OC&+8^Pox$p`BFhtN_)xFr5ZgI1@<{B zI^he}j_vflR!uaLur2gdWA)c2R1}Bi#XRSmYd~(912|2UW9BO9fq#FS^}m1Jxc2G3 z*6jcMedB79`%Ict9cLv+o3KjN6P}kFpp)D;2dLwEtWud8|4*n?$;fbIR>(lfFfJa{ zrrm31{F^NBq?aQ4^L?gvhLzHg4)5r5G>3T#z{qr|uBHSDAwPVD;&?(n3IJ8T=*GH5 Wr%<8?=}6*LCB~$DFm?T|QU3$t**SIq literal 439 zcmYjMu};G<5Cy@Mk(t2*8(afhN!1~=Zi#4`$PHCtsod10MyVay4gw@TgWuy@I8#A6 z>B)Y+chB#>PL4khunrNYh%>|y;sW8Ti}=9iHJ)DcSGm#8qI8g~VJ?i7T16y}2Y2z9 zk~w9wB%20IG}<^wZ6()m(^eJ=9g!f$IUO=&RU z)s^yh{Lh$WB?oI2~@ES(iY;8nT^FwVvnHF?RS&!@<`gD;qI`ipz zL7Jp=AO5Oy84R>?LgA-x4W@G9)rC#XrRtG#!;KZLe_xECyVv<}Pr?9IrCv)_MWnlu zE?B@sml|feHKp)(UVA^YEZA=^_kOrjjlyN)$+FSd91A7PZe8y|HqJFR3PaTKT3XRr I$@lQ!8-R#{bN~PV diff --git a/locale/tr/LC_MESSAGES/BingWallpaper.po b/locale/tr/LC_MESSAGES/BingWallpaper.po index 5b46754f..90747e92 100644 --- a/locale/tr/LC_MESSAGES/BingWallpaper.po +++ b/locale/tr/LC_MESSAGES/BingWallpaper.po @@ -1,454 +1,370 @@ -#, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-01-23 18:58+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: \n" -"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"POT-Creation-Date: 2023-05-17 22:53+0200\n" +"PO-Revision-Date: 2023-05-18 21:53+0000\n" +"Last-Translator: Sabri Ünal \n" +"Language-Team: Turkish \n" +"Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Loco-Source-Locale: tr_TR\n" -"X-Loco-Parser: loco_parse_po\n" -"X-Generator: Loco https://localise.biz/" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.18-dev\n" #: ui/Settings.ui.h:1 ui/Settings4.ui.h:2 -msgctxt "Göstergeyi gizle" msgid "Hide the indicator" -msgstr "" +msgstr "Göstergeyi gizle" #: ui/Settings.ui.h:2 ui/Settings4.ui.h:3 -msgctxt "Gösterge simgesi" msgid "Indicator icon" -msgstr "" +msgstr "Gösterge simgesi" #: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:159 -msgctxt "Masaüstü bildirimlerini etkinleştir" msgid "Enable desktop notifications" -msgstr "" +msgstr "Masaüstü bildirimlerini etkinleştir" #: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:142 extension.js:156 -msgctxt "Arka plan resmi olarak ayarla" msgid "Set background image" -msgstr "" +msgstr "Arka plan görüntüsünü ayarla" #: ui/Settings.ui.h:5 ui/Settings4.ui.h:6 -msgctxt "Arka plan stili seçeneği" msgid "Background style option" -msgstr "" +msgstr "Arka plan stili seçeneği" #: ui/Settings.ui.h:6 ui/Settings4.ui.h:7 -msgctxt "Klasörü indir" msgid "Download folder" -msgstr "" +msgstr "İndirme klasörü" #: ui/Settings.ui.h:7 ui/Settings4.ui.h:1 -msgctxt "Bing Wallpaper Fotoğraf klasörü" msgid "Bing Wallpaper pictures folder" -msgstr "" +msgstr "Bing Duvar Kağıdı resimleri klasörü" #: ui/Settings.ui.h:8 ui/Settings4.ui.h:8 -msgctxt "Klasörü aç" msgid "Open folder" -msgstr "" +msgstr "Klasörü aç" #: ui/Settings.ui.h:9 ui/Settings4.ui.h:9 -msgctxt "Daha önce indirilen duvar kağıtlarını sil" msgid "Delete previously downloaded wallpapers" -msgstr "" +msgstr "Önceden indirilmiş duvar kağıtlarını sil" #: ui/Settings.ui.h:10 ui/Settings4.ui.h:10 -msgctxt "Seçili resim" msgid "Selected image" -msgstr "" +msgstr "Seçilen görüntü" #: ui/Settings.ui.h:11 -msgctxt "Galeriden resim seç" msgid "Select from image gallery" -msgstr "" +msgstr "Görüntü galerisinden seç" #: ui/Settings.ui.h:12 ui/Settings4.ui.h:11 -msgctxt "Bing konumu" msgid "Bing locale" -msgstr "" +msgstr "Bing yerel ayarı" #: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:145 -msgctxt "Ayarlar" msgid "Settings" -msgstr "" +msgstr "Ayarlar" #: ui/Settings.ui.h:14 ui/Settings4.ui.h:13 -msgctxt "Özel bulanıklık ve parlaklık kullan" msgid "Use custom blur and brightness" -msgstr "" +msgstr "Özel bulanıklık ve parlaklık kullan" #: ui/Settings.ui.h:15 ui/Settings4.ui.h:14 -msgctxt "GDM3 kilit ekranı efektlerini geçersiz kıl" msgid "Override GDM3 lockscreen effects" -msgstr "" +msgstr "GDM3 kilit ekranı etkilerini geçersiz kıl" #: ui/Settings.ui.h:16 ui/Settings4.ui.h:15 -msgctxt "Bulanıklaştırma, oturum açma isteminin okunabilirliğini artırabilir" msgid "Blur can improve readability of login prompt" -msgstr "" +msgstr "Bulanıklaştırma, giriş isteminin okunabilirliğini artırabilir" #: ui/Settings.ui.h:17 ui/Settings4.ui.h:16 -msgctxt "Arka plan bulanıklık yoğunluğu" msgid "Background blur intensity" -msgstr "" +msgstr "Arka plan bulanıklık yoğunluğu" #: ui/Settings.ui.h:18 ui/Settings4.ui.h:17 -msgctxt "Oturum açma isteminin kontrastı iyileştirebilir" msgid "Can improve contrast of login prompt" -msgstr "" +msgstr "Giriş isteminin karşıtlığını iyileştirebilir" #: ui/Settings.ui.h:19 ui/Settings4.ui.h:18 -msgctxt "Arka plan parlaklığı" msgid "Background brightness" -msgstr "" +msgstr "Arka plan parlaklığı" #: ui/Settings.ui.h:20 ui/Settings4.ui.h:19 -msgctxt "Ön Ayarlar" msgid "Presets" -msgstr "" +msgstr "Ön Ayarlar" #: ui/Settings.ui.h:21 -msgctxt "Yaygın olarak kullanılan ön ayarlar" msgid "Commonly used presets" -msgstr "" +msgstr "Yaygın kullanılan ön ayarlar" #: ui/Settings.ui.h:22 ui/Settings4.ui.h:20 -msgctxt "Bulanıklık yok, hafif loş" msgid "No blur, slight dim" -msgstr "" +msgstr "Bulanıklık yok, hafif loş" #: ui/Settings.ui.h:23 ui/Settings4.ui.h:21 -msgctxt "GNOME varsayılanı" msgid "GNOME default" -msgstr "" +msgstr "GNOME varsayılanı" #: ui/Settings.ui.h:24 ui/Settings4.ui.h:22 -msgctxt "Hafif bulanıklık, hafif loşluk" msgid "Slight blur, slight dim" -msgstr "" +msgstr "Hafif bulanıklık, hafif loş" #: ui/Settings.ui.h:25 ui/Settings4.ui.h:23 -msgctxt "Kilit Ekranı" msgid "Lock Screen" -msgstr "" +msgstr "Kilit Ekranı" #: ui/Settings.ui.h:26 ui/Settings4.ui.h:25 -msgctxt "Hata ayıklama günlüğü" msgid "Debug logging" -msgstr "" +msgstr "Hata ayıklama günlüğü" #: ui/Settings.ui.h:27 ui/Settings4.ui.h:24 -msgctxt "Sistem günlüğüne günlüğe kaydetmeyi etkinleştirme" msgid "Enable logging to system journal" -msgstr "" +msgstr "Sistem günlüğüne günlüklemeyi etkinleştir" #: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:157 -msgctxt "Her zaman yeni görüntüler gösterin" msgid "Always show new images" -msgstr "" +msgstr "Her zaman yeni görüntüleri göster" #: ui/Settings.ui.h:29 ui/Settings4.ui.h:26 -msgctxt "Mevcut olduğunda yeni görüntülere geçin (rastgele modda değilse)" msgid "Switch to new images when available (unless on random mode)" -msgstr "" +msgstr "Mevcut olduğunda yeni görüntülere geç (rastgele kipte değilse)" #: ui/Settings.ui.h:30 ui/Settings4.ui.h:29 -msgctxt "Wayland üzerindeki tüm özellikleri etkinleştirin" msgid "Enable all features on Wayland" -msgstr "" +msgstr "Wayland üzerinde tüm özellikleri etkinleştir" #: ui/Settings.ui.h:31 ui/Settings4.ui.h:28 -msgctxt "Bazı yeni özellikler Wayland üzerinde kararsız olabilir" msgid "Some newer features may be unstable on Wayland" -msgstr "" +msgstr "Bazı yeni özellikler Wayland üzerinde kararsız olabilir" #: ui/Settings.ui.h:32 ui/Settings4.ui.h:30 -msgctxt "Ekran çözünürlüğü" msgid "Screen resolution" -msgstr "" +msgstr "Ekran çözünürlüğü" #: ui/Settings.ui.h:33 ui/Settings4.ui.h:31 -msgctxt "Otomatik çözünürlük seçimini geçersiz kılma" msgid "Override automatic resolution selection" -msgstr "" +msgstr "Kendiliğinden çözünürlük seçimini geçersiz kıl" #: ui/Settings.ui.h:34 ui/Settings4.ui.h:32 -msgctxt "Rastgele aralığı manuel olarak ayarlama (saniye)" msgid "Manually adjust random interval (seconds)" -msgstr "" +msgstr "Rastgele aralığı elle ayarla (saniye)" #: ui/Settings.ui.h:35 ui/Settings4.ui.h:33 -msgctxt "Rastgele aralık" msgid "Random interval" -msgstr "" +msgstr "Rastgele aralık" #: ui/Settings.ui.h:36 ui/Settings4.ui.h:34 -msgctxt "Bing Wallpaper verilerini içe aktarma" msgid "Import Bing Wallpaper data" -msgstr "" +msgstr "Bing Duvar Kağıdı verilerini içe aktar" #: ui/Settings.ui.h:37 ui/Settings4.ui.h:35 -msgctxt "" -"Duvar kağıdı dizininden önceden dışa aktarılmış JSON verilerini içe aktarma" msgid "Import previously exported JSON data from wallpaper directory" msgstr "" +"Duvar kağıdı dizininden önceden dışa aktarılmış JSON verilerini içe aktar" #: ui/Settings.ui.h:38 ui/Settings4.ui.h:36 -msgctxt "İçe Aktar" msgid "Import" -msgstr "" +msgstr "İçe Aktar" #: ui/Settings.ui.h:39 ui/Settings4.ui.h:37 -msgctxt "Bing Wallpaper verilerini dışa aktarma" msgid "Export Bing Wallpaper data" -msgstr "" +msgstr "Bing Duvar Kağıdı verilerini dışa aktar" #: ui/Settings.ui.h:40 ui/Settings4.ui.h:38 msgid "Export JSON data to wallpaper dir for backup or data migration" msgstr "" +"JSON verilerini yedekleme veya veri taşıma için duvar kağıdı dizinine aktar" #: ui/Settings.ui.h:41 ui/Settings4.ui.h:39 -msgctxt "Dışa Aktar" msgid "Export" -msgstr "" +msgstr "Dışa Aktar" #: ui/Settings.ui.h:42 ui/Settings4.ui.h:40 -msgctxt "Bing verilerini her zaman dışa aktarın" msgid "Always export Bing data" -msgstr "" +msgstr "Bing verilerini her zaman dışa aktar" #: ui/Settings.ui.h:43 ui/Settings4.ui.h:41 -msgctxt "Veriler değiştiğinde Bing JSON'u dışa aktarın" msgid "Export Bing JSON whenever data changes" -msgstr "" +msgstr "Veriler her değiştiğinde Bing JSON'u dışa aktar" #: ui/Settings.ui.h:44 ui/Settings4.ui.h:42 -msgctxt "Hata ayıklama seçenekleri" msgid "Debug options" -msgstr "" +msgstr "Hata ayıklama seçenekleri" #: ui/Settings.ui.h:45 ui/Settings4.ui.h:44 -msgctxt "Bing'den her gün yeni duvar kağıdı görselleri" msgid "New wallpaper images everyday from Bing" -msgstr "" +msgstr "Bing'den her gün yeni duvar kağıdı görüntüleri" #: ui/Settings.ui.h:46 -msgctxt "GNOME kabuk uzantısı sürümü " msgid "Gnome shell extension version " -msgstr "" +msgstr "GNOME shell uzantısı sürümü " #: ui/Settings.ui.h:47 ui/Settings4.ui.h:46 -msgctxt "Michael Carroll tarafından geliştiriliyor" msgid "Maintained by Michael Carroll" -msgstr "" +msgstr "Michael Carroll tarafından sürdürülmektedir" #: ui/Settings.ui.h:48 ui/Settings4.ui.h:47 -msgctxt "" -"Yazara desteğinizi Flattr veya GitHub Sponsors üzerinden " -"gösterin." msgid "" -"Show your support to the author on " -"Flattr or Github " +"Show your support to the author on Flattr or Github " "Sponsors." msgstr "" +"Yazara desteğinizi Flattr veya Github Sponsorları üzerinden " +"gösterin." #: ui/Settings.ui.h:49 ui/Settings4.ui.h:48 -msgctxt "Son sürümden bu yana yapılan değişiklikler" msgid "Changes since last version" -msgstr "" +msgstr "Son sürümden bu yana değişiklikler" #: ui/Settings.ui.h:50 ui/Settings4.ui.h:49 -msgctxt "Elia Argentieri'nin NASA APOD GNOME kabuk uzantısına dayanmaktadır" msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "" +msgstr "Elia Argentieri'nin NASA APOD GNOME shell uzantısına dayanmaktadır" #: ui/Settings.ui.h:51 ui/Settings4.ui.h:50 -msgctxt "" -"Bu program KESİNLİKLE HİÇBİR GARANTİ vermez.\n" -"Ayrıntılar için GNU " -"Genel Kamu Lisansı, sürüm 3 veya sonrası'na bakın." msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General " "Public License, version 3 or later for details." msgstr "" +"Bu program KESİNLİKLE HİÇBİR GARANTİ ile birlikte " +"gelmez.\n" +"Ayrıntılar için GNU " +"Genel Kamu Lisansı, sürüm 3 veya sonrası'na bakın." #: ui/Settings.ui.h:53 ui/Settings4.ui.h:52 -msgctxt "Hakkında" msgid "About" -msgstr "" +msgstr "Hakkında" #: ui/Settings4.ui.h:43 -msgctxt "Galeri" msgid "Gallery" -msgstr "" +msgstr "Galeri" #: ui/Settings4.ui.h:45 -msgctxt "GNOME kabuk uzantısı sürümü " msgid "GNOME shell extension version " -msgstr "" +msgstr "GNOME shell uzantısı sürümü " #: ui/carousel.ui.h:1 ui/carousel4.ui.h:1 -msgctxt "Uygula" msgid "Apply" -msgstr "" +msgstr "Uygula" #: ui/carousel.ui.h:2 ui/carousel4.ui.h:2 -msgctxt "Görünüm" msgid "View" -msgstr "" +msgstr "Görüntüle" #: ui/carousel.ui.h:3 ui/carousel4.ui.h:3 -msgctxt "Bilgi" msgid "Info" -msgstr "" +msgstr "Bilgi" #: ui/carousel.ui.h:4 ui/carousel4.ui.h:4 -msgctxt "Sil" msgid "Delete" -msgstr "" +msgstr "Sil" #: ui/carousel.ui.h:5 ui/carousel4.ui.h:6 -msgctxt "Rastgele modu ayarla" msgid "Set random mode" -msgstr "" +msgstr "Rastgele kipi ayarla" #: ui/carousel4.ui.h:5 -msgctxt "" msgid "" -msgstr "" +msgstr "" #: ui/carousel4.ui.h:7 -msgctxt "Resim galerisini yükle" msgid "Load image gallery" -msgstr "" +msgstr "Görüntü galerisini yükle" #: extension.js:135 -msgctxt "" msgid "" -msgstr "" +msgstr "" #: extension.js:136 extension.js:137 extension.js:138 -msgctxt "Yenilenmeyi bekliyor..." msgid "Awaiting refresh..." -msgstr "" +msgstr "Yenileme bekleniyor..." #: extension.js:139 -msgctxt "Görüntüyü panoya kopyala" msgid "Copy image to clipboard" -msgstr "" +msgstr "Görüntüyü panoya kopyala" #: extension.js:140 -msgctxt "Görüntü URL'sini panoya kopyala" msgid "Copy image URL to clipboard" -msgstr "" +msgstr "Görüntü URL'sini panoya kopyala" #: extension.js:141 -msgctxt "Görüntü klasörünü açın" msgid "Open image folder" -msgstr "" +msgstr "Görüntü klasörünü aç" #: extension.js:143 -msgctxt "Kilit ekranı görüntüsünü ayarla" msgid "Set lock screen image" -msgstr "" +msgstr "Kilit ekranı görüntüsünü ayarla" #: extension.js:144 -msgctxt "Şimdi Yenile" msgid "Refresh Now" -msgstr "" +msgstr "Şimdi Yenile" #: extension.js:146 -msgctxt "Resim görüntüleyicide aç" msgid "Open in image viewer" -msgstr "" +msgstr "Görüntü göstericide aç" #: extension.js:147 -msgctxt "Bing resim bilgi sayfasını açın" msgid "Open Bing image information page" -msgstr "" +msgstr "Bing görüntü bilgileri sayfasını aç" #: extension.js:154 -msgctxt "Hızlı ayarlar" msgid "Quick settings" -msgstr "" +msgstr "Hızlı ayarlar" #: extension.js:158 -msgctxt "Görüntü karıştırma modu" msgid "Image shuffle mode" -msgstr "" +msgstr "Görüntü karıştırma kipi" #: extension.js:160 -msgctxt "Görüntü sayısını göster" msgid "Show image count" -msgstr "" +msgstr "Görüntü sayısını göster" #: extension.js:326 -msgctxt "Sonraki yenileme" msgid "Next refresh" -msgstr "" +msgstr "Sonraki yenileme" #: extension.js:327 -msgctxt "Son yenileme" msgid "Last refresh" -msgstr "" +msgstr "Son yenileme" #: extension.js:724 extension.js:760 -msgctxt "Bing için Günün Duvar Kağıdı" msgid "Bing Wallpaper of the Day for" -msgstr "" +msgstr "Bing Günün Duvar Kağıdı" #: extension.js:784 -msgctxt "Duvar kağıdı mevcut değil" msgid "No wallpaper available" -msgstr "" +msgstr "Kullanılabilir duvar kağıdı yok" #: extension.js:785 -msgctxt "Bugün için fotoğraf yok." msgid "No picture for today." -msgstr "" +msgstr "Bugün için resim yok." #: prefs.js:181 -msgctxt "Klasör seçin" msgid "Select folder" -msgstr "" +msgstr "Klasör seç" #: prefs.js:249 -msgctxt "En son görüntü" msgid "Most recent image" -msgstr "" +msgstr "En son görüntü" #: prefs.js:250 -msgctxt "Rastgele görüntü" msgid "Random image" -msgstr "" +msgstr "Rastgele görüntü" #: utils.js:135 -msgctxt "Değişiklik günlüğü alınırken hata oluştu: " msgid "Error fetching change log: " -msgstr "" +msgstr "Değişiklik günlüğü alınırken hata oluştu: " #: utils.js:350 utils.js:353 -msgctxt "dakika" msgid "minutes" -msgstr "" +msgstr "dakika" #: utils.js:356 -msgctxt "gün" msgid "days" -msgstr "" +msgstr "gün" #: utils.js:359 -msgctxt "saat" msgid "hours" -msgstr "" +msgstr "saat" From 5c9c5610cda6263e03c744ef511338b5ff5be228 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 14 Jun 2023 23:03:12 +1000 Subject: [PATCH 06/21] use array.filter() --- utils.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/utils.js b/utils.js index d9857072..32cd2ef0 100644 --- a/utils.js +++ b/utils.js @@ -193,20 +193,15 @@ function getImageList(settings, filter = null) { return image_list; } else { - let filtered = []; - image_list.forEach(function(x, i) { - let ignore = false; + return image_list.filter((x, i) => { if (filter.faves && !x.favourite) - ignore = true; + return false; if (filter.min_height && x.height < filter.min_height) - ignore = true; + return false; if (filter.hidden && x.hidden) - ignore = true; - - if (!ignore) - filtered.push(x); + return false; + return true; }); - return filtered; } } From 070a3972ddb7984b5a12605f41e4f253b730500d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 14 Jun 2023 23:16:18 +1000 Subject: [PATCH 07/21] add random key to schema --- schemas/gschemas.compiled | Bin 2241 -> 2277 bytes ...shell.extensions.bingwallpaper.gschema.xml | 6 ++++++ 2 files changed, 6 insertions(+) diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index 0055ba0dc1019332dd5ad18d4f391cd1d9255428..e27ce0ec29a84d02a232c30bcc68fb43d5b810b9 100644 GIT binary patch literal 2277 zcmZ`)U1(fI7`@RZ_Q$lFwAv&znluQz(8fkPTlymOA(8k{^vzHRDM&@kLn{h;&fLvUOS^FP9M1fG zGxOc~UU|cflpDrQ{nrK_Np<#-RTJF!gyZ~&U)nZg`;5Z>{m|x9>_(k+UUl9Fk8g6E z2C$Bby~R+MWv?m8An29HVi_8xL(}W2uvm42pyF0!#GyU-;N)A3(#5zLUo=5cGtl@b=0v3OgvS`)8MZAu$OHoXEU8(?xo3@a!TMbFn;IX zoAjxh;ZK7<1Wqomd`X{r2mCYObHJ9r2Ak3Cf4+E`KJ|9^ZQy>O>9A|#r*4El06qx3H8l7=`%|~W z9|4a6ht7K)^r`p2p9aqW)x%3G^r;!o8Sq8G=|3y!Q)l2`2hRiT{nK~pQ}2d<3w#?m z`cuOR`qW$D-vu||QZwV9KSQ5-C;T>WCotG`;7|J0E%5um&jIrJ)uy#(5n)4|FZ=`j|d7?{^Wr#J2s*m+4cp zKa;T$7#;3)(kzzK^HWsoG$|zOR?I6rk5+b(WFeDCO3&SJd@K?GK!QhMW73l zrVvRP3NJ|bh@?M^OBWS73~C~9V`*Z%EAWks?J$v!TkBs|p-4);C`nZ;rR!A?80Q?o z_jYL;L{?>MS*3EhoQW~zn`1T_Q_@vY&`B5z%%RF|QHof_fwb{QZs_Z>C~JhP!a|UM zZBSS&U7Qnpxq=SkNC!qJC}Gq)(!NPtpKn_q`>wCQb^_Ikml3IuC+(f=pc#l0y}HxxiLl=x?Ujbp<%vARsy#mMHL&4co}vbliN7vo_$TY zQ#y$hPTa=h>uMNi*B28y@a;R#I8E-ps}m-UWLS(#Xyv=VdY3kk2kbiujXS}pY5@+I zF|lqSUSE1i5jR{cV(Y1I<3QR;97wE1A&IaQE{iv{HqIV<=$7HwLo>Cqrvp{6!5U;{ zA(nnRrar*~x8X%hpHLd?em^FE$Ucy>I8PCmlCo!P+`SdoZXRRuD4Ka&H1oD-=GTj6 z{+^k2R5J+X}G0u{O2?JAp?5`&@wWEaUri zoLvBGEbB3ABGkgt^V{o159G!F>eJhm literal 2241 zcmZ`*U1%It7@cSn`(xT9R-448CiZ0)d$YBz5-?Ikt)ZqwAJh~Z%@z`32waCasI=V{x)c1PQd^D$mTN)qs}-3&KuyTHaSiM zSVw-ZAL^3qjf+yLUO8!G7za9xd-Fl)S6rpaZdpcr^g-Ns-3j1vrx9oZ?gBOg+km@) zW?(ze0<;46)PVFH;=WtZ0o_@{Zg5u(d%#4`Ixq*D$H8-w@8LXJoC#+bJOX_4@J~bZ zskg%~gHHmF&YydWK6NMj8St0DmOuNO=~FkszXbjsxG=QzEPd)8_}9SKf!UYN?xjz? z1wI#{5jefPa-Kf*4*2chF5s2H{;%j$cfjuhKMpj>Lx0exX8d#D7w8{#Tj*0a!XE|u zK;OkD+vrm>eiHmXaQTT(&eEse3x6KG037)&-$|c(H~cH$C7@m-)Q&Ug{0c5&6Z^Xl zU1L0TE8?fYZvx#{cD_rWx*7fqcow*PVEH0_>Ro&p7 zc^e|$Uk1R(fD3c|c7Lh44x?ZREPws^6vv@% zgFgwL0=kYLUZPLU_s)Q4fy&XP75dbS{{s92aAK(Yb^6rI=V$P5z()-|i}a~kS2w}` z0;4znxk{g!>(hdR&Ci8y#o+I?hxTjM5wuDoIQWQnWgUykhGG4&^`%pOZETXmiU4@s#LQa-7 XHvP8M=93sNlCf5a!G93W>bd_PFIUX` diff --git a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml index f7dc1fb5..8b08fc40 100644 --- a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml +++ b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml @@ -150,6 +150,12 @@ + + false + Pick a random image at random-interval + + + false Only pick from UHD in random mode From 6b6d98116f71bdbcab7d1d3eb3740e69c635bd2d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 15 Jun 2023 00:19:49 +1000 Subject: [PATCH 08/21] fix broken shuffle mode --- extension.js | 206 ++++++++++++++++++--------------------- locale/BingWallpaper.pot | 54 +++++----- 2 files changed, 122 insertions(+), 138 deletions(-) diff --git a/extension.js b/extension.js index 059b9af1..22375427 100644 --- a/extension.js +++ b/extension.js @@ -30,6 +30,8 @@ const BingURL = 'https://www.bing.com'; const IndicatorName = 'BingWallpaperIndicator'; const TIMEOUT_SECONDS = 24 * 3600; // FIXME: this should use the end data from the json data const TIMEOUT_SECONDS_ON_HTTP_ERROR = 1 * 3600; // retry in one hour if there is a http error +const MINIMUM_SHUFFLE_IMAGES = 3; // bare minimum to use filtered image set in shuffle mode + const ICON_PREVIOUS_BUTTON = 'media-seek-backward-symbolic'; const ICON_SHUFFLE_BUTTON = 'media-playlist-shuffle-symbolic'; const ICON_CONSEC_BUTTON = 'media-playlist-consecutive-symbolic'; @@ -108,6 +110,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.imageURL = ""; // link to image itself this.imageinfolink = ""; // link to Bing photo info page this.refreshdue = 0; + this.shuffledue = 0; this.refreshduetext = ""; this.thumbnail = null; this.thumbnailItem = null; @@ -140,7 +143,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { } this.refreshDueItem = newMenuItem(_("")); - this.titleItem = new PopupMenu.PopupSubMenuMenuItem(_("Awaiting refresh..."), false); + this.explainItem = newMenuItem(_("Awaiting refresh...")); this.copyrightItem = newMenuItem(_("Awaiting refresh...")); this.clipboardImageItem = newMenuItem(_("Copy image to clipboard")); @@ -153,6 +156,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.openImageItem = newMenuItem(_("Open in image viewer")); this.openImageInfoLinkItem = newMenuItem(_("Open Bing image information page")); + // create collapsable menu item (the image title), clicking this opens a sub-menu with various image options + this.titleItem = new PopupMenu.PopupSubMenuMenuItem(_("Awaiting refresh..."), false); [this.openImageInfoLinkItem, this.openImageItem, this.folderItem, this.clipboardImageItem, this.clipboardURLItem, this.dwallpaperItem] .forEach(e => this.titleItem.menu.addMenuItem(e)); @@ -162,7 +167,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { // toggles under the quick settings submenu this.toggleSetBackground = newMenuSwitchItem(_("Set background image"), this._settings.get_boolean('set-background')); this.toggleSelectNew = newMenuSwitchItem(_("Always show new images"), this._settings.get_boolean('revert-to-current-image')); - this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), true); + this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), this._settings.get_boolean('random-mode-enabled')); this.toggleShuffleOnlyFaves = newMenuSwitchItem(_("Image shuffle only favourites"), this._settings.get_boolean('random-mode-include-only-favourites')); this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); this.toggleShuffleOnlyUHD = newMenuSwitchItem(_("Image shuffle only UHD resolutions"), this._settings.get_boolean('random-mode-include-only-uhd')); @@ -244,7 +249,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { ]; // _setShuffleToggleState - settingConnections.forEach((e) => { + settingConnections.forEach( (e) => { this._settings.connect(e.signal, e.call.bind(this)); }); @@ -270,58 +275,27 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.refreshItem.connect('activate', this._refresh.bind(this)); this.settingsItem.connect('activate', this._openPrefs.bind(this)); - // unfortunately we can't bind like we can with prefs here, so we handle toggles in two steps - // first, we listen for changes to these toggle settings and update toggles - this._settings.connect('changed::set-background', () => { - this.toggleSetBackground.setToggleState(this._settings.get_boolean('set-background')); - }); - this._settings.connect('changed::revert-to-current-image', () => { - this.toggleSelectNew.setToggleState(this._settings.get_boolean('revert-to-current-image')); - }); - this._settings.connect('changed::notify', () => { - this.toggleNotifications.setToggleState(this._settings.get_boolean('notify')); - }); - this._settings.connect('changed::show-count-in-image-title', () => { - this.toggleImageCount.setToggleState(this._settings.get_boolean('show-count-in-image-title')); - this._setMenuText(); - }); - this._settings.connect('changed::random-mode-include-only-favourites', () => { - this.toggleShuffleOnlyFaves.setToggleState(this._settings.get_boolean('random-mode-include-only-favourites')); - }); - this._settings.connect('changed::random-mode-include-only-unhidden', () => { - this.toggleShuffleOnlyUnhidden.setToggleState(this._settings.get_boolean('random-mode-include-only-unhidden')); - }); - this._settings.connect('changed::random-mode-include-only-uhd', () => { - this.toggleShuffleOnlyUHD.setToggleState(this._settings.get_boolean('random-mode-include-only-uhd')); - }); - - // & then, link settings to toggle state (the other way) - this.toggleSetBackground.connect('toggled', (item, state) => { - this._settings.set_boolean('set-background', state); - }); - this.toggleSelectNew.connect('toggled', (item, state) => { - this._settings.set_boolean('revert-to-current-image', state); - }); - this.toggleNotifications.connect('toggled', (item, state) => { - this._settings.set_boolean('notify', state); - }); - this.toggleImageCount.connect('toggled', (item, state) => { - this._settings.set_boolean('show-count-in-image-title', state); - this._selectImage(false); - }); - this.toggleShuffleOnlyFaves.connect('toggled', (item, state) => { - this._settings.set_boolean('random-mode-include-only-favourites', state); - }); - this.toggleShuffleOnlyUnhidden.connect('toggled', (item, state) => { - this._settings.set_boolean('random-mode-include-only-unhidden', state); - }); - this.toggleShuffleOnlyUHD.connect('toggled', (item, state) => { - this._settings.set_boolean('random-mode-include-only-uhd', state); - }); + // unfortunately we can't bind toggles trivially like we can with prefs.js here, so we handle toggles in two steps + // first, we listen for changes to these toggle settings and update the status + // & then, link settings to toggle state (the other way) + + let toggles = [ {key: 'set-background', toggle: this.toggleSetBackground}, + {key: 'revert-to-current-image', toggle: this.toggleSelectNew}, + {key: 'notify', toggle: this.toggleNotifications}, + {key: 'show-count-in-image-title', toggle: this.toggleImageCount}, + {key: 'random-mode-enabled', toggle: this.toggleShuffle}, + {key: 'random-mode-include-only-favourites', toggle: this.toggleShuffleOnlyFaves}, + {key: 'random-mode-include-only-unhidden', toggle: this.toggleShuffleOnlyUnhidden}, + {key: 'random-mode-include-only-uhd', toggle: this.toggleShuffleOnlyUHD}]; - // shuffle is a special case - this._setShuffleToggleState(); - this.toggleShuffle.connect('toggled', this._toggleShuffle.bind(this)); + toggles.forEach( (e) => { + this._settings.connect('changed::'+e.key, () => { + e.toggle.setToggleState(this._settings.get_boolean(e.key)); + }); + e.toggle.connect('toggled', (item, state) => { + this._settings.set_boolean(e.key, state); + }); + }); this.folderItem.connect('activate', Utils.openImageFolder.bind(this, this._settings)); if (this.clipboard.clipboard) { // only if we have a clipboard @@ -368,7 +342,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.selected_image = this._settings.get_string('selected-image'); log('selected image changed to: ' + this.selected_image); this._selectImage(); - this._setShuffleToggleState(); } _notifyCurrentImage() { @@ -497,10 +470,11 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.randomizeBtn = this._newMenuIcon( ICON_RANDOM, this.controlItem, - this._shuffleImage); + this._selectImage, + null, true); } - _newMenuIcon(icon_name, parent, fn, position = null) { + _newMenuIcon(icon_name, parent, fn, position = null, arg = null) { let gicon = Gio.icon_new_for_string(icon_name); let icon = new St.Icon({ /*icon_name: icon_name,*/ @@ -527,7 +501,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { getActorCompat(parent).add_child(iconBtn); } - iconBtn.connect('button-press-event', fn.bind(this)); + iconBtn.connect('button-press-event', fn.bind(this, arg)); return iconBtn; } @@ -580,24 +554,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._gotoImage(0); } - _shuffleImage() { - this._selectImage(true); - } - - _setShuffleToggleState() { - this.toggleShuffle.setToggleState(this._settings.get_string('selected-image') == 'random'); - } - _toggleShuffle() { - if (this._settings.get_string('selected-image') == 'random') { - this._settings.set_string('selected-image', 'current'); - } - else { - this._settings.set_string('selected-image', 'random'); - } - this._setShuffleToggleState(); - log('switched mode to ' + this._settings.get_string('selected-image')); - } _favouriteImage() { log('favourite image '+this.imageURL+' status was '+this.favourite_status); @@ -631,8 +588,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { let imageList = Utils.getImageList(this._settings); let curIndex = 0; + /* if (this.selected_image == 'random') return; + */ if (this.selected_image == 'current') { curIndex = Utils.getCurrentImageIndex(imageList); @@ -705,7 +664,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { log('Recieved ' + data.length + ' bytes'); this._parseData(data); - if (this.selected_image != 'random') + if (!this._settings.get_boolean('random-mode-enabled')) this._selectImage(); } catch (error) { @@ -724,9 +683,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { seconds = TIMEOUT_SECONDS; this._timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._refresh.bind(this)); - let localTime = GLib.DateTime.new_now_local().add_seconds(seconds); - this.refreshdue = localTime; - log('next check in ' + seconds + ' seconds @ local time ' + localTime.format('%F %R %z')); + this.refreshdue = GLib.DateTime.new_now_local().add_seconds(seconds); + log('next check in ' + seconds + ' seconds'); } _restartShuffleTimeout(seconds = null) { @@ -736,7 +694,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (seconds == null) seconds = this._settings.get_int('random-interval'); - this._shuffleTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._selectImage.bind(this)); + this._shuffleTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._selectImage.bind(this, true)); + this.shuffledue = GLib.DateTime.new_now_local().add_seconds(seconds); log('next shuffle in ' + seconds + ' seconds'); } @@ -812,35 +771,57 @@ class BingWallpaperIndicator extends PanelMenu.Button { source.showNotification(notification); } + _shuffleImage() { + let image = null; + let imageList = Utils.getImageList(this._settings); + let filter = { 'faves': this._settings.get_boolean('random-mode-include-only-favourites'), + 'hidden': this._settings.get_boolean('random-mode-include-only-unhidden'), + 'min_height': this._settings.get_boolean('random-mode-include-only-uhd')?this._settings.get_int('min-uhd-height'):false + }; + let favImageList = Utils.getImageList(this._settings, filter); + + if (favImageList.length >= MINIMUM_SHUFFLE_IMAGES) { // we have the minimum images to shuffle, if not fall back to shuffle all iamges + imageList = favImageList; + } + else { + log('not enough filtered images available to shuffle'); + } + try { + this.imageIndex = Utils.getRandomInt(imageList.length); + image = imageList[this.imageIndex]; + + log('shuffled to image '+image.urlbase); + + return image; + } + catch (e) { + log('shuffle failed '+e); + return null; + } + } + _selectImage(force_shuffle = false) { let imageList = Utils.getImageList(this._settings); let image = null; // special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename - if (this.selected_image == 'random' || force_shuffle) { - let filter = { 'faves': this._settings.get_boolean('random-mode-include-only-favourites'), - 'hidden': this._settings.get_boolean('random-mode-include-only-unhidden'), - 'min_height': this._settings.get_boolean('random-mode-include-only-uhd')?this._settings.get_int('min-uhd-height'):false - }; - - let favImageList = Utils.getImageList(this._settings, filter); - if (favImageList.length > 0) - imageList = favImageList; - else - log('not enough favourites available to shuffle'); - this.imageIndex = Utils.getRandomInt(imageList.length); - image = imageList[this.imageIndex]; - if (this.selected_image == 'random') + if (force_shuffle) { + image = this._shuffleImage(); + if (this._settings.get_boolean('random-mode-enabled')) this._restartShuffleTimeout(); - } else if (this.selected_image == 'current') { - image = Utils.getCurrentImage(imageList); - this.imageIndex = Utils.getCurrentImageIndex(imageList); - } else { - image = Utils.inImageList(imageList, this.selected_image); - log('_selectImage: ' + this.selected_image + ' = ' + image ? image.urlbase : 'not found'); - if (!image) // if we didn't find it, try for current + } + + if (!image) { + if (this.selected_image == 'current') { image = Utils.getCurrentImage(imageList); - this.imageIndex = Utils.imageIndex(imageList, image.urlbase); + this.imageIndex = Utils.getCurrentImageIndex(imageList); + } else { + image = Utils.inImageList(imageList, this.selected_image); + //log('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase) ? image.urlbase : 'not found'); + if (!image) // if we didn't find it, try for current + image = Utils.getCurrentImage(imageList); + this.imageIndex = Utils.imageIndex(imageList, image.urlbase); + } } if (!image) @@ -907,7 +888,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { let maxLongDate = Utils.getMaxLongDate(this._settings); // refresh date from most recent Bing image let state = {maxlongdate: maxLongDate, title: this.title, explanation: this.explanation, copyright: this.copyright, longstartdate: this.longstartdate, imageinfolink: this.imageinfolink, imageURL: this.imageURL, - filename: this.filename, favourite: this.favourite_status}; + filename: this.filename, favourite: this.favourite_status, width: this.dimensions.width, + height: this.dimensions.height, + shuffledue: (this.shuffledue.to_unix? this.shuffledue.to_unix():0) + }; let stateJSON = JSON.stringify(state); log('Storing state as JSON: ' + stateJSON); @@ -916,6 +900,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { } _reStoreState() { + log('attempting to restore state'); try { // patch for relative paths, ensures that users running git version don't end up with broken state - see EGO review for version 38 https://extensions.gnome.org/review/30299 this._settings.set_string('download-folder', this._settings.get_string('download-folder').replace('$HOME', '~')); @@ -924,6 +909,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { let maxLongDate = null; log('restoring state...'); + log('state JSON is :'+stateJSON); maxLongDate = state.maxlongdate ? state.maxlongdate : null; this.title = state.title; this.explanation = state.explanation; @@ -932,13 +918,11 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.imageinfolink = state.imageinfolink; this.imageURL = state.imageURL; this.filename = state.filename; + this.dimensions.width = state.width; + this.dimensions.height = state.height; this._selected_image = this._settings.get_string('selected-image'); - if ("favourite" in state && state.favourite === true) { - this.favourite_status = true; - } - else { - this.favourite_status = false; - } + this.shuffledue = ("shuffledue" in state)? GLib.DateTime.new_from_unix_local(state.shuffledue) : 0; + this.favourite_status = ("favourite" in state && state.favourite === true); // update menus and thumbnail this._setMenuText(); this._setBackground(); @@ -948,8 +932,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { return; } - if (this.selected_image == 'random') { - this._shuffleImage(); + if (this._settings.get_boolean('random-mode-enabled')) { + this._restartShuffleTimeout(60); // FIXME: use state value this._restartTimeoutFromLongDate(maxLongDate); } else { diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index bcda3bd8..69af9c88 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -6,11 +6,11 @@ msgstr "" msgid "Indicator icon" msgstr "" -#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:169 +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:174 msgid "Enable desktop notifications" msgstr "" -#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:149 extension.js:163 +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:152 extension.js:168 msgid "Set background image" msgstr "" @@ -46,7 +46,7 @@ msgstr "" msgid "Bing locale" msgstr "" -#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:152 +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:155 msgid "Settings" msgstr "" @@ -106,7 +106,7 @@ msgstr "" msgid "Enable logging to system journal" msgstr "" -#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:164 +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:169 msgid "Always show new images" msgstr "" @@ -252,83 +252,83 @@ msgstr "" msgid "Load image gallery" msgstr "" -#: extension.js:142 +#: extension.js:145 msgid "" msgstr "" -#: extension.js:143 extension.js:144 extension.js:145 +#: extension.js:147 extension.js:148 extension.js:160 msgid "Awaiting refresh..." msgstr "" -#: extension.js:146 +#: extension.js:149 msgid "Copy image to clipboard" msgstr "" -#: extension.js:147 +#: extension.js:150 msgid "Copy image URL to clipboard" msgstr "" -#: extension.js:148 +#: extension.js:151 msgid "Open image folder" msgstr "" -#: extension.js:150 +#: extension.js:153 msgid "Set lock screen image" msgstr "" -#: extension.js:151 +#: extension.js:154 msgid "Refresh Now" msgstr "" -#: extension.js:153 +#: extension.js:156 msgid "Open in image viewer" msgstr "" -#: extension.js:154 +#: extension.js:157 msgid "Open Bing image information page" msgstr "" -#: extension.js:161 +#: extension.js:166 msgid "Quick settings" msgstr "" -#: extension.js:165 +#: extension.js:170 msgid "Image shuffle mode" msgstr "" -#: extension.js:166 +#: extension.js:171 msgid "Image shuffle only favourites" msgstr "" -#: extension.js:167 +#: extension.js:172 msgid "Image shuffle only unhidden" msgstr "" -#: extension.js:168 +#: extension.js:173 msgid "Image shuffle only UHD resolutions" msgstr "" -#: extension.js:170 +#: extension.js:175 msgid "Show image count" msgstr "" -#: extension.js:355 +#: extension.js:329 msgid "Next refresh" msgstr "" -#: extension.js:356 +#: extension.js:330 msgid "Last refresh" msgstr "" -#: extension.js:808 extension.js:855 +#: extension.js:767 extension.js:836 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:891 +#: extension.js:872 msgid "No wallpaper available" msgstr "" -#: extension.js:892 +#: extension.js:873 msgid "No picture for today." msgstr "" @@ -348,14 +348,14 @@ msgstr "" msgid "Error fetching change log: " msgstr "" -#: utils.js:436 utils.js:439 +#: utils.js:431 utils.js:434 msgid "minutes" msgstr "" -#: utils.js:442 +#: utils.js:437 msgid "days" msgstr "" -#: utils.js:445 +#: utils.js:440 msgid "hours" msgstr "" From 484c93ef7dd9599ffe36121103ff59d25249370e Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Fri, 23 Jun 2023 00:01:31 +1000 Subject: [PATCH 09/21] respond to random mode changes --- extension.js | 30 +++++++++++++++++++++---- locale/BingWallpaper.pot | 16 ++++++++----- locale/tr/LC_MESSAGES/BingWallpaper.mo | Bin 7537 -> 7556 bytes 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/extension.js b/extension.js index 22375427..1070a2e3 100644 --- a/extension.js +++ b/extension.js @@ -166,7 +166,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.settingsSubMenu = new PopupMenu.PopupSubMenuMenuItem(_("Quick settings"), false); // toggles under the quick settings submenu this.toggleSetBackground = newMenuSwitchItem(_("Set background image"), this._settings.get_boolean('set-background')); - this.toggleSelectNew = newMenuSwitchItem(_("Always show new images"), this._settings.get_boolean('revert-to-current-image')); + this.toggleSelectNew = newMenuSwitchItem(_("Always switch to new images"), this._settings.get_boolean('revert-to-current-image')); this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), this._settings.get_boolean('random-mode-enabled')); this.toggleShuffleOnlyFaves = newMenuSwitchItem(_("Image shuffle only favourites"), this._settings.get_boolean('random-mode-include-only-favourites')); this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); @@ -207,8 +207,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { allMenuItems.forEach(e => this.menu.addMenuItem(e)); // non clickable information items - [this.explainItem, this.copyrightItem, this.refreshDueItem, this.thumbnailItem] - .forEach((e) => { + let nonclickable = [this.explainItem, this.copyrightItem, this.refreshDueItem, this.thumbnailItem]; + if (this._settings.get_boolean('random-mode-enabled')) + nonclickable.concat(this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUHD, this.toggleShuffleOnlyUnhidden); + nonclickable.forEach((e) => { e.setSensitive(false); }); @@ -245,7 +247,11 @@ class BingWallpaperIndicator extends PanelMenu.Button { {signal: 'changed::notify', call: this._notifyCurrentImage}, {signal: 'changed::always-export-bing-json', call: this._exportData}, {signal: 'changed::bing-json', call: this._exportData}, - {signal: 'changed::controls-icon-size', call: this._setControls} + {signal: 'changed::controls-icon-size', call: this._setControls}, + {signal: 'changed::random-mode-enabled', call: this._randomModeChanged}, + {signal: 'changed::random-mode-include-only-favourites', call: this._randomModeChanged}, + {signal: 'changed::random-mode-include-only-unhidden', call: this._randomModeChanged}, + {signal: 'changed::random-mode-include-only-uhd', call: this._randomModeChanged}, ]; // _setShuffleToggleState @@ -554,6 +560,22 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._gotoImage(0); } + _randomModeChanged() { + let randomEnabled = this._settings.get_boolean('random-mode-enabled'); + [this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUnhidden, this.toggleShuffleOnlyUHD] + .forEach( x => { + x.setSensitive(randomEnabled); + }); + if (randomEnabled) { + // enable shuffle mode, by setting a shuffe timer (5 seconds) + this._restartShuffleTimeout(5); + } + else { + // clear shuffle timer + if (this._shuffleTimeout) + GLib.source_remove(this._shuffleTimeout); + } + } _favouriteImage() { diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 69af9c88..88f0a53d 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -106,7 +106,7 @@ msgstr "" msgid "Enable logging to system journal" msgstr "" -#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 extension.js:169 +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 msgid "Always show new images" msgstr "" @@ -292,6 +292,10 @@ msgstr "" msgid "Quick settings" msgstr "" +#: extension.js:169 +msgid "Always switch to new images" +msgstr "" + #: extension.js:170 msgid "Image shuffle mode" msgstr "" @@ -312,23 +316,23 @@ msgstr "" msgid "Show image count" msgstr "" -#: extension.js:329 +#: extension.js:335 msgid "Next refresh" msgstr "" -#: extension.js:330 +#: extension.js:336 msgid "Last refresh" msgstr "" -#: extension.js:767 extension.js:836 +#: extension.js:789 extension.js:858 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:872 +#: extension.js:894 msgid "No wallpaper available" msgstr "" -#: extension.js:873 +#: extension.js:895 msgid "No picture for today." msgstr "" diff --git a/locale/tr/LC_MESSAGES/BingWallpaper.mo b/locale/tr/LC_MESSAGES/BingWallpaper.mo index 24378ca893f49ade8356334d412ec5350df84159..18fa19bb4e8f6c473ecb88d2e2aa1fb54d0d86f4 100644 GIT binary patch delta 746 zcmXZaODKd<6u|K_o{dLlyx;G4jOQRzN@JSjO;{;3V?`;CNcu_^HcDBM6j@lRu@a() zg$=Q=APZ$jY@{gv)6D93?w#+RbMCqG*|_XDxCt^YOd{rt%1b&SHRM8jYBo{cg#%(UNwbx6~) zf;qT_dgIf;`V#d9ZP-Yu@v*L4?9u6+r>~kL@j)TdZ8Lu$%7=HVlj;2&zfBF3Z>vIp!zz2F4a<0fju#vMTn!87WO-%$$% zaat3_Aw5YBYUhop4Y*Oi_n=N_4)wpWiM*nmVK_cuCO+W~{sz|DByosT%LzdXKm1@3 zHZe~vG=?EK6>tvq2^M|xp>Gi}-ObLnX16PQz}4H=+STbBwyc>fgWl2ck!f#st*xq| N+~b|~{aR-t{{aA5Rfqrp delta 726 zcmXZa&nv@m7{Kvo7%^-ZWAk(JTeG%_tSCP&QY<&69ISBJg#(xG4zlEcgFj#=A;P%Q z92{^_ZWISiTqMO!-cQ@<^?W}2exG08tp>mPj_yrLI>QS-IZrJl#pk5MedvkD_!ILSpP7e5%nM#i9N zS;7WfN1gZ}b3R3#-~nqeg%-?VjqPZ|NerSsw~1zqqZZyp9q7y;C?dGWE__B^k+mxQ zVlQ@c9!0*AL{VSdMrz6tHsUq5;Rk9yJ8RMnxij{o4mgE97(;E?xFoO=+@enWh+60q zHIZhaCn-klyaly^0P6E0)D4AE{~Iyn>&YSJ;T6{64aV_3bKW3HP{b$u1jGE0!WQgc rpIT@Vb8seO81)k@B$mx@1&N4l%TzcK3D3?i*84p^k1t^@U9$WGwcAZx From a76fc98672cc87661bd4b5a3be8aaed7146cc32e Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 26 Jun 2023 14:16:48 +1000 Subject: [PATCH 10/21] fix shuffle timing & support on hour, day, week --- .eslintrc.yml | 270 ++++++++++++++++++ carousel.js | 6 +- extension.js | 28 +- locale/BingWallpaper.pot | 24 +- schemas/gschemas.compiled | Bin 2277 -> 2375 bytes ...shell.extensions.bingwallpaper.gschema.xml | 6 + utils.js | 36 ++- 7 files changed, 348 insertions(+), 22 deletions(-) create mode 100644 .eslintrc.yml diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..97e728f9 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,270 @@ +--- +# SPDX-License-Identifier: MIT OR LGPL-2.0-or-later +# SPDX-FileCopyrightText: 2018 Claudio André +env: + es2021: true +extends: 'eslint:recommended' +plugins: + - jsdoc +rules: + array-bracket-newline: + - error + - consistent + array-bracket-spacing: + - error + - never + array-callback-return: error + arrow-parens: + - error + - as-needed + arrow-spacing: error + block-scoped-var: error + block-spacing: error + brace-style: error + # Waiting for this to have matured a bit in eslint + # camelcase: + # - error + # - properties: never + # allow: [^vfunc_, ^on_, _instance_init] + comma-dangle: + - error + - arrays: always-multiline + objects: always-multiline + functions: never + comma-spacing: + - error + - before: false + after: true + comma-style: + - error + - last + computed-property-spacing: error + curly: + - error + - multi-or-nest + - consistent + dot-location: + - error + - property + eol-last: error + eqeqeq: error + func-call-spacing: error + func-name-matching: error + func-style: + - error + - declaration + - allowArrowFunctions: true + indent: + - error + - 4 + - ignoredNodes: + # Allow not indenting the body of GObject.registerClass, since in the + # future it's intended to be a decorator + - 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child' + # Allow dedenting chained member expressions + MemberExpression: 'off' + jsdoc/check-alignment: error + jsdoc/check-param-names: error + jsdoc/check-tag-names: error + jsdoc/check-types: error + jsdoc/implements-on-classes: error + jsdoc/newline-after-description: error + jsdoc/require-jsdoc: error + jsdoc/require-param: error + jsdoc/require-param-description: error + jsdoc/require-param-name: error + jsdoc/require-param-type: error + key-spacing: + - error + - beforeColon: false + afterColon: true + keyword-spacing: + - error + - before: true + after: true + linebreak-style: + - error + - unix + lines-between-class-members: + - error + - always + - exceptAfterSingleLine: true + max-nested-callbacks: error + max-statements-per-line: error + new-parens: error + no-array-constructor: error + no-await-in-loop: error + no-caller: error + no-constant-condition: + - error + - checkLoops: false + no-div-regex: error + no-empty: + - error + - allowEmptyCatch: true + no-extra-bind: error + no-extra-parens: + - error + - all + - conditionalAssign: false + nestedBinaryExpressions: false + returnAssign: false + no-implicit-coercion: + - error + - allow: + - '!!' + no-invalid-this: error + no-iterator: error + no-label-var: error + no-lonely-if: error + no-loop-func: error + no-nested-ternary: error + no-new-object: error + no-new-wrappers: error + no-octal-escape: error + no-proto: error + no-prototype-builtins: 'off' + no-restricted-globals: [error, window] + no-restricted-properties: + - error + - object: imports + property: format + message: Use template strings + - object: pkg + property: initFormat + message: Use template strings + - object: Lang + property: copyProperties + message: Use Object.assign() + - object: Lang + property: bind + message: Use arrow notation or Function.prototype.bind() + - object: Lang + property: Class + message: Use ES6 classes + no-restricted-syntax: + - error + - selector: >- + MethodDefinition[key.name="_init"] > + FunctionExpression[params.length=1] > + BlockStatement[body.length=1] + CallExpression[arguments.length=1][callee.object.type="Super"][callee.property.name="_init"] > + Identifier:first-child + message: _init() that only calls super._init() is unnecessary + - selector: >- + MethodDefinition[key.name="_init"] > + FunctionExpression[params.length=0] > + BlockStatement[body.length=1] + CallExpression[arguments.length=0][callee.object.type="Super"][callee.property.name="_init"] + message: _init() that only calls super._init() is unnecessary + - selector: BinaryExpression[operator="instanceof"][right.name="Array"] + message: Use Array.isArray() + no-return-assign: error + no-return-await: error + no-self-compare: error + no-shadow: error + no-shadow-restricted-names: error + no-spaced-func: error + no-tabs: error + no-template-curly-in-string: error + no-throw-literal: error + no-trailing-spaces: error + no-undef-init: error + no-unneeded-ternary: error + no-unused-expressions: error + no-unused-vars: + - error + # Vars use a suffix _ instead of a prefix because of file-scope private vars + - varsIgnorePattern: (^unused|_$) + argsIgnorePattern: ^(unused|_) + no-useless-call: error + no-useless-computed-key: error + no-useless-concat: error + no-useless-constructor: error + no-useless-rename: error + no-useless-return: error + no-whitespace-before-property: error + no-with: error + nonblock-statement-body-position: + - error + - below + object-curly-newline: + - error + - consistent: true + multiline: true + object-curly-spacing: error + object-shorthand: error + operator-assignment: error + operator-linebreak: error + padded-blocks: + - error + - never + # These may be a bit controversial, we can try them out and enable them later + # prefer-const: error + # prefer-destructuring: error + prefer-numeric-literals: error + prefer-promise-reject-errors: error + prefer-rest-params: error + prefer-spread: error + prefer-template: error + quotes: + - error + - single + - avoidEscape: true + require-await: error + rest-spread-spacing: error + semi: + - error + - always + semi-spacing: + - error + - before: false + after: true + semi-style: error + space-before-blocks: error + space-before-function-paren: + - error + - named: never + # for `function ()` and `async () =>`, preserve space around keywords + anonymous: always + asyncArrow: always + space-in-parens: error + space-infix-ops: + - error + - int32Hint: false + space-unary-ops: error + spaced-comment: error + switch-colon-spacing: error + symbol-description: error + template-curly-spacing: error + template-tag-spacing: error + unicode-bom: error + wrap-iife: + - error + - inside + yield-star-spacing: error + yoda: error +settings: + jsdoc: + mode: typescript +globals: + ARGV: readonly + Debugger: readonly + GIRepositoryGType: readonly + globalThis: readonly + imports: readonly + Intl: readonly + log: readonly + logError: readonly + print: readonly + printerr: readonly + window: readonly + TextEncoder: readonly + TextDecoder: readonly + console: readonly + setTimeout: readonly + setInterval: readonly + clearTimeout: readonly + clearInterval: readonly +parserOptions: + ecmaVersion: 2022 diff --git a/carousel.js b/carousel.js index d665e0d3..8009cb0a 100644 --- a/carousel.js +++ b/carousel.js @@ -78,8 +78,8 @@ var Carousel = class Carousel { } _create_gallery() { - Utils.randomIntervals.forEach((seconds, i) => { - let item = this._create_random_item(seconds, Utils.randomIntervalsTitle[i]); + Utils.randomIntervals.forEach((x) => { + let item = this._create_random_item(x.value, x.title); if (Gtk.get_major_version() < 4) this.flowBox.add(item); else @@ -183,7 +183,7 @@ var Carousel = class Carousel { return item; } - _create_random_item(seconds, title) { + _create_random_item(interval, title) { let buildable = new Gtk.Builder(); // grab appropriate object from UI file diff --git a/extension.js b/extension.js index 1070a2e3..9513bb5e 100644 --- a/extension.js +++ b/extension.js @@ -169,13 +169,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.toggleSelectNew = newMenuSwitchItem(_("Always switch to new images"), this._settings.get_boolean('revert-to-current-image')); this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), this._settings.get_boolean('random-mode-enabled')); this.toggleShuffleOnlyFaves = newMenuSwitchItem(_("Image shuffle only favourites"), this._settings.get_boolean('random-mode-include-only-favourites')); - this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); + //this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); this.toggleShuffleOnlyUHD = newMenuSwitchItem(_("Image shuffle only UHD resolutions"), this._settings.get_boolean('random-mode-include-only-uhd')); this.toggleNotifications = newMenuSwitchItem(_("Enable desktop notifications"), this._settings.get_boolean('notify')); this.toggleImageCount = newMenuSwitchItem(_("Show image count"), this._settings.get_boolean('show-count-in-image-title')); [this.toggleNotifications, this.toggleImageCount, this.toggleSetBackground, this.toggleSelectNew, - this.toggleShuffle, this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUnhidden, this.toggleShuffleOnlyUHD] + this.toggleShuffle, this.toggleShuffleOnlyFaves, /*this.toggleShuffleOnlyUnhidden,*/ this.toggleShuffleOnlyUHD] .forEach(e => this.settingsSubMenu.menu.addMenuItem(e)); // these items are a bit unique, we'll populate them in _setControls() @@ -209,7 +209,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { // non clickable information items let nonclickable = [this.explainItem, this.copyrightItem, this.refreshDueItem, this.thumbnailItem]; if (this._settings.get_boolean('random-mode-enabled')) - nonclickable.concat(this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUHD, this.toggleShuffleOnlyUnhidden); + nonclickable.concat(this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUHD /*, this.toggleShuffleOnlyUnhidden*/); nonclickable.forEach((e) => { e.setSensitive(false); }); @@ -291,7 +291,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { {key: 'show-count-in-image-title', toggle: this.toggleImageCount}, {key: 'random-mode-enabled', toggle: this.toggleShuffle}, {key: 'random-mode-include-only-favourites', toggle: this.toggleShuffleOnlyFaves}, - {key: 'random-mode-include-only-unhidden', toggle: this.toggleShuffleOnlyUnhidden}, + /*{key: 'random-mode-include-only-unhidden', toggle: this.toggleShuffleOnlyUnhidden},*/ {key: 'random-mode-include-only-uhd', toggle: this.toggleShuffleOnlyUHD}]; toggles.forEach( (e) => { @@ -562,7 +562,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { _randomModeChanged() { let randomEnabled = this._settings.get_boolean('random-mode-enabled'); - [this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUnhidden, this.toggleShuffleOnlyUHD] + [this.toggleShuffleOnlyFaves, this.toggleShuffleOnlyUHD /*, this.toggleShuffleOnlyUnhidden*/] .forEach( x => { x.setSensitive(randomEnabled); }); @@ -713,8 +713,22 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (this._shuffleTimeout) GLib.source_remove(this._shuffleTimeout); - if (seconds == null) - seconds = this._settings.get_int('random-interval'); + if (seconds == null) { + let diff = Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000); + + + log('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff); + + if (diff > 0) { + seconds = diff; // if not specified, we should maintain the existing shuffle timeout (i.e. we just restored from saved state) + } + else if (this._settings.get_string('random-interval-mode') != 'custom') { + seconds = Utils.seconds_until(this._settings.get_string('random-interval-mode')); // else we shuffle at specified interval (midnight default) + } + else { + seconds = this._settings.get_int('random-interval'); // or whatever the user has specified (as a timer) + } + } this._shuffleTimeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._selectImage.bind(this, true)); this.shuffledue = GLib.DateTime.new_now_local().add_seconds(seconds); diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 88f0a53d..07ed3f67 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -304,10 +304,6 @@ msgstr "" msgid "Image shuffle only favourites" msgstr "" -#: extension.js:172 -msgid "Image shuffle only unhidden" -msgstr "" - #: extension.js:173 msgid "Image shuffle only UHD resolutions" msgstr "" @@ -324,15 +320,15 @@ msgstr "" msgid "Last refresh" msgstr "" -#: extension.js:789 extension.js:858 +#: extension.js:803 extension.js:872 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:894 +#: extension.js:908 msgid "No wallpaper available" msgstr "" -#: extension.js:895 +#: extension.js:909 msgid "No picture for today." msgstr "" @@ -348,7 +344,19 @@ msgstr "" msgid "Random image" msgstr "" -#: utils.js:135 +#: utils.js:65 +msgid "on the hour" +msgstr "" + +#: utils.js:66 +msgid "every day at midnight" +msgstr "" + +#: utils.js:67 +msgid "every Sunday at midnight" +msgstr "" + +#: utils.js:136 msgid "Error fetching change log: " msgstr "" diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index e27ce0ec29a84d02a232c30bcc68fb43d5b810b9..ba56fde6ef87b9c8864fc4b15d68e64b0b06cc13 100644 GIT binary patch literal 2375 zcmaJ@U1%It7@cSmlh(9Jn%X3`bz>~-LT|RFMJfiYh;68m=!2Tlik;cH*&TCt?lM2w zuC^rvgW3nlOVAdoKC~iA#fKa;a%y$(LvXju(l z9pne{zAnmvuppHhkS8MPho1Js0mt+6Wm~C|U6KKtK7=1WY)5cx;%=Y`Xs)6KT*C(F zd#h*z*U%1KLkDyx&;?)#);6FAxW9_+;GMt&Kni#e=m$8Tq13+LHiNmI4r|hy1R}Ix*h&!;Lm}@+bd=I z)Lhq9@YleVzb-sQpPKpb6LO#x?3|u$r%&AsKLy?e9Q?%TrBA&b z{xJ9%;OeQ<8~N=~H^CnR&j3fhZ8*(%>J9K`!DoRTM;>3IPtEgM0AB&#Yv@~~PtAFL z2mTTG`NlgZ=~FktzYbmk=0}&Frcd1mzoixD1{}Zr_YL~gJjWC`4Yd9~)JC70>)Hc; zl=`r3)=SO#9{?W$0$EaaPKvS}$)IQl6KIRpVJ4JH<|63|uW09`adUAHNR}zQcBK>N zh0^&vs)%`O+Bq3pmF-F>}jC~7wu-LhQUQx!A%x}fU#?VGS3=-nt@Q_tZi?WHSe&&y;oUQYYMw~MALGpVpr zbhPqv$zlt-EOI*bBMh8ONJL(wY9nJ_=pYKT3Wez^^j?*wR&hMmxjmdieY{Xc*qq#i z2y=my)zu@w$jMiTi?nFynG?@Wf&rC5crRF5q2u{ z%%QQSa~*-iQH!V$7acanV|*~{{Cxn@0=b#YXA8I!U~R@HWNQ6JFl%(JjkiP9GX?6o|>iJ<_dVWsD z2-3c)h;e&T$AK3~tO{|iF8fN`t{B(KHTN6aGjWx~`b)?|Psi0AK)kObZ@iLprLaR` zlfkPTlymOA(8k{^vzHRDM&@kLn{h;&fLvUOS^FP9M1fG zGxOc~UU|cflpDrQ{nrK_Np<#-RTJF!gyZ~&U)nZg`;5Z>{m|x9>_(k+UUl9Fk8g6E z2C$Bby~R+MWv?m8An29HVi_8xL(}W2uvm42pyF0!#GyU-;N)A3(#5zLUo=5cGtl@b=0v3OgvS`)8MZAu$OHoXEU8(?xo3@a!TMbFn;IX zoAjxh;ZK7<1Wqomd`X{r2mCYObHJ9r2Ak3Cf4+E`KJ|9^ZQy>O>9A|#r*4El06qx3H8l7=`%|~W z9|4a6ht7K)^r`p2p9aqW)x%3G^r;!o8Sq8G=|3y!Q)l2`2hRiT{nK~pQ}2d<3w#?m z`cuOR`qW$D-vu||QZwV9KSQ5-C;T>WCotG`;7|J0E%5um&jIrJ)uy#(5n)4|FZ=`j|d7?{^Wr#J2s*m+4cp zKa;T$7#;3)(kzzK^HWsoG$|zOR?I6rk5+b(WFeDCO3&SJd@K?GK!QhMW73l zrVvRP3NJ|bh@?M^OBWS73~C~9V`*Z%EAWks?J$v!TkBs|p-4);C`nZ;rR!A?80Q?o z_jYL;L{?>MS*3EhoQW~zn`1T_Q_@vY&`B5z%%RF|QHof_fwb{QZs_Z>C~JhP!a|UM zZBSS&U7Qnpxq=SkNC!qJC}Gq)(!NPtpKn_q`>wCQb^_Ikml3IuC+(f=pc#l0y}HxxiLl=x?Ujbp<%vARsy#mMHL&4co}vbliN7vo_$TY zQ#y$hPTa=h>uMNi*B28y@a;R#I8E-ps}m-UWLS(#Xyv=VdY3kk2kbiujXS}pY5@+I zF|lqSUSE1i5jR{cV(Y1I<3QR;97wE1A&IaQE{iv{HqIV<=$7HwLo>Cqrvp{6!5U;{ zA(nnRrar*~x8X%hpHLd?em^FE$Ucy>I8PCmlCo!P+`SdoZXRRuD4Ka&H1oD-=GTj6 z{+^k2R5J+X}G0u{O2?JAp?5`&@wWEaUri zoLvBGEbB3ABGkgt^V{o159G!F>eJhm diff --git a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml index 8b08fc40..b13c27c5 100644 --- a/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml +++ b/schemas/org.gnome.shell.extensions.bingwallpaper.gschema.xml @@ -137,6 +137,12 @@ + + "daily" + Set to either 'daily', 'hourly', 'weekly', 'custom' + Daily is midnight, hourly is on the hour, weekly is midnight on Sunday, or custom as defined by the 'random-interval' + + 3600 diff --git a/utils.js b/utils.js index 32cd2ef0..8065dcf6 100644 --- a/utils.js +++ b/utils.js @@ -62,8 +62,9 @@ var marketName = [ ]; var backgroundStyle = ['none', 'wallpaper', 'centered', 'scaled', 'stretched', 'zoom', 'spanned']; -var randomIntervals = [300, 3600, 86400, 604800]; -var randomIntervalsTitle = ['00:00:05:00', '00:01:00:00', '00:24:00:00', '07:00:00:00']; +var randomIntervals = [ {value: 'hourly', title: _('on the hour')}, + {value: 'daily', title: _('every day at midnight')}, + {value: 'weekly', title: _('every Sunday at midnight')} ]; var BingImageURL = 'https://www.bing.com/HPImageArchive.aspx'; var BingParams = { format: 'js', idx: '0' , n: '8' , mbl: '1' , mkt: '' } ; @@ -420,8 +421,7 @@ function dump(object, level = 0) { function friendly_time_diff(time, short = true) { // short we want to keep ~4-5 characters - let timezone = GLib.TimeZone.new_local(); - let now = GLib.DateTime.new_now(timezone).to_unix(); + let now = GLib.DateTime.new_now_local().to_unix(); let seconds = time.to_unix() - now; if (seconds <= 0) { @@ -441,6 +441,34 @@ function friendly_time_diff(time, short = true) { } } +function seconds_until(until) { + let now = GLib.DateTime.new_now_local(); + let end, day; + if (until == 'hourly') { + end = GLib.DateTime.new_local( + now.get_year(), + now.get_month(), + now.get_day_of_month(), + now.get_hour()+1, // should roll over to next day if results in >23 + 0, 0); + } + else { + if (until == 'weekly') { + day = now.add_days(7 - now.get_day_of_week()); + } + else { + day = now.add_days(1); + } + end = GLib.DateTime.new_local( + day.get_year(), + day.get_month(), + day.get_day_of_month(), + 0, 0, 0); // midnight + } + log('shuffle timer will be set to '+end.format_iso8601()); + return(Math.floor(end.difference(now)/1000000)); // difference in μs -> s +} + function getResolution(settings, image) { let resolution = settings.get_string('resolution'); if (resolutions.indexOf(resolution) == -1 || (image ? image.wp == false : true) || // wp == false when background is animated From 18e37121642af3bb3603712e8d8de8ccaf17a8dc Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 26 Jun 2023 16:23:14 +1000 Subject: [PATCH 11/21] add shuffle mode to prefs, handle setting changes --- carousel.js | 8 +-- extension.js | 28 +++------ locale/BingWallpaper.pot | 126 +++++++++++++++++++++------------------ prefs.js | 22 ++++--- ui/Settings.ui | 86 +++++++++++++++++++++++++- ui/Settings4.ui | 79 ++++++++++++++++++++---- ui/carousel.ui | 2 +- ui/carousel4.ui | 2 +- utils.js | 5 +- 9 files changed, 246 insertions(+), 112 deletions(-) diff --git a/carousel.js b/carousel.js index 8009cb0a..13e9b634 100644 --- a/carousel.js +++ b/carousel.js @@ -196,13 +196,13 @@ var Carousel = class Carousel { let randomLabel = buildable.get_object('randomLabel'); randomLabel.set_text(title); - let filename = 'random'; let applyButton = buildable.get_object('randomButton'); applyButton.connect('clicked', (widget) => { - this.settings.set_string('selected-image', filename); - this.settings.set_int('random-interval', seconds); - this.log('gallery selected random with interval '+seconds); + this.settings.set_string('random-interval-mode', interval); + //this.settings.set_int('random-interval', seconds); + this.settings.set_boolean('random-mode-enabled', true); + this.log('gallery selected random with interval '+interval+' ('+title+')'); }); let item = buildable.get_object('flowBoxRandom'); diff --git a/extension.js b/extension.js index 9513bb5e..6ff0ccd8 100644 --- a/extension.js +++ b/extension.js @@ -124,11 +124,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (!blur) // as Blur isn't disabled on screen lock (like the rest of the extension is) blur = new Blur.Blur(); - - /* - blur.BWP_BLUR_BRIGHTNESS = 2; - blur.BWP_BLUR_SIGMA = 55; - */ // take a variety of actions when the gsettings values are modified by prefs this._settings = ExtensionUtils.getSettings(Utils.BING_SCHEMA); @@ -137,11 +132,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { getActorCompat(this).visible = !this._settings.get_boolean('hide'); - // enable testing potentially unsafe features on Wayland if the user overrides it - if (!Utils.is_x11() && this._settings.get_boolean('override-unsafe-wayland')) { - Utils.is_x11 = Utils.enabled_unsafe; - } - this.refreshDueItem = newMenuItem(_("")); this.explainItem = newMenuItem(_("Awaiting refresh...")); @@ -252,6 +242,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { {signal: 'changed::random-mode-include-only-favourites', call: this._randomModeChanged}, {signal: 'changed::random-mode-include-only-unhidden', call: this._randomModeChanged}, {signal: 'changed::random-mode-include-only-uhd', call: this._randomModeChanged}, + {signal: 'changed::random-interval-mode', call: this._randomModeChanged} ]; // _setShuffleToggleState @@ -321,10 +312,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { _openMenu() { // Grey out menu items if an update is pending this.refreshItem.setSensitive(!this._updatePending); - if (Utils.is_x11()) { - this.clipboardImageItem.setSensitive(!this._updatePending && this.imageURL != ""); - this.clipboardURLItem.setSensitive(!this._updatePending && this.imageURL != ""); - } + this.clipboardImageItem.setSensitive(!this._updatePending && this.imageURL != ""); + this.clipboardURLItem.setSensitive(!this._updatePending && this.imageURL != ""); this.thumbnailItem.setSensitive(!this._updatePending && this.imageURL != ""); //this.showItem.setSensitive(!this._updatePending && this.title != "" && this.explanation != ""); this.dwallpaperItem.setSensitive(!this._updatePending && this.filename != ""); @@ -334,6 +323,9 @@ class BingWallpaperIndicator extends PanelMenu.Button { this.refreshduetext = _("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%Y-%m-%d %X") : '-') + " (" + Utils.friendly_time_diff(this.refreshdue) + ")\n" + _("Last refresh") + ": " + (maxlongdate? this._localeDate(maxlongdate, true) : '-'); + // also show when shuffle is next due + if (this._settings.get_boolean('random-mode-enabled')) + this.refreshduetext += "\n" + _("Next shuffle")+": "+(this.shuffledue ? this.shuffledue.format("%Y-%m-%d %X") : '-') + " (" + Utils.friendly_time_diff(this.shuffledue) + ")"; this.refreshDueItem.label.set_text(this.refreshduetext); } @@ -577,7 +569,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { } } - _favouriteImage() { log('favourite image '+this.imageURL+' status was '+this.favourite_status); this.favourite_status = !this.favourite_status; @@ -610,11 +601,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { let imageList = Utils.getImageList(this._settings); let curIndex = 0; - /* - if (this.selected_image == 'random') - return; - */ - if (this.selected_image == 'current') { curIndex = Utils.getCurrentImageIndex(imageList); } @@ -822,6 +808,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { else { log('not enough filtered images available to shuffle'); } + + // shuffle could fail for a number of reasons try { this.imageIndex = Utils.getRandomInt(imageList.length); image = imageList[this.imageIndex]; diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index 07ed3f67..adec027e 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -42,39 +42,39 @@ msgstr "" msgid "Select from image gallery" msgstr "" -#: ui/Settings.ui.h:12 ui/Settings4.ui.h:11 +#: ui/Settings.ui.h:12 ui/Settings4.ui.h:13 msgid "Bing locale" msgstr "" -#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 extension.js:155 +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:14 extension.js:155 msgid "Settings" msgstr "" -#: ui/Settings.ui.h:14 ui/Settings4.ui.h:13 +#: ui/Settings.ui.h:14 ui/Settings4.ui.h:15 msgid "Use custom blur and brightness" msgstr "" -#: ui/Settings.ui.h:15 ui/Settings4.ui.h:14 +#: ui/Settings.ui.h:15 ui/Settings4.ui.h:16 msgid "Override GDM3 lockscreen effects" msgstr "" -#: ui/Settings.ui.h:16 ui/Settings4.ui.h:15 +#: ui/Settings.ui.h:16 ui/Settings4.ui.h:17 msgid "Blur can improve readability of login prompt" msgstr "" -#: ui/Settings.ui.h:17 ui/Settings4.ui.h:16 +#: ui/Settings.ui.h:17 ui/Settings4.ui.h:18 msgid "Background blur intensity" msgstr "" -#: ui/Settings.ui.h:18 ui/Settings4.ui.h:17 +#: ui/Settings.ui.h:18 ui/Settings4.ui.h:19 msgid "Can improve contrast of login prompt" msgstr "" -#: ui/Settings.ui.h:19 ui/Settings4.ui.h:18 +#: ui/Settings.ui.h:19 ui/Settings4.ui.h:20 msgid "Background brightness" msgstr "" -#: ui/Settings.ui.h:20 ui/Settings4.ui.h:19 +#: ui/Settings.ui.h:20 ui/Settings4.ui.h:21 msgid "Presets" msgstr "" @@ -82,99 +82,99 @@ msgstr "" msgid "Commonly used presets" msgstr "" -#: ui/Settings.ui.h:22 ui/Settings4.ui.h:20 +#: ui/Settings.ui.h:22 ui/Settings4.ui.h:22 msgid "No blur, slight dim" msgstr "" -#: ui/Settings.ui.h:23 ui/Settings4.ui.h:21 +#: ui/Settings.ui.h:23 ui/Settings4.ui.h:23 msgid "GNOME default" msgstr "" -#: ui/Settings.ui.h:24 ui/Settings4.ui.h:22 +#: ui/Settings.ui.h:24 ui/Settings4.ui.h:24 msgid "Slight blur, slight dim" msgstr "" -#: ui/Settings.ui.h:25 ui/Settings4.ui.h:23 +#: ui/Settings.ui.h:25 ui/Settings4.ui.h:25 msgid "Lock Screen" msgstr "" -#: ui/Settings.ui.h:26 ui/Settings4.ui.h:25 +#: ui/Settings.ui.h:26 ui/Settings4.ui.h:27 msgid "Debug logging" msgstr "" -#: ui/Settings.ui.h:27 ui/Settings4.ui.h:24 +#: ui/Settings.ui.h:27 ui/Settings4.ui.h:26 msgid "Enable logging to system journal" msgstr "" -#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:29 msgid "Always show new images" msgstr "" -#: ui/Settings.ui.h:29 ui/Settings4.ui.h:26 +#: ui/Settings.ui.h:29 ui/Settings4.ui.h:28 msgid "Switch to new images when available (unless on random mode)" msgstr "" -#: ui/Settings.ui.h:30 ui/Settings4.ui.h:29 +#: ui/Settings.ui.h:30 ui/Settings4.ui.h:31 msgid "Enable all features on Wayland" msgstr "" -#: ui/Settings.ui.h:31 ui/Settings4.ui.h:28 +#: ui/Settings.ui.h:31 ui/Settings4.ui.h:30 msgid "Some newer features may be unstable on Wayland" msgstr "" -#: ui/Settings.ui.h:32 ui/Settings4.ui.h:30 +#: ui/Settings.ui.h:32 ui/Settings4.ui.h:32 msgid "Screen resolution" msgstr "" -#: ui/Settings.ui.h:33 ui/Settings4.ui.h:31 +#: ui/Settings.ui.h:33 ui/Settings4.ui.h:33 msgid "Override automatic resolution selection" msgstr "" -#: ui/Settings.ui.h:34 ui/Settings4.ui.h:32 +#: ui/Settings.ui.h:34 ui/Settings4.ui.h:34 msgid "Manually adjust random interval (seconds)" msgstr "" -#: ui/Settings.ui.h:35 ui/Settings4.ui.h:33 +#: ui/Settings.ui.h:35 ui/Settings4.ui.h:35 msgid "Random interval" msgstr "" -#: ui/Settings.ui.h:36 ui/Settings4.ui.h:34 +#: ui/Settings.ui.h:36 ui/Settings4.ui.h:36 msgid "Import Bing Wallpaper data" msgstr "" -#: ui/Settings.ui.h:37 ui/Settings4.ui.h:35 +#: ui/Settings.ui.h:37 ui/Settings4.ui.h:37 msgid "Import previously exported JSON data from wallpaper directory" msgstr "" -#: ui/Settings.ui.h:38 ui/Settings4.ui.h:36 +#: ui/Settings.ui.h:38 ui/Settings4.ui.h:38 msgid "Import" msgstr "" -#: ui/Settings.ui.h:39 ui/Settings4.ui.h:37 +#: ui/Settings.ui.h:39 ui/Settings4.ui.h:39 msgid "Export Bing Wallpaper data" msgstr "" -#: ui/Settings.ui.h:40 ui/Settings4.ui.h:38 +#: ui/Settings.ui.h:40 ui/Settings4.ui.h:40 msgid "Export JSON data to wallpaper dir for backup or data migration" msgstr "" -#: ui/Settings.ui.h:41 ui/Settings4.ui.h:39 +#: ui/Settings.ui.h:41 ui/Settings4.ui.h:41 msgid "Export" msgstr "" -#: ui/Settings.ui.h:42 ui/Settings4.ui.h:40 +#: ui/Settings.ui.h:42 ui/Settings4.ui.h:42 msgid "Always export Bing data" msgstr "" -#: ui/Settings.ui.h:43 ui/Settings4.ui.h:41 +#: ui/Settings.ui.h:43 ui/Settings4.ui.h:43 msgid "Export Bing JSON whenever data changes" msgstr "" -#: ui/Settings.ui.h:44 ui/Settings4.ui.h:42 +#: ui/Settings.ui.h:44 ui/Settings4.ui.h:44 msgid "Debug options" msgstr "" -#: ui/Settings.ui.h:45 ui/Settings4.ui.h:44 +#: ui/Settings.ui.h:45 ui/Settings4.ui.h:46 msgid "New wallpaper images everyday from Bing" msgstr "" @@ -182,41 +182,49 @@ msgstr "" msgid "Gnome shell extension version " msgstr "" -#: ui/Settings.ui.h:47 ui/Settings4.ui.h:46 +#: ui/Settings.ui.h:47 ui/Settings4.ui.h:48 msgid "Maintained by Michael Carroll" msgstr "" -#: ui/Settings.ui.h:48 ui/Settings4.ui.h:47 +#: ui/Settings.ui.h:48 ui/Settings4.ui.h:49 msgid "" "Show your support to the author on Flattr or Github " "Sponsors." msgstr "" -#: ui/Settings.ui.h:49 ui/Settings4.ui.h:48 +#: ui/Settings.ui.h:49 ui/Settings4.ui.h:50 msgid "Changes since last version" msgstr "" -#: ui/Settings.ui.h:50 ui/Settings4.ui.h:49 +#: ui/Settings.ui.h:50 ui/Settings4.ui.h:51 msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" msgstr "" -#: ui/Settings.ui.h:51 ui/Settings4.ui.h:50 +#: ui/Settings.ui.h:51 ui/Settings4.ui.h:52 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General " "Public License, version 3 or later for details." msgstr "" -#: ui/Settings.ui.h:53 ui/Settings4.ui.h:52 +#: ui/Settings.ui.h:53 ui/Settings4.ui.h:54 msgid "About" msgstr "" -#: ui/Settings4.ui.h:43 -msgid "Gallery" +#: ui/Settings4.ui.h:11 +msgid "Shuffle enabled" +msgstr "" + +#: ui/Settings4.ui.h:12 +msgid "Shuffle mode" msgstr "" #: ui/Settings4.ui.h:45 +msgid "Gallery" +msgstr "" + +#: ui/Settings4.ui.h:47 msgid "GNOME shell extension version " msgstr "" @@ -236,7 +244,7 @@ msgstr "" msgid "Delete" msgstr "" -#: ui/carousel.ui.h:5 ui/carousel4.ui.h:7 +#: ui/carousel.ui.h:5 msgid "Set random mode" msgstr "" @@ -248,6 +256,10 @@ msgstr "" msgid "" msgstr "" +#: ui/carousel4.ui.h:7 +msgid "Set shuffle mode" +msgstr "" + #: ui/carousel4.ui.h:8 msgid "Load image gallery" msgstr "" @@ -312,23 +324,27 @@ msgstr "" msgid "Show image count" msgstr "" -#: extension.js:335 +#: extension.js:336 msgid "Next refresh" msgstr "" -#: extension.js:336 +#: extension.js:337 msgid "Last refresh" msgstr "" -#: extension.js:803 extension.js:872 +#: extension.js:339 +msgid "Next shuffle" +msgstr "" + +#: extension.js:806 extension.js:875 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:908 +#: extension.js:911 msgid "No wallpaper available" msgstr "" -#: extension.js:909 +#: extension.js:912 msgid "No picture for today." msgstr "" @@ -336,14 +352,6 @@ msgstr "" msgid "Select folder" msgstr "" -#: prefs.js:249 -msgid "Most recent image" -msgstr "" - -#: prefs.js:250 -msgid "Random image" -msgstr "" - #: utils.js:65 msgid "on the hour" msgstr "" @@ -356,18 +364,18 @@ msgstr "" msgid "every Sunday at midnight" msgstr "" -#: utils.js:136 +#: utils.js:133 msgid "Error fetching change log: " msgstr "" -#: utils.js:431 utils.js:434 +#: utils.js:428 utils.js:431 msgid "minutes" msgstr "" -#: utils.js:437 +#: utils.js:434 msgid "days" msgstr "" -#: utils.js:440 +#: utils.js:437 msgid "hours" msgstr "" diff --git a/prefs.js b/prefs.js index b39b9138..3a8c51bd 100644 --- a/prefs.js +++ b/prefs.js @@ -102,8 +102,8 @@ function buildPrefsWidget() { let buttonImportData = buildable.get_object('button_json_import'); let buttonExportData = buildable.get_object('button_json_export'); let switchAlwaysExport = buildable.get_object('always_export_switch'); - /*let searchEntry = buildable.get_object('searchEntry'); - let searchBuffer = buildable.get_object('searchBuffer');*/ + let switchEnableShuffle = buildable.get_object('shuffle_enabled_switch'); + let entryShuffleMode = buildable.get_object('shuffle_mode_combo'); let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null; try { @@ -244,17 +244,15 @@ function buildPrefsWidget() { Utils.validate_resolution(settings); }); - // History - let imageList = Utils.getImageList(settings); - historyEntry.append('current', _('Most recent image')); - historyEntry.append('random', _('Random image')); - - imageList.forEach((image) => { - historyEntry.append(image.urlbase.replace('/th?id=OHR.', ''), Utils.shortenName(Utils.getImageTitle(image), 50)); + // shuffle modes + settings.bind('random-mode-enabled', switchEnableShuffle, 'active', Gio.SettingsBindFlags.DEFAULT); + Utils.randomIntervals.forEach((x) => { + entryShuffleMode.append(x.value, _(x.title)); }); - - // selected image can also be changed through the menu or even dconf - settings.bind('selected-image', historyEntry, 'active_id', Gio.SettingsBindFlags.DEFAULT); + settings.bind('random-interval-mode', entryShuffleMode, 'active_id', Gio.SettingsBindFlags.DEFAULT); + + // selected image can no longer be changed through a dropdown (didn't scale) + settings.bind('selected-image', historyEntry, 'label', Gio.SettingsBindFlags.DEFAULT); settings.connect('changed::selected-image', () => { Utils.validate_imagename(settings); }); diff --git a/ui/Settings.ui b/ui/Settings.ui index e9dedcee..d31a2947 100644 --- a/ui/Settings.ui +++ b/ui/Settings.ui @@ -477,7 +477,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll - + True True @@ -490,6 +490,90 @@ Bing Wallpaper GNOME extension by: Michael Carroll + + + True + False + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + start + True + Shuffle enabled + True + + + 0 + 0 + + + + + True + True + end + True + + + 1 + 0 + + + + + + + + + True + False + + + True + False + 12 + 12 + 12 + 12 + 32 + + + True + False + start + True + Shuffle mode + True + + + 0 + 0 + + + + + True + False + + + 1 + 0 + + + + + + diff --git a/ui/Settings4.ui b/ui/Settings4.ui index 14ef1570..14fab4d7 100644 --- a/ui/Settings4.ui +++ b/ui/Settings4.ui @@ -409,21 +409,80 @@ Bing Wallpaper GNOME extension by: Michael Carroll - + + + 1 + 0 + 1 + + + + + + + + + + 0 + + + 0 + 12 + 12 + 12 + 12 + 32 + + 0 start - - + 1 + Shuffle enabled 0 - 1 + 0 + + + + + + end + 1 + + 1 + 0 + + + + + + + + + + 0 + + + 0 + 12 + 12 + 12 + 12 + 32 + + + 0 + start + 1 + Shuffle mode + + 0 + 0 - + 1 0 @@ -554,7 +613,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll 0 start 1 - Use custom blur and brightness + Dynamically switches blur on GDM3 lock screen @@ -569,7 +628,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll 0 start 1 - Override GDM3 lockscreen effects + Enable dynamic lockscreen blur 1 0 @@ -599,7 +658,7 @@ Bing Wallpaper GNOME extension by: Michael Carroll 0 start 1 - Blur can improve readability of login prompt + Blur can improve readability diff --git a/ui/carousel.ui b/ui/carousel.ui index f8168631..1a2292ab 100644 --- a/ui/carousel.ui +++ b/ui/carousel.ui @@ -153,7 +153,7 @@ Author: Michael Carroll - Set random mode + Set shuffle mode True True True diff --git a/ui/carousel4.ui b/ui/carousel4.ui index 4be8a98d..10992721 100644 --- a/ui/carousel4.ui +++ b/ui/carousel4.ui @@ -162,7 +162,7 @@ Author: Michael Carroll - Set random mode + Set shuffle mode 1 0 diff --git a/utils.js b/utils.js index 8065dcf6..3ddc65d1 100644 --- a/utils.js +++ b/utils.js @@ -32,7 +32,7 @@ var vertical_blur = null; var horizontal_blur = null; let gitreleaseurl = 'https://api.github.com/repos/neffo/bing-wallpaper-gnome-extension/releases/tags/'; -let debug = false; +let debug = true; // remove this when dropping support for < 3.33, see https://github.com/OttoAllmendinger/ var getActorCompat = (obj) => @@ -93,11 +93,8 @@ function validate_resolution(settings) { // FIXME: needs work function validate_imagename(settings) { let filename = settings.get_string('selected-image'); - if (filename != 'current' || filename != 'random') - return; if (!inImageList(getImageList(settings), filename)) { log('invalid image selected'); - //settings.reset('selected-image'); settings.set_string('selected-image', 'current'); } } From 1e2bd5db6b5e1a92bc9073eb7428a3b33cb96402 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 26 Jun 2023 17:02:29 +1000 Subject: [PATCH 12/21] menu thumbnails hidpi now support hidpi --- extension.js | 17 +++++++++-------- thumbnail.js | 12 ++++++++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/extension.js b/extension.js index 6ff0ccd8..66ef76db 100644 --- a/extension.js +++ b/extension.js @@ -155,16 +155,16 @@ class BingWallpaperIndicator extends PanelMenu.Button { // quick settings submenu this.settingsSubMenu = new PopupMenu.PopupSubMenuMenuItem(_("Quick settings"), false); // toggles under the quick settings submenu - this.toggleSetBackground = newMenuSwitchItem(_("Set background image"), this._settings.get_boolean('set-background')); + /*this.toggleSetBackground = newMenuSwitchItem(_("Set background image"), this._settings.get_boolean('set-background'));*/ this.toggleSelectNew = newMenuSwitchItem(_("Always switch to new images"), this._settings.get_boolean('revert-to-current-image')); - this.toggleShuffle = newMenuSwitchItem(_("Image shuffle mode"), this._settings.get_boolean('random-mode-enabled')); + this.toggleShuffle = newMenuSwitchItem(_("Enable image shuffle mode"), this._settings.get_boolean('random-mode-enabled')); this.toggleShuffleOnlyFaves = newMenuSwitchItem(_("Image shuffle only favourites"), this._settings.get_boolean('random-mode-include-only-favourites')); //this.toggleShuffleOnlyUnhidden = newMenuSwitchItem(_("Image shuffle only unhidden"), this._settings.get_boolean('random-mode-include-only-unhidden')); this.toggleShuffleOnlyUHD = newMenuSwitchItem(_("Image shuffle only UHD resolutions"), this._settings.get_boolean('random-mode-include-only-uhd')); this.toggleNotifications = newMenuSwitchItem(_("Enable desktop notifications"), this._settings.get_boolean('notify')); - this.toggleImageCount = newMenuSwitchItem(_("Show image count"), this._settings.get_boolean('show-count-in-image-title')); + /*this.toggleImageCount = newMenuSwitchItem(_("Show image count"), this._settings.get_boolean('show-count-in-image-title'));*/ - [this.toggleNotifications, this.toggleImageCount, this.toggleSetBackground, this.toggleSelectNew, + [this.toggleNotifications, /*this.toggleImageCount,*/ /*this.toggleSetBackground,*/ this.toggleSelectNew, this.toggleShuffle, this.toggleShuffleOnlyFaves, /*this.toggleShuffleOnlyUnhidden,*/ this.toggleShuffleOnlyUHD] .forEach(e => this.settingsSubMenu.menu.addMenuItem(e)); @@ -230,7 +230,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { {signal: 'changed::icon-name', call: this._setIcon}, {signal: 'changed::market', call: this._refresh}, {signal: 'changed::set-background', call: this._setBackground}, - /*{signal: 'changed::set-lockscreen', call: this._setBackground},*/ {signal: 'changed::override-lockscreen-blur', call: this._setBlur}, {signal: 'changed::selected-image', call: this._setImage}, {signal: 'changed::delete-previous', call: this._cleanUpImages}, @@ -276,10 +275,10 @@ class BingWallpaperIndicator extends PanelMenu.Button { // first, we listen for changes to these toggle settings and update the status // & then, link settings to toggle state (the other way) - let toggles = [ {key: 'set-background', toggle: this.toggleSetBackground}, + let toggles = [ /*{key: 'set-background', toggle: this.toggleSetBackground},*/ {key: 'revert-to-current-image', toggle: this.toggleSelectNew}, {key: 'notify', toggle: this.toggleNotifications}, - {key: 'show-count-in-image-title', toggle: this.toggleImageCount}, + /*{key: 'show-count-in-image-title', toggle: this.toggleImageCount},*/ {key: 'random-mode-enabled', toggle: this.toggleShuffle}, {key: 'random-mode-include-only-favourites', toggle: this.toggleShuffleOnlyFaves}, /*{key: 'random-mode-include-only-unhidden', toggle: this.toggleShuffleOnlyUnhidden},*/ @@ -366,7 +365,7 @@ class BingWallpaperIndicator extends PanelMenu.Button { _setBackground() { if (this.filename == '') return; - this.thumbnail = new Thumbnail.Thumbnail(this.filename); // historically thumbnails were a bit unsafe on Wayland, but now fixed + this.thumbnail = new Thumbnail.Thumbnail(this.filename, St.ThemeContext.get_for_stage(global.stage).scale_factor); // use scale factor to make them look nicer if (!this.dimensions.width || !this.dimensions.height) // if dimensions aren't in image database yet [this.dimensions.width, this.dimensions.height] = Utils.getFileDimensions(this.filename); log('image set to : '+this.filename); @@ -561,11 +560,13 @@ class BingWallpaperIndicator extends PanelMenu.Button { if (randomEnabled) { // enable shuffle mode, by setting a shuffe timer (5 seconds) this._restartShuffleTimeout(5); + this._settings.set_boolean('revert-to-current-image', false); } else { // clear shuffle timer if (this._shuffleTimeout) GLib.source_remove(this._shuffleTimeout); + this._settings.set_boolean('revert-to-current-image', true); } } diff --git a/thumbnail.js b/thumbnail.js index e5474821..a191ca58 100644 --- a/thumbnail.js +++ b/thumbnail.js @@ -6,16 +6,20 @@ // (at your option) any later version. // See the GNU General Public License, version 3 or later for details. -const Gio = imports.gi.Gio; -const GdkPixbuf = imports.gi.GdkPixbuf; +const {Gio, GdkPixbuf, St} = imports.gi; + +const THUMBNAIL_WIDTH = 480; +const THUMBNAIL_HEIGHT = 270; var Thumbnail = class Thumbnail { - constructor(filePath) { + constructor(filePath, scale = 1.0) { if (!filePath) { throw new Error(`need argument ${filePath}`); } try { - this.pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filePath, 480, 270); + let w = Math.round(THUMBNAIL_WIDTH * scale); + let h = Math.round(THUMBNAIL_HEIGHT * scale); + this.pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(filePath, w, h); this.srcFile = Gio.File.new_for_path(filePath); } catch (err) { log('Unable to create thumbnail for corrupt or incomplete file: ' + filePath + ' err: ' + err); From cecb4c224e6027b82261e565b3e8bc2a7e26ebdf Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 29 Jun 2023 21:19:51 +1000 Subject: [PATCH 13/21] fix soup initialisation in prefs #208 --- extension.js | 9 ++------- prefs.js | 10 +--------- utils.js | 12 ++++++++++++ 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/extension.js b/extension.js index 66ef76db..706cb09a 100644 --- a/extension.js +++ b/extension.js @@ -128,7 +128,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { // take a variety of actions when the gsettings values are modified by prefs this._settings = ExtensionUtils.getSettings(Utils.BING_SCHEMA); - this._initSoup(); + // create Soup session + this.httpSession = Utils.initSoup(); getActorCompat(this).visible = !this._settings.get_boolean('hide'); @@ -214,12 +215,6 @@ class BingWallpaperIndicator extends PanelMenu.Button { } } - // create soup Session - _initSoup() { - this.httpSession = new Soup.Session(); - this.httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + imports.misc.config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + Me.metadata.version; - } - // listen for configuration changes _setConnections() { this._settings.connect('changed::hide', () => { diff --git a/prefs.js b/prefs.js index 3a8c51bd..867a49b2 100644 --- a/prefs.js +++ b/prefs.js @@ -7,8 +7,6 @@ // See the GNU General Public License, version 3 or later for details. // Based on GNOME shell extension NASA APOD by Elia Argentieri https://github.com/Elinvention/gnome-shell-extension-nasa-apod -imports.gi.versions.Soup = "2.4"; // force single version of Soup, not sure if there is a way to force latest version - const {Gtk, Gdk, GdkPixbuf, Gio, GLib, Soup} = imports.gi; const ExtensionUtils = imports.misc.extensionUtils; const Me = ExtensionUtils.getCurrentExtension(); @@ -106,13 +104,7 @@ function buildPrefsWidget() { let entryShuffleMode = buildable.get_object('shuffle_mode_combo'); let carouselFlowBox = (Gtk.get_major_version() == 4) ? buildable.get_object('carouselFlowBox'): null; - try { - httpSession = new Soup.Session(); - httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + imports.misc.config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + Me.metadata.version; - } - catch (e) { - log("Error creating httpSession: " + e); - } + httpSession = httpSession = Utils.initSoup(); // check that these are valid (can be edited through dconf-editor) Utils.validate_resolution(settings); diff --git a/utils.js b/utils.js index 3ddc65d1..6fd96ef2 100644 --- a/utils.js +++ b/utils.js @@ -644,3 +644,15 @@ function toFilename(wallpaperDir, startdate, imageURL, resolution) { return wallpaperDir + startdate + '-' + imageURL.replace(/^.*[\\\/]/, '').replace('th?id=OHR.', '') + '_' + resolution + '.jpg'; } +function initSoup() { + try { + let httpSession = new Soup.Session(); + httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + imports.misc.config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + Me.metadata.version; + return httpSession; + } + catch (e) { + log('Unable to create soup session: '+e); + return null; + } + +} \ No newline at end of file From b326c6be64556d779965bad3f2c85e2a984b41d5 Mon Sep 17 00:00:00 2001 From: izotopo <140181701+izotopo@users.noreply.github.com> Date: Sun, 23 Jul 2023 00:27:27 +0900 Subject: [PATCH 14/21] Remove inessential Korean translations --- locale/ko_KP/LC_MESSAGES/BingWallpaper.mo | Bin 2844 -> 0 bytes locale/ko_KP/LC_MESSAGES/BingWallpaper.po | 294 ---------------------- locale/ko_KR/LC_MESSAGES/BingWallpaper.mo | Bin 2785 -> 0 bytes locale/ko_KR/LC_MESSAGES/BingWallpaper.po | 286 --------------------- 4 files changed, 580 deletions(-) delete mode 100644 locale/ko_KP/LC_MESSAGES/BingWallpaper.mo delete mode 100644 locale/ko_KP/LC_MESSAGES/BingWallpaper.po delete mode 100644 locale/ko_KR/LC_MESSAGES/BingWallpaper.mo delete mode 100644 locale/ko_KR/LC_MESSAGES/BingWallpaper.po diff --git a/locale/ko_KP/LC_MESSAGES/BingWallpaper.mo b/locale/ko_KP/LC_MESSAGES/BingWallpaper.mo deleted file mode 100644 index 31880861d1c45cede6ba55d53682acbd95e11f82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2844 zcmbW1U2GiH6~}K0h15xb2GUR{;qW051hZa8xWLAV>cj~|#EBI^>+G>%9lUJwsRyj2x1sA}JK?!H#3`qKZIU4O*Q zQ?GXRxA*IO{Lk6>e#8Amf$=P!pW}J?2SRj$J@?@Y;|};!@ZaDj@R2n_{1Ds%J_;tl zZQxGuDe(8;X0Qyd1HS;D1iuEifd2&9*ZTW~cmeDL9|jMDkANAF@4o|X08fJtfuDhF z|0ehx_&0Dp_#bd1xE4WioSQ+m+YPe+-+(^>9gyw63qA&(0QufIa4mQPgembQh>!RR zU$27SfDeLe9uVS9XtNG{8uKA6vfU8Gk~j(y_#wC#{4>aT+yVLgCOF|dUIl*v?g3f1 z_rT}Do1g)H53;W7f7HsCz{fG)0sag;46UR*GxKaqwW>R}R)6GKe4J;hM5;oIC5ygX_w@!1d!1>kA^~xCUHb9-J5CkNb}` zd?@L?srd2)^yWu}kH~$r&{>k`5i*N1-Ci zb#iHC`nG_%fLDT0`I5#Ky#XdpBy&xZb(i*ySDV&X z!trd!G7-7hyZDP7OL?N-bi5D`{6g4%$I6=0rClbf=DOJRM`TEz3duZTI^B{?3A ztGtimWl#^XAEj9=q(C>c^=0WHmu-$Gcy%eMWkccs;`BK}Gasr^GjuH236z@;xy}JJ zviO%c*zT|WYD^4TzLegIb7Bwyn!&Pzcp+_CBN<=iJ-b!Tco9V&L6gP?;v(}Zmn;wn zGZ0y1h3_!T1*y)?j1y+_>4c?5J3To(tUA*;X)NVoWVkzxrM?uSj+f`!4*2S~2;A6f z8^3DRAw?YrWls5_(H~?S+t``U1jdlU^1uP(AXwaZ9$8_CzH>y=cp z`=zdAGTE`u3_@ebH@(2+BBp3CpB>MS&;aT~TfC8=tNTUj@f=Iy8R_c&Wo8uB;@EfK zu9wN9qm3bHj>6~SJVhhw?Y9Ox`uFzlUXHXYk?h!|Jp9?XpiyQ@;MG{So+3p&r&v2O3`a+C+zsO@rLxI-->uZN!tl&YvPqeSI2;x_f6N> zqx{hzMP4qR2HU%~QS0aS=b~e?q|cw?f6c1*hpv=XymcBk7NVomr2kN& z=9!{CdqGzU#8zr0UA~1ds9C%c9iN8Pgkb;2N^Bs02Sv47(RyANHO|T znFERDuj}{c#7YMotbYHhu9lm{60VW17WC;EU;?Q$i*<@l&9D^MYt#xN`h1~r{VH^v z)F0IwwTU>>`GrR9kNWHfOIcRxZ8Jz(e_V%eM9?fEf)xq3{fd=m786A>(WfUk2l&v{ zg;=+xdi;;%6kRL8qtKOwXm&PMr`{|end!?M_d;#;j#%~Pic_wXIA2!t(nK_KSu}1; zKol-k D6EXx# diff --git a/locale/ko_KP/LC_MESSAGES/BingWallpaper.po b/locale/ko_KP/LC_MESSAGES/BingWallpaper.po deleted file mode 100644 index 3b73b1e0..00000000 --- a/locale/ko_KP/LC_MESSAGES/BingWallpaper.po +++ /dev/null @@ -1,294 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -# Note: -# The translation of Korean in the Democratic People's Republic of Korea is uncomplete and may look strange to some North Koreans. -# This is mostly because the current translator is an user of the Korean standard language of the Republic of Korea. -# If you are skilled in Culture language of DPR Korea, please contribute in this translation. -# -# 조선민주주의인민공화국 문화어에 대한 번역은 완전하지 않고 일부 사람들에게는 이상하게 보일 수 있습니다. -# 이 문제는 현재 번역가가 대한민국 표준어를 사용하기 때문에 발생합니다. -# 만약 귀하가 조선민주주의인민공화국 문화어에 능숙하다면 이 번역에 기여해주세요. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-09 13:10+1000\n" -"PO-Revision-Date: 2021-05-09 14:05+1000\n" -"Last-Translator: Suhyuk Park (nks15) \n" -"Language-Team: \n" -"Language: ko_KP\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.4.1\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: Settings.ui.h:1 Settings4.ui.h:2 -msgid "Hide the indicator" -msgstr "인디케이터 숨기기" - -#: Settings.ui.h:2 Settings4.ui.h:3 -msgid "Indicator icon" -msgstr "인디케이터" - -#: Settings.ui.h:3 Settings4.ui.h:4 -msgid "Enable desktop notifications" -msgstr "" - -#: Settings.ui.h:4 Settings4.ui.h:5 extension.js:129 -msgid "Set background image" -msgstr "탁상화면 배경 설정" - -#: Settings.ui.h:5 Settings4.ui.h:6 extension.js:130 -msgid "Set lock screen image" -msgstr "잠금화면 배경 설정" - -#: Settings.ui.h:6 Settings4.ui.h:7 -msgid "Download folder" -msgstr "다운로드 폴더" - -#: Settings.ui.h:7 Settings4.ui.h:1 -msgid "Bing Wallpaper pictures folder" -msgstr "Bing 배경화면 화상 폴더" - -#: Settings.ui.h:8 Settings4.ui.h:9 -msgid "Delete previously downloaded wallpapers" -msgstr "이전에 다운로드한 배경화면 삭제" - -#: Settings.ui.h:9 Settings4.ui.h:10 -msgid "Days to store wallpapers before deleting" -msgstr "배경화면을 삭제하기 전에 저장해 두는 기간" - -#: Settings.ui.h:10 Settings4.ui.h:11 -msgid "Bing locale" -msgstr "Bing 로케일" - -#: Settings.ui.h:11 Settings4.ui.h:12 -msgid "Default is English - United States" -msgstr "미국 영어가 기본값입니다." - -#: Settings.ui.h:12 Settings4.ui.h:14 -msgid "Screen resolution" -msgstr "화면 해상도" - -#: Settings.ui.h:13 Settings4.ui.h:15 -msgid "Override automatic resolution selection" -msgstr "자동 도형표시 선택을 무시" - -#: Settings.ui.h:14 Settings4.ui.h:13 -msgid "Selected image" -msgstr "" - -#: Settings.ui.h:15 Settings4.ui.h:16 extension.js:132 -msgid "Settings" -msgstr "설정" - -#: Settings.ui.h:16 Settings4.ui.h:17 -msgid "Use custom blur and brightness" -msgstr "" - -#: Settings.ui.h:17 Settings4.ui.h:18 -msgid "Override GDM3 lockscreen effects" -msgstr "" - -#: Settings.ui.h:18 Settings4.ui.h:19 -msgid "Blur can improve readability of login prompt" -msgstr "" - -#: Settings.ui.h:19 Settings4.ui.h:20 -msgid "Background blur intensity" -msgstr "" - -#: Settings.ui.h:20 Settings4.ui.h:21 -msgid "Can improve contrast of login prompt" -msgstr "" - -#: Settings.ui.h:21 Settings4.ui.h:22 -msgid "Background brightness" -msgstr "" - -#: Settings.ui.h:22 Settings4.ui.h:23 -msgid "Presets" -msgstr "" - -#: Settings.ui.h:23 Settings4.ui.h:24 -msgid "Commonly used presets" -msgstr "" - -#: Settings.ui.h:24 Settings4.ui.h:25 -msgid "No blur, slight dim" -msgstr "" - -#: Settings.ui.h:25 Settings4.ui.h:26 -msgid "GNOME default" -msgstr "" - -#: Settings.ui.h:26 Settings4.ui.h:27 -msgid "Slight blur, slight dim" -msgstr "" - -#: Settings.ui.h:27 Settings4.ui.h:28 -msgid "Lock Screen" -msgstr "" - -#: Settings.ui.h:28 Settings4.ui.h:29 -msgid "New wallpaper images everyday from Bing" -msgstr "" - -#: Settings.ui.h:29 Settings4.ui.h:30 -msgid "Gnome shell extension version " -msgstr "그놈 쉘 확장 버전" - -#: Settings.ui.h:30 Settings4.ui.h:31 -msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" -msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" - -#: Settings.ui.h:31 Settings4.ui.h:32 -msgid "Maintained by Michael Carroll" -msgstr "Michael Carroll에 의해 유지됨" - -#: Settings.ui.h:32 Settings4.ui.h:33 -msgid "" -"Show your support to the author on Flattr or Github " -"Sponsors." -msgstr "" - -#: Settings.ui.h:33 Settings4.ui.h:34 -msgid "Changes since last version" -msgstr "" - -#: Settings.ui.h:34 Settings4.ui.h:35 -msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "Elia Argentieri의 NASA APOD 그놈 쉘 확장을 기반으로 합니다." - -#: Settings.ui.h:35 Settings4.ui.h:36 -#, fuzzy -#| msgid "" -#| "This program comes with ABSOLUTELY NO WARRANTY.\n" -#| "See the GNU General Public License, version 3 or later for details." -msgid "" -"This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General " -"Public License, version 3 or later for details." -msgstr "" -"이 프로그람은 어떠한 형태의 보증도 제공되지 않습니다.\n" -"더 자세한 내용은 GNU 일반 공중 사용 허가서, 판본 3 또는 그 이상 을 참고하" -"세요." - -#: Settings.ui.h:37 Settings4.ui.h:38 -msgid "About" -msgstr "정보" - -#: Settings4.ui.h:8 -msgid "Open folder" -msgstr "" - -#: extension.js:117 -msgid "" -msgstr "<예정된 새로고침 없음>" - -#: extension.js:119 extension.js:121 extension.js:123 -msgid "Awaiting refresh..." -msgstr "새로고침 기다리는 중..." - -#: extension.js:126 -msgid "Copy image to clipboard" -msgstr "" - -#: extension.js:127 -msgid "Copy image URL to clipboard" -msgstr "화상 유일자원지시기를 클립보드로 복사" - -#: extension.js:128 -msgid "Open image folder" -msgstr "" - -#: extension.js:131 -msgid "Refresh Now" -msgstr "지금 새로고침" - -#: extension.js:137 -msgid "Thumbnail disabled on Wayland" -msgstr "" - -#: extension.js:203 -msgid "Next refresh" -msgstr "다음 새로고침" - -#: extension.js:490 extension.js:527 -msgid "Bing Wallpaper of the Day for" -msgstr "오늘의 Bing 배경화면은" - -#: extension.js:495 -msgid "Set as wallpaper" -msgstr "배경화면 설정" - -#: extension.js:498 -msgid "More info on Bing.com" -msgstr "" - -#: extension.js:553 -msgid "No wallpaper available" -msgstr "리용 가능한 배경화면 없음" - -#: extension.js:554 -msgid "No picture for today." -msgstr "오늘은 화상이 없네요." - -#: prefs.js:173 -msgid "Most recent image" -msgstr "" - -#: prefs.js:174 -msgid "Random image" -msgstr "" - -#: prefs.js:190 prefs.js:206 -msgid "Disabled on current GNOME version" -msgstr "" - -#: utils.js:139 -msgid "Fetching data..." -msgstr "자료를 가져오는 중..." - -#: utils.js:150 -msgid "Market not available in your region" -msgstr "귀하의 구역에서 리용할 수 없는 시장입니다." - -#: utils.js:154 -msgid "A network error occured" -msgstr "망 오류 발생" - -#: utils.js:159 -msgid "Too many requests in 5 seconds" -msgstr "" - -#: utils.js:186 -msgid "No change log found for this release" -msgstr "" - -#: utils.js:366 utils.js:369 -msgid "minutes" -msgstr "분" - -#: utils.js:372 -msgid "days" -msgstr "일" - -#: utils.js:375 -msgid "hours" -msgstr "시간" - -#~ msgid "" -#~ "Changes your wallpaper daily to the Bing picture of the day for your " -#~ "region. Displays the picture description and copyright information." -#~ msgstr "" -#~ "귀하의 구역에 맞는 그날의 Bing 화상으로 매일 배경화면을 변경해 줍니다. 또" -#~ "한 해당 화상에 대한 설명과 저작권 정보에 대한 알림을 보여줍니다." diff --git a/locale/ko_KR/LC_MESSAGES/BingWallpaper.mo b/locale/ko_KR/LC_MESSAGES/BingWallpaper.mo deleted file mode 100644 index d93e5542701566a6cc0da7c9ca8c55d057913350..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2785 zcmbW1YjYD-7{?Eaw|c+fT_2Pgbad0SV@GTYW1)am3Y`|z7dp-+dz!4>>}Ga1)V^zJ z#0of6X(V9M2{YxUWz0a3I8*%+z7=0M&M4WFPoOjUe>Q0wkXN3`=9fK}=k|Ycetl?d zPGGFZ^E93fYlLVAU%3Te7=ME6z-!=RJaMZKw*ilX4};HwJzyvJ3}}PTf=9r+!EeE* zz$@U3;LqUm;NRdz@VT`@+z;*q9{}G4`Fs+52>cXeyC=aHz$$nT_zU+jPB2G5n=RvN+ z>E`@Z5M>ZRs26L(gU|Bdv+S2OW4&7kw-Rf{aq!@Jw+@sx)Z$){wc&bk?yMgV){}da z_2a?$vgSxNtTES(#}jx^_Ao#0Rl>6}dUreI%28K(N%G=JX=E&EY!Q8AOMl#P$4I)a zKV%?)1&Qn!ZJ}AjrQ55kNie_-IpG=V6UXKEBBjD#%R(GBcbH7)v^v&*sW zkbXSL$r`$^bJcEMqW#hhOC{bk4H?$Lv<)+^BXTjQo3@V!j!?-#GoI9?McZ`9WLa2s z$D~iTOz$IvGtJiC&`sv)rlfw>%# zp7EWO?wfJg@f<7Tv#=hD66arHxYT^jYJA+aqL@g)=p&5!rES`r{Ht>y_?3I58obc8ypziz8YyqB-*ykvGMPM z!-+H^@{wYD+Cq=?5W2(lq`!IJ-W}Se)qNb;sC2dMcHA*grEc03GyS&rw4KtHZX@C$ zM;fM2osm}~9c@Ea#?>uthvTNaZnD$itGBtMhZ;XOM|;{tugcG;QZAS+keZ$eP8DjG zO6rGmq>dj{#UoopkX@)Bs;aM#)Tb6n{3NscdS+|2ZtAeGmF8Y zIZ_K>@c-q8n?n`zE%#0BN;Nn*L+Z0U)lcNq{ApFp5?d+fRbdJ7P(61(I6MQZ5yAcs z<=H@Z`vm23?c$I16LZ1&iYiVvE}hm%QU?~**(}wMR)Wvxn(L?Gei?6y8t3C{e8oPuKo_8eTg3D!56cf zJJxFDtbl{sl=`YtD^G^0U8>f~U#j^}R?;d~nr4utI$42lL{QHmf|d-Mensn^ z<;;T5%gCmlEeEHU2yRrV8rEt>ga4G7f{R%=6$8tc6sehW9CWoTZn&Vr{EB%_P8CY1 zS1@}{)UHgT0xSh4)bR`0q_XHC6#V4*daeX>SUP@?YZ08CQA@{K66O?&N3LtQ6>TS* zq9LE~d=?d%gY=+ipAC+lK*v{(J?nypUyS6He^{|Qu8I)y!le&aM*2!3)~R@_u>n_&x(Hm Du-xW( diff --git a/locale/ko_KR/LC_MESSAGES/BingWallpaper.po b/locale/ko_KR/LC_MESSAGES/BingWallpaper.po deleted file mode 100644 index 04c3346b..00000000 --- a/locale/ko_KR/LC_MESSAGES/BingWallpaper.po +++ /dev/null @@ -1,286 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-09 13:10+1000\n" -"PO-Revision-Date: 2021-05-09 14:07+1000\n" -"Last-Translator: Suhyuk Park (nks15) \n" -"Language-Team: \n" -"Language: ko_KR\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.4.1\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: Settings.ui.h:1 Settings4.ui.h:2 -msgid "Hide the indicator" -msgstr "Indicator 숨기기" - -#: Settings.ui.h:2 Settings4.ui.h:3 -msgid "Indicator icon" -msgstr "" - -#: Settings.ui.h:3 Settings4.ui.h:4 -msgid "Enable desktop notifications" -msgstr "" - -#: Settings.ui.h:4 Settings4.ui.h:5 extension.js:129 -msgid "Set background image" -msgstr "바탕화면 배경 설정" - -#: Settings.ui.h:5 Settings4.ui.h:6 extension.js:130 -msgid "Set lock screen image" -msgstr "잠금화면 배경 설정" - -#: Settings.ui.h:6 Settings4.ui.h:7 -msgid "Download folder" -msgstr "다운로드 폴더" - -#: Settings.ui.h:7 Settings4.ui.h:1 -msgid "Bing Wallpaper pictures folder" -msgstr "Bing 배경화면 사진 폴더" - -#: Settings.ui.h:8 Settings4.ui.h:9 -msgid "Delete previously downloaded wallpapers" -msgstr "이전에 다운로드한 배경화면 삭제" - -#: Settings.ui.h:9 Settings4.ui.h:10 -msgid "Days to store wallpapers before deleting" -msgstr "배경화면을 삭제하기 전에 저장해 두는 기간" - -#: Settings.ui.h:10 Settings4.ui.h:11 -msgid "Bing locale" -msgstr "Bing 로케일" - -#: Settings.ui.h:11 Settings4.ui.h:12 -msgid "Default is English - United States" -msgstr "미국 영어가 기본값입니다." - -#: Settings.ui.h:12 Settings4.ui.h:14 -msgid "Screen resolution" -msgstr "화면 해상도" - -#: Settings.ui.h:13 Settings4.ui.h:15 -msgid "Override automatic resolution selection" -msgstr "자동 해상도 선택을 무시" - -#: Settings.ui.h:14 Settings4.ui.h:13 -msgid "Selected image" -msgstr "" - -#: Settings.ui.h:15 Settings4.ui.h:16 extension.js:132 -msgid "Settings" -msgstr "설정" - -#: Settings.ui.h:16 Settings4.ui.h:17 -msgid "Use custom blur and brightness" -msgstr "" - -#: Settings.ui.h:17 Settings4.ui.h:18 -msgid "Override GDM3 lockscreen effects" -msgstr "" - -#: Settings.ui.h:18 Settings4.ui.h:19 -msgid "Blur can improve readability of login prompt" -msgstr "" - -#: Settings.ui.h:19 Settings4.ui.h:20 -msgid "Background blur intensity" -msgstr "" - -#: Settings.ui.h:20 Settings4.ui.h:21 -msgid "Can improve contrast of login prompt" -msgstr "" - -#: Settings.ui.h:21 Settings4.ui.h:22 -msgid "Background brightness" -msgstr "" - -#: Settings.ui.h:22 Settings4.ui.h:23 -msgid "Presets" -msgstr "" - -#: Settings.ui.h:23 Settings4.ui.h:24 -msgid "Commonly used presets" -msgstr "" - -#: Settings.ui.h:24 Settings4.ui.h:25 -msgid "No blur, slight dim" -msgstr "" - -#: Settings.ui.h:25 Settings4.ui.h:26 -msgid "GNOME default" -msgstr "" - -#: Settings.ui.h:26 Settings4.ui.h:27 -msgid "Slight blur, slight dim" -msgstr "" - -#: Settings.ui.h:27 Settings4.ui.h:28 -msgid "Lock Screen" -msgstr "" - -#: Settings.ui.h:28 Settings4.ui.h:29 -msgid "New wallpaper images everyday from Bing" -msgstr "" - -#: Settings.ui.h:29 Settings4.ui.h:30 -msgid "Gnome shell extension version " -msgstr "그놈 쉘 확장 버전" - -#: Settings.ui.h:30 Settings4.ui.h:31 -msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" -msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" - -#: Settings.ui.h:31 Settings4.ui.h:32 -msgid "Maintained by Michael Carroll" -msgstr "Michael Carroll에 의해 유지됨" - -#: Settings.ui.h:32 Settings4.ui.h:33 -msgid "" -"Show your support to the author on Flattr or Github " -"Sponsors." -msgstr "" - -#: Settings.ui.h:33 Settings4.ui.h:34 -msgid "Changes since last version" -msgstr "" - -#: Settings.ui.h:34 Settings4.ui.h:35 -msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "Elia Argentieri의 NASA APOD 그놈 쉘 확장을 기반으로 합니다." - -#: Settings.ui.h:35 Settings4.ui.h:36 -#, fuzzy -#| msgid "" -#| "This program comes with ABSOLUTELY NO WARRANTY.\n" -#| "See the GNU General Public License, version 3 or later for details." -msgid "" -"This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General " -"Public License, version 3 or later for details." -msgstr "" -"이 프로그램은 어떠한 형태의 보증도 제공되지 않습니다.\n" -"더 자세한 내용은 GNU 일반 공중 사용 허가서, 버전 3 또는 그 이상 을 참고하" -"세요." - -#: Settings.ui.h:37 Settings4.ui.h:38 -msgid "About" -msgstr "정보" - -#: Settings4.ui.h:8 -msgid "Open folder" -msgstr "" - -#: extension.js:117 -msgid "" -msgstr "<예정된 새로고침 없음>" - -#: extension.js:119 extension.js:121 extension.js:123 -msgid "Awaiting refresh..." -msgstr "새로고침 기다리는 중..." - -#: extension.js:126 -#, fuzzy -msgid "Copy image to clipboard" -msgstr "이미지 클립보드로 복사" - -#: extension.js:127 -msgid "Copy image URL to clipboard" -msgstr "이미지 URL을 클립보드로 복사" - -#: extension.js:128 -msgid "Open image folder" -msgstr "" - -#: extension.js:131 -msgid "Refresh Now" -msgstr "지금 새로고침" - -#: extension.js:137 -msgid "Thumbnail disabled on Wayland" -msgstr "" - -#: extension.js:203 -msgid "Next refresh" -msgstr "다음 새로고침" - -#: extension.js:490 extension.js:527 -msgid "Bing Wallpaper of the Day for" -msgstr "오늘의 Bing 배경화면은" - -#: extension.js:495 -msgid "Set as wallpaper" -msgstr "배경화면 설정" - -#: extension.js:498 -msgid "More info on Bing.com" -msgstr "" - -#: extension.js:553 -msgid "No wallpaper available" -msgstr "사용 가능한 배경화면 없음" - -#: extension.js:554 -msgid "No picture for today." -msgstr "오늘은 사진이 없네요." - -#: prefs.js:173 -msgid "Most recent image" -msgstr "" - -#: prefs.js:174 -msgid "Random image" -msgstr "" - -#: prefs.js:190 prefs.js:206 -msgid "Disabled on current GNOME version" -msgstr "" - -#: utils.js:139 -msgid "Fetching data..." -msgstr "데이터를 가져오는 중..." - -#: utils.js:150 -msgid "Market not available in your region" -msgstr "귀하의 지역에서 사용할 수 없는 마켓입니다." - -#: utils.js:154 -msgid "A network error occured" -msgstr "네트워크 오류 발생" - -#: utils.js:159 -msgid "Too many requests in 5 seconds" -msgstr "" - -#: utils.js:186 -msgid "No change log found for this release" -msgstr "" - -#: utils.js:366 utils.js:369 -msgid "minutes" -msgstr "분" - -#: utils.js:372 -msgid "days" -msgstr "일" - -#: utils.js:375 -msgid "hours" -msgstr "시간" - -#~ msgid "" -#~ "Changes your wallpaper daily to the Bing picture of the day for your " -#~ "region. Displays the picture description and copyright information." -#~ msgstr "" -#~ "귀하의 지역에 맞는 그날의 Bing 그림으로 매일 배경화면을 변경해 줍니다. 또" -#~ "한 해당 그림에 대한 설명과 저작권 정보에 대한 알림을 보여줍니다." From af0a829828fb35892efce7dd577751e3c58e167d Mon Sep 17 00:00:00 2001 From: izotopo <140181701+izotopo@users.noreply.github.com> Date: Sun, 23 Jul 2023 01:17:01 +0900 Subject: [PATCH 15/21] Update Korean translation --- locale/ko/LC_MESSAGES/BingWallpaper.mo | Bin 3420 -> 5758 bytes locale/ko/LC_MESSAGES/BingWallpaper.po | 105 +++++++++++++------------ 2 files changed, 53 insertions(+), 52 deletions(-) diff --git a/locale/ko/LC_MESSAGES/BingWallpaper.mo b/locale/ko/LC_MESSAGES/BingWallpaper.mo index 17d385e73c8c55af44f7fe09b0a2f5e2706fa43a..19e433dd2cb16183ed36a1d7588da3413fcca385 100644 GIT binary patch literal 5758 zcmbVPYit}>6~2Y?sM|tYN?Xe7Hqg>i@A}n{)N!mhvExR>57`cBk*YGgd%ZjL?94JV z8`lv(oMaQ+I3Z5!O*W}*ZG~f}szW!)23*OZKWN1dkPzY_Bm@! zS?}73io_`6Z|6SG`ObIFz4`4ux8@n1cD$d$d&m128wCFQ{rH3DsShxAA8-%w9pKl1 z_X8jKAY=H++JPSfb^<>Ed>Z(1pbgvxoB)0r_%`q}z~2LJ2j21_#_EB00zVII1wIIT z4oLG40zV0y0@8jtEgJ|L~L1qc_|b3j@z38e8Zkj9S#$-b9> zF(C2yB9H^W10?1;VjlH^i_wjCF3R^RHe>R3ud~Yzao*xjlqgy6# z;g-z}%@uZAgVxT6@s$v+rW;PQt%1yMXC2%W?xo1VlrRh~UQpA~9~QZAQxo7&olw>eR-_myNv{J?_GG z2Yp6Dgx!V}*9^gSlBIFPOHU&{2Lv3_5?V|*U^gvmSV`Ta(4{jj+f_3zZkevFIqr>v zQkt2>W{z&g1xUt_kao7qN~bN;7~@&;JOh)2>!39=hV8Ya;QI#la@XQW&tJ!YO3Xf{j@4?%uwht~LKU!+8~=yG)t@W1JD! z%5c+i^wF5{3Wi+BbW^@#OlgjtD<`W3S{*tE52OJmdH zVbc!OP1}i@$i<8?7Oi^Gj#bQL76}*`5?UI&SH4^Mh*j6Kr>CoGa8tCgZWpRIk~T6l zmVsd|JZ;DrC=lBy>1>qc?fZsyN48eSk$uC$j&zxED*>`v`PP{3*7YN8H6yayveQm0 zH#6$f+1|8`2S2wrZmWAb5*)|MxqeF|beFe8TcXW%tW6dsWHIke&2V{S!h3aQ^=eVR zd6CPr$K>pZn_ea4Y?=GhIU4)DWpD1HoE_)#OxZhA^z$>^FXa6rGjg`Ty{l!pFzcPl zaaqK&*Sx8MT*T1)ae4fjH#y-=&PVIKlha(zP08FcP4*6#<@wiW!5egb(|ZR_)5y9@ zNb|Z&h@4&VN(GL+<@{+b4=-VH?w_4lEse|EOg;Cm_C+?w`2;!dW1vjpLM#PK83!0xI$rU#vtA0rOwUL2cvUj*Rp3msk*aSv(Xv8pIw7B(}+rg(Z1(lKF?q z-okZ+$9s83o}HrLdv7e0O6eZtK{tn&-eXWWpq3q_nZuW$cxVPeg7$N2<>EL3;OEQS zI~{0kxwKkBT;Et;y>nP?zCooc$cbbuM#fipPrGEGm4stivawqZOiA#>FWh1=ZdS#6G1Yt z4Hu?B>SZoxiX;XUnu!7>5pf2Ny~#H@+U40xf&ZZse!j@nz_Z5`BT&-H%X02$P>Yn3 z=^PE`P-XHKzon|1N@4OGq{w{EyNX}5<6KRi6De~SxV(n4i0+D#AlP}RF|4kLp}Kvc zP}HP)&0vIi_QbkU9HvxQk?Uc?bqFUY4{xaiMm_cxAmk+kkF@5U7*`SrG9s+gWPIuS zN}gmn%6p{g_KI$)VH#dpoYP-&HRbnYZ7VIiM0``RFT{~tXf}-Wze?HiAr10b;D8i-j}@aEV^M<^{#>cAOFvbUMOM| zO*)dmA;ljlu?T6D<+oSD#NSwPwXgqDG=IF?=&78Wa53b8ce7C%+K?&s`Icc+%V7J@=lM z=XvhA-Tg;fp@)oWkU49H}1n9n(KZcwn8_&4u{}2Si4Dxa=05d!EX2r z+z%gu@53E%0d9d;;REnGqI;?`fK*T0~g;-ns z4xfZKVI^$E-yo{B3+_aJ9Fw-8{}F6M|H5V=FjRaE34RBM;9rmv>T+Nn_7^YUhBJB# za-=6A!HbYf`aR?fZ^Itgjx@OBBaq-2+zwB}R=5bcf(6L)euBJ?hCHtmW#Rz(VWa~$ zua_P~ArH6!x%9bG{|Cq!{Z{f85pAXnUvfMZ^PMTY} zczmNo+~Lx3S-5dFeAxJ)aO3lVr0upVH(1_MCZ{SUbP>>cgJ*!en}mnV!&u{CV?U`IKXi3_D1E?l>s_-ZJyN zyT{en<9eFhz586fU2d1ly@(=oC>$g9iOu&0tKY)LBjmHu#5 z+!=Sz0QqD6o0X?aD|R;QZNkcWA&;q8fUHmR>XU?AYiN($34*NiNxis4YAvQSF)UqB ziG=8RB>E8}Xudbi(lX>7ZenLBC(m%@Pu|l6lgp402Gj%c8g*wUYCk zKOX40D;T6>Dbmtx?66}?&(Ph~lxLf^cdHm;PB;ZJ)e9?B%tqDJl9fdE*=%v`nsq** zR\n" +"PO-Revision-Date: 2023-07-23 01:13+0900\n" +"Last-Translator: izotopo <140181701+izotopo@users.noreply.github.com>\n" "Language-Team: \n" "Language: ko\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.4.1\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.3.2\n" #: Settings.ui.h:1 Settings4.ui.h:2 msgid "Hide the indicator" -msgstr "인디케이터 숨기기" +msgstr "표시기 숨기기" #: Settings.ui.h:2 Settings4.ui.h:3 msgid "Indicator icon" -msgstr "인디케이터" +msgstr "표시기 아이콘" #: Settings.ui.h:3 Settings4.ui.h:4 msgid "Enable desktop notifications" -msgstr "" +msgstr "데스크톱 알림 사용" #: Settings.ui.h:4 Settings4.ui.h:5 extension.js:129 msgid "Set background image" -msgstr "바탕화면 배경 설정" +msgstr "배경화면 설정" #: Settings.ui.h:5 Settings4.ui.h:6 extension.js:130 msgid "Set lock screen image" -msgstr "잠금화면 배경 설정" +msgstr "잠금화면 설정" #: Settings.ui.h:6 Settings4.ui.h:7 msgid "Download folder" @@ -60,7 +60,7 @@ msgstr "Bing 로케일" #: Settings.ui.h:11 Settings4.ui.h:12 msgid "Default is English - United States" -msgstr "미국 영어가 기본값입니다" +msgstr "미국 영어가 기본값임" #: Settings.ui.h:12 Settings4.ui.h:14 msgid "Screen resolution" @@ -68,11 +68,11 @@ msgstr "화면 해상도" #: Settings.ui.h:13 Settings4.ui.h:15 msgid "Override automatic resolution selection" -msgstr "자동 해상도 선택 무시" +msgstr "자동 해상도 선택 재정의" #: Settings.ui.h:14 Settings4.ui.h:13 msgid "Selected image" -msgstr "" +msgstr "선택한 이미지" #: Settings.ui.h:15 Settings4.ui.h:16 extension.js:132 msgid "Settings" @@ -80,61 +80,59 @@ msgstr "설정" #: Settings.ui.h:16 Settings4.ui.h:17 msgid "Use custom blur and brightness" -msgstr "" +msgstr "사용자 지정 흐림 및 밝기 사용" #: Settings.ui.h:17 Settings4.ui.h:18 msgid "Override GDM3 lockscreen effects" -msgstr "" +msgstr "GDM3 잠금화면 효과 재정의" #: Settings.ui.h:18 Settings4.ui.h:19 msgid "Blur can improve readability of login prompt" -msgstr "" +msgstr "흐림을 통한 로그인 프롬프트 가독성 향상" #: Settings.ui.h:19 Settings4.ui.h:20 msgid "Background blur intensity" -msgstr "" +msgstr "배경화면 흐림 강도" #: Settings.ui.h:20 Settings4.ui.h:21 msgid "Can improve contrast of login prompt" -msgstr "" +msgstr "로그인 프롬프트의 대비 개선" #: Settings.ui.h:21 Settings4.ui.h:22 -#, fuzzy -#| msgid "Set background image" msgid "Background brightness" -msgstr "바탕화면 배경 설정" +msgstr "배경화면 밝기" #: Settings.ui.h:22 Settings4.ui.h:23 msgid "Presets" -msgstr "" +msgstr "프리셋" #: Settings.ui.h:23 Settings4.ui.h:24 msgid "Commonly used presets" -msgstr "" +msgstr "일반적으로 사용되는 프리셋" #: Settings.ui.h:24 Settings4.ui.h:25 msgid "No blur, slight dim" -msgstr "" +msgstr "흐림 없음, 약간 흐릿함" #: Settings.ui.h:25 Settings4.ui.h:26 msgid "GNOME default" -msgstr "" +msgstr "GNOME 기본값" #: Settings.ui.h:26 Settings4.ui.h:27 msgid "Slight blur, slight dim" -msgstr "" +msgstr "약간 흐림, 약간 흐릿함" #: Settings.ui.h:27 Settings4.ui.h:28 msgid "Lock Screen" -msgstr "" +msgstr "잠금화면" #: Settings.ui.h:28 Settings4.ui.h:29 msgid "New wallpaper images everyday from Bing" -msgstr "" +msgstr "매일 새로운 Bing 배경화면 이미지" #: Settings.ui.h:29 Settings4.ui.h:30 msgid "Gnome shell extension version " -msgstr "그놈 쉘 확장 버전" +msgstr "GNOME 셸 확장 버전 " #: Settings.ui.h:30 Settings4.ui.h:31 msgid "https://github.com/neffo/bing-wallpaper-gnome-extension" @@ -142,7 +140,7 @@ msgstr "https://github.com/neffo/bing-wallpaper-gnome-extension" #: Settings.ui.h:31 Settings4.ui.h:32 msgid "Maintained by Michael Carroll" -msgstr "Michael Carroll에 의해 유지됨" +msgstr "Michael Carroll 님이 유지보수 중임" #: Settings.ui.h:32 Settings4.ui.h:33 msgid "" @@ -150,14 +148,16 @@ msgid "" "\">Flattr or Github " "Sponsors." msgstr "" +"Flattr 또는 Github Sponsors에서 개발자를 지지해주세요." #: Settings.ui.h:33 Settings4.ui.h:34 msgid "Changes since last version" -msgstr "" +msgstr "마지막 버전 이후 변경 사항" #: Settings.ui.h:34 Settings4.ui.h:35 msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" -msgstr "Elia Argentieri의 NASA APOD 그놈 쉘 확장을 기반으로 합니다" +msgstr "Elia Argentieri 님의 NASA APOD Gnome 셸 확장을 기반으로 함" #: Settings.ui.h:35 Settings4.ui.h:36 msgid "" @@ -165,10 +165,11 @@ msgid "" "See the GNU General " "Public License, version 3 or later for details." msgstr "" -"이 프로그램은 어떠한 형태의 보증도 제공되지 않습니다.\n" +"이 프로그램은 어떠한 형태의 보증도 제공되지 않습니" +"다.\n" "더 자세한 내용은 GNU 일반 공중 사용 허가서, 버전 3 또는 그 이상 을 참고하" -"세요." +"gpl-2.0.html\">GNU 일반 공중 사용 허가서, 버전 3 또는 그 이상 을 참고" +"하세요." #: Settings.ui.h:37 Settings4.ui.h:38 msgid "About" @@ -176,7 +177,7 @@ msgstr "정보" #: Settings4.ui.h:8 msgid "Open folder" -msgstr "" +msgstr "폴더 열기" #: extension.js:117 msgid "" @@ -184,19 +185,19 @@ msgstr "<예정된 새로고침 없음>" #: extension.js:119 extension.js:121 extension.js:123 msgid "Awaiting refresh..." -msgstr "새로고침 기다리는 중..." +msgstr "새로고침을 기다리는 중..." #: extension.js:126 msgid "Copy image to clipboard" -msgstr "이미지 클립보드로 복사" +msgstr "클립보드에 이미지 복사" #: extension.js:127 msgid "Copy image URL to clipboard" -msgstr "이미지 URL을 클립보드로 복사" +msgstr "클립보드에 이미지 URL 복사" #: extension.js:128 msgid "Open image folder" -msgstr "" +msgstr "이미지 폴더 열기" #: extension.js:131 msgid "Refresh Now" @@ -204,7 +205,7 @@ msgstr "지금 새로고침" #: extension.js:137 msgid "Thumbnail disabled on Wayland" -msgstr "" +msgstr "Wayland에서 썸네일이 비활성화됨" #: extension.js:203 msgid "Next refresh" @@ -216,31 +217,31 @@ msgstr "오늘의 Bing 배경화면은" #: extension.js:495 msgid "Set as wallpaper" -msgstr "배경화면 설정" +msgstr "배경화면으로 설정" #: extension.js:498 msgid "More info on Bing.com" -msgstr "" +msgstr "Bing.com에서 더 많은 정보를 알아볼 수 있습니다" #: extension.js:553 msgid "No wallpaper available" -msgstr "사용 가능한 배경화면 없음" +msgstr "사용할 수 있는 배경화면이 없습니다" #: extension.js:554 msgid "No picture for today." -msgstr "오늘은 사진이 없네요." +msgstr "오늘은 사진이 없습니다." #: prefs.js:173 msgid "Most recent image" -msgstr "" +msgstr "가장 최근 이미지" #: prefs.js:174 msgid "Random image" -msgstr "" +msgstr "임의의 이미지" #: prefs.js:190 prefs.js:206 msgid "Disabled on current GNOME version" -msgstr "" +msgstr "현재 GNOME 버전에서는 비활성화됨" #: utils.js:139 msgid "Fetching data..." @@ -248,19 +249,19 @@ msgstr "데이터를 가져오는 중..." #: utils.js:150 msgid "Market not available in your region" -msgstr "귀하의 지역에서 사용할 수 없는 마켓입니다" +msgstr "해당 지역에서 사용할 수 없는 마켓입니다" #: utils.js:154 msgid "A network error occured" -msgstr "네트워크 오류 발생" +msgstr "네트워크 오류가 발생했습니다" #: utils.js:159 msgid "Too many requests in 5 seconds" -msgstr "" +msgstr "5초 동안 너무 많은 요청이 발생했습니다" #: utils.js:186 msgid "No change log found for this release" -msgstr "" +msgstr "이 릴리스에 대한 변경 로그를 찾을 수 없습니다" #: utils.js:366 utils.js:369 msgid "minutes" @@ -278,5 +279,5 @@ msgstr "시간" #~ "Changes your wallpaper daily to the Bing picture of the day for your " #~ "region. Displays the picture description and copyright information." #~ msgstr "" -#~ "귀하의 지역에 맞는 그날의 Bing 그림으로 매일 배경화면을 변경해 줍니다. 또" -#~ "한 해당 그림에 대한 설명과 저작권 정보에 대한 알림을 보여줍니다." +#~ "해당 지역에 맞는 그날의 Bing 이미지로 매일 배경화면을 변경합니다. 또한 " +#~ "해당 이미지에 대한 설명과 저작권에 대한 정보를 보여줍니다." From 7a4520eab8ce1c30dc14da7ccf8da9c72b37f230 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sun, 23 Jul 2023 16:58:01 +1000 Subject: [PATCH 16/21] fix signage in shuffle mode --- .github/FUNDING.yml | 2 +- extension.js | 20 ++- locale/BingWallpaper.pot | 162 +++++++++--------- schemas/gschemas.compiled | Bin 2375 -> 2432 bytes ...shell.extensions.bingwallpaper.gschema.xml | 5 + 5 files changed, 106 insertions(+), 83 deletions(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 902bc400..965d5cbe 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ github: [neffo] -custom: ['https://flattr.com/@neffo'] +ko_fi: [michaelcarroll] diff --git a/extension.js b/extension.js index 706cb09a..d87820b5 100644 --- a/extension.js +++ b/extension.js @@ -403,6 +403,16 @@ class BingWallpaperIndicator extends PanelMenu.Button { this._restartTimeout(difference); } + _restartShuffleTimeoutFromDueDate(duedate) { + let now = GLib.DateTime.new_now_local(); + let difference = duedate.difference(now) / 1000000; + if (difference < 60 || difference > 86400) // clamp to a reasonable range + difference = 60; + + log('Next shuffle due ' + difference + ' seconds from now'); + this._restartShuffleTimeout(difference); + } + // convert longdate format into human friendly format _localeDate(longdate, include_time = false) { try { @@ -692,11 +702,12 @@ class BingWallpaperIndicator extends PanelMenu.Button { } _restartShuffleTimeout(seconds = null) { + log('_restartShuffleTimeout('+seconds+')'); if (this._shuffleTimeout) GLib.source_remove(this._shuffleTimeout); if (seconds == null) { - let diff = Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000); + let diff = -Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000); log('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff); @@ -705,7 +716,9 @@ class BingWallpaperIndicator extends PanelMenu.Button { seconds = diff; // if not specified, we should maintain the existing shuffle timeout (i.e. we just restored from saved state) } else if (this._settings.get_string('random-interval-mode') != 'custom') { - seconds = Utils.seconds_until(this._settings.get_string('random-interval-mode')); // else we shuffle at specified interval (midnight default) + let random_mode = this._settings.get_string('random-interval-mode'); + seconds = Utils.seconds_until(random_mode); // else we shuffle at specified interval (midnight default) + log('shuffle mode = '+random_mode+' = '+seconds+' from now'); } else { seconds = this._settings.get_int('random-interval'); // or whatever the user has specified (as a timer) @@ -953,7 +966,8 @@ class BingWallpaperIndicator extends PanelMenu.Button { } if (this._settings.get_boolean('random-mode-enabled')) { - this._restartShuffleTimeout(60); // FIXME: use state value + log('random mode enabled, restarting random state'); + this._restartShuffleTimeoutFromDueDate(this.shuffledue); // FIXME: use state value this._restartTimeoutFromLongDate(maxLongDate); } else { diff --git a/locale/BingWallpaper.pot b/locale/BingWallpaper.pot index adec027e..f527080b 100644 --- a/locale/BingWallpaper.pot +++ b/locale/BingWallpaper.pot @@ -6,11 +6,11 @@ msgstr "" msgid "Indicator icon" msgstr "" -#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:174 +#: ui/Settings.ui.h:3 ui/Settings4.ui.h:4 extension.js:165 msgid "Enable desktop notifications" msgstr "" -#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:152 extension.js:168 +#: ui/Settings.ui.h:4 ui/Settings4.ui.h:5 extension.js:143 msgid "Set background image" msgstr "" @@ -42,182 +42,194 @@ msgstr "" msgid "Select from image gallery" msgstr "" -#: ui/Settings.ui.h:12 ui/Settings4.ui.h:13 +#: ui/Settings.ui.h:12 ui/Settings4.ui.h:11 +msgid "Shuffle enabled" +msgstr "" + +#: ui/Settings.ui.h:13 ui/Settings4.ui.h:12 +msgid "Shuffle mode" +msgstr "" + +#: ui/Settings.ui.h:14 ui/Settings4.ui.h:13 msgid "Bing locale" msgstr "" -#: ui/Settings.ui.h:13 ui/Settings4.ui.h:14 extension.js:155 +#: ui/Settings.ui.h:15 ui/Settings4.ui.h:14 extension.js:146 msgid "Settings" msgstr "" -#: ui/Settings.ui.h:14 ui/Settings4.ui.h:15 +#: ui/Settings.ui.h:16 msgid "Use custom blur and brightness" msgstr "" -#: ui/Settings.ui.h:15 ui/Settings4.ui.h:16 +#: ui/Settings.ui.h:17 msgid "Override GDM3 lockscreen effects" msgstr "" -#: ui/Settings.ui.h:16 ui/Settings4.ui.h:17 +#: ui/Settings.ui.h:18 msgid "Blur can improve readability of login prompt" msgstr "" -#: ui/Settings.ui.h:17 ui/Settings4.ui.h:18 +#: ui/Settings.ui.h:19 ui/Settings4.ui.h:18 msgid "Background blur intensity" msgstr "" -#: ui/Settings.ui.h:18 ui/Settings4.ui.h:19 +#: ui/Settings.ui.h:20 ui/Settings4.ui.h:19 msgid "Can improve contrast of login prompt" msgstr "" -#: ui/Settings.ui.h:19 ui/Settings4.ui.h:20 +#: ui/Settings.ui.h:21 ui/Settings4.ui.h:20 msgid "Background brightness" msgstr "" -#: ui/Settings.ui.h:20 ui/Settings4.ui.h:21 +#: ui/Settings.ui.h:22 ui/Settings4.ui.h:21 msgid "Presets" msgstr "" -#: ui/Settings.ui.h:21 +#: ui/Settings.ui.h:23 msgid "Commonly used presets" msgstr "" -#: ui/Settings.ui.h:22 ui/Settings4.ui.h:22 +#: ui/Settings.ui.h:24 ui/Settings4.ui.h:22 msgid "No blur, slight dim" msgstr "" -#: ui/Settings.ui.h:23 ui/Settings4.ui.h:23 +#: ui/Settings.ui.h:25 ui/Settings4.ui.h:23 msgid "GNOME default" msgstr "" -#: ui/Settings.ui.h:24 ui/Settings4.ui.h:24 +#: ui/Settings.ui.h:26 ui/Settings4.ui.h:24 msgid "Slight blur, slight dim" msgstr "" -#: ui/Settings.ui.h:25 ui/Settings4.ui.h:25 +#: ui/Settings.ui.h:27 ui/Settings4.ui.h:25 msgid "Lock Screen" msgstr "" -#: ui/Settings.ui.h:26 ui/Settings4.ui.h:27 +#: ui/Settings.ui.h:28 ui/Settings4.ui.h:27 msgid "Debug logging" msgstr "" -#: ui/Settings.ui.h:27 ui/Settings4.ui.h:26 +#: ui/Settings.ui.h:29 ui/Settings4.ui.h:26 msgid "Enable logging to system journal" msgstr "" -#: ui/Settings.ui.h:28 ui/Settings4.ui.h:29 +#: ui/Settings.ui.h:30 ui/Settings4.ui.h:29 msgid "Always show new images" msgstr "" -#: ui/Settings.ui.h:29 ui/Settings4.ui.h:28 +#: ui/Settings.ui.h:31 ui/Settings4.ui.h:28 msgid "Switch to new images when available (unless on random mode)" msgstr "" -#: ui/Settings.ui.h:30 ui/Settings4.ui.h:31 +#: ui/Settings.ui.h:32 ui/Settings4.ui.h:31 msgid "Enable all features on Wayland" msgstr "" -#: ui/Settings.ui.h:31 ui/Settings4.ui.h:30 +#: ui/Settings.ui.h:33 ui/Settings4.ui.h:30 msgid "Some newer features may be unstable on Wayland" msgstr "" -#: ui/Settings.ui.h:32 ui/Settings4.ui.h:32 +#: ui/Settings.ui.h:34 ui/Settings4.ui.h:32 msgid "Screen resolution" msgstr "" -#: ui/Settings.ui.h:33 ui/Settings4.ui.h:33 +#: ui/Settings.ui.h:35 ui/Settings4.ui.h:33 msgid "Override automatic resolution selection" msgstr "" -#: ui/Settings.ui.h:34 ui/Settings4.ui.h:34 +#: ui/Settings.ui.h:36 ui/Settings4.ui.h:34 msgid "Manually adjust random interval (seconds)" msgstr "" -#: ui/Settings.ui.h:35 ui/Settings4.ui.h:35 +#: ui/Settings.ui.h:37 ui/Settings4.ui.h:35 msgid "Random interval" msgstr "" -#: ui/Settings.ui.h:36 ui/Settings4.ui.h:36 +#: ui/Settings.ui.h:38 ui/Settings4.ui.h:36 msgid "Import Bing Wallpaper data" msgstr "" -#: ui/Settings.ui.h:37 ui/Settings4.ui.h:37 +#: ui/Settings.ui.h:39 ui/Settings4.ui.h:37 msgid "Import previously exported JSON data from wallpaper directory" msgstr "" -#: ui/Settings.ui.h:38 ui/Settings4.ui.h:38 +#: ui/Settings.ui.h:40 ui/Settings4.ui.h:38 msgid "Import" msgstr "" -#: ui/Settings.ui.h:39 ui/Settings4.ui.h:39 +#: ui/Settings.ui.h:41 ui/Settings4.ui.h:39 msgid "Export Bing Wallpaper data" msgstr "" -#: ui/Settings.ui.h:40 ui/Settings4.ui.h:40 +#: ui/Settings.ui.h:42 ui/Settings4.ui.h:40 msgid "Export JSON data to wallpaper dir for backup or data migration" msgstr "" -#: ui/Settings.ui.h:41 ui/Settings4.ui.h:41 +#: ui/Settings.ui.h:43 ui/Settings4.ui.h:41 msgid "Export" msgstr "" -#: ui/Settings.ui.h:42 ui/Settings4.ui.h:42 +#: ui/Settings.ui.h:44 ui/Settings4.ui.h:42 msgid "Always export Bing data" msgstr "" -#: ui/Settings.ui.h:43 ui/Settings4.ui.h:43 +#: ui/Settings.ui.h:45 ui/Settings4.ui.h:43 msgid "Export Bing JSON whenever data changes" msgstr "" -#: ui/Settings.ui.h:44 ui/Settings4.ui.h:44 +#: ui/Settings.ui.h:46 ui/Settings4.ui.h:44 msgid "Debug options" msgstr "" -#: ui/Settings.ui.h:45 ui/Settings4.ui.h:46 +#: ui/Settings.ui.h:47 ui/Settings4.ui.h:46 msgid "New wallpaper images everyday from Bing" msgstr "" -#: ui/Settings.ui.h:46 +#: ui/Settings.ui.h:48 msgid "Gnome shell extension version " msgstr "" -#: ui/Settings.ui.h:47 ui/Settings4.ui.h:48 +#: ui/Settings.ui.h:49 ui/Settings4.ui.h:48 msgid "Maintained by Michael Carroll" msgstr "" -#: ui/Settings.ui.h:48 ui/Settings4.ui.h:49 +#: ui/Settings.ui.h:50 ui/Settings4.ui.h:49 msgid "" "Show your support to the author on Flattr or Github " "Sponsors." msgstr "" -#: ui/Settings.ui.h:49 ui/Settings4.ui.h:50 +#: ui/Settings.ui.h:51 ui/Settings4.ui.h:50 msgid "Changes since last version" msgstr "" -#: ui/Settings.ui.h:50 ui/Settings4.ui.h:51 +#: ui/Settings.ui.h:52 ui/Settings4.ui.h:51 msgid "Based on NASA APOD Gnome shell extension by Elia Argentieri" msgstr "" -#: ui/Settings.ui.h:51 ui/Settings4.ui.h:52 +#: ui/Settings.ui.h:53 ui/Settings4.ui.h:52 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General " "Public License, version 3 or later for details." msgstr "" -#: ui/Settings.ui.h:53 ui/Settings4.ui.h:54 +#: ui/Settings.ui.h:55 ui/Settings4.ui.h:54 msgid "About" msgstr "" -#: ui/Settings4.ui.h:11 -msgid "Shuffle enabled" +#: ui/Settings4.ui.h:15 +msgid "Dynamically switches blur on GDM3 lock screen" msgstr "" -#: ui/Settings4.ui.h:12 -msgid "Shuffle mode" +#: ui/Settings4.ui.h:16 +msgid "Enable dynamic lockscreen blur" +msgstr "" + +#: ui/Settings4.ui.h:17 +msgid "Blur can improve readability" msgstr "" #: ui/Settings4.ui.h:45 @@ -244,8 +256,8 @@ msgstr "" msgid "Delete" msgstr "" -#: ui/carousel.ui.h:5 -msgid "Set random mode" +#: ui/carousel.ui.h:5 ui/carousel4.ui.h:7 +msgid "Set shuffle mode" msgstr "" #: ui/carousel4.ui.h:1 @@ -256,99 +268,91 @@ msgstr "" msgid "" msgstr "" -#: ui/carousel4.ui.h:7 -msgid "Set shuffle mode" -msgstr "" - #: ui/carousel4.ui.h:8 msgid "Load image gallery" msgstr "" -#: extension.js:145 +#: extension.js:136 msgid "" msgstr "" -#: extension.js:147 extension.js:148 extension.js:160 +#: extension.js:138 extension.js:139 extension.js:151 msgid "Awaiting refresh..." msgstr "" -#: extension.js:149 +#: extension.js:140 msgid "Copy image to clipboard" msgstr "" -#: extension.js:150 +#: extension.js:141 msgid "Copy image URL to clipboard" msgstr "" -#: extension.js:151 +#: extension.js:142 msgid "Open image folder" msgstr "" -#: extension.js:153 +#: extension.js:144 msgid "Set lock screen image" msgstr "" -#: extension.js:154 +#: extension.js:145 msgid "Refresh Now" msgstr "" -#: extension.js:156 +#: extension.js:147 msgid "Open in image viewer" msgstr "" -#: extension.js:157 +#: extension.js:148 msgid "Open Bing image information page" msgstr "" -#: extension.js:166 +#: extension.js:157 msgid "Quick settings" msgstr "" -#: extension.js:169 +#: extension.js:160 msgid "Always switch to new images" msgstr "" -#: extension.js:170 -msgid "Image shuffle mode" +#: extension.js:161 +msgid "Enable image shuffle mode" msgstr "" -#: extension.js:171 +#: extension.js:162 msgid "Image shuffle only favourites" msgstr "" -#: extension.js:173 +#: extension.js:164 msgid "Image shuffle only UHD resolutions" msgstr "" -#: extension.js:175 -msgid "Show image count" -msgstr "" - -#: extension.js:336 +#: extension.js:318 msgid "Next refresh" msgstr "" -#: extension.js:337 +#: extension.js:319 msgid "Last refresh" msgstr "" -#: extension.js:339 +#: extension.js:322 msgid "Next shuffle" msgstr "" -#: extension.js:806 extension.js:875 +#: extension.js:798 extension.js:869 msgid "Bing Wallpaper of the Day for" msgstr "" -#: extension.js:911 +#: extension.js:905 msgid "No wallpaper available" msgstr "" -#: extension.js:912 +#: extension.js:906 msgid "No picture for today." msgstr "" -#: prefs.js:181 +#: prefs.js:173 msgid "Select folder" msgstr "" diff --git a/schemas/gschemas.compiled b/schemas/gschemas.compiled index ba56fde6ef87b9c8864fc4b15d68e64b0b06cc13..77f335cdc4d35f582d719ad2abaf7a9ab30ff7d5 100644 GIT binary patch literal 2432 zcmZ`*U1%It7`@RXCaq~VX=;<$*2Eath2Cs!iv&zjk=D?rL|-(;7ISy!W_Qf&%rZaO ztlAQ)VC{qYQmlolpcPRn3Ppl6+804EmHN;Z5iEreQIKE^t*GcZcXl^6*nyLC_RO7c z?)~m}zsX}yD&JOaC@NP6cr@0@+o~qGVWSZL;EL}Jn=yyr|FXB~1cy;4#gKRje5ziE zI%d&o8Zjw80DlTJ z?o$c+)D7@wz+VD~M!KJ;Pu&dvYw-8LY}4q^^r_q7FM^kW4?7y`=~L5BG+=JPGsA`b{~D} z4e)2cv%p(*J#+M_IsP*E3h>4K-;L0xrvDT8cVOVcqiyu5*TZjW6rvY6KQh0cK6MZL zA@Bj9T1V7E42#FXKLE!TmdrG4{D^r@M*Pr%;*V&`d1pE?2mDtI2)dhB(x z@6?U(7s1QG#Un@8@_bOU9s~+h0)LD?c#d(XTi`zo-UD>*oW4Pyn(G<^YoPhJ!4~?| zj9&zofw}8TCHmB?tK;C;fb-`D&Aw1GZ|{K50$UC~G|%zW%)>?SSHPL4PWIBLW}M65 zE5P25GF|kkH^aXH{u{XT$onVhQ}@E}#-Zy28uhMU=~MH)1K{1jkJsLKfj)IT{2}lG zp!;h3tMsXvhcU1Q#;*T$jXpK~DeyGl>%eoO5X}NNaj7Wu&?bUZ5UNlM@$_Ny%g%bP zbX7sKp~#?I$as#OHMc@v1$k*{M~6C)c0uKIz(~nV%2%%C6{PKk+MiU8EO-_|n#)qQ zQ;uJh_ewJBMQ(_J@$)jYL#H|talA?G`?jTJGy`9-swaU+0wom@0k)*vHX=u>QE8-wuxVUKV{lX?u~`e7M|yjg1Rs=*dc2RuW~_ z;dt4JAnR-G%8V2FGUIcfTpa{r2O=;}yy9)B?bGU~f)E+cg?TfU>%PTvzAic{%j!Wn z7L-3>9^giyxI^D_P`xbkz04&RhgDZ z<0G9mAL+FDNT*jm(&?K%(rF=>63kJC`KXYoq|@X}IjHZziKw3?&%Y*0P9cpn#~ z<2tXM<5i<7=b07FJjyuzmHF3JwkpMDMTn21j{hr6d7JrE3f!ESn=3XSpOQ-4TaFu7 zlV0T8II$*wmRE8ePg!!@b1d`!3Ibq%Q2y0!5RcQDD2Msya_B~8avYaQRVz?hNK@>y J?y+~Ne*qmT_hA44 literal 2375 zcmaJ@U1%It7@cSmlh(9Jn%X3`bz>~-LT|RFMJfiYh;68m=!2Tlik;cH*&TCt?lM2w zuC^rvgW3nlOVAdoKC~iA#fKa;a%y$(LvXju(l z9pne{zAnmvuppHhkS8MPho1Js0mt+6Wm~C|U6KKtK7=1WY)5cx;%=Y`Xs)6KT*C(F zd#h*z*U%1KLkDyx&;?)#);6FAxW9_+;GMt&Kni#e=m$8Tq13+LHiNmI4r|hy1R}Ix*h&!;Lm}@+bd=I z)Lhq9@YleVzb-sQpPKpb6LO#x?3|u$r%&AsKLy?e9Q?%TrBA&b z{xJ9%;OeQ<8~N=~H^CnR&j3fhZ8*(%>J9K`!DoRTM;>3IPtEgM0AB&#Yv@~~PtAFL z2mTTG`NlgZ=~FktzYbmk=0}&Frcd1mzoixD1{}Zr_YL~gJjWC`4Yd9~)JC70>)Hc; zl=`r3)=SO#9{?W$0$EaaPKvS}$)IQl6KIRpVJ4JH<|63|uW09`adUAHNR}zQcBK>N zh0^&vs)%`O+Bq3pmF-F>}jC~7wu-LhQUQx!A%x}fU#?VGS3=-nt@Q_tZi?WHSe&&y;oUQYYMw~MALGpVpr zbhPqv$zlt-EOI*bBMh8ONJL(wY9nJ_=pYKT3Wez^^j?*wR&hMmxjmdieY{Xc*qq#i z2y=my)zu@w$jMiTi?nFynG?@Wf&rC5crRF5q2u{ z%%QQSa~*-iQH!V$7acanV|*~{{Cxn@0=b#YXA8I!U~R@HWNQ6JFl%(JjkiP9GX?6o|>iJ<_dVWsD z2-3c)h;e&T$AK3~tO{|iF8fN`t{B(KHTN6aGjWx~`b)?|Psi0AK)kObZ@iLprLaR` zl32 Size of icons for controls in popup menu + + + false + Trash deletes images or just marks as bad +