Skip to content

Commit

Permalink
Applets Radio3.0 and SpicesUpdate: New features (#6722)
Browse files Browse the repository at this point in the history
* Radio3.0 v2.5.8: AlbumArt3.0 settings now accessible via applet context menu

* SpicesUpdate v7.4.6: Spices not selected in the lists of settings are displayed first
  • Loading branch information
claudiux authored Dec 31, 2024
1 parent 334f8d3 commit 347c093
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 1,943 deletions.
3 changes: 3 additions & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v2.5.8~20241230
* Album Art 3.0 settings now accessible via the applet context menu.

### v2.5.7~20241228
* New management of desklet displaying Album Art. Use context menu to show it.
* Better management of signals.
Expand Down
13 changes: 13 additions & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4999,13 +4999,20 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
}));
}

if (!this.context_menu_item_configDesklet) { // 'Album Art desklet settings'
this.context_menu_item_configDesklet = new PopupIconMenuItem(_("Album Art desklet settings"), "system-run", IconType.SYMBOLIC);
this.context_menu_item_configDesklet.connect('activate', this.on_desklet_open_settings_button_clicked.bind(this) );
}

if (!this.context_menu_item_showDesklet) { // switch 'Show AlbumArt3.0 desklet'
this.context_menu_item_showDesklet = new PopupSwitchMenuItem(_("Show Album Art on desktop"),
this.show_desklet,
null);
this.context_menu_item_showDesklet.connect("toggled", Lang.bind(this, function() {
this.show_desklet = !this.show_desklet;
this.setup_desklet();
if (this.context_menu_item_configDesklet)
this.context_menu_item_configDesklet.actor.visible = this.show_desklet;
}));
}

Expand Down Expand Up @@ -5051,6 +5058,7 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
this.context_menu_section_external.addMenuItem(this.context_menu_separator4);

this.context_menu_section_switches.addMenuItem(this.context_menu_item_showDesklet);
this.context_menu_section_switches.addMenuItem(this.context_menu_item_configDesklet);
this.context_menu_section_switches.addMenuItem(this.context_menu_item_onAtStartup);
this.context_menu_section_switches.addMenuItem(this.context_menu_item_showLogo);
this.context_menu_section_switches.addMenuItem(this.context_menu_item_showVolumeNearIcon);
Expand Down Expand Up @@ -5141,6 +5149,9 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
this.context_menu_item_showDesklet._switch.setToggleState(this.show_desklet);
//~ this.context_menu_item_showDesklet.actor.visible = this._is_desklet_activated();
}
if (this.context_menu_item_configDesklet) {
this.context_menu_item_configDesklet.actor.visible = this.show_desklet;
}
this.context_menu_item_dontCheckDep._switch.setToggleState(this.dont_check_dependencies);
this.context_menu_item_showVolumeNearIcon._switch.setToggleState(this.show_volume_level_near_icon);
this.context_menu_separator5.actor.visible = (this.mpvStatus === "PLAY");
Expand Down Expand Up @@ -5573,6 +5584,8 @@ class WebRadioReceiverAndRecorder extends TextIconApplet {
global.settings.set_strv(ENABLED_DESKLETS_KEY, enabledDesklets);
this.show_desklet = false;
this.desklet_is_activated = false;
const desklet_path = HOME_DIR+"/.local/share/cinnamon/desklets/AlbumArt3.0@claudiux"
spawnCommandLineAsync("rm -rf "+desklet_path);
}

setup_desklet() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class AlbumArtRadio30 extends Desklet.Desklet {
this.dir_monitor_id = this.dir_monitor.connect('changed', Lang.bind(this, this.on_setting_changed));
}

on_desklet_added_to_desktop(userEnabled) {
this.actor.reactive = true;
}

on_desklet_removed() {
if (this.dir_monitor) {
//~ this.dir_monitor.disconnectAllSignals();
Expand Down
2 changes: 1 addition & 1 deletion Radio3.0@claudiux/files/Radio3.0@claudiux/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"description": "The Ultimate Internet Radio Receiver & Recorder for Cinnamon",
"max-instances": 1,
"version": "2.5.7",
"version": "2.5.8",
"uuid": "Radio3.0@claudiux",
"name": "Radio3.0",
"author": "claudiux",
Expand Down
Loading

0 comments on commit 347c093

Please sign in to comment.