Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bing-wallpaper@starcross.dev: Add force refresh menu. #6718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nabetaro
Copy link
Contributor

I would like to make this wonderful applet even better.

It seems that once you change the background manually, you can't immediately change it to a bing background. So I would like to add the ability to refresh it immediately.

Please let me know if there is a better way to do this in implementing the feature.

@rcalixte
Copy link
Member

cc @Starcross

Copy link
Contributor

@Starcross Starcross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR, I like this idea! I've left a few comments...

@@ -45,10 +47,19 @@ BingWallpaperApplet.prototype = {
this.wallpaperPath = `${this.wallpaperDir}/BingWallpaper.jpg`;
this.metaDataPath = `${this.wallpaperDir}/meta.json`;

let refreshBg = new PopupMenu.PopupIconMenuItem(_("Refresh Now"), "view-refresh", St.IconType.SYMBOLIC);
refreshBg.connect('activate', Lang.bind(this, function() {
this.forceReload = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a forceReload flag, I think it may be enough to simply make a call to _downloadMetaData here.
The only difference this makes to the behaviour I can think of is that the timer will not be reset, but I don't think this matters. The idea of a refresh 'now' could be understood as an additional one anyway.

@@ -140,7 +151,7 @@ BingWallpaperApplet.prototype = {

_downloadMetaData: function () {
const process_result = data => {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these extra line spaces? I appreciate the formatting is not consistent anyway!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually just looks like whitespace was trimmed, possibly by some auto-formatting. GitHub has a feature where you can view diffs with whitespace changes hidden as well. This doesn't seem like a bad thing since it is minor here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants