Skip to content

Commit

Permalink
v1.12.0 - Added an option (in the context menu) to display the volume…
Browse files Browse the repository at this point in the history
… level near the icon
  • Loading branch information
claudiux committed Dec 16, 2023
1 parent 698bda3 commit c9b4f49
Show file tree
Hide file tree
Showing 7 changed files with 204 additions and 159 deletions.
5 changes: 5 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,8 @@
### v1.12.0~20231216
* Added an option (in the context menu) to display the volume level near the icon.
* Updated .pot file for translations.
* Updated fr.po file - French translation.

### v1.11.3~20231210
* Minor bugfixes. Maybe fixes #5201.

Expand Down
2 changes: 1 addition & 1 deletion Radio3.0@claudiux/files/Radio3.0@claudiux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ With Radio3.0 you can:

* Launch and use _Pulse Effects_ (if installed) for amazing sound experience.

* Modify the volume of the radio, independent of the general sound volume.
* Modify the volume of the radio, independent of the general sound volume. This volume level can be displayed near the icon.


Details, help and FAQ can be found in the [Manual](https://github.com/linuxmint/cinnamon-spices-applets/blob/master/Radio3.0%40claudiux/files/Radio3.0%40claudiux/help/MANUAL.md).
Expand Down
28 changes: 28 additions & 0 deletions Radio3.0@claudiux/files/Radio3.0@claudiux/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ WebRadioReceiverAndRecorder.prototype = {
get_user_settings: function() {
//log("get_user_settings");

this.settings.bind("show-volume-level-near-icon", "show_volume_level_near_icon", this.volume_near_icon);
this.settings.bind("dont-check-dependencies", "dont_check_dependencies");
this.settings.bind("recentRadios", "recentRadios");
this.settings.bind("volume-step", "volume_step");
Expand Down Expand Up @@ -1222,6 +1223,14 @@ WebRadioReceiverAndRecorder.prototype = {
this.populate_help_textviews()
},

volume_near_icon: function() {
if (this.show_volume_level_near_icon) {
this.set_applet_label(""+this.percentage+"%")
} else {
this.set_applet_label("")
}
},

onShortcutChanged: function() {
keybindingManager.addHotKey("shortcutVolUp", this.shortcutVolUp, (event) => {
//~ log("Volume Up", true);
Expand Down Expand Up @@ -2068,6 +2077,7 @@ WebRadioReceiverAndRecorder.prototype = {

_tooltip = null;
title = null;
this.volume_near_icon();
},

set_radio_tooltip_to_default_one: function() {
Expand Down Expand Up @@ -3474,6 +3484,7 @@ WebRadioReceiverAndRecorder.prototype = {

this.page_label = undefined;
this.settingsWindow = undefined;
this.volume_near_icon();
},

listen_to_last_station: function() {
Expand Down Expand Up @@ -3577,6 +3588,8 @@ WebRadioReceiverAndRecorder.prototype = {
60000
);
}

this.volume_near_icon();
},

on_applet_removed_from_panel: function() {
Expand Down Expand Up @@ -4544,6 +4557,21 @@ WebRadioReceiverAndRecorder.prototype = {
this._applet_context_menu.addMenuItem(this.context_menu_item_reloadThisApplet);
}

// Display volume level near icon?
if (this.context_menu_item_showVolumeNearIcon == null) {
this.context_menu_item_showVolumeNearIcon = new PopupSwitchMenuItem(_("Display volume level near icon"),
this.show_volume_level_near_icon,
null);
this.context_menu_item_showVolumeNearIcon.connect("toggled", Lang.bind(this, function() {
this.show_volume_level_near_icon = !this.show_volume_level_near_icon;
this.volume_near_icon();
}));
}
if (items.indexOf(this.context_menu_item_showVolumeNearIcon) == -1) {
this._applet_context_menu.addMenuItem(new PopupSeparatorMenuItem());
this._applet_context_menu.addMenuItem(this.context_menu_item_showVolumeNearIcon);
}

// Submenu Cancel YT downloads
if (this.submenu_cancel_yt_downloads != null)
this.submenu_cancel_yt_downloads.destroy();
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": "1.11.3",
"version": "1.12.0",
"uuid": "Radio3.0@claudiux",
"name": "Radio3.0",
"author": "claudiux",
Expand Down
Loading

0 comments on commit c9b4f49

Please sign in to comment.