Skip to content

Commit

Permalink
[SpicesUpdate@claudiux] v7.5.2: Minor bugfixes (linuxmint#6756)
Browse files Browse the repository at this point in the history
* SpicesUpdate v7.5.2: Minor bugfixes

* SpicesUpdate v7.5.2: Fixed minor bugs in animations
  • Loading branch information
claudiux authored Jan 13, 2025
1 parent 015534b commit 0823dfe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
69 changes: 33 additions & 36 deletions SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/6.0/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class SpicesUpdate extends IconApplet {

this.timeoutId = null;
this.isProcessing = false;
this.loopCacheIntervalId = null;
//~ this.loopCacheIntervalId = null;

// Default icon color
this.defaultColor = "white";
Expand Down Expand Up @@ -287,9 +287,7 @@ class SpicesUpdate extends IconApplet {
} // End of constructor

_loop_refresh_cache() {
if (source_exists(this.loopRefreshId)) {
source_remove(this.loopRefreshId);
}
source_remove(this.loopRefreshId);
this.loopRefreshId = null;
var is_to_download = false;
for (let t of TYPES) {
Expand Down Expand Up @@ -615,7 +613,7 @@ class SpicesUpdate extends IconApplet {
let id = setTimeout(() => {
this.http = new HttpLib();
clearTimeout(id);
id = null
id = null;
}, 30000);
} else {
//~ logDebug("The network connectivity has been LOST.");
Expand Down Expand Up @@ -886,9 +884,7 @@ class SpicesUpdate extends IconApplet {
} // End of _set_main_label

on_frequency_changed() {
if (source_exists(this.loopId)) {
source_remove(this.loopId);
}
source_remove(this.loopId);
this.loopId = null;

//~ let coeff = QUICK() ? 720 : 3600;
Expand Down Expand Up @@ -2050,9 +2046,7 @@ class SpicesUpdate extends IconApplet {
this.refresh_requested = true;

if (!this.isLooping) {
if (source_exists(this.loopId)) {
source_remove(this.loopId);
}
source_remove(this.loopId);
this.loopId = null;
this.refreshInterval = 3600 * this.general_frequency;
this.do_rotation = true;
Expand All @@ -2063,9 +2057,7 @@ class SpicesUpdate extends IconApplet {
_on_reload_this_applet_pressed() {
// Before to reload this applet, stop the loop, remove all bindings and disconnect all signals to avoid errors.
this.applet_running = false;
if (source_exists(this.loopId)) {
source_remove(this.loopId);
}
source_remove(this.loopId);
this.loopId = null;
var monitor, Id;
for (let tuple of this.monitors) {
Expand Down Expand Up @@ -2131,8 +2123,8 @@ class SpicesUpdate extends IconApplet {
}
Tweener.addTween(this.actor, {
opacity: 255,
transition: "linear",
time: 0.5,
transition: "easeOutQuad", //"linear",
time: 1,
onComplete: null
});
} // End of set_icon_color
Expand Down Expand Up @@ -2175,7 +2167,7 @@ class SpicesUpdate extends IconApplet {
}
}

if (this.do_rotation) {
if (this.do_rotation && this.actor.get_stage() != null) {
if (this.interval == null)
this.interval = setInterval(() => this.icon_rotate(), 10);
}
Expand Down Expand Up @@ -2222,18 +2214,14 @@ class SpicesUpdate extends IconApplet {
}
this.numberLabel.style = "font-size: %spx; padding: 0px; color: %s;".format(""+fontSize, this.defaultColor);

if (!this.do_rotation && this.interval) {
if (!this.do_rotation && this.interval && this.actor.get_stage() != null) {
Tweener.addTween(this.actor, {
opacity: 0,
transition: "linear",
time: 0.5,
onComplete: Lang.bind(this, function() {
clearInterval(this.interval);
this.interval = null;
this.angle = 0;
this.set_applet_icon_symbolic_name("spices-update");
this.set_icon_color();
})
opacity: 255,
transition: "easeOutQuad", //"linear",
delay: 0,
time: 1,
rounded: true,
onComplete: () => { this._on_updateUI_tween_completed(); },
});
}

Expand All @@ -2246,15 +2234,23 @@ class SpicesUpdate extends IconApplet {
// End of updateUI
}

_on_updateUI_tween_completed() {
this.angle = 0;
this.set_applet_icon_symbolic_name("spices-update");
this.set_icon_color();
this.do_rotation = false;
Tweener.removeTweens(this.actor);
clearInterval(this.interval);
this.interval = null;
}

// This is the loop run at general_frequency rate to call updateUI() to update the display in the applet and tooltip
updateLoop() {
if (this.isLooping === true) {
//~ logDebug("ONE MORE LOOP requested, but already looping");
this.isLooping = false;

if (source_exists(this.loopId)) {
source_remove(this.loopId);
}
source_remove(this.loopId);
this.loopId = null;

this.loopId = timeout_add_seconds(10, () => this.updateLoop());
Expand All @@ -2265,9 +2261,7 @@ class SpicesUpdate extends IconApplet {
}
//~ logDebug("ONE MORE LOOP!");
this.isLooping = true;
if (source_exists(this.loopId)) {
source_remove(this.loopId);
}
source_remove(this.loopId);
this.loopId = null;

this.check_dependencies();
Expand Down Expand Up @@ -2513,6 +2507,9 @@ class SpicesUpdate extends IconApplet {
}
}

if (Tweener.getTweenCount(this.actor) > 0)
Tweener.removeTweens(this.actor);

remove_all_sources();
} // End of on_applet_removed_from_panel

Expand All @@ -2531,8 +2528,8 @@ class SpicesUpdate extends IconApplet {
clearTimeout(this.timeoutId);
this.timeoutId = null;

clearInterval(this.loopCacheIntervalId);
this.loopCacheIntervalId = null;
//~ clearInterval(this.loopCacheIntervalId);
//~ this.loopCacheIntervalId = null;


this.destroy_all_notifications();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v7.5.2~20250112
* Fixed minor bugs in animations.

### v7.5.1~20250112
* Now use mainloopTools to optimize loop management.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Spices Update",
"max-instances": "1",
"hide-configuration": false,
"version": "7.5.1",
"version": "7.5.2",
"description": "Warns you when installed Spices (actions, applets, desklets, extensions, themes) require an update or new Spices are available.",
"multiversion": true,
"cinnamon-version": [
Expand Down

0 comments on commit 0823dfe

Please sign in to comment.