Skip to content

Commit 21effdd

Browse files
authored
SpicesUpdate v7.8.4: Improved functioning (#6952)
1 parent d5df78c commit 21effdd

File tree

3 files changed

+47
-33
lines changed

3 files changed

+47
-33
lines changed

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/6.0/applet.js

+40-29
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ class SpicesUpdate extends IconApplet {
299299
//~ logDebug("currentTime = "+currentTime);
300300
const difference = parseInt(currentTime - jsonModifTime);
301301
//~ logDebug("difference = "+difference);
302-
if (difference > 720) {
303-
// the cache is older than 12 minutes (720 seconds)
302+
if (difference > 900) {
303+
// the cache is older than 15 minutes (900 seconds)
304304
is_to_download = true;
305305
break
306306
}
@@ -888,8 +888,10 @@ class SpicesUpdate extends IconApplet {
888888
} // End of _set_main_label
889889

890890
on_frequency_changed() {
891-
source_remove(this.loopId);
892-
this.loopId = null;
891+
if (this.loopId != null) {
892+
source_remove(this.loopId);
893+
this.loopId = null;
894+
}
893895

894896
//~ let coeff = QUICK() ? 720 : 3600;
895897
this.refreshInterval = 3600 * this.general_frequency;
@@ -1549,7 +1551,7 @@ class SpicesUpdate extends IconApplet {
15491551
} else {
15501552
clearInterval(id);
15511553
}
1552-
}, (type && this.new_Spices[type] && (this.new_Spices[type].length > 0)) ? this.new_Spices[type].length * 12000 : 12000);
1554+
}, (type && this.new_Spices[type] && (this.new_Spices[type].length > 0)) ? this.new_Spices[type].length * 15000 : 15000);
15531555
} // End of _on_forget_new_spices_pressed
15541556

15551557
download_image(type, uuid) {
@@ -1725,13 +1727,15 @@ class SpicesUpdate extends IconApplet {
17251727
} // End of monitor_png_directory
17261728

17271729
_on_pngDir_changed(type) {
1728-
clearTimeout(this.timeoutId);
1729-
this.timeoutId = null;
1730-
this.timeoutId = setTimeout(() => {
1730+
if (this.timeoutId != null) {
1731+
clearTimeout(this.timeoutId);
1732+
this.timeoutId = null;
1733+
}
1734+
this.timeoutId = setTimeout( () => {
17311735
clearTimeout(this.timeoutId);
17321736
this._on_refresh_pressed();
17331737
this.timeoutId = null;
1734-
}, 12000);
1738+
}, 15000);
17351739
} // End of _on_pngDir_changed
17361740

17371741
monitor_metadatajson(type, uuid) {
@@ -1772,7 +1776,7 @@ class SpicesUpdate extends IconApplet {
17721776
clearTimeout(this.timeoutId);
17731777
this._on_refresh_pressed();
17741778
this.timeoutId = null;
1775-
}, 12000);
1779+
}, 15000);
17761780
}
17771781
} // End of _on_metadatajson_changed
17781782

