From 4eb58283a2bf3f624cba8193b809bbb89106645f Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Sun, 29 Sep 2024 21:45:29 +1000 Subject: [PATCH 1/3] clarify which log function we are using --- BWClipboard.js | 4 +-- blur.js | 18 +++++----- carousel.js | 22 ++++++------ extension.js | 94 +++++++++++++++++++++++++------------------------- prefs.js | 6 ++-- thumbnail.js | 2 +- 6 files changed, 73 insertions(+), 73 deletions(-) diff --git a/BWClipboard.js b/BWClipboard.js index 279c65e3..8be37a90 100644 --- a/BWClipboard.js +++ b/BWClipboard.js @@ -20,11 +20,11 @@ export default class BWClipboard { try { let file = Gio.File.new_for_path(filename); let [success, image_data] = file.load_contents(null); - //log('error: '+success); + //console.log('error: '+success); if (success) this.clipboard.set_content(CLIPBOARD_TYPE, 'image/jpeg', image_data); } catch (err) { - log('unable to set clipboard to data in '+filename); + console.log('unable to set clipboard to data in '+filename); } } diff --git a/blur.js b/blur.js index b6111bf2..8de91b14 100644 --- a/blur.js +++ b/blur.js @@ -32,7 +32,7 @@ var debug = false; var promptActive = false; // default GNOME method of testing this relies on state of a transisiton // so we are being explicit here (do not want any races, thanks) -function log(msg) { +function BingLog(msg) { if (debug) // set 'debug' above to false to keep the noise down in journal console.log("BingWallpaper extension/Blur: " + msg); } @@ -40,14 +40,14 @@ function log(msg) { // we patch UnlockDialog._updateBackgroundEffects() export function _updateBackgroundEffects_BWP(monitorIndex) { // GNOME shell 3.36.4 and above - log("_updateBackgroundEffects_BWP() called for shell >= 3.36.4"); + BingLog("_updateBackgroundEffects_BWP() called for shell >= 3.36.4"); const themeContext = St.ThemeContext.get_for_stage(global.stage); for (const widget of this._backgroundGroup.get_children()) { // set blur effects, we have two modes in lockscreen: login prompt or clock // blur on when clock is visible is adjustable const effect = widget.get_effect('blur'); if (promptActive) { - log('default blur active'); + BingLog('default blur active'); if (effect) { effect.set({ // GNOME defaults when login prompt is visible brightness: BLUR_BRIGHTNESS, @@ -56,7 +56,7 @@ export function _updateBackgroundEffects_BWP(monitorIndex) { } } else { - log('adjustable blur active'); + BingLog('adjustable blur active'); if (effect) { effect.set({ // adjustable blur when clock is visible brightness: BWP_BLUR_BRIGHTNESS * 0.01, // we use 0-100 rather than 0-1, so divide by 100 @@ -92,17 +92,17 @@ export function _clampValue(value) { export default class Blur { constructor() { this.enabled = false; - log('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available')); + BingLog('Bing Wallpaper adjustable blur is '+(supportedVersion()?'available':'not available')); } set_blur_strength(value) { BWP_BLUR_SIGMA = _clampValue(value); - log("lockscreen blur strength set to "+BWP_BLUR_SIGMA); + BingLog("lockscreen blur strength set to "+BWP_BLUR_SIGMA); } set_blur_brightness(value) { BWP_BLUR_BRIGHTNESS = _clampValue(value); - log("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS); + BingLog("lockscreen brightness set to " + BWP_BLUR_BRIGHTNESS); } _switch(enabled) { @@ -116,7 +116,7 @@ export default class Blur { _enable() { if (supportedVersion()) { - log("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION); + BingLog("Blur._enable() called on GNOME "+Config.PACKAGE_VERSION); UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects_BWP; // we override _showClock and _showPrompt to patch in updates to blur effect before calling the GNOME functions UnlockDialog.UnlockDialog.prototype._showClock = _showClock_BWP; @@ -133,7 +133,7 @@ export default class Blur { _disable() { if (!this.enabled) return; - log("_lockscreen_blur_disable() called"); + BingLog("_lockscreen_blur_disable() called"); if (supportedVersion()) { // restore default functions UnlockDialog.UnlockDialog.prototype._updateBackgroundEffects = _updateBackgroundEffects; diff --git a/carousel.js b/carousel.js index 6b0c2943..31ebda81 100644 --- a/carousel.js +++ b/carousel.js @@ -30,7 +30,7 @@ export default class Carousel { this.searchEntry = null; this.extensionPath = extensionPath - this.log('create carousel...'); + this._log('create carousel...'); this.flowBox = prefs_flowbox; this.flowBox.insert(this._create_placeholder_item(), -1); @@ -72,7 +72,7 @@ export default class Carousel { if (Utils.isFavourite(image)) { favButton.set_visible(false); - this.log('image is favourited'); + this._log('image is favourited'); } else { unfavButton.set_visible(false); @@ -84,7 +84,7 @@ export default class Carousel { catch (e) { galleryImage.set_from_icon_name('image-missing'); galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE; - this.log('create_gallery_image: '+e); + this._log('create_gallery_image: '+e); } galleryImage.set_tooltip_text(image.copyright); @@ -96,16 +96,16 @@ export default class Carousel { applyButton.connect('clicked', () => { this.settings.set_string('selected-image', Utils.getImageUrlBase(image)); - this.log('gallery selected '+Utils.getImageUrlBase(image)); + this._log('gallery selected '+Utils.getImageUrlBase(image)); }); infoButton.connect('clicked', () => { Utils.openInSystemViewer(image.copyrightlink, false); - this.log('info page link opened '+image.copyrightlink); + this._log('info page link opened '+image.copyrightlink); }); deleteButton.connect('clicked', (widget) => { - this.log('Delete requested for '+filename); + this._log('Delete requested for '+filename); Utils.deleteImage(filename); Utils.setImageHiddenStatus(this.settings, image.urlbase, true); Utils.purgeImages(this.settings); // hide image instead @@ -116,7 +116,7 @@ export default class Carousel { // button is unchecked, so we want to make the checked one visible favButton.connect('clicked', (widget) => { - this.log('favourited '+Utils.getImageUrlBase(image)); + this._log('favourited '+Utils.getImageUrlBase(image)); widget.set_visible(false); unfavButton.set_visible(true); Utils.setImageFavouriteStatus(this.settings, image.urlbase, true); @@ -124,7 +124,7 @@ export default class Carousel { // button is checked, so we want to make the unchecked one visible unfavButton.connect('clicked', (widget) => { - this.log('unfavourited '+Utils.getImageUrlBase(image)); + this._log('unfavourited '+Utils.getImageUrlBase(image)); widget.set_visible(false); favButton.set_visible(true); Utils.setImageFavouriteStatus(this.settings, image.urlbase, false); @@ -148,7 +148,7 @@ export default class Carousel { applyButton.connect('clicked', (widget) => { this.settings.set_string('random-interval-mode', interval); this.settings.set_boolean('random-mode-enabled', true); - this.log('gallery selected random with interval '+interval+' ('+title+')'); + this._log('gallery selected random with interval '+interval+' ('+title+')'); }); let item = buildable.get_object('flowBoxRandom'); @@ -212,7 +212,7 @@ export default class Carousel { } catch (e) { this._set_blank_image(galleryImage); - this.log('create_gallery_image: '+e); + this._log('create_gallery_image: '+e); } } } @@ -222,7 +222,7 @@ export default class Carousel { //galleryImage.set_icon_size = 2; // Gtk.GTK_ICON_SIZE_LARGE; } - log(msg) { + _log(msg) { if (this.settings.get_boolean('debug-logging')) console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal } diff --git a/extension.js b/extension.js index c520b319..0a51b917 100644 --- a/extension.js +++ b/extension.js @@ -54,7 +54,7 @@ const newMenuSwitchItem = (label, state) => { return switchItem; } -function log(msg) { +function BingLog(msg) { if (BingDebug()) console.log('BingWallpaper extension: ' + msg); // disable to keep the noise down in journal } @@ -78,7 +78,7 @@ function doSetBackground(uri, schema) { gsettings.set_string('picture-uri-dark', uri); } catch (e) { - log("unable to set dark background for : " + e); + BingLog("unable to set dark background for : " + e); } Gio.Settings.sync(); gsettings.apply(); @@ -296,12 +296,12 @@ class BingWallpaperIndicator extends Button { toggles.forEach( (e) => { this.settings_connections.push( this._settings.connect('changed::'+e.key, () => { - log(e.key+' setting changed to '+ (this._settings.get_boolean(e.key)?'true':'false')); + BingLog(e.key+' setting changed to '+ (this._settings.get_boolean(e.key)?'true':'false')); e.toggle.setToggleState(this._settings.get_boolean(e.key)); }) ); e.toggle.connect('toggled', (item, state) => { - log(e.key+' switch toggled to '+ (state?'true':'false')); + BingLog(e.key+' switch toggled to '+ (state?'true':'false')); this._setBooleanSetting(e.key, state); }); }); @@ -319,17 +319,17 @@ class BingWallpaperIndicator extends Button { _setBooleanSetting(key, state) { let success = this._settings.set_boolean(key, state); - log('key '+key+' set to ' + (state?'true':'false') + ' (returned ' + (success?'true':'false')+')'); + BingLog('key '+key+' set to ' + (state?'true':'false') + ' (returned ' + (success?'true':'false')+')'); } _setStringSetting(key, value) { let success = this._settings.set_string(key, value); - log('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')'); + BingLog('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')'); } _setIntSetting(key, value) { let success = this._settings.set_int(key, value); - log('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')'); + BingLog('key '+key+' set to ' + value + ' (returned ' + (success?'true':'false')+')'); } _onDestroy() { @@ -378,7 +378,7 @@ class BingWallpaperIndicator extends Button { _setImage() { Utils.validate_imagename(this._settings); this.selected_image = this._settings.get_string('selected-image'); - log('selected image changed to: ' + this.selected_image); + BingLog('selected image changed to: ' + this.selected_image); this._selectImage(); //this._setShuffleToggleState(); } @@ -398,7 +398,7 @@ class BingWallpaperIndicator extends Button { let icon_name = this._settings.get_string('icon-name'); let gicon = Gio.icon_new_for_string(this._extension.dir.get_child('icons').get_path() + '/' + icon_name + '.svg'); this.icon = new St.Icon({gicon: gicon, style_class: 'system-status-icon'}); - log('Replace icon set to: ' + icon_name); + BingLog('Replace icon set to: ' + icon_name); this.remove_all_children(); this.add_child(this.icon); } @@ -411,7 +411,7 @@ class BingWallpaperIndicator extends Button { this._setThumbnailImage(); 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); + BingLog('image set to : '+this.filename); if (this._settings.get_boolean('set-background')) this._setBackgroundDesktop(); } @@ -439,7 +439,7 @@ class BingWallpaperIndicator extends Button { difference = 60; difference = difference + 300; // 5 minute fudge offset in case of inaccurate local clock - log('Next refresh due ' + difference + ' seconds from now'); + BingLog('Next refresh due ' + difference + ' seconds from now'); this._restartTimeout(difference); } @@ -450,7 +450,7 @@ class BingWallpaperIndicator extends Button { if (difference < 60 || difference > 86400) // clamp to a reasonable range difference = 60; - log('Next shuffle due ' + difference + ' seconds from now'); + BingLog('Next shuffle due ' + difference + ' seconds from now'); this._restartShuffleTimeout(difference); } @@ -580,7 +580,7 @@ class BingWallpaperIndicator extends Button { this.thumbnailItem.vexpand = false; this.thumbnailItem.content = image; - log('scale factor: ' + scale_factor); + BingLog('scale factor: ' + scale_factor); this.thumbnailItem.set_size(480*scale_factor, 270*scale_factor); this.thumbnailItem.setSensitive(true); } @@ -606,7 +606,7 @@ class BingWallpaperIndicator extends Button { x.setSensitive(randomEnabled); }); if (randomEnabled) { - log('enabled shuffle mode, by setting a shuffe timer (5 seconds)'); + BingLog('enabled shuffle mode, by setting a shuffe timer (5 seconds)'); this._restartShuffleTimeout(5); this._setBooleanSetting('revert-to-current-image', false); } @@ -619,19 +619,19 @@ class BingWallpaperIndicator extends Button { } _favouriteImage() { - log('favourite image '+this.imageURL+' status was '+this.favourite_status); + BingLog('favourite image '+this.imageURL+' status was '+this.favourite_status); this.favourite_status = !this.favourite_status; Utils.setImageFavouriteStatus(this._settings, this.imageURL, this.favourite_status); this._setFavouriteIcon(this.favourite_status?this.ICON_FAVE_BUTTON:this.ICON_UNFAVE_BUTTON); } _trashImage() { - log('trash image '+this.imageURL+' status was '+this.hidden_status); + BingLog('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?this.ICON_UNTRASH_BUTTON:this.ICON_TRASH_BUTTON); if (this._settings.get_boolean('trash-deletes-images')) { - log('image to be deleted: '+this.filename); + BingLog('image to be deleted: '+this.filename); Utils.deleteImage(this.filename); Utils.validate_imagename(this._settings); } @@ -705,7 +705,7 @@ class BingWallpaperIndicator extends Button { }); } catch(error) { - log('unable to send libsoup json message '+error); + BingLog('unable to send libsoup json message '+error); notifyError('Unable to fetch Bing metadata\n'+error); } } @@ -721,7 +721,7 @@ class BingWallpaperIndicator extends Button { }); } catch (error) { - log('unable to send libsoup json message '+error); + BingLog('unable to send libsoup json message '+error); notifyError('Unable to fetch Bing metadata\n'+error); } } @@ -734,14 +734,14 @@ class BingWallpaperIndicator extends Button { decoder.decode(this.httpSession.send_and_read_finish(message).get_data()): // Soup3 message.response_body.data; // Soup 2 - log('Recieved ' + data.length + ' bytes'); + BingLog('Recieved ' + data.length + ' bytes'); this._parseData(data); if (!this._settings.get_boolean('random-mode-enabled')) this._selectImage(); } catch (error) { - log('Network error occured: ' + error); + BingLog('Network error occured: ' + error); notifyError('network error occured\n'+error); this._updatePending = false; this._restartTimeout(TIMEOUT_SECONDS_ON_HTTP_ERROR); @@ -758,11 +758,11 @@ class BingWallpaperIndicator extends Button { this._timeout = GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, seconds, this._refresh.bind(this)); this.refreshdue = GLib.DateTime.new_now_local().add_seconds(seconds); - log('next check in ' + seconds + ' seconds'); + BingLog('next check in ' + seconds + ' seconds'); } _restartShuffleTimeout(seconds = null) { - log('_restartShuffleTimeout('+seconds+')'); + BingLog('_restartShuffleTimeout('+seconds+')'); //console.trace(); if (this._shuffleTimeout) @@ -770,14 +770,14 @@ class BingWallpaperIndicator extends Button { if (seconds == null) { let diff = -Math.floor(GLib.DateTime.new_now_local().difference(this.shuffledue)/1000000); - log('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff); + BingLog('shuffle ('+this.shuffledue.format_iso8601()+') diff = '+diff); if (diff > 30) { // on occasions the above will be 1 second 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') { 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'); + BingLog('shuffle mode = '+random_mode+' = '+seconds+' from now'); } else { seconds = this._settings.get_int('random-interval'); // or whatever the user has specified (as a timer) @@ -786,7 +786,7 @@ class BingWallpaperIndicator extends Button { 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'); + BingLog('next shuffle in ' + seconds + ' seconds'); } // auto export Bing data to JSON file if requested @@ -805,7 +805,7 @@ class BingWallpaperIndicator extends Button { let newImages = Utils.mergeImageLists(this._settings, parsed.images); if (datamarket != prefmarket && prefmarket != 'auto') - log('WARNING: Bing returning market data for ' + datamarket + ' rather than selected ' + prefmarket); + BingLog('WARNING: Bing returning market data for ' + datamarket + ' rather than selected ' + prefmarket); Utils.purgeImages(this._settings); // delete older images if enabled //Utils.cleanupImageList(this._settings); // merged into purgeImages @@ -821,7 +821,7 @@ class BingWallpaperIndicator extends Button { if (!this._settings.get_boolean('notify-only-latest')) { // notify all new images newImages.forEach((image) => { - log('New image to notify: ' + Utils.getImageTitle(image)); + BingLog('New image to notify: ' + Utils.getImageTitle(image)); this._createImageNotification(image); }); } @@ -829,7 +829,7 @@ class BingWallpaperIndicator extends Button { // notify only the most recent image let last = newImages.pop(); if (last) { - log('New image to notify: ' + Utils.getImageTitle(last)); + BingLog('New image to notify: ' + Utils.getImageTitle(last)); this._createImageNotification(last); } } @@ -839,9 +839,9 @@ class BingWallpaperIndicator extends Button { this._updatePending = false; } catch (error) { - log('_parseData() failed with error ' + error + ' @ '+error.lineNumber); + BingLog('_parseData() failed with error ' + error + ' @ '+error.lineNumber); notifyError('Bing metadata parsing error check ' + error + ' @ '+error.lineNumber); - log(error.stack); + BingLog(error.stack); } } @@ -855,7 +855,7 @@ class BingWallpaperIndicator extends Button { let msg = _('Bing Wallpaper of the Day for') + ' ' + this._localeDate(image.fullstartdate); let details = Utils.getImageTitle(image); this._createNotification(msg, details); - log('_createImageNotification: '+msg+' details: '+details); + BingLog('_createImageNotification: '+msg+' details: '+details); } _createNotification(msg, details) { @@ -869,7 +869,7 @@ class BingWallpaperIndicator extends Button { }); systemSource.addNotification(bingNotify); //Main.notify(msg, details); - log('_createNotification: '+msg+' details: '+details); + BingLog('_createNotification: '+msg+' details: '+details); } _shuffleImage() { @@ -885,7 +885,7 @@ class BingWallpaperIndicator extends Button { imageList = favImageList; } else { - log('not enough filtered images available to shuffle'); + BingLog('not enough filtered images available to shuffle'); } // shuffle could fail for a number of reasons @@ -893,12 +893,12 @@ class BingWallpaperIndicator extends Button { this.imageIndex = Utils.getRandomInt(imageList.length); image = imageList[this.imageIndex]; - log('shuffled to image '+image.urlbase); + BingLog('shuffled to image '+image.urlbase); return image; } catch (e) { - log('shuffle failed '+e); + BingLog('shuffle failed '+e); return null; } } @@ -909,7 +909,7 @@ class BingWallpaperIndicator extends Button { // special values, 'current' is most recent (default mode), 'random' picks one at random, anything else should be filename if (force_shuffle) { - log('forcing shuffle of image') + BingLog('forcing shuffle of image') image = this._shuffleImage(); if (this._settings.get_boolean('random-mode-enabled')) this._restartShuffleTimeout(); @@ -927,7 +927,7 @@ class BingWallpaperIndicator extends Button { if (image) this.imageIndex = Utils.imageIndex(imageList, image.urlbase); - log('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase) ? image.urlbase : 'not found'); + BingLog('_selectImage: ' + this.selected_image + ' = ' + (image && image.urlbase) ? image.urlbase : 'not found'); } } @@ -1003,7 +1003,7 @@ class BingWallpaperIndicator extends Button { }; let stateJSON = JSON.stringify(state); - log('Storing state as JSON: ' + stateJSON); + BingLog('Storing state as JSON: ' + stateJSON); this._setStringSetting('state', stateJSON); } } @@ -1016,7 +1016,7 @@ class BingWallpaperIndicator extends Button { let state = JSON.parse(stateJSON); let maxLongDate = null; - log('restoring state...'); + BingLog('restoring state...'); maxLongDate = state.maxlongdate ? state.maxlongdate : null; this.title = state.title; this.explanation = state.explanation; @@ -1040,7 +1040,7 @@ class BingWallpaperIndicator extends Button { } if (this._settings.get_boolean('random-mode-enabled')) { - log('random mode enabled, restarting random state'); + BingLog('random mode enabled, restarting random state'); this._restartShuffleTimeoutFromDueDate(this.shuffledue); // FIXME: use state value this._restartTimeoutFromLongDate(maxLongDate); } @@ -1051,7 +1051,7 @@ class BingWallpaperIndicator extends Button { return; } catch (error) { - log('bad state - refreshing... error was ' + error); + BingLog('bad state - refreshing... error was ' + error); } this._restartTimeout(60); } @@ -1079,7 +1079,7 @@ class BingWallpaperIndicator extends Button { notifyError('Download folder '+BingWallpaperDir+' does not exist or is not writable'); return; } - log("Downloading " + url + " to " + file.get_uri()); + BingLog("Downloading " + url + " to " + file.get_uri()); let request = Soup.Message.new('GET', url); // queue the http request @@ -1096,7 +1096,7 @@ class BingWallpaperIndicator extends Button { } } catch (error) { - log('error sending libsoup message '+error); + BingLog('error sending libsoup message '+error); notifyError('Network error '+error); } } @@ -1118,17 +1118,17 @@ class BingWallpaperIndicator extends Button { file.replace_contents_finish(res); if (set_background) this._setBackground(); - log('Download successful'); + BingLog('Download successful'); } catch(e) { - log('Error writing file: ' + e); + BingLog('Error writing file: ' + e); notifyError('Image '+file.get_path()+' is not writable, check folder permissions or select a different folder\n'+e); } } ); } catch (error) { - log('Unable download image '+error); + BingLog('Unable download image '+error); notifyError('Image '+file.get_path()+' file error, check folder permissions, disk space or select a different folder\n'+e); } } diff --git a/prefs.js b/prefs.js index 228a4678..6322982d 100644 --- a/prefs.js +++ b/prefs.js @@ -44,7 +44,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen let carousel = null; let httpSession = null; - let log = (msg) => { // avoids need for globals + let BingLog = (msg) => { // avoids need for globals if (settings.get_boolean('debug-logging')) console.log("BingWallpaper extension: " + msg); // disable to keep the noise down in journal } @@ -186,7 +186,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen httpSession.user_agent = 'User-Agent: Mozilla/5.0 (X11; GNOME Shell/' + Config.PACKAGE_VERSION + '; Linux x86_64; +https://github.com/neffo/bing-wallpaper-gnome-extension ) BingWallpaper Gnome Extension/' + this.metadata.version; } catch (e) { - log("Error creating httpSession: " + e); + BingLog("Error creating httpSession: " + e); } const icon_image = buildable.get_object('icon_image'); @@ -245,7 +245,7 @@ export default class BingWallpaperExtensionPreferences extends ExtensionPreferen dirChooser.set_initial_folder(Gio.File.new_for_path(Utils.getWallpaperDir(settings))); dirChooser.select_folder(window, null, (self, res) => { let new_path = self.select_folder_finish(res).get_uri().replace('file://', ''); - log(new_path); + BingLog(new_path); Utils.moveImagesToNewFolder(settings, Utils.getWallpaperDir(settings), new_path); Utils.setWallpaperDir(settings, new_path); }); diff --git a/thumbnail.js b/thumbnail.js index 58bdb55c..7c8ba01c 100644 --- a/thumbnail.js +++ b/thumbnail.js @@ -23,7 +23,7 @@ export default class Thumbnail { 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); + console.log('Unable to create thumbnail for corrupt or incomplete file: ' + filePath + ' err: ' + err); } } }; From dbf05456826552f5d1cdc4b7120d74934f6a0177 Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Wed, 2 Oct 2024 23:12:54 +1000 Subject: [PATCH 2/3] catch occasional startup errors --- extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension.js b/extension.js index 0a51b917..f855e863 100644 --- a/extension.js +++ b/extension.js @@ -358,13 +358,13 @@ class BingWallpaperIndicator extends Button { let maxlongdate = Utils.getMaxLongDate(this._settings); this.refreshduetext = _("Next refresh") + ": " + (this.refreshdue ? this.refreshdue.format("%Y-%m-%d %X") : '-') + - " (" + Utils.friendly_time_diff(this.refreshdue) + ")\n" + + " (" + this.refreshdue?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.refreshdue?Utils.friendly_time_diff(this.shuffledue):"-" + ")"; } this.refreshDueItem.label.set_text(this.refreshduetext); } From ddf4d89e306b4f40f91d3d94bebec1dee7e46fca Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 7 Oct 2024 20:25:49 +1000 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fb547b33..192b1140 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Also, check out my related [Google Earth View wallpaper extension](https://githu ![Gallery item](/screenshot/gallery.png) -The 4 buttons in the gallery (3rd page in the preferences) do have tool-tips but these do the following: +The 5 buttons in the gallery (3rd page in the preferences) do have tool-tips but these do the following: - Favorite - favorite this image (equivalent to doing this via the control bar) - Apply - set this image as wallpaper - View - open image in image viewer