Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions SpiceSpy@claudiux/files/SpiceSpy@claudiux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### v5.7.0~20251228
* You can now interrupt a refresh.
* You can request to change the icon color when refreshing. You can choose this color.
* The menu should no longer close unexpectedly.

### v5.6.2~20251125
* Highlights the number of new issues in the menu.

Expand Down
85 changes: 63 additions & 22 deletions SpiceSpy@claudiux/files/SpiceSpy@claudiux/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {
const { HttpLib } = require("./lib/httpLib");
const { to_string } = require("./lib/to-string");
//mainloopTools:
const { _sourceIds, timeout_add_seconds, timeout_add, setTimeout, clearTimeout, setInterval, clearInterval, source_exists, source_remove, remove_all_sources } = require("./lib/mainloopTools");
const { timeout_add_seconds, setTimeout, clearTimeout, source_remove, remove_all_sources } = require("./lib/mainloopTools");

const UUID = "SpiceSpy@claudiux";

Expand Down Expand Up @@ -340,6 +340,8 @@ class SpiceSpy extends Applet.TextIconApplet {
this.jobsLoopId = null;
this.issuesLoopId = null;
this.is_looping = true;

this.iconColorLoopId = null;

this.settings = new Settings.AppletSettings(this, UUID, instance_id);

Expand All @@ -352,6 +354,9 @@ class SpiceSpy extends Applet.TextIconApplet {
this.update_interval = 0.5 * Math.round(this.settings.getValue("update-interval") / 30);
this.settings.setValue("update-interval", -1);
}
this.settings.bind("update-interruptible", "updateIsInterruptible");
this.settings.bind("coloredIcon", "coloredIcon");
this.settings.bind("colorWhileRefreshing", "colorWhileRefreshing");
this.settings.bind("standard-opacity", "standard_opacity");
this.settings.bind("color-on-change", "color_on_change", () => { this.make_menu() });
this.show_icon_in_menu = true;
Expand All @@ -369,6 +374,18 @@ class SpiceSpy extends Applet.TextIconApplet {
this.settings.bind("spices_to_spy", "spices_to_spy");
this.settings.bind("old_spices_to_spy", "old_spices_to_spy");
} // End of get_user_settings

setIconColor() {
if (!this.coloredIcon) {
this.actor.style = null;
return
}
if (this.commentsJobsList.length > 0 || this.issuesJobsList.length > 0) {
this.actor.style = `color: ${this.colorWhileRefreshing};`
} else {
this.actor.style = null
}
} // End of setIconColor

update_interval_value() {
const sec = Math.round(this.update_interval * 3600); // From hours to seconds.
Expand Down Expand Up @@ -449,7 +466,10 @@ class SpiceSpy extends Applet.TextIconApplet {
this.settings.setValue("uuid-list", _uuid_list);

// Loop next tick (value 0) to ensure that this.actor is on stage:
setTimeout(() => this.loop(), 0);
let _to = setTimeout(() => {
clearTimeout(_to);
this.loop()
}, 0);
}
} // End of _add_user_Spices

Expand Down Expand Up @@ -570,7 +590,8 @@ class SpiceSpy extends Applet.TextIconApplet {
if (this.spices_to_spy[type][uuid])
this.spices_to_spy[type][uuid]["issues"] = issuesNumber;
GLib.free(jsonFileContents);
this.make_menu();
if (!this.menu.isOpen)
this.make_menu();
} // End of do_issuesJob

do_issuesJob_OLD(type, spice, command) {
Expand Down Expand Up @@ -663,7 +684,10 @@ class SpiceSpy extends Applet.TextIconApplet {
source_remove(id);
}
this.issuesLoopId = null;
this.issuesLoopId = timeout_add_seconds(5, () => { this.issuesJobs_loop(); return (this.issuesJobsList.length > 0 && this.is_looping); });
this.issuesLoopId = timeout_add_seconds(5, () => {
this.issuesJobs_loop();
return (this.issuesJobsList.length > 0 && this.is_looping);
});

return this.is_looping;
} // End of loop
Expand Down Expand Up @@ -790,18 +814,6 @@ class SpiceSpy extends Applet.TextIconApplet {
}
} // End of update_issues

update_issues_OLD() {
const GET_ISSUES_SCRIPT = SCRIPTS_DIR+"/get-issues.sh"
const interval = 5000; //ms = 5 seconds.
for (let type of TYPES) {
let spices = this.spices_to_spy[type];
for (let spice of Object.keys(spices)) {
let command = ""+GET_ISSUES_SCRIPT+" "+type+" "+spices[spice]['uuid'];
this.issuesJobsList.push(type, spice, command);
}
}
} // End of update_issues_OLD

make_menu() {
var total_diff_score = 0;
var total_diff_comments = 0;
Expand Down Expand Up @@ -915,7 +927,7 @@ class SpiceSpy extends Applet.TextIconApplet {
}

if (this.issuesJobsList.length === 0) {
let refresh = new PopupMenu.PopupIconMenuItem(_("Refresh"), "", St.IconType.SYMBOLIC);
let refresh = new PopupMenu.PopupIconMenuItem(_("Refresh"), "view-refresh-symbolic", St.IconType.SYMBOLIC);
refresh.connect("activate",
() => {
if (this.menu) this.menu.toggle(true);
Expand All @@ -926,12 +938,40 @@ class SpiceSpy extends Applet.TextIconApplet {
);
this.menu.addMenuItem(refresh);
} else {
let refresh_in_progress = new PopupMenu.PopupIconMenuItem(
_("Refreshing in progress"),
"view-refresh",
St.IconType.SYMBOLIC,
{ reactive: false }
let refresh_in_progress;
if (this.updateIsInterruptible) {
refresh_in_progress = new PopupMenu.PopupIconMenuItem(
_("Refreshing in progress - Click to stop"),
"hand-open-symbolic",
St.IconType.SYMBOLIC,
{ reactive: true }
);
refresh_in_progress.connect("activate",
() => {
if (this.menu) this.menu.toggle(true);
if (this.issuesLoopId != null) {
source_remove(this.issuesLoopId);
}
this.issuesLoopId = null;
this.issuesJobsList = [];

if (this.jobsLoopId != null) {
source_remove(this.jobsLoopId);
}
this.jobsLoopId = null;
this.commentsJobsList = [];
//~ this.is_looping = true;
//~ this.fistTime = false;
}
);
} else {
refresh_in_progress = new PopupMenu.PopupIconMenuItem(
_("Refreshing in progress"),
"hand-open-symbolic",
St.IconType.SYMBOLIC,
{ reactive: false }
);
}
this.menu.addMenuItem(refresh_in_progress);
}

Expand Down Expand Up @@ -972,6 +1012,7 @@ class SpiceSpy extends Applet.TextIconApplet {

this.loopId = timeout_add_seconds(60, () => { this.loop() });
this.jobsLoopId = timeout_add_seconds(15, () => { this.commentsJobs_loop(); return this.is_looping; });
this.iconColorLoopId = timeout_add_seconds(1, () => { this.setIconColor(); return this.is_looping; });

this.update_issues_json();
this.updateUI();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion SpiceSpy@claudiux/files/SpiceSpy@claudiux/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"uuid": "SpiceSpy@claudiux",
"name": "SpiceSpy",
"description": "Notifies you when there's a change to your favorite Spices on the website.",
"version": "5.6.2",
"version": "5.7.0",
"max-instances": 1,
"author": "claudiux"
}
42 changes: 29 additions & 13 deletions SpiceSpy@claudiux/files/SpiceSpy@claudiux/po/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: SpiceSpy@claudiux 5.5.0\n"
"Project-Id-Version: SpiceSpy@claudiux 5.7.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2025-09-25 23:34+0200\n"
"POT-Creation-Date: 2025-12-28 16:21+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,47 +17,51 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. applet.js:201
#. applet.js:185
msgid "score"
msgstr ""

#. applet.js:213
#. applet.js:197
msgid "comments"
msgstr ""

#. applet.js:225
#. applet.js:209
msgid "recent issues"
msgstr ""

#. applet.js:237
#. applet.js:222
msgid "translations"
msgstr ""

#. applet.js:312
#. applet.js:297
msgid "Reload icons"
msgstr ""

#. applet.js:318
#. applet.js:303
msgid "Visit website"
msgstr ""

#. applet.js:826
#. applet.js:831
msgid "Spices"
msgstr ""

#. applet.js:915
#. applet.js:919
msgid "Mark all as read"
msgstr ""

#. applet.js:926
#. applet.js:930
msgid "Refresh"
msgstr ""

#. applet.js:938
#. applet.js:944
msgid "Refreshing in progress - Click to stop"
msgstr ""

#. applet.js:969
msgid "Refreshing in progress"
msgstr ""

#. applet.js:949
#. applet.js:981
msgid "Configure..."
msgstr ""

Expand Down Expand Up @@ -95,6 +99,10 @@ msgstr ""
msgid "hours"
msgstr ""

#. settings-schema.json->update-interruptible->description
msgid "The update can be interrupted by the user"
msgstr ""

#. settings-schema.json->standard-opacity->description
msgid "Opacity in absence of change"
msgstr ""
Expand Down Expand Up @@ -216,6 +224,14 @@ msgstr ""
msgid "Show only non-zero values in panel"
msgstr ""

#. settings-schema.json->coloredIcon->description
msgid "Change icon color while refreshing"
msgstr ""

#. settings-schema.json->colorWhileRefreshing->description
msgid "Icon color while refreshing"
msgstr ""

#. settings-schema.json->author-list->columns->title
msgid "GitHub user name"
msgstr ""
Expand Down
Loading