@@ -1864,7 +1868,7 @@ class SpicesUpdate extends IconApplet {
18641868
this.menu.addMenuItem(menuitemHead1);
18651869
this.menu.addMenuItem(new PopupSeparatorMenuItem());
18661870

1867-
if (this.dependenciesMet) {
1871+
if (this.dependenciesMet && !this.isLooping) {
18681872
// Refresh button
18691873
let refreshButton = new PopupIconMenuItem(_("Refresh"), "emblem-synchronizing-symbolic", IconType.SYMBOLIC);
18701874
refreshButton.connect("activate", (event) => this._on_refresh_pressed());
@@ -2169,7 +2173,7 @@ class SpicesUpdate extends IconApplet {
21692173
if (this.old_watch_message[type].length > 0) this.tooltip_contents += "\n\u2604 %s".format(this._clean_str(this.old_watch_message[type].replace(/, /gi, "\n\t")));
21702174
}
21712175
}
2172-
if (!tooltip_was_modified) {
2176+
if (!tooltip_was_modified && !this.isLooping) {
21732177
this.tooltip_contents += "\n%s".format(_("Middle-Click to Refresh"));
21742178
}
21752179
this.numberLabel.text = ""+(this.nb_to_update + this.nb_to_watch);
@@ -2180,7 +2184,8 @@ class SpicesUpdate extends IconApplet {
21802184
this.isProcessing = false;
21812185
this.set_icon_color();
21822186
} else {
2183-
this.tooltip_contents = "<b>" + this.default_tooltip + "</b>" + "\n%s".format(_("Middle-Click to Refresh"));
2187+
this.tooltip_contents = "<b>" + this.default_tooltip + "</b>"
2188+
if (!this.isLooping) this.tooltip_contents += "\n%s".format(_("Middle-Click to Refresh"));
21842189
this.numberLabel.text = "";
21852190
this.isProcessing = false;
21862191
this.set_icon_color();
@@ -2232,9 +2237,10 @@ class SpicesUpdate extends IconApplet {
22322237
//~ logDebug("ONE MORE LOOP requested, but already looping");
22332238
this.isLooping = false;
22342239

2235-
if (this.loopId != null)
2240+
if (this.loopId != null) {
22362241
source_remove(this.loopId);
2237-
this.loopId = null;
2242+
this.loopId = null;
2243+
}
22382244

22392245
this.loopId = timeout_add_seconds(10, () => this.updateLoop());
22402246
//logDebug("updateLoop: Next in 10 sec.");
@@ -2244,8 +2250,10 @@ class SpicesUpdate extends IconApplet {
22442250
}
22452251
// logDebug("updateLoop: ONE MORE LOOP!");
22462252
this.isLooping = true;
2247-
source_remove(this.loopId);
2248-
this.loopId = null;
2253+
if (this.loopId != null) {
2254+
source_remove(this.loopId);
2255+
this.loopId = null;
2256+
}
22492257

22502258
this.check_dependencies();
22512259

@@ -2371,7 +2379,7 @@ class SpicesUpdate extends IconApplet {
23712379
this.do_rotation = false;
23722380
if (this.new_loop_requested === true) {
23732381
this.new_loop_requested = false;
2374-
this.refreshInterval = 12; // 12 seconds
2382+
this.refreshInterval = 15; // 15 seconds
23752383
}
23762384
//// One more loop !
23772385
//this.loopId = timeout_add_seconds(this.refreshInterval, () => this.updateLoop());
@@ -2424,7 +2432,8 @@ class SpicesUpdate extends IconApplet {
24242432
_onButtonPressEvent(actor, event) {
24252433
if (event.get_button() == 2) {
24262434
if ((this.nb_to_update + this.nb_to_watch) === 0) {
2427-
this._on_refresh_pressed();
2435+
if (!this.isLooping)
2436+
this._on_refresh_pressed();
24282437
} else {
24292438
this.open_each_download_tab();
24302439
}
@@ -2450,12 +2459,14 @@ class SpicesUpdate extends IconApplet {
24502459
this.disable_system_auto_update();
24512460
this.isLoopingForRefreshCache = false;
24522461
let stoId = setTimeout( () => {
2453-
if (stoId)
2462+
if (stoId) {
24542463
clearTimeout(stoId);
2464+
stoId = null;
2465+
}
24552466
if (this.applet_running)
24562467
this.loopRefreshId = timeout_add_seconds(907, () => this._loop_refresh_cache());
24572468
this._loop_refresh_cache();
2458-
stoId = null;
2469+
24592470
}, 60000); // Wait 60 seconds for mintupdate to run correctly.
24602471

24612472
// Events:
@@ -2491,21 +2502,21 @@ class SpicesUpdate extends IconApplet {
24912502
}
24922503

24932504
on_applet_removed_from_panel() {
2494-
this.on_applet_reloaded();
2505+
//~ this.on_applet_reloaded();
24952506

24962507
for (let type of TYPES) {
24972508
this.monitorsPngId[type] = 0;
24982509
this.cache[type] = "{}";
24992510
//~ this.oldCache[type] = "{}";
25002511
}
25012512

2502-
if (this.settings) {
2503-
try {
2504-
this.settings.finalize();
2505-
} catch(e) {
2506-
logError(e)
2507-
}
2508-
}
2513+
//~ if (this.settings) {
2514+
//~ try {
2515+
//~ this.settings.finalize();
2516+
//~ } catch(e) {
2517+
//~ logError(e)
2518+
//~ }
2519+
//~ }
25092520

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

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/CHANGELOG.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
### 7.8.3~20250303
1+
### v7.8.4~20250304
2+
* Improved functioning.
3+
4+
### v7.8.3~20250303
25
* Minor bugfix.
36

4-
### 7.8.2~20250303
7+
### v7.8.2~20250303
58
* Does not try to translate null messages from other spices. This also helps avoid black screens.
69

7-
### 7.8.1~20250302
10+
### v7.8.1~20250302
811
* Forces the use of 'cjs' even if 'gjs' is installed.
912
* Uses “try” for each “destroy” command.
1013
* Fixes #6933.

SpicesUpdate@claudiux/files/SpicesUpdate@claudiux/metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Spices Update",
44
"max-instances": "1",
55
"hide-configuration": false,
6-
"version": "7.8.3",
6+
"version": "7.8.4",
77
"description": "Warns you when installed Spices (actions, applets, desklets, extensions, themes) require an update or new Spices are available.",
88
"multiversion": true,
99
"cinnamon-version": [

0 commit comments

Comments
 (0